[SCM] lwjgl - Lightweight Java Game Library branch, master, updated. debian/2.4.2+dfsg-1-8-gc18443d
Gabriele Giacone
gg0-guest at alioth.debian.org
Sun Jul 4 17:49:48 UTC 2010
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "lwjgl - Lightweight Java Game Library".
The branch, master has been updated
via c18443d43190319e8fb0bb926d7863b9ad1f9e58 (commit)
via 0abed5a5f52b80fa53c3cc99d1c0ff0903422353 (commit)
via ded421829736e66c7981dfe72bef19cb11a0cf80 (commit)
via a316fe97fd9a0a16a7914fb1889f1b451c6060d6 (commit)
from 07f8439a703de6bcadd53d0cc6ec78018198bd5f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit c18443d43190319e8fb0bb926d7863b9ad1f9e58
Author: Gabriele Giacone <1o5g4r8o at gmail.com>
Date: Sun Jul 4 18:07:40 2010 +0200
added classpath for javadoc
commit 0abed5a5f52b80fa53c3cc99d1c0ff0903422353
Merge: a316fe9 ded4218
Author: Gabriele Giacone <1o5g4r8o at gmail.com>
Date: Sun Jul 4 17:55:26 2010 +0200
+dfsg2
commit a316fe97fd9a0a16a7914fb1889f1b451c6060d6
Author: Gabriele Giacone <1o5g4r8o at gmail.com>
Date: Sun Jul 4 17:53:02 2010 +0200
nocrlf, 3.9.0, javadoc, copyright
-----------------------------------------------------------------------
Summary of changes:
build.xml | 998 +++---
debian/changelog | 7 +-
debian/control | 2 +
debian/copyright | 72 +-
debian/patches/00nomacosx | 166 +-
debian/patches/02systemjinput | 38 +-
debian/patches/03javadoc | 13 +
debian/patches/series | 1 +
debian/rules | 3 +-
platform_build/build-applet.xml | 300 +-
platform_build/build-definitions.xml | 316 +-
platform_build/build-generator.xml | 286 +-
platform_build/build-webstart.xml | 120 +-
platform_build/mingw_ant/build.xml | 132 +-
platform_build/windows_ant/build.xml | 120 +-
src/java/org/lwjgl/BufferChecks.java | 382 ++--
src/java/org/lwjgl/BufferUtils.java | 296 +-
src/java/org/lwjgl/DefaultSysImplementation.java | 112 +-
src/java/org/lwjgl/J2SESysImplementation.java | 146 +-
src/java/org/lwjgl/LWJGLException.java | 158 +-
src/java/org/lwjgl/LWJGLUtil.java | 982 +++---
src/java/org/lwjgl/LinuxSysImplementation.java | 152 +-
src/java/org/lwjgl/MacOSXSysImplementation.java | 130 +-
src/java/org/lwjgl/Sys.java | 494 ++--
src/java/org/lwjgl/SysImplementation.java | 152 +-
src/java/org/lwjgl/WindowsSysImplementation.java | 238 +-
src/java/org/lwjgl/examples/Game.java | 386 ++--
.../lwjgl/examples/spaceinvaders/AlienEntity.java | 312 +-
.../org/lwjgl/examples/spaceinvaders/Entity.java | 366 ++--
.../org/lwjgl/examples/spaceinvaders/Game.java | 1228 ++++----
.../lwjgl/examples/spaceinvaders/GameApplet.java | 206 +-
.../lwjgl/examples/spaceinvaders/ShipEntity.java | 194 +-
.../lwjgl/examples/spaceinvaders/ShotEntity.java | 238 +-
.../lwjgl/examples/spaceinvaders/SoundManager.java | 378 ++--
.../org/lwjgl/examples/spaceinvaders/Sprite.java | 252 +-
.../org/lwjgl/examples/spaceinvaders/Texture.java | 378 ++--
.../examples/spaceinvaders/TextureLoader.java | 570 ++--
src/java/org/lwjgl/input/Controller.java | 546 ++--
src/java/org/lwjgl/input/ControllerEvent.java | 338 +-
src/java/org/lwjgl/input/Controllers.java | 574 ++--
src/java/org/lwjgl/input/Cursor.java | 660 ++--
src/java/org/lwjgl/input/JInputController.java | 1024 ++++----
src/java/org/lwjgl/input/Keyboard.java | 1204 ++++----
src/java/org/lwjgl/input/Mouse.java | 1366 +++++-----
src/java/org/lwjgl/openal/AL.java | 462 ++--
src/java/org/lwjgl/openal/ALC10.java | 872 +++---
src/java/org/lwjgl/openal/ALC11.java | 394 ++--
src/java/org/lwjgl/openal/ALCcontext.java | 230 +-
src/java/org/lwjgl/openal/ALCdevice.java | 248 +-
src/java/org/lwjgl/openal/OpenALException.java | 170 +-
src/java/org/lwjgl/openal/Util.java | 172 +-
.../org/lwjgl/opengl/AWTCanvasImplementation.java | 118 +-
src/java/org/lwjgl/opengl/AWTGLCanvas.java | 724 +++---
src/java/org/lwjgl/opengl/AWTSurfaceLock.java | 212 +-
src/java/org/lwjgl/opengl/Context.java | 502 ++--
.../org/lwjgl/opengl/ContextImplementation.java | 180 +-
src/java/org/lwjgl/opengl/Display.java | 2254 +++++++-------
.../org/lwjgl/opengl/DisplayImplementation.java | 324 +-
src/java/org/lwjgl/opengl/DisplayMode.java | 284 +-
src/java/org/lwjgl/opengl/Drawable.java | 86 +-
src/java/org/lwjgl/opengl/EventQueue.java | 166 +-
src/java/org/lwjgl/opengl/GLChecks.java | 512 ++--
src/java/org/lwjgl/opengl/GLContext.java | 784 +++---
src/java/org/lwjgl/opengl/GLUConstants.java | 116 +-
src/java/org/lwjgl/opengl/KeyboardEventQueue.java | 732 +++---
.../org/lwjgl/opengl/LinuxAWTGLCanvasPeerInfo.java | 146 +-
.../lwjgl/opengl/LinuxCanvasImplementation.java | 246 +-
.../lwjgl/opengl/LinuxContextImplementation.java | 336 +-
src/java/org/lwjgl/opengl/LinuxDisplay.java | 2430 ++++++++--------
.../org/lwjgl/opengl/LinuxDisplayPeerInfo.java | 176 +-
src/java/org/lwjgl/opengl/LinuxKeyboard.java | 706 +++---
.../org/lwjgl/opengl/LinuxPbufferPeerInfo.java | 166 +-
src/java/org/lwjgl/opengl/LinuxPeerInfo.java | 114 +-
.../lwjgl/opengl/MacOSXAWTGLCanvasPeerInfo.java | 110 +-
.../lwjgl/opengl/MacOSXCanvasImplementation.java | 132 +-
.../org/lwjgl/opengl/MacOSXCanvasPeerInfo.java | 120 +-
.../lwjgl/opengl/MacOSXContextImplementation.java | 266 +-
src/java/org/lwjgl/opengl/MacOSXDisplay.java | 1016 +++---
.../org/lwjgl/opengl/MacOSXDisplayPeerInfo.java | 134 +-
src/java/org/lwjgl/opengl/MacOSXFrame.java | 456 ++--
src/java/org/lwjgl/opengl/MacOSXGLCanvas.java | 154 +-
.../org/lwjgl/opengl/MacOSXMouseEventQueue.java | 226 +-
.../org/lwjgl/opengl/MacOSXPbufferPeerInfo.java | 126 +-
src/java/org/lwjgl/opengl/MacOSXPeerInfo.java | 126 +-
src/java/org/lwjgl/opengl/MouseEventQueue.java | 522 ++--
src/java/org/lwjgl/opengl/OpenGLException.java | 178 +-
src/java/org/lwjgl/opengl/Pbuffer.java | 734 +++---
src/java/org/lwjgl/opengl/PeerInfo.java | 194 +-
src/java/org/lwjgl/opengl/PixelFormat.java | 754 +++---
src/java/org/lwjgl/opengl/ReferencesStack.java | 146 +-
src/java/org/lwjgl/opengl/RenderTexture.java | 496 ++--
src/java/org/lwjgl/opengl/StateStack.java | 130 +-
src/java/org/lwjgl/opengl/StateTracker.java | 198 +-
src/java/org/lwjgl/opengl/Util.java | 174 +-
.../lwjgl/opengl/WindowsAWTGLCanvasPeerInfo.java | 142 +-
.../lwjgl/opengl/WindowsCanvasImplementation.java | 170 +-
.../lwjgl/opengl/WindowsContextImplementation.java | 238 +-
src/java/org/lwjgl/opengl/WindowsDisplay.java | 1952 ++++++------
.../org/lwjgl/opengl/WindowsDisplayPeerInfo.java | 146 +-
src/java/org/lwjgl/opengl/WindowsFileVersion.java | 108 +-
src/java/org/lwjgl/opengl/WindowsKeyboard.java | 360 ++--
src/java/org/lwjgl/opengl/WindowsKeycodes.java | 1156 ++++----
src/java/org/lwjgl/opengl/WindowsMouse.java | 398 ++--
.../org/lwjgl/opengl/WindowsPbufferPeerInfo.java | 166 +-
src/java/org/lwjgl/opengl/WindowsPeerInfo.java | 132 +-
src/java/org/lwjgl/opengl/WindowsRegistry.java | 138 +-
src/java/org/lwjgl/opengl/XRandR.java | 514 ++--
src/java/org/lwjgl/test/DisplayTest.java | 504 ++--
src/java/org/lwjgl/test/NativeTest.java | 124 +-
src/java/org/lwjgl/test/SysTest.java | 360 ++--
src/java/org/lwjgl/test/WaveDataTest.java | 270 +-
src/java/org/lwjgl/test/WindowCreationTest.java | 648 ++--
.../org/lwjgl/test/applet/AppletLoaderTest.java | 144 +-
.../org/lwjgl/test/applet/ControllersTest.java | 104 +-
src/java/org/lwjgl/test/applet/GearsApplet.java | 800 +++---
src/java/org/lwjgl/test/applet/OpenAL.java | 364 ++--
src/java/org/lwjgl/test/applet/OpenGL.java | 256 +-
src/java/org/lwjgl/test/applet/Speed.java | 182 +-
src/java/org/lwjgl/test/applet/Test.java | 76 +-
.../lwjgl/test/glu/tessellation/TessCallback.java | 160 +-
.../test/glu/tessellation/TessellationTest.java | 390 ++--
.../lwjgl/test/glu/tessellation/VertexData.java | 80 +-
src/java/org/lwjgl/test/input/HWCursorTest.java | 806 +++---
src/java/org/lwjgl/test/input/KeyboardTest.java | 472 ++--
.../org/lwjgl/test/input/MouseCreationTest.java | 434 ++--
src/java/org/lwjgl/test/input/MouseTest.java | 850 +++---
src/java/org/lwjgl/test/input/TestControllers.java | 372 ++--
src/java/org/lwjgl/test/openal/ALCCaptureTest.java | 306 +-
src/java/org/lwjgl/test/openal/ALCTest.java | 218 +-
src/java/org/lwjgl/test/openal/BasicTest.java | 280 +-
.../org/lwjgl/test/openal/MovingSoundTest.java | 436 ++--
.../org/lwjgl/test/openal/OpenALCreationTest.java | 450 ++--
src/java/org/lwjgl/test/openal/OpenALInfo.java | 344 ++--
src/java/org/lwjgl/test/openal/PlayTest.java | 442 ++--
src/java/org/lwjgl/test/openal/PlayTestMemory.java | 468 ++--
src/java/org/lwjgl/test/openal/PositionTest.java | 1104 ++++----
.../org/lwjgl/test/openal/SourceLimitTest.java | 330 +-
src/java/org/lwjgl/test/openal/StressTest.java | 446 ++--
.../lwjgl/test/opengl/FullScreenWindowedTest.java | 558 ++--
src/java/org/lwjgl/test/opengl/Gears.java | 678 ++--
src/java/org/lwjgl/test/opengl/PbufferTest.java | 800 +++---
src/java/org/lwjgl/test/opengl/SyncTest.java | 354 ++--
src/java/org/lwjgl/test/opengl/VBOIndexTest.java | 484 ++--
src/java/org/lwjgl/test/opengl/VBOTest.java | 418 ++--
src/java/org/lwjgl/test/opengl/VersionTest.java | 390 ++--
src/java/org/lwjgl/test/opengl/awt/AWTGears.java | 550 ++--
.../org/lwjgl/test/opengl/awt/AWTGearsCanvas.java | 648 ++--
src/java/org/lwjgl/test/opengl/awt/AWTTest.java | 278 +-
src/java/org/lwjgl/test/opengl/awt/DemoBox.java | 1276 ++++----
.../lwjgl/test/opengl/awt/DisplayParentTest.java | 264 +-
.../lwjgl/test/opengl/pbuffers/PbufferTest.java | 876 +++---
.../test/opengl/pbuffers/TextureRenderer.java | 200 +-
.../lwjgl/test/opengl/pbuffers/UniqueRenderer.java | 144 +-
.../test/opengl/pbuffers/UniqueRendererRTT.java | 164 +-
src/java/org/lwjgl/test/opengl/shaders/Shader.java | 296 +-
.../org/lwjgl/test/opengl/shaders/ShaderFP.java | 212 +-
.../org/lwjgl/test/opengl/shaders/ShaderFSH.java | 252 +-
.../org/lwjgl/test/opengl/shaders/ShaderUNI.java | 326 +-
.../org/lwjgl/test/opengl/shaders/ShaderVP.java | 158 +-
.../org/lwjgl/test/opengl/shaders/ShaderVSH.java | 194 +-
.../org/lwjgl/test/opengl/shaders/ShadersTest.java | 690 +++---
src/java/org/lwjgl/test/opengl/shaders/shaderFP.fp | 78 +-
src/java/org/lwjgl/test/opengl/shaders/shaderFP.vp | 72 +-
.../org/lwjgl/test/opengl/shaders/shaderFSH.fsh | 40 +-
.../org/lwjgl/test/opengl/shaders/shaderFSH.vsh | 24 +-
.../org/lwjgl/test/opengl/shaders/shaderUNI.vsh | 54 +-
src/java/org/lwjgl/test/opengl/shaders/shaderVP.vp | 116 +-
.../org/lwjgl/test/opengl/shaders/shaderVSH.vsh | 42 +-
src/java/org/lwjgl/util/Color.java | 988 +++---
src/java/org/lwjgl/util/Dimension.java | 312 +-
src/java/org/lwjgl/util/Display.java | 492 ++--
src/java/org/lwjgl/util/Point.java | 340 +-
src/java/org/lwjgl/util/ReadableColor.java | 292 +-
src/java/org/lwjgl/util/ReadableDimension.java | 120 +-
src/java/org/lwjgl/util/ReadablePoint.java | 114 +-
src/java/org/lwjgl/util/ReadableRectangle.java | 96 +-
src/java/org/lwjgl/util/Rectangle.java | 1162 ++++----
src/java/org/lwjgl/util/Renderable.java | 98 +-
src/java/org/lwjgl/util/Timer.java | 310 +-
src/java/org/lwjgl/util/WaveData.java | 506 ++--
src/java/org/lwjgl/util/WritableColor.java | 250 +-
src/java/org/lwjgl/util/WritableDimension.java | 106 +-
src/java/org/lwjgl/util/WritablePoint.java | 88 +-
src/java/org/lwjgl/util/WritableRectangle.java | 126 +-
src/java/org/lwjgl/util/XPMFile.java | 602 ++--
src/java/org/lwjgl/util/generator/ALTypeMap.java | 436 ++--
src/java/org/lwjgl/util/generator/ALboolean.java | 94 +-
src/java/org/lwjgl/util/generator/ALbyte.java | 94 +-
src/java/org/lwjgl/util/generator/ALdouble.java | 94 +-
src/java/org/lwjgl/util/generator/ALenum.java | 94 +-
src/java/org/lwjgl/util/generator/ALfloat.java | 94 +-
src/java/org/lwjgl/util/generator/ALint.java | 94 +-
src/java/org/lwjgl/util/generator/ALshort.java | 94 +-
src/java/org/lwjgl/util/generator/ALsizei.java | 94 +-
src/java/org/lwjgl/util/generator/ALubyte.java | 94 +-
src/java/org/lwjgl/util/generator/ALuint.java | 94 +-
src/java/org/lwjgl/util/generator/ALvoid.java | 94 +-
src/java/org/lwjgl/util/generator/Alternate.java | 106 +-
src/java/org/lwjgl/util/generator/Auto.java | 96 +-
.../org/lwjgl/util/generator/AutoResultSize.java | 100 +-
src/java/org/lwjgl/util/generator/AutoSize.java | 104 +-
src/java/org/lwjgl/util/generator/AutoType.java | 102 +-
src/java/org/lwjgl/util/generator/BufferKind.java | 94 +-
.../org/lwjgl/util/generator/BufferObject.java | 100 +-
.../org/lwjgl/util/generator/CachedReference.java | 108 +-
.../org/lwjgl/util/generator/CachedResult.java | 94 +-
src/java/org/lwjgl/util/generator/Check.java | 96 +-
src/java/org/lwjgl/util/generator/Code.java | 94 +-
src/java/org/lwjgl/util/generator/Const.java | 92 +-
src/java/org/lwjgl/util/generator/Constant.java | 98 +-
.../generator/ContextCapabilitiesGenerator.java | 584 ++--
.../ContextGeneratorProcessorFactory.java | 378 ++--
src/java/org/lwjgl/util/generator/Dependent.java | 92 +-
.../org/lwjgl/util/generator/DeprecatedGL.java | 90 +-
src/java/org/lwjgl/util/generator/Extension.java | 98 +-
.../org/lwjgl/util/generator/FieldsGenerator.java | 156 +-
src/java/org/lwjgl/util/generator/ForceInit.java | 88 +-
src/java/org/lwjgl/util/generator/GLTypeMap.java | 598 ++--
src/java/org/lwjgl/util/generator/GLbitfield.java | 94 +-
src/java/org/lwjgl/util/generator/GLboolean.java | 94 +-
src/java/org/lwjgl/util/generator/GLbyte.java | 94 +-
src/java/org/lwjgl/util/generator/GLchar.java | 94 +-
src/java/org/lwjgl/util/generator/GLcharARB.java | 94 +-
src/java/org/lwjgl/util/generator/GLclampd.java | 94 +-
src/java/org/lwjgl/util/generator/GLclampf.java | 94 +-
src/java/org/lwjgl/util/generator/GLdouble.java | 94 +-
src/java/org/lwjgl/util/generator/GLenum.java | 94 +-
src/java/org/lwjgl/util/generator/GLfloat.java | 94 +-
src/java/org/lwjgl/util/generator/GLhalf.java | 94 +-
src/java/org/lwjgl/util/generator/GLhandleARB.java | 94 +-
src/java/org/lwjgl/util/generator/GLint.java | 94 +-
src/java/org/lwjgl/util/generator/GLint64.java | 78 +-
src/java/org/lwjgl/util/generator/GLint64EXT.java | 78 +-
src/java/org/lwjgl/util/generator/GLintptr.java | 94 +-
src/java/org/lwjgl/util/generator/GLintptrARB.java | 94 +-
src/java/org/lwjgl/util/generator/GLpointer.java | 84 +-
src/java/org/lwjgl/util/generator/GLreturn.java | 108 +-
src/java/org/lwjgl/util/generator/GLshort.java | 94 +-
src/java/org/lwjgl/util/generator/GLsizei.java | 94 +-
src/java/org/lwjgl/util/generator/GLsizeiptr.java | 94 +-
.../org/lwjgl/util/generator/GLsizeiptrARB.java | 94 +-
src/java/org/lwjgl/util/generator/GLtime.java | 92 +-
src/java/org/lwjgl/util/generator/GLubyte.java | 94 +-
src/java/org/lwjgl/util/generator/GLuint.java | 94 +-
src/java/org/lwjgl/util/generator/GLuint64.java | 78 +-
src/java/org/lwjgl/util/generator/GLuint64EXT.java | 78 +-
src/java/org/lwjgl/util/generator/GLushort.java | 94 +-
src/java/org/lwjgl/util/generator/GLvoid.java | 100 +-
.../org/lwjgl/util/generator/GenerateAutos.java | 92 +-
.../util/generator/GeneratorProcessorFactory.java | 312 +-
.../org/lwjgl/util/generator/GeneratorVisitor.java | 556 ++--
src/java/org/lwjgl/util/generator/Indirect.java | 98 +-
.../lwjgl/util/generator/JNITypeTranslator.java | 260 +-
.../lwjgl/util/generator/JavaMethodsGenerator.java | 1186 ++++----
.../lwjgl/util/generator/JavaTypeTranslator.java | 250 +-
src/java/org/lwjgl/util/generator/Mode.java | 78 +-
.../util/generator/NativeMethodStubsGenerator.java | 628 ++--
src/java/org/lwjgl/util/generator/NativeType.java | 98 +-
.../lwjgl/util/generator/NativeTypeTranslator.java | 458 ++--
.../org/lwjgl/util/generator/NoErrorCheck.java | 98 +-
.../org/lwjgl/util/generator/NullTerminated.java | 100 +-
src/java/org/lwjgl/util/generator/Optional.java | 92 +-
.../org/lwjgl/util/generator/OutParameter.java | 96 +-
src/java/org/lwjgl/util/generator/Platform.java | 186 +-
.../lwjgl/util/generator/PlatformDependent.java | 102 +-
.../lwjgl/util/generator/PostfixTranslator.java | 362 ++--
.../ReferencesGeneratorProcessorFactory.java | 410 ++--
.../util/generator/RegisterStubsGenerator.java | 238 +-
src/java/org/lwjgl/util/generator/Result.java | 98 +-
.../lwjgl/util/generator/SignatureTranslator.java | 284 +-
src/java/org/lwjgl/util/generator/Signedness.java | 92 +-
src/java/org/lwjgl/util/generator/StringList.java | 94 +-
.../org/lwjgl/util/generator/StripPostfix.java | 106 +-
src/java/org/lwjgl/util/generator/TypeInfo.java | 458 ++--
src/java/org/lwjgl/util/generator/TypeMap.java | 126 +-
.../lwjgl/util/generator/TypedefsGenerator.java | 182 +-
src/java/org/lwjgl/util/generator/Utils.java | 794 +++---
src/java/org/lwjgl/util/glu/Cylinder.java | 400 ++--
src/java/org/lwjgl/util/glu/Disk.java | 426 ++--
src/java/org/lwjgl/util/glu/GLU.java | 858 +++---
src/java/org/lwjgl/util/glu/GLUtessellator.java | 142 +-
src/java/org/lwjgl/util/glu/MipMap.java | 702 +++---
src/java/org/lwjgl/util/glu/PartialDisk.java | 714 +++---
src/java/org/lwjgl/util/glu/PixelStoreState.java | 168 +-
src/java/org/lwjgl/util/glu/Project.java | 820 +++---
src/java/org/lwjgl/util/glu/Quadric.java | 396 ++--
src/java/org/lwjgl/util/glu/Registry.java | 156 +-
src/java/org/lwjgl/util/glu/Sphere.java | 458 ++--
src/java/org/lwjgl/util/glu/Util.java | 492 ++--
.../org/lwjgl/util/input/ControllerAdapter.java | 656 ++--
src/java/org/lwjgl/util/jinput/KeyMap.java | 586 ++--
.../lwjgl/util/jinput/LWJGLEnvironmentPlugin.java | 110 +-
src/java/org/lwjgl/util/jinput/LWJGLKeyboard.java | 264 +-
src/java/org/lwjgl/util/jinput/LWJGLMouse.java | 382 ++--
src/java/org/lwjgl/util/vector/Matrix.java | 268 +-
src/java/org/lwjgl/util/vector/Matrix2f.java | 800 +++---
src/java/org/lwjgl/util/vector/Matrix3f.java | 1020 ++++----
src/java/org/lwjgl/util/vector/Matrix4f.java | 1654 +++++-----
src/java/org/lwjgl/util/vector/Quaternion.java | 1060 ++++----
src/java/org/lwjgl/util/vector/ReadableVector.java | 106 +-
.../org/lwjgl/util/vector/ReadableVector2f.java | 90 +-
.../org/lwjgl/util/vector/ReadableVector3f.java | 82 +-
.../org/lwjgl/util/vector/ReadableVector4f.java | 88 +-
src/java/org/lwjgl/util/vector/Vector.java | 224 +-
src/java/org/lwjgl/util/vector/Vector2f.java | 580 ++--
src/java/org/lwjgl/util/vector/Vector3f.java | 694 +++---
src/java/org/lwjgl/util/vector/Vector4f.java | 680 ++--
.../org/lwjgl/util/vector/WritableVector2f.java | 120 +-
.../org/lwjgl/util/vector/WritableVector3f.java | 110 +-
.../org/lwjgl/util/vector/WritableVector4f.java | 112 +-
src/native/common/awt_tools.h | 106 +-
src/native/common/common_tools.c | 712 +++---
src/native/common/common_tools.h | 308 +-
src/native/common/extal.c | 156 +-
src/native/common/extal.h | 344 ++--
src/native/common/extgl.c | 166 +-
src/native/common/extgl.h | 292 +-
src/native/common/org_lwjgl_openal_AL.c | 94 +-
src/native/common/org_lwjgl_openal_ALC10.c | 630 ++--
src/native/common/org_lwjgl_openal_ALC11.c | 270 +-
.../common/org_lwjgl_opengl_AWTSurfaceLock.c | 188 +-
src/native/common/org_lwjgl_opengl_GLContext.c | 114 +-
src/native/linux/context.c | 694 +++---
src/native/linux/context.h | 166 +-
src/native/linux/display.c | 822 +++---
src/native/linux/extgl_glx.c | 462 ++--
src/native/linux/extgl_glx.h | 796 +++---
src/native/linux/linux_al.c | 130 +-
src/native/linux/lwjgl.map | 14 +-
src/native/linux/org_lwjgl_input_Cursor.c | 240 +-
src/native/linux/org_lwjgl_opengl_Display.c | 1178 ++++----
.../org_lwjgl_opengl_LinuxAWTGLCanvasPeerInfo.c | 164 +-
.../org_lwjgl_opengl_LinuxCanvasImplementation.c | 130 +-
.../org_lwjgl_opengl_LinuxContextImplementation.c | 380 ++--
src/native/linux/org_lwjgl_opengl_LinuxPeerInfo.c | 116 +-
src/native/linux/org_lwjgl_opengl_Pbuffer.c | 180 +-
src/native/macosx/context.h | 120 +-
src/native/macosx/context.m | 288 +-
src/native/macosx/macosx_al.c | 240 +-
src/native/macosx/org_lwjgl_input_Mouse.c | 146 +-
src/native/macosx/org_lwjgl_opengl_Display.m | 156 +-
.../macosx/org_lwjgl_opengl_MacOSXCanvasPeerInfo.m | 112 +-
.../org_lwjgl_opengl_MacOSXContextImplementation.m | 314 +-
.../org_lwjgl_opengl_MacOSXPbufferPeerInfo.m | 156 +-
.../macosx/org_lwjgl_opengl_MacOSXPeerInfo.m | 146 +-
src/native/windows/LWJGL.c | 130 +-
src/native/windows/Window.h | 130 +-
src/native/windows/context.c | 978 +++---
src/native/windows/context.h | 192 +-
src/native/windows/display.c | 554 ++--
src/native/windows/display.h | 114 +-
src/native/windows/extgl_wgl.c | 366 ++--
src/native/windows/extgl_wgl.h | 502 ++--
src/native/windows/org_lwjgl_Sys.c | 242 +-
src/native/windows/org_lwjgl_input_Cursor.c | 334 +-
src/native/windows/org_lwjgl_opengl_Display.c | 960 +++---
src/native/windows/org_lwjgl_opengl_Pbuffer.c | 424 ++--
.../org_lwjgl_opengl_WindowsAWTGLCanvasPeerInfo.c | 108 +-
...org_lwjgl_opengl_WindowsContextImplementation.c | 324 +-
.../org_lwjgl_opengl_WindowsDisplayPeerInfo.c | 106 +-
.../windows/org_lwjgl_opengl_WindowsPeerInfo.c | 140 +-
.../windows/org_lwjgl_opengl_WindowsRegistry.c | 290 +-
src/native/windows/windows_al.c | 142 +-
src/templates/org/lwjgl/openal/AL10.java | 2524 ++++++++--------
src/templates/org/lwjgl/openal/AL11.java | 556 ++--
.../org/lwjgl/opengl/AMD_performance_monitor.java | 242 +-
.../opengl/AMD_seamless_cubemap_per_texture.java | 82 +-
.../lwjgl/opengl/AMD_shader_stencil_export.java | 68 +-
.../org/lwjgl/opengl/AMD_texture_texture4.java | 68 +-
.../opengl/AMD_vertex_shader_tessellator.java | 112 +-
src/templates/org/lwjgl/opengl/APPLE_fence.java | 132 +-
.../org/lwjgl/opengl/APPLE_flush_buffer_range.java | 100 +-
.../org/lwjgl/opengl/APPLE_object_purgeable.java | 152 +-
.../org/lwjgl/opengl/APPLE_texture_range.java | 136 +-
.../lwjgl/opengl/APPLE_vertex_array_object.java | 120 +-
.../org/lwjgl/opengl/APPLE_vertex_array_range.java | 164 +-
.../opengl/APPLE_vertex_program_evaluators.java | 166 +-
.../org/lwjgl/opengl/ARB_blend_func_extended.java | 130 +-
.../org/lwjgl/opengl/ARB_buffer_object.java | 300 +-
.../org/lwjgl/opengl/ARB_color_buffer_float.java | 146 +-
.../org/lwjgl/opengl/ARB_compatibility.java | 68 +-
.../org/lwjgl/opengl/ARB_copy_buffer.java | 106 +-
.../org/lwjgl/opengl/ARB_depth_buffer_float.java | 102 +-
.../org/lwjgl/opengl/ARB_depth_clamp.java | 84 +-
.../org/lwjgl/opengl/ARB_depth_texture.java | 110 +-
.../org/lwjgl/opengl/ARB_draw_buffers.java | 132 +-
.../org/lwjgl/opengl/ARB_draw_indirect.java | 120 +-
.../org/lwjgl/opengl/ARB_draw_instanced.java | 96 +-
.../lwjgl/opengl/ARB_explicit_attrib_location.java | 68 +-
.../opengl/ARB_fragment_coord_conventions.java | 68 +-
.../org/lwjgl/opengl/ARB_fragment_program.java | 138 +-
.../lwjgl/opengl/ARB_fragment_program_shadow.java | 72 +-
.../org/lwjgl/opengl/ARB_fragment_shader.java | 110 +-
.../org/lwjgl/opengl/ARB_framebuffer_object.java | 532 ++--
.../org/lwjgl/opengl/ARB_gpu_shader5.java | 96 +-
.../org/lwjgl/opengl/ARB_gpu_shader_fp64.java | 350 ++--
.../org/lwjgl/opengl/ARB_half_float_pixel.java | 90 +-
.../org/lwjgl/opengl/ARB_half_float_vertex.java | 84 +-
src/templates/org/lwjgl/opengl/ARB_imaging.java | 666 ++--
.../org/lwjgl/opengl/ARB_instanced_arrays.java | 90 +-
.../org/lwjgl/opengl/ARB_matrix_palette.java | 140 +-
.../org/lwjgl/opengl/ARB_multisample.java | 98 +-
.../org/lwjgl/opengl/ARB_multitexture.java | 250 +-
.../org/lwjgl/opengl/ARB_occlusion_query.java | 194 +-
.../org/lwjgl/opengl/ARB_occlusion_query2.java | 82 +-
.../org/lwjgl/opengl/ARB_pixel_buffer_object.java | 100 +-
.../org/lwjgl/opengl/ARB_point_parameters.java | 100 +-
.../org/lwjgl/opengl/ARB_point_sprite.java | 100 +-
src/templates/org/lwjgl/opengl/ARB_program.java | 370 ++--
.../org/lwjgl/opengl/ARB_provoking_vertex.java | 100 +-
.../org/lwjgl/opengl/ARB_sample_shading.java | 104 +-
.../org/lwjgl/opengl/ARB_sampler_objects.java | 220 +-
.../org/lwjgl/opengl/ARB_seamless_cube_map.java | 84 +-
.../org/lwjgl/opengl/ARB_shader_bit_encoding.java | 68 +-
.../org/lwjgl/opengl/ARB_shader_objects.java | 544 ++--
.../org/lwjgl/opengl/ARB_shader_subroutine.java | 230 +-
.../org/lwjgl/opengl/ARB_shader_texture_lod.java | 68 +-
.../org/lwjgl/opengl/ARB_shading_language_100.java | 80 +-
.../lwjgl/opengl/ARB_shading_language_include.java | 210 +-
src/templates/org/lwjgl/opengl/ARB_shadow.java | 76 +-
.../org/lwjgl/opengl/ARB_shadow_ambient.java | 72 +-
src/templates/org/lwjgl/opengl/ARB_sync.java | 206 +-
.../org/lwjgl/opengl/ARB_tessellation_shader.java | 242 +-
.../org/lwjgl/opengl/ARB_texture_border_clamp.java | 72 +-
.../lwjgl/opengl/ARB_texture_buffer_object.java | 114 +-
.../opengl/ARB_texture_buffer_object_rgb32.java | 68 +-
.../org/lwjgl/opengl/ARB_texture_compression.java | 198 +-
.../org/lwjgl/opengl/ARB_texture_cube_map.java | 94 +-
.../lwjgl/opengl/ARB_texture_cube_map_array.java | 128 +-
.../org/lwjgl/opengl/ARB_texture_env_add.java | 70 +-
.../org/lwjgl/opengl/ARB_texture_env_combine.java | 126 +-
.../org/lwjgl/opengl/ARB_texture_env_crossbar.java | 70 +-
.../org/lwjgl/opengl/ARB_texture_env_dot3.java | 74 +-
.../org/lwjgl/opengl/ARB_texture_float.java | 136 +-
.../org/lwjgl/opengl/ARB_texture_gather.java | 86 +-
.../lwjgl/opengl/ARB_texture_mirrored_repeat.java | 72 +-
.../org/lwjgl/opengl/ARB_texture_multisample.java | 220 +-
.../lwjgl/opengl/ARB_texture_non_power_of_two.java | 70 +-
.../org/lwjgl/opengl/ARB_texture_query_lod.java | 68 +-
.../org/lwjgl/opengl/ARB_texture_rectangle.java | 156 +-
src/templates/org/lwjgl/opengl/ARB_texture_rg.java | 158 +-
.../org/lwjgl/opengl/ARB_timer_query.java | 142 +-
.../org/lwjgl/opengl/ARB_transpose_matrix.java | 98 +-
.../lwjgl/opengl/ARB_uniform_buffer_object.java | 348 ++--
.../org/lwjgl/opengl/ARB_vertex_array_object.java | 120 +-
.../org/lwjgl/opengl/ARB_vertex_blend.java | 244 +-
.../org/lwjgl/opengl/ARB_vertex_buffer_object.java | 130 +-
.../org/lwjgl/opengl/ARB_vertex_program.java | 300 +-
.../org/lwjgl/opengl/ARB_vertex_shader.java | 418 ++--
.../opengl/ARB_vertex_type_2_10_10_10_rev.java | 364 ++--
src/templates/org/lwjgl/opengl/ARB_window_pos.java | 124 +-
.../org/lwjgl/opengl/ATI_draw_buffers.java | 132 +-
.../org/lwjgl/opengl/ATI_element_array.java | 106 +-
.../org/lwjgl/opengl/ATI_envmap_bumpmap.java | 118 +-
.../org/lwjgl/opengl/ATI_fragment_shader.java | 348 ++--
.../org/lwjgl/opengl/ATI_map_object_buffer.java | 140 +-
src/templates/org/lwjgl/opengl/ATI_meminfo.java | 80 +-
.../org/lwjgl/opengl/ATI_pn_triangles.java | 100 +-
.../org/lwjgl/opengl/ATI_separate_stencil.java | 90 +-
.../org/lwjgl/opengl/ATI_shader_texture_lod.java | 68 +-
.../org/lwjgl/opengl/ATI_text_fragment_shader.java | 92 +-
.../lwjgl/opengl/ATI_texture_compression_3dc.java | 78 +-
.../org/lwjgl/opengl/ATI_texture_float.java | 104 +-
.../org/lwjgl/opengl/ATI_texture_mirror_once.java | 74 +-
.../org/lwjgl/opengl/ATI_vertex_array_object.java | 182 +-
.../opengl/ATI_vertex_attrib_array_object.java | 92 +-
.../org/lwjgl/opengl/ATI_vertex_streams.java | 208 +-
src/templates/org/lwjgl/opengl/EXT_abgr.java | 72 +-
src/templates/org/lwjgl/opengl/EXT_bgra.java | 74 +-
.../lwjgl/opengl/EXT_blend_equation_separate.java | 92 +-
.../org/lwjgl/opengl/EXT_blend_func_separate.java | 86 +-
.../org/lwjgl/opengl/EXT_blend_minmax.java | 100 +-
.../org/lwjgl/opengl/EXT_blend_subtract.java | 74 +-
src/templates/org/lwjgl/opengl/EXT_cg_shader.java | 88 +-
.../lwjgl/opengl/EXT_compiled_vertex_array.java | 86 +-
.../org/lwjgl/opengl/EXT_depth_bounds_test.java | 104 +-
.../org/lwjgl/opengl/EXT_direct_state_access.java | 3026 +++++++++---------
.../org/lwjgl/opengl/EXT_draw_range_elements.java | 96 +-
src/templates/org/lwjgl/opengl/EXT_fog_coord.java | 118 +-
.../org/lwjgl/opengl/EXT_framebuffer_blit.java | 148 +-
.../lwjgl/opengl/EXT_framebuffer_multisample.java | 118 +-
.../org/lwjgl/opengl/EXT_framebuffer_object.java | 374 ++--
.../org/lwjgl/opengl/EXT_multi_draw_arrays.java | 80 +-
.../org/lwjgl/opengl/EXT_packed_depth_stencil.java | 134 +-
.../org/lwjgl/opengl/EXT_packed_pixels.java | 80 +-
.../org/lwjgl/opengl/EXT_paletted_texture.java | 202 +-
.../org/lwjgl/opengl/EXT_pixel_buffer_object.java | 100 +-
.../org/lwjgl/opengl/EXT_point_parameters.java | 96 +-
.../org/lwjgl/opengl/EXT_provoking_vertex.java | 100 +-
.../org/lwjgl/opengl/EXT_rescale_normal.java | 72 +-
.../org/lwjgl/opengl/EXT_secondary_color.java | 130 +-
.../lwjgl/opengl/EXT_separate_shader_objects.java | 104 +-
.../lwjgl/opengl/EXT_separate_specular_color.java | 76 +-
.../org/lwjgl/opengl/EXT_shadow_funcs.java | 70 +-
.../lwjgl/opengl/EXT_shared_texture_palette.java | 72 +-
.../org/lwjgl/opengl/EXT_stencil_clear_tag.java | 104 +-
.../org/lwjgl/opengl/EXT_stencil_two_side.java | 82 +-
.../org/lwjgl/opengl/EXT_stencil_wrap.java | 74 +-
src/templates/org/lwjgl/opengl/EXT_texture_3d.java | 70 +-
.../lwjgl/opengl/EXT_texture_compression_s3tc.java | 84 +-
.../org/lwjgl/opengl/EXT_texture_env_combine.java | 112 +-
.../org/lwjgl/opengl/EXT_texture_env_dot3.java | 74 +-
.../opengl/EXT_texture_filter_anisotropic.java | 74 +-
.../org/lwjgl/opengl/EXT_texture_lod_bias.java | 82 +-
.../org/lwjgl/opengl/EXT_texture_mirror_clamp.java | 90 +-
.../org/lwjgl/opengl/EXT_texture_rectangle.java | 78 +-
.../org/lwjgl/opengl/EXT_texture_sRGB.java | 126 +-
.../org/lwjgl/opengl/EXT_texture_snorm.java | 138 +-
.../org/lwjgl/opengl/EXT_timer_query.java | 124 +-
.../org/lwjgl/opengl/EXT_vertex_shader.java | 580 ++--
.../org/lwjgl/opengl/EXT_vertex_weighting.java | 124 +-
src/templates/org/lwjgl/opengl/GL11.java | 3224 ++++++++++----------
src/templates/org/lwjgl/opengl/GL12.java | 242 +-
src/templates/org/lwjgl/opengl/GL13.java | 514 ++--
src/templates/org/lwjgl/opengl/GL14.java | 344 ++--
src/templates/org/lwjgl/opengl/GL15.java | 474 ++--
src/templates/org/lwjgl/opengl/GL20.java | 1134 ++++----
src/templates/org/lwjgl/opengl/GL21.java | 248 +-
src/templates/org/lwjgl/opengl/GL30.java | 2070 +++++++-------
src/templates/org/lwjgl/opengl/GL31.java | 590 ++--
src/templates/org/lwjgl/opengl/GL32.java | 676 ++--
src/templates/org/lwjgl/opengl/GL33.java | 834 +++---
src/templates/org/lwjgl/opengl/GL40.java | 896 +++---
.../org/lwjgl/opengl/HP_occlusion_test.java | 96 +-
.../org/lwjgl/opengl/IBM_rasterpos_clip.java | 84 +-
.../org/lwjgl/opengl/NVX_gpu_memory_info.java | 86 +-
.../org/lwjgl/opengl/NV_blend_square.java | 70 +-
.../org/lwjgl/opengl/NV_conditional_render.java | 98 +-
.../org/lwjgl/opengl/NV_copy_depth_to_color.java | 74 +-
src/templates/org/lwjgl/opengl/NV_copy_image.java | 96 +-
src/templates/org/lwjgl/opengl/NV_depth_clamp.java | 72 +-
src/templates/org/lwjgl/opengl/NV_evaluators.java | 182 +-
.../org/lwjgl/opengl/NV_explicit_multisample.java | 200 +-
src/templates/org/lwjgl/opengl/NV_fence.java | 112 +-
.../org/lwjgl/opengl/NV_float_buffer.java | 182 +-
.../org/lwjgl/opengl/NV_fog_distance.java | 76 +-
.../org/lwjgl/opengl/NV_fragment_program.java | 138 +-
.../org/lwjgl/opengl/NV_fragment_program2.java | 88 +-
.../lwjgl/opengl/NV_fragment_program_option.java | 70 +-
.../org/lwjgl/opengl/NV_geometry_shader4.java | 72 +-
src/templates/org/lwjgl/opengl/NV_gpu_shader5.java | 362 ++--
src/templates/org/lwjgl/opengl/NV_half_float.java | 272 +-
.../org/lwjgl/opengl/NV_light_max_exponent.java | 74 +-
.../lwjgl/opengl/NV_multisample_filter_hint.java | 82 +-
.../org/lwjgl/opengl/NV_occlusion_query.java | 160 +-
.../org/lwjgl/opengl/NV_packed_depth_stencil.java | 74 +-
.../org/lwjgl/opengl/NV_pixel_data_range.java | 138 +-
.../org/lwjgl/opengl/NV_point_sprite.java | 94 +-
.../org/lwjgl/opengl/NV_primitive_restart.java | 112 +-
src/templates/org/lwjgl/opengl/NV_program.java | 208 +-
.../org/lwjgl/opengl/NV_register_combiners.java | 308 +-
.../org/lwjgl/opengl/NV_register_combiners2.java | 92 +-
.../org/lwjgl/opengl/NV_shader_buffer_load.java | 200 +-
.../org/lwjgl/opengl/NV_shader_buffer_store.java | 84 +-
.../org/lwjgl/opengl/NV_texgen_reflection.java | 74 +-
.../org/lwjgl/opengl/NV_texture_barrier.java | 74 +-
.../lwjgl/opengl/NV_texture_compression_vtc.java | 96 +-
.../org/lwjgl/opengl/NV_texture_env_combine4.java | 80 +-
.../org/lwjgl/opengl/NV_texture_expand_normal.java | 84 +-
.../org/lwjgl/opengl/NV_texture_rectangle.java | 78 +-
.../org/lwjgl/opengl/NV_texture_shader.java | 348 ++--
.../org/lwjgl/opengl/NV_texture_shader2.java | 126 +-
.../org/lwjgl/opengl/NV_texture_shader3.java | 104 +-
.../org/lwjgl/opengl/NV_vertex_array_range.java | 124 +-
.../org/lwjgl/opengl/NV_vertex_array_range2.java | 72 +-
.../opengl/NV_vertex_buffer_unified_memory.java | 220 +-
.../org/lwjgl/opengl/NV_vertex_program.java | 660 ++--
.../org/lwjgl/opengl/NV_vertex_program1_1.java | 70 +-
.../org/lwjgl/opengl/NV_vertex_program2.java | 70 +-
.../lwjgl/opengl/NV_vertex_program2_option.java | 82 +-
.../org/lwjgl/opengl/NV_vertex_program3.java | 82 +-
.../org/lwjgl/opengl/SGIS_generate_mipmap.java | 98 +-
.../org/lwjgl/opengl/SGIS_texture_lod.java | 92 +-
.../org/lwjgl/opengl/SUN_slice_accum.java | 82 +-
574 files changed, 81386 insertions(+), 81306 deletions(-)
diff --git a/build.xml b/build.xml
index 60d236a..d625767 100644
--- a/build.xml
+++ b/build.xml
@@ -1,499 +1,499 @@
-<project name="LWJGL" default="all" basedir=".">
-
- <property name="build.sysclasspath" value="last" />
-
- <import file="platform_build/build-definitions.xml"/>
- <import file="platform_build/build-generator.xml"/>
- <import file="platform_build/build-applet.xml"/>
- <import file="platform_build/build-webstart.xml"/>
-
- <!-- ================================================================== -->
- <!-- Everything below this line is targets. -->
- <!-- Do not modify, unless you know what you're doing -->
- <!-- ================================================================== -->
-
- <!-- ================================================================== -->
- <!-- Initialize build -->
- <!-- ================================================================== -->
- <target name="-initialize">
- <mkdir dir="${lwjgl.bin}" taskname="initialiazing bin folder" />
- <mkdir dir="${lwjgl.bin}/lwjgl" taskname="initialiazing bin folder" />
- <mkdir dir="${lwjgl.lib}" taskname="initialiazing lib folder" />
- <mkdir dir="${lwjgl.dist}" taskname="initialiazing dist folder" />
- <mkdir dir="${lwjgl.docs}/javadoc" taskname="initialiazing docs folder" />
- <mkdir dir="${lwjgl.res}" taskname="initialiazing res folder" />
- <mkdir dir="${lwjgl.temp}" taskname="initialiazing temp folder" />
- <mkdir dir="${lwjgl.temp}/jar" taskname="initialiazing temp/jar folder" />
- <mkdir dir="${lwjgl.temp}/doc" taskname="initialiazing temp/doc folder" />
- <mkdir dir="${lwjgl.temp}/res" taskname="initialiazing temp/res folder" />
- <mkdir dir="${lwjgl.temp}/native" taskname="initialiazing temp/native folder" />
- <mkdir dir="${lwjgl.temp}/native/windows" taskname="initialiazing temp/windows folder" />
- <mkdir dir="${lwjgl.temp}/native/linux" taskname="initialiazing temp/linux folder" />
- <mkdir dir="${lwjgl.temp}/native/macosx" taskname="initialiazing temp/macosx folder" />
- <mkdir dir="${lwjgl.temp}/native/solaris" taskname="initialiazing temp/solaris folder" />
- </target>
-
- <!-- Cleans up any files created during the execution of this script -->
- <target name="clean" description="Cleans the diectories controlled by this ant script" depends="clean-generated">
- <delete dir="${lwjgl.temp}" quiet="true" failonerror="false" taskname="cleaning temp folder" />
- <delete dir="${lwjgl.docs}/javadoc" quiet="true" failonerror="false" taskname="cleaning javadoc folder" />
- <delete dir="${lwjgl.bin}" quiet="true" failonerror="false" taskname="cleaning bin folder" />
- </target>
-
- <!-- Creates a distribution of LWJGL -->
- <target name="release" description="Creates a distribution of LWJGL using supplied native binaries">
- <!-- Warn user -->
- <echo message="Before running the release target, please manually compile all platforms and place required files in ${lwjgl.lib}/windows, ${lwjgl.lib}/linux and ${lwjgl.lib}/macosx${line.separator}Missing files will result in a successfull built, but with incomplete release zips"/>
- <input
- message="All data in the ${lwjgl.dist} folder will be deleted. Continue? "
- validargs="yes,no"
- addproperty="do.delete"
- />
- <condition property="do.abort">
- <equals arg1="no" arg2="${do.delete}"/>
- </condition>
- <fail if="do.abort">Build aborted by user.</fail>
-
- <!-- prepare -->
- <delete dir="${lwjgl.dist}" quiet="true" failonerror="false" />
- <antcall target="clean" />
- <antcall target="-initialize" />
-
- <!-- compile and create jars -->
- <antcall target="generate-debug"/>
- <antcall target="compile" />
- <antcall target="-createdebugjars" />
- <!-- Generator will skip all templates if we don't clean -->
- <delete dir="${lwjgl.bin}" quiet="true" failonerror="false" taskname="cleaning bin folder" />
- <mkdir dir="${lwjgl.bin}" taskname="initialiazing bin folder" />
- <antcall target="generate-all"/>
- <antcall target="compile" />
- <antcall target="-createjars" />
- <antcall target="-jars_NoDEP" />
- <antcall target="javadoc" />
- <antcall target="applet-release" />
-
- <!-- copy resources to res folder -->
- <copy todir="${lwjgl.temp}/res">
- <fileset dir="res"/>
- </copy>
-
- <!-- copy docs -->
- <copy todir="${lwjgl.temp}/doc">
- <fileset dir="${lwjgl.docs}">
- <patternset refid="lwjgl-docs.fileset" />
- </fileset>
- </copy>
-
- <!-- create distribution from files in libs/ and temp/ -->
- <antcall target="-distribution_javadoc" />
- <antcall target="-distribution_source" />
- <antcall target="-distribute" />
- </target>
-
- <target name="all" description="Creates the Java archives and the natives for the current platform" depends="jars, compile_native"/>
-
- <!-- Create ONLY the jar archives -->
- <target name="jars" description="Creates the Java archives ONLY and places them in libs/" depends="-initialize, generate-all, compile, -createjars">
- <antcall target="-jars_NoDEP" />
- </target>
-
- <target name="-jars_NoDEP">
- <move todir="libs/">
- <fileset dir="${lwjgl.temp}/jar">
- <include name="*.jar"/>
- </fileset>
- </move>
- </target>
-
- <!-- Packages the java files -->
- <target name="-createdebugjars">
- <!-- Create lwjgl.jar -->
- <jar destfile="${lwjgl.temp}/jar/lwjgl-debug.jar" taskname="lwjgl-debug.jar">
- <fileset refid="lwjgl.fileset" />
- <manifest>
- <attribute name="Sealed" value="true"/>
- </manifest>
- </jar>
- </target>
-
- <!-- Packages the java files -->
- <target name="-createjars">
- <!-- Create lwjgl.jar -->
- <jar destfile="${lwjgl.temp}/jar/lwjgl.jar" taskname="lwjgl.jar">
- <fileset refid="lwjgl.fileset" />
- <manifest>
- <attribute name="Sealed" value="true"/>
- <attribute name="Trusted-Library" value="true"/>
- </manifest>
- </jar>
-
- <!-- Create lwjgl_util_applet.jar -->
- <jar destfile="${lwjgl.temp}/jar/lwjgl_util_applet.jar" taskname="lwjgl_util_applet.jar">
- <fileset refid="lwjgl_util_applet.fileset" />
- <manifest>
- <attribute name="Sealed" value="true"/>
- <attribute name="Trusted-Library" value="true"/>
- </manifest>
- </jar>
-
- <!-- Create lwjgl_test.jar -->
- <jar destfile="${lwjgl.temp}/jar/lwjgl_test.jar" taskname="lwjgl_test.jar">
- <fileset refid="lwjgl_test.fileset" />
- <fileset refid="lwjgl_test_extra.fileset" />
- </jar>
-
- <!-- Create lwjgl_util.jar -->
- <jar destfile="${lwjgl.temp}/jar/lwjgl_util.jar" taskname="lwjgl_util.jar">
- <fileset refid="lwjgl_util.fileset" />
- </jar>
- </target>
-
- <!-- Distributes files -->
- <target name="-distribute">
- <delete>
- <fileset dir="${lwjgl.temp}/native/" includes="**/*"/>
- </delete>
-
- <copy todir="${lwjgl.temp}/jar">
- <fileset dir="${lwjgl.lib}/" includes="*.jar"/>
- </copy>
- <copy todir="${lwjgl.temp}/native/windows">
- <fileset dir="${lwjgl.lib}/windows">
- <patternset refid="lwjgl-windows.fileset" />
- </fileset>
- </copy>
- <copy todir="${lwjgl.temp}/native/linux">
- <fileset dir="${lwjgl.lib}/linux">
- <patternset refid="lwjgl-linux.fileset" />
- </fileset>
- </copy>
- <copy todir="${lwjgl.temp}/native/macosx">
- <fileset dir="${lwjgl.lib}/macosx">
- <patternset refid="lwjgl-macosx.fileset" />
- </fileset>
- </copy>
- <copy todir="${lwjgl.temp}/native/solaris">
- <fileset dir="${lwjgl.lib}/solaris">
- <patternset refid="lwjgl-solaris.fileset" />
- </fileset>
- </copy>
-
- <!-- create base package -->
- <zip destfile="${lwjgl.dist}/lwjgl-${lwjgl.version}.zip">
- <zipfileset dir="${lwjgl.temp}" prefix="lwjgl-${lwjgl.version}/">
- <patternset refid="lwjgl_base"/>
- </zipfileset>
- </zip>
-
- <!-- create applet package -->
- <zip destfile="${lwjgl.dist}/lwjgl_applet-${lwjgl.version}.zip">
- <zipfileset dir="." prefix="lwjgl_applet-${lwjgl.version}/">
- <patternset refid="lwjgl_applet"/>
- </zipfileset>
- </zip>
- </target>
-
- <!-- Creates a versioned distribution of javadocs -->
- <target name="-distribution_javadoc">
- <zip destfile="${lwjgl.dist}/lwjgl-docs-${lwjgl.version}.zip" basedir="${lwjgl.docs}" includes="javadoc/**" />
- </target>
-
- <!-- Creates a versioned distribution of the source code -->
- <target name="-distribution_source">
- <zip destfile="${lwjgl.dist}/lwjgl-source-${lwjgl.version}.zip">
- <fileset refid="lwjgl.source.fileset" />
- </zip>
- </target>
-
- <!-- Generates the native headers from source files -->
- <target name="headers" description="invokes javah on java classes" depends="compile">
- <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/linux" force="yes">
- <class name="org.lwjgl.LinuxSysImplementation" />
- <class name="org.lwjgl.opengl.LinuxEvent" />
- <class name="org.lwjgl.opengl.LinuxMouse" />
- <class name="org.lwjgl.opengl.LinuxKeyboard" />
- <class name="org.lwjgl.opengl.LinuxDisplay" />
- <class name="org.lwjgl.opengl.LinuxPeerInfo" />
- <class name="org.lwjgl.opengl.LinuxPbufferPeerInfo" />
- <class name="org.lwjgl.opengl.LinuxDisplayPeerInfo" />
- <class name="org.lwjgl.opengl.LinuxAWTGLCanvasPeerInfo" />
- <class name="org.lwjgl.opengl.LinuxContextImplementation" />
- <class name="org.lwjgl.opengl.LinuxCanvasImplementation" />
- </javah>
-
- <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/windows" force="yes">
- <class name="org.lwjgl.opengl.WindowsKeyboard" />
- <class name="org.lwjgl.opengl.WindowsPbufferPeerInfo" />
- <class name="org.lwjgl.opengl.WindowsDisplay" />
- <class name="org.lwjgl.opengl.WindowsRegistry" />
- <class name="org.lwjgl.WindowsSysImplementation" />
- <class name="org.lwjgl.opengl.WindowsAWTGLCanvasPeerInfo" />
- <class name="org.lwjgl.opengl.WindowsPeerInfo" />
- <class name="org.lwjgl.opengl.WindowsDisplayPeerInfo" />
- <class name="org.lwjgl.opengl.WindowsContextImplementation" />
- </javah>
-
- <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/macosx" force="yes">
- <class name="org.lwjgl.MacOSXSysImplementation" />
- <class name="org.lwjgl.opengl.MacOSXMouseEventQueue" />
- <class name="org.lwjgl.opengl.MacOSXCanvasPeerInfo" />
- <class name="org.lwjgl.opengl.MacOSXPeerInfo" />
- <class name="org.lwjgl.opengl.MacOSXPbufferPeerInfo" />
- <class name="org.lwjgl.opengl.MacOSXDisplay" />
- <class name="org.lwjgl.opengl.MacOSXContextImplementation" />
- </javah>
-
- <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.headers}" force="yes">
- <class name="org.lwjgl.opengl.AWTSurfaceLock" />
- <class name="org.lwjgl.DefaultSysImplementation" />
- <class name="org.lwjgl.input.Cursor" />
- <class name="org.lwjgl.input.Keyboard" />
- <class name="org.lwjgl.input.Mouse" />
- <class name="org.lwjgl.openal.AL" />
- <class name="org.lwjgl.opengl.GLContext" />
- <class name="org.lwjgl.opengl.Pbuffer" />
- </javah>
- </target>
-
- <target name="touch-version">
- <touch file="${lwjgl.src.native}/windows/org_lwjgl_opengl_Display.c"/>
- <touch file="${lwjgl.src.native}/linux/org_lwjgl_opengl_Display.c"/>
- <touch file="${lwjgl.src.native}/macosx/org_lwjgl_opengl_Display.m"/>
- </target>
-
- <target name="version-mismatch">
- <loadfile srcfile="${lwjgl.src}/java/org/lwjgl/WindowsSysImplementation.java" property="lwjgl.java.windows.version">
- <filterchain>
- <tokenfilter>
- <containsstring contains="JNI_VERSION ="/>
- </tokenfilter>
- </filterchain>
- </loadfile>
- <loadfile srcfile="${lwjgl.src}/java/org/lwjgl/LinuxSysImplementation.java" property="lwjgl.java.linux.version">
- <filterchain>
- <tokenfilter>
- <containsstring contains="JNI_VERSION ="/>
- </tokenfilter>
- </filterchain>
- </loadfile>
- <loadfile srcfile="${lwjgl.src}/java/org/lwjgl/MacOSXSysImplementation.java" property="lwjgl.java.macosx.version">
- <filterchain>
- <tokenfilter>
- <containsstring contains="JNI_VERSION ="/>
- </tokenfilter>
- </filterchain>
- </loadfile>
- <loadfile srcfile="${lwjgl.src.native}/windows/org_lwjgl_WindowsSysImplementation.h" property="lwjgl.native.windows.version">
- <filterchain>
- <tokenfilter>
- <containsstring contains="#define org_lwjgl_WindowsSysImplementation_JNI_VERSION"/>
- </tokenfilter>
- </filterchain>
- </loadfile>
- <loadfile srcfile="${lwjgl.src.native}/linux/org_lwjgl_LinuxSysImplementation.h" property="lwjgl.native.linux.version">
- <filterchain>
- <tokenfilter>
- <containsstring contains="#define org_lwjgl_LinuxSysImplementation_JNI_VERSION"/>
- </tokenfilter>
- </filterchain>
- </loadfile>
- <loadfile srcfile="${lwjgl.src.native}/macosx/org_lwjgl_MacOSXSysImplementation.h" property="lwjgl.native.macosx.version">
- <filterchain>
- <tokenfilter>
- <containsstring contains="#define org_lwjgl_MacOSXSysImplementation_JNI_VERSION"/>
- </tokenfilter>
- </filterchain>
- </loadfile>
- <echo>
- lwjgl.java.windows.version = ${lwjgl.java.windows.version}
- lwjgl.native.windows.version = ${lwjgl.native.windows.version}
- lwjgl.java.linux.version = ${lwjgl.java.linux.version}
- lwjgl.native.linux.version = ${lwjgl.native.linux.version}
- lwjgl.java.macosx.version = ${lwjgl.java.macosx.version}
- lwjgl.native.macosx.version = ${lwjgl.native.macosx.version}
- </echo>
- </target>
-
- <macrodef name="version-check">
- <attribute name="platform"/>
- <sequential>
- <java classname="org.lwjgl.test.NativeTest" logError="false" resultproperty="nativetest.res" outputproperty="nativetest.out" errorproperty="nativetest.err" fork="true">
- <jvmarg value="-Djava.library.path=libs/@{platform}"/>
- <classpath>
- <pathelement path="${lwjgl.bin}"/>
- <pathelement path="${java.class.path}"/>
- </classpath>
- </java>
-
- <fail message="Unable to load native library: ${nativetest.err}">
- <condition>
- <not>
- <equals arg1="OK" arg2="${nativetest.out}"/>
- </not>
- </condition>
- </fail>
-
- <echo message="Successfully executed NativeTest"/>
- </sequential>
- </macrodef>
-
- <!-- Compiles the Java source code -->
- <target name="compile" description="Compiles the java source code" depends="-initialize">
- <javac debug="yes" destdir="${lwjgl.bin}" source="1.4" target="1.4" classpath="${lwjgl.lib}/jinput.jar:${lwjgl.lib}/AppleJavaExtensions.jar" taskname="core">
- <src path="${lwjgl.src}/java/"/>
- <src path="${lwjgl.src}/generated/"/>
- <include name="org/lwjgl/*.java"/>
- <include name="org/lwjgl/input/**"/>
- <include name="org/lwjgl/opengl/**"/>
- <include name="org/lwjgl/openal/**"/>
- <include name="org/lwjgl/util/**"/>
- <exclude name="org/lwjgl/util/generator/**"/>
- </javac>
- <javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/test/**" source="1.4" target="1.4" taskname="test" />
- <javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/examples/**" source="1.4" target="1.4" taskname="examples" />
- </target>
-
- <target name="compile_native" depends="headers, touch-version, version-mismatch" description="Compiles the native files">
- <condition property="lwjgl.platform.windows">
- <os family="windows" />
- </condition>
- <antcall target="-compile_native_win32" />
-
- <condition property="lwjgl.platform.linux">
- <os name="Linux" />
- </condition>
- <antcall target="-compile_native_linux" />
-
- <condition property="lwjgl.platform.solaris">
- <os name="SunOS" />
- </condition>
- <antcall target="-compile_native_solaris" />
-
- <condition property="lwjgl.platform.macosx">
- <os name="Mac OS X" />
- </condition>
- <antcall target="-compile_native_macosx" />
- </target>
-
- <!-- Compiles LWJGL on Win32 platforms -->
- <target name="-compile_native_win32" if="lwjgl.platform.windows">
- <ant antfile="platform_build/windows_ant/build.xml" inheritAll="false"/>
- <copy todir="${lwjgl.lib}/windows">
- <fileset dir="${lwjgl.bin}/lwjgl" includes="lwjgl*.dll"/>
- </copy>
- <version-check platform="windows"/>
- </target>
-
- <!-- Compiles LWJGL on Linux platforms -->
- <target name="-compile_native_linux" if="lwjgl.platform.linux">
- <ant antfile="platform_build/linux_ant/build.xml" inheritAll="false"/>
- <copy todir="${lwjgl.lib}/linux">
- <fileset dir="${lwjgl.bin}/lwjgl" includes="liblwjgl*.so"/>
- </copy>
- <!-- headless issues <version-check platform="linux"/> -->
- </target>
-
- <!-- Compiles LWJGL on solaris platforms -->
- <target name="-compile_native_solaris" if="lwjgl.platform.solaris">
- <!-- Reusing the linux ant task, but copy the output to solaris -->
- <ant antfile="platform_build/linux_ant/build.xml" inheritAll="false"/>
- <copy todir="${lwjgl.lib}/solaris">
- <fileset dir="${lwjgl.bin}/lwjgl" includes="liblwjgl*.so"/>
- </copy>
- <version-check platform="solaris"/>
- </target>
-
- <!-- Compiles LWJGL on Mac platforms -->
- <target name="-compile_native_macosx" if="lwjgl.platform.macosx">
- <ant antfile="platform_build/macosx_ant/build.xml" inheritAll="false"/>
- <copy file="${lwjgl.bin}/lwjgl/liblwjgl.jnilib" todir="${lwjgl.lib}/macosx"/>
- <version-check platform="macosx"/>
- </target>
-
- <target name="repack200" description="Pack200-repack a jar file">
- <pack200 src="${input}" destfile="${output}" repack="true"/>
- </target>
-
- <target name="pack200" description="Pack200 a jar file">
- <pack200 src="${input}" destfile="${output}"/>
- </target>
-
- <target name="lzma" description="LZMA compress a file">
- <java fork="true" classname="SevenZip.LzmaAlone">
- <classpath>
- <pathelement location="platform_build/JLzma.jar"/>
- </classpath>
- <jvmarg value="-Xmx512m"/>
- <arg value="e"/>
- <arg value="${input}"/>
- <arg value="${output}"/>
- </java>
- </target>
-
- <target name="compress-sign-class">
- <antcall target="repack200">
- <param name="input" value="${dir}${jarfile}.jar"/>
- <param name="output" value="${dir}${jarfile}-repack.jar"/>
- </antcall>
- <signjar jar="${dir}${jarfile}-repack.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
- <antcall target="pack200">
- <param name="input" value="${dir}${jarfile}-repack.jar"/>
- <param name="output" value="${dir}${jarfile}.jar.pack"/>
- </antcall>
- <antcall target="lzma">
- <param name="input" value="${dir}${jarfile}.jar.pack"/>
- <param name="output" value="${dir}${jarfile}.jar.pack.lzma"/>
- </antcall>
- <delete file="${dir}${jarfile}-repack.jar"/>
- <delete file="${dir}${jarfile}.jar.pack"/>
- <delete file="${dir}${jarfile}.jar"/>
- </target>
-
- <target name="compress-resource">
- <antcall target="lzma">
- <param name="input" value="${input}"/>
- <param name="output" value="${output}"/>
- </antcall>
- </target>
-
- <target name="applettest" depends="applet">
- <exec executable="appletviewer">
- <arg value="-J-Djava.security.policy=applet/appletviewer.policy"/>
- <arg path="applet/applet.html"/>
- </exec>
- </target>
-
- <target name="runtest" depends="all">
- <fail message="test.mainclass is not set. Use 'ant -Dtest.mainclass=<main-class> runtest'" unless="test.mainclass"/>
- <condition property="native_path" value="libs/windows">
- <os family="windows" />
- </condition>
-
- <condition property="native_path" value="libs/linux">
- <or>
- <os name="Linux" />
- <os name="SunOS" />
- </or>
- </condition>
-
- <condition property="native_path" value="libs/macosx">
- <os name="Mac OS X" />
- </condition>
- <property name="native_path_expanded" location="${native_path}"/>
- <java classname="${test.mainclass}" classpath="res:${lwjgl.lib}/lwjgl.jar:${lwjgl.lib}/lwjgl_util.jar:${lwjgl.lib}/lwjgl_test.jar:${lwjgl.lib}/jinput.jar" fork="true">
- <sysproperty key="org.lwjgl.util.Debug" value="true"/>
- <sysproperty key="java.library.path" value="${native_path_expanded}"/>
- <arg line="${args}"/>
- </java>
- </target>
-
- <!-- Creates the Javadoc -->
- <target name="javadoc" description="Creates javadoc from java source code">
- <javadoc destdir="${lwjgl.docs}/javadoc" classpath="${lwjgl.lib}/jinput.jar" author="true" version="true" use="true" source="1.4" windowtitle="LWJGL API" useexternalfile="true">
- <fileset refid="lwjgl.javadoc.fileset" />
- <doctitle><![CDATA[<h1>Lightweight Java Game Toolkit</h1>]]></doctitle>
- <bottom><![CDATA[<i>Copyright © 2002-2009 lwjgl.org. All Rights Reserved.</i>]]></bottom>
- </javadoc>
- </target>
-</project>
+<project name="LWJGL" default="all" basedir=".">
+
+ <property name="build.sysclasspath" value="last" />
+
+ <import file="platform_build/build-definitions.xml"/>
+ <import file="platform_build/build-generator.xml"/>
+ <import file="platform_build/build-applet.xml"/>
+ <import file="platform_build/build-webstart.xml"/>
+
+ <!-- ================================================================== -->
+ <!-- Everything below this line is targets. -->
+ <!-- Do not modify, unless you know what you're doing -->
+ <!-- ================================================================== -->
+
+ <!-- ================================================================== -->
+ <!-- Initialize build -->
+ <!-- ================================================================== -->
+ <target name="-initialize">
+ <mkdir dir="${lwjgl.bin}" taskname="initialiazing bin folder" />
+ <mkdir dir="${lwjgl.bin}/lwjgl" taskname="initialiazing bin folder" />
+ <mkdir dir="${lwjgl.lib}" taskname="initialiazing lib folder" />
+ <mkdir dir="${lwjgl.dist}" taskname="initialiazing dist folder" />
+ <mkdir dir="${lwjgl.docs}/javadoc" taskname="initialiazing docs folder" />
+ <mkdir dir="${lwjgl.res}" taskname="initialiazing res folder" />
+ <mkdir dir="${lwjgl.temp}" taskname="initialiazing temp folder" />
+ <mkdir dir="${lwjgl.temp}/jar" taskname="initialiazing temp/jar folder" />
+ <mkdir dir="${lwjgl.temp}/doc" taskname="initialiazing temp/doc folder" />
+ <mkdir dir="${lwjgl.temp}/res" taskname="initialiazing temp/res folder" />
+ <mkdir dir="${lwjgl.temp}/native" taskname="initialiazing temp/native folder" />
+ <mkdir dir="${lwjgl.temp}/native/windows" taskname="initialiazing temp/windows folder" />
+ <mkdir dir="${lwjgl.temp}/native/linux" taskname="initialiazing temp/linux folder" />
+ <mkdir dir="${lwjgl.temp}/native/macosx" taskname="initialiazing temp/macosx folder" />
+ <mkdir dir="${lwjgl.temp}/native/solaris" taskname="initialiazing temp/solaris folder" />
+ </target>
+
+ <!-- Cleans up any files created during the execution of this script -->
+ <target name="clean" description="Cleans the diectories controlled by this ant script" depends="clean-generated">
+ <delete dir="${lwjgl.temp}" quiet="true" failonerror="false" taskname="cleaning temp folder" />
+ <delete dir="${lwjgl.docs}/javadoc" quiet="true" failonerror="false" taskname="cleaning javadoc folder" />
+ <delete dir="${lwjgl.bin}" quiet="true" failonerror="false" taskname="cleaning bin folder" />
+ </target>
+
+ <!-- Creates a distribution of LWJGL -->
+ <target name="release" description="Creates a distribution of LWJGL using supplied native binaries">
+ <!-- Warn user -->
+ <echo message="Before running the release target, please manually compile all platforms and place required files in ${lwjgl.lib}/windows, ${lwjgl.lib}/linux and ${lwjgl.lib}/macosx${line.separator}Missing files will result in a successfull built, but with incomplete release zips"/>
+ <input
+ message="All data in the ${lwjgl.dist} folder will be deleted. Continue? "
+ validargs="yes,no"
+ addproperty="do.delete"
+ />
+ <condition property="do.abort">
+ <equals arg1="no" arg2="${do.delete}"/>
+ </condition>
+ <fail if="do.abort">Build aborted by user.</fail>
+
+ <!-- prepare -->
+ <delete dir="${lwjgl.dist}" quiet="true" failonerror="false" />
+ <antcall target="clean" />
+ <antcall target="-initialize" />
+
+ <!-- compile and create jars -->
+ <antcall target="generate-debug"/>
+ <antcall target="compile" />
+ <antcall target="-createdebugjars" />
+ <!-- Generator will skip all templates if we don't clean -->
+ <delete dir="${lwjgl.bin}" quiet="true" failonerror="false" taskname="cleaning bin folder" />
+ <mkdir dir="${lwjgl.bin}" taskname="initialiazing bin folder" />
+ <antcall target="generate-all"/>
+ <antcall target="compile" />
+ <antcall target="-createjars" />
+ <antcall target="-jars_NoDEP" />
+ <antcall target="javadoc" />
+ <antcall target="applet-release" />
+
+ <!-- copy resources to res folder -->
+ <copy todir="${lwjgl.temp}/res">
+ <fileset dir="res"/>
+ </copy>
+
+ <!-- copy docs -->
+ <copy todir="${lwjgl.temp}/doc">
+ <fileset dir="${lwjgl.docs}">
+ <patternset refid="lwjgl-docs.fileset" />
+ </fileset>
+ </copy>
+
+ <!-- create distribution from files in libs/ and temp/ -->
+ <antcall target="-distribution_javadoc" />
+ <antcall target="-distribution_source" />
+ <antcall target="-distribute" />
+ </target>
+
+ <target name="all" description="Creates the Java archives and the natives for the current platform" depends="jars, compile_native"/>
+
+ <!-- Create ONLY the jar archives -->
+ <target name="jars" description="Creates the Java archives ONLY and places them in libs/" depends="-initialize, generate-all, compile, -createjars">
+ <antcall target="-jars_NoDEP" />
+ </target>
+
+ <target name="-jars_NoDEP">
+ <move todir="libs/">
+ <fileset dir="${lwjgl.temp}/jar">
+ <include name="*.jar"/>
+ </fileset>
+ </move>
+ </target>
+
+ <!-- Packages the java files -->
+ <target name="-createdebugjars">
+ <!-- Create lwjgl.jar -->
+ <jar destfile="${lwjgl.temp}/jar/lwjgl-debug.jar" taskname="lwjgl-debug.jar">
+ <fileset refid="lwjgl.fileset" />
+ <manifest>
+ <attribute name="Sealed" value="true"/>
+ </manifest>
+ </jar>
+ </target>
+
+ <!-- Packages the java files -->
+ <target name="-createjars">
+ <!-- Create lwjgl.jar -->
+ <jar destfile="${lwjgl.temp}/jar/lwjgl.jar" taskname="lwjgl.jar">
+ <fileset refid="lwjgl.fileset" />
+ <manifest>
+ <attribute name="Sealed" value="true"/>
+ <attribute name="Trusted-Library" value="true"/>
+ </manifest>
+ </jar>
+
+ <!-- Create lwjgl_util_applet.jar -->
+ <jar destfile="${lwjgl.temp}/jar/lwjgl_util_applet.jar" taskname="lwjgl_util_applet.jar">
+ <fileset refid="lwjgl_util_applet.fileset" />
+ <manifest>
+ <attribute name="Sealed" value="true"/>
+ <attribute name="Trusted-Library" value="true"/>
+ </manifest>
+ </jar>
+
+ <!-- Create lwjgl_test.jar -->
+ <jar destfile="${lwjgl.temp}/jar/lwjgl_test.jar" taskname="lwjgl_test.jar">
+ <fileset refid="lwjgl_test.fileset" />
+ <fileset refid="lwjgl_test_extra.fileset" />
+ </jar>
+
+ <!-- Create lwjgl_util.jar -->
+ <jar destfile="${lwjgl.temp}/jar/lwjgl_util.jar" taskname="lwjgl_util.jar">
+ <fileset refid="lwjgl_util.fileset" />
+ </jar>
+ </target>
+
+ <!-- Distributes files -->
+ <target name="-distribute">
+ <delete>
+ <fileset dir="${lwjgl.temp}/native/" includes="**/*"/>
+ </delete>
+
+ <copy todir="${lwjgl.temp}/jar">
+ <fileset dir="${lwjgl.lib}/" includes="*.jar"/>
+ </copy>
+ <copy todir="${lwjgl.temp}/native/windows">
+ <fileset dir="${lwjgl.lib}/windows">
+ <patternset refid="lwjgl-windows.fileset" />
+ </fileset>
+ </copy>
+ <copy todir="${lwjgl.temp}/native/linux">
+ <fileset dir="${lwjgl.lib}/linux">
+ <patternset refid="lwjgl-linux.fileset" />
+ </fileset>
+ </copy>
+ <copy todir="${lwjgl.temp}/native/macosx">
+ <fileset dir="${lwjgl.lib}/macosx">
+ <patternset refid="lwjgl-macosx.fileset" />
+ </fileset>
+ </copy>
+ <copy todir="${lwjgl.temp}/native/solaris">
+ <fileset dir="${lwjgl.lib}/solaris">
+ <patternset refid="lwjgl-solaris.fileset" />
+ </fileset>
+ </copy>
+
+ <!-- create base package -->
+ <zip destfile="${lwjgl.dist}/lwjgl-${lwjgl.version}.zip">
+ <zipfileset dir="${lwjgl.temp}" prefix="lwjgl-${lwjgl.version}/">
+ <patternset refid="lwjgl_base"/>
+ </zipfileset>
+ </zip>
+
+ <!-- create applet package -->
+ <zip destfile="${lwjgl.dist}/lwjgl_applet-${lwjgl.version}.zip">
+ <zipfileset dir="." prefix="lwjgl_applet-${lwjgl.version}/">
+ <patternset refid="lwjgl_applet"/>
+ </zipfileset>
+ </zip>
+ </target>
+
+ <!-- Creates a versioned distribution of javadocs -->
+ <target name="-distribution_javadoc">
+ <zip destfile="${lwjgl.dist}/lwjgl-docs-${lwjgl.version}.zip" basedir="${lwjgl.docs}" includes="javadoc/**" />
+ </target>
+
+ <!-- Creates a versioned distribution of the source code -->
+ <target name="-distribution_source">
+ <zip destfile="${lwjgl.dist}/lwjgl-source-${lwjgl.version}.zip">
+ <fileset refid="lwjgl.source.fileset" />
+ </zip>
+ </target>
+
+ <!-- Generates the native headers from source files -->
+ <target name="headers" description="invokes javah on java classes" depends="compile">
+ <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/linux" force="yes">
+ <class name="org.lwjgl.LinuxSysImplementation" />
+ <class name="org.lwjgl.opengl.LinuxEvent" />
+ <class name="org.lwjgl.opengl.LinuxMouse" />
+ <class name="org.lwjgl.opengl.LinuxKeyboard" />
+ <class name="org.lwjgl.opengl.LinuxDisplay" />
+ <class name="org.lwjgl.opengl.LinuxPeerInfo" />
+ <class name="org.lwjgl.opengl.LinuxPbufferPeerInfo" />
+ <class name="org.lwjgl.opengl.LinuxDisplayPeerInfo" />
+ <class name="org.lwjgl.opengl.LinuxAWTGLCanvasPeerInfo" />
+ <class name="org.lwjgl.opengl.LinuxContextImplementation" />
+ <class name="org.lwjgl.opengl.LinuxCanvasImplementation" />
+ </javah>
+
+ <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/windows" force="yes">
+ <class name="org.lwjgl.opengl.WindowsKeyboard" />
+ <class name="org.lwjgl.opengl.WindowsPbufferPeerInfo" />
+ <class name="org.lwjgl.opengl.WindowsDisplay" />
+ <class name="org.lwjgl.opengl.WindowsRegistry" />
+ <class name="org.lwjgl.WindowsSysImplementation" />
+ <class name="org.lwjgl.opengl.WindowsAWTGLCanvasPeerInfo" />
+ <class name="org.lwjgl.opengl.WindowsPeerInfo" />
+ <class name="org.lwjgl.opengl.WindowsDisplayPeerInfo" />
+ <class name="org.lwjgl.opengl.WindowsContextImplementation" />
+ </javah>
+
+ <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/macosx" force="yes">
+ <class name="org.lwjgl.MacOSXSysImplementation" />
+ <class name="org.lwjgl.opengl.MacOSXMouseEventQueue" />
+ <class name="org.lwjgl.opengl.MacOSXCanvasPeerInfo" />
+ <class name="org.lwjgl.opengl.MacOSXPeerInfo" />
+ <class name="org.lwjgl.opengl.MacOSXPbufferPeerInfo" />
+ <class name="org.lwjgl.opengl.MacOSXDisplay" />
+ <class name="org.lwjgl.opengl.MacOSXContextImplementation" />
+ </javah>
+
+ <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.headers}" force="yes">
+ <class name="org.lwjgl.opengl.AWTSurfaceLock" />
+ <class name="org.lwjgl.DefaultSysImplementation" />
+ <class name="org.lwjgl.input.Cursor" />
+ <class name="org.lwjgl.input.Keyboard" />
+ <class name="org.lwjgl.input.Mouse" />
+ <class name="org.lwjgl.openal.AL" />
+ <class name="org.lwjgl.opengl.GLContext" />
+ <class name="org.lwjgl.opengl.Pbuffer" />
+ </javah>
+ </target>
+
+ <target name="touch-version">
+ <touch file="${lwjgl.src.native}/windows/org_lwjgl_opengl_Display.c"/>
+ <touch file="${lwjgl.src.native}/linux/org_lwjgl_opengl_Display.c"/>
+ <touch file="${lwjgl.src.native}/macosx/org_lwjgl_opengl_Display.m"/>
+ </target>
+
+ <target name="version-mismatch">
+ <loadfile srcfile="${lwjgl.src}/java/org/lwjgl/WindowsSysImplementation.java" property="lwjgl.java.windows.version">
+ <filterchain>
+ <tokenfilter>
+ <containsstring contains="JNI_VERSION ="/>
+ </tokenfilter>
+ </filterchain>
+ </loadfile>
+ <loadfile srcfile="${lwjgl.src}/java/org/lwjgl/LinuxSysImplementation.java" property="lwjgl.java.linux.version">
+ <filterchain>
+ <tokenfilter>
+ <containsstring contains="JNI_VERSION ="/>
+ </tokenfilter>
+ </filterchain>
+ </loadfile>
+ <loadfile srcfile="${lwjgl.src}/java/org/lwjgl/MacOSXSysImplementation.java" property="lwjgl.java.macosx.version">
+ <filterchain>
+ <tokenfilter>
+ <containsstring contains="JNI_VERSION ="/>
+ </tokenfilter>
+ </filterchain>
+ </loadfile>
+ <loadfile srcfile="${lwjgl.src.native}/windows/org_lwjgl_WindowsSysImplementation.h" property="lwjgl.native.windows.version">
+ <filterchain>
+ <tokenfilter>
+ <containsstring contains="#define org_lwjgl_WindowsSysImplementation_JNI_VERSION"/>
+ </tokenfilter>
+ </filterchain>
+ </loadfile>
+ <loadfile srcfile="${lwjgl.src.native}/linux/org_lwjgl_LinuxSysImplementation.h" property="lwjgl.native.linux.version">
+ <filterchain>
+ <tokenfilter>
+ <containsstring contains="#define org_lwjgl_LinuxSysImplementation_JNI_VERSION"/>
+ </tokenfilter>
+ </filterchain>
+ </loadfile>
+ <loadfile srcfile="${lwjgl.src.native}/macosx/org_lwjgl_MacOSXSysImplementation.h" property="lwjgl.native.macosx.version">
+ <filterchain>
+ <tokenfilter>
+ <containsstring contains="#define org_lwjgl_MacOSXSysImplementation_JNI_VERSION"/>
+ </tokenfilter>
+ </filterchain>
+ </loadfile>
+ <echo>
+ lwjgl.java.windows.version = ${lwjgl.java.windows.version}
+ lwjgl.native.windows.version = ${lwjgl.native.windows.version}
+ lwjgl.java.linux.version = ${lwjgl.java.linux.version}
+ lwjgl.native.linux.version = ${lwjgl.native.linux.version}
+ lwjgl.java.macosx.version = ${lwjgl.java.macosx.version}
+ lwjgl.native.macosx.version = ${lwjgl.native.macosx.version}
+ </echo>
+ </target>
+
+ <macrodef name="version-check">
+ <attribute name="platform"/>
+ <sequential>
+ <java classname="org.lwjgl.test.NativeTest" logError="false" resultproperty="nativetest.res" outputproperty="nativetest.out" errorproperty="nativetest.err" fork="true">
+ <jvmarg value="-Djava.library.path=libs/@{platform}"/>
+ <classpath>
+ <pathelement path="${lwjgl.bin}"/>
+ <pathelement path="${java.class.path}"/>
+ </classpath>
+ </java>
+
+ <fail message="Unable to load native library: ${nativetest.err}">
+ <condition>
+ <not>
+ <equals arg1="OK" arg2="${nativetest.out}"/>
+ </not>
+ </condition>
+ </fail>
+
+ <echo message="Successfully executed NativeTest"/>
+ </sequential>
+ </macrodef>
+
+ <!-- Compiles the Java source code -->
+ <target name="compile" description="Compiles the java source code" depends="-initialize">
+ <javac debug="yes" destdir="${lwjgl.bin}" source="1.4" target="1.4" classpath="${lwjgl.lib}/jinput.jar:${lwjgl.lib}/AppleJavaExtensions.jar" taskname="core">
+ <src path="${lwjgl.src}/java/"/>
+ <src path="${lwjgl.src}/generated/"/>
+ <include name="org/lwjgl/*.java"/>
+ <include name="org/lwjgl/input/**"/>
+ <include name="org/lwjgl/opengl/**"/>
+ <include name="org/lwjgl/openal/**"/>
+ <include name="org/lwjgl/util/**"/>
+ <exclude name="org/lwjgl/util/generator/**"/>
+ </javac>
+ <javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/test/**" source="1.4" target="1.4" taskname="test" />
+ <javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/examples/**" source="1.4" target="1.4" taskname="examples" />
+ </target>
+
+ <target name="compile_native" depends="headers, touch-version, version-mismatch" description="Compiles the native files">
+ <condition property="lwjgl.platform.windows">
+ <os family="windows" />
+ </condition>
+ <antcall target="-compile_native_win32" />
+
+ <condition property="lwjgl.platform.linux">
+ <os name="Linux" />
+ </condition>
+ <antcall target="-compile_native_linux" />
+
+ <condition property="lwjgl.platform.solaris">
+ <os name="SunOS" />
+ </condition>
+ <antcall target="-compile_native_solaris" />
+
+ <condition property="lwjgl.platform.macosx">
+ <os name="Mac OS X" />
+ </condition>
+ <antcall target="-compile_native_macosx" />
+ </target>
+
+ <!-- Compiles LWJGL on Win32 platforms -->
+ <target name="-compile_native_win32" if="lwjgl.platform.windows">
+ <ant antfile="platform_build/windows_ant/build.xml" inheritAll="false"/>
+ <copy todir="${lwjgl.lib}/windows">
+ <fileset dir="${lwjgl.bin}/lwjgl" includes="lwjgl*.dll"/>
+ </copy>
+ <version-check platform="windows"/>
+ </target>
+
+ <!-- Compiles LWJGL on Linux platforms -->
+ <target name="-compile_native_linux" if="lwjgl.platform.linux">
+ <ant antfile="platform_build/linux_ant/build.xml" inheritAll="false"/>
+ <copy todir="${lwjgl.lib}/linux">
+ <fileset dir="${lwjgl.bin}/lwjgl" includes="liblwjgl*.so"/>
+ </copy>
+ <!-- headless issues <version-check platform="linux"/> -->
+ </target>
+
+ <!-- Compiles LWJGL on solaris platforms -->
+ <target name="-compile_native_solaris" if="lwjgl.platform.solaris">
+ <!-- Reusing the linux ant task, but copy the output to solaris -->
+ <ant antfile="platform_build/linux_ant/build.xml" inheritAll="false"/>
+ <copy todir="${lwjgl.lib}/solaris">
+ <fileset dir="${lwjgl.bin}/lwjgl" includes="liblwjgl*.so"/>
+ </copy>
+ <version-check platform="solaris"/>
+ </target>
+
+ <!-- Compiles LWJGL on Mac platforms -->
+ <target name="-compile_native_macosx" if="lwjgl.platform.macosx">
+ <ant antfile="platform_build/macosx_ant/build.xml" inheritAll="false"/>
+ <copy file="${lwjgl.bin}/lwjgl/liblwjgl.jnilib" todir="${lwjgl.lib}/macosx"/>
+ <version-check platform="macosx"/>
+ </target>
+
+ <target name="repack200" description="Pack200-repack a jar file">
+ <pack200 src="${input}" destfile="${output}" repack="true"/>
+ </target>
+
+ <target name="pack200" description="Pack200 a jar file">
+ <pack200 src="${input}" destfile="${output}"/>
+ </target>
+
+ <target name="lzma" description="LZMA compress a file">
+ <java fork="true" classname="SevenZip.LzmaAlone">
+ <classpath>
+ <pathelement location="platform_build/JLzma.jar"/>
+ </classpath>
+ <jvmarg value="-Xmx512m"/>
+ <arg value="e"/>
+ <arg value="${input}"/>
+ <arg value="${output}"/>
+ </java>
+ </target>
+
+ <target name="compress-sign-class">
+ <antcall target="repack200">
+ <param name="input" value="${dir}${jarfile}.jar"/>
+ <param name="output" value="${dir}${jarfile}-repack.jar"/>
+ </antcall>
+ <signjar jar="${dir}${jarfile}-repack.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
+ <antcall target="pack200">
+ <param name="input" value="${dir}${jarfile}-repack.jar"/>
+ <param name="output" value="${dir}${jarfile}.jar.pack"/>
+ </antcall>
+ <antcall target="lzma">
+ <param name="input" value="${dir}${jarfile}.jar.pack"/>
+ <param name="output" value="${dir}${jarfile}.jar.pack.lzma"/>
+ </antcall>
+ <delete file="${dir}${jarfile}-repack.jar"/>
+ <delete file="${dir}${jarfile}.jar.pack"/>
+ <delete file="${dir}${jarfile}.jar"/>
+ </target>
+
+ <target name="compress-resource">
+ <antcall target="lzma">
+ <param name="input" value="${input}"/>
+ <param name="output" value="${output}"/>
+ </antcall>
+ </target>
+
+ <target name="applettest" depends="applet">
+ <exec executable="appletviewer">
+ <arg value="-J-Djava.security.policy=applet/appletviewer.policy"/>
+ <arg path="applet/applet.html"/>
+ </exec>
+ </target>
+
+ <target name="runtest" depends="all">
+ <fail message="test.mainclass is not set. Use 'ant -Dtest.mainclass=<main-class> runtest'" unless="test.mainclass"/>
+ <condition property="native_path" value="libs/windows">
+ <os family="windows" />
+ </condition>
+
+ <condition property="native_path" value="libs/linux">
+ <or>
+ <os name="Linux" />
+ <os name="SunOS" />
+ </or>
+ </condition>
+
+ <condition property="native_path" value="libs/macosx">
+ <os name="Mac OS X" />
+ </condition>
+ <property name="native_path_expanded" location="${native_path}"/>
+ <java classname="${test.mainclass}" classpath="res:${lwjgl.lib}/lwjgl.jar:${lwjgl.lib}/lwjgl_util.jar:${lwjgl.lib}/lwjgl_test.jar:${lwjgl.lib}/jinput.jar" fork="true">
+ <sysproperty key="org.lwjgl.util.Debug" value="true"/>
+ <sysproperty key="java.library.path" value="${native_path_expanded}"/>
+ <arg line="${args}"/>
+ </java>
+ </target>
+
+ <!-- Creates the Javadoc -->
+ <target name="javadoc" description="Creates javadoc from java source code">
+ <javadoc destdir="${lwjgl.docs}/javadoc" classpath="${lwjgl.lib}/jinput.jar" author="true" version="true" use="true" source="1.4" windowtitle="LWJGL API" useexternalfile="true">
+ <fileset refid="lwjgl.javadoc.fileset" />
+ <doctitle><![CDATA[<h1>Lightweight Java Game Toolkit</h1>]]></doctitle>
+ <bottom><![CDATA[<i>Copyright © 2002-2009 lwjgl.org. All Rights Reserved.</i>]]></bottom>
+ </javadoc>
+ </target>
+</project>
diff --git a/debian/changelog b/debian/changelog
index 054963d..eda8a3d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,11 @@
-lwjgl (2.4.2+dfsg-4) unstable; urgency=low
+lwjgl (2.4.2+dfsg2-1) unstable; urgency=low
+ * +dfsg2: Removed trailing CRs from sources.
* Standards version to 3.9.0.
+ * Linked javadoc to system javadoc.
+ * d/copyright: Included full text of BSD license.
- -- Gabriele Giacone <1o5g4r8o at gmail.com> Sat, 03 Jul 2010 21:02:15 +0200
+ -- Gabriele Giacone <1o5g4r8o at gmail.com> Sun, 04 Jul 2010 17:52:02 +0200
lwjgl (2.4.2+dfsg-3) unstable; urgency=low
diff --git a/debian/control b/debian/control
index 6578e2c..47adc17 100644
--- a/debian/control
+++ b/debian/control
@@ -6,6 +6,7 @@ Uploaders: Gabriele Giacone <1o5g4r8o at gmail.com>
Build-Depends: debhelper (>= 7.0.50~), javahelper, ant, ant-optional,
default-jdk, libjinput-java, libxrandr-dev, libxxf86vm-dev, libxcursor-dev,
libxt-dev
+Build-Depends-Indep: default-jdk-doc
Standards-Version: 3.9.0
Vcs-Git: git://git.debian.org/pkg-java/lwjgl.git
Vcs-Browser: http://git.debian.org/?p=pkg-java/lwjgl.git
@@ -44,6 +45,7 @@ Architecture: all
Section: doc
Depends: ${misc:Depends}
Suggests: liblwjgl-java
+Recommends: default-jdk-doc
Description: Lightweight Java Game Library (javadoc)
The Lightweight Java Game Library (LWJGL) is a solution aimed directly at
professional and amateur Java programmers alike to enable commercial quality
diff --git a/debian/copyright b/debian/copyright
index 293e7c3..d98e1f7 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -5,17 +5,77 @@ Source: http://java-game-lib.svn.sourceforge.net/viewvc/java-game-lib/
Copyright: 2002-2010, Lightweight Java Game Library Project
License: BSD
- On Debian GNU/Linux system you can find the complete text of the
- BSD license in '/usr/share/common-licenses/BSD'
+ 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 'Light Weight Java Game Library' 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.
Files: ./src/native/common/extgl.c, ./src/native/windows/extgl_wgl.c
Copyright: 2001-2002, Lev Povalahev <levp at gmx.net>
License: BSD
- On Debian GNU/Linux system you can find the complete text of the
- BSD license in '/usr/share/common-licenses/BSD'
+ 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 'Light Weight Java Game Library' 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.
Files: debian/*
Copyright: 2010, Gabriele Giacone <1o5g4r8o at gmail.com>
License: BSD
- On Debian GNU/Linux system you can find the complete text of the
- BSD license in '/usr/share/common-licenses/BSD'
+ 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 'Debian' 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.
diff --git a/debian/patches/00nomacosx b/debian/patches/00nomacosx
index b855740..a565322 100644
--- a/debian/patches/00nomacosx
+++ b/debian/patches/00nomacosx
@@ -1,99 +1,99 @@
-Description: Removes references to macosx-related classes.
-Author: Gabriele Giacone <1o5g4r8o at gmail.com>
-
+Description: Removes references to macosx-related classes.
+Author: Gabriele Giacone <1o5g4r8o at gmail.com>
+
--- a/build.xml
+++ b/build.xml
@@ -234,7 +234,7 @@
- <class name="org.lwjgl.opengl.WindowsContextImplementation" />
- </javah>
-
-- <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/macosx" force="yes">
-+<!-- <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/macosx" force="yes">
- <class name="org.lwjgl.MacOSXSysImplementation" />
- <class name="org.lwjgl.opengl.MacOSXMouseEventQueue" />
- <class name="org.lwjgl.opengl.MacOSXCanvasPeerInfo" />
+ <class name="org.lwjgl.opengl.WindowsContextImplementation" />
+ </javah>
+
+- <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/macosx" force="yes">
++<!-- <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/macosx" force="yes">
+ <class name="org.lwjgl.MacOSXSysImplementation" />
+ <class name="org.lwjgl.opengl.MacOSXMouseEventQueue" />
+ <class name="org.lwjgl.opengl.MacOSXCanvasPeerInfo" />
@@ -242,7 +242,7 @@
- <class name="org.lwjgl.opengl.MacOSXPbufferPeerInfo" />
- <class name="org.lwjgl.opengl.MacOSXDisplay" />
- <class name="org.lwjgl.opengl.MacOSXContextImplementation" />
-- </javah>
-+ </javah> -->
-
- <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.headers}" force="yes">
- <class name="org.lwjgl.opengl.AWTSurfaceLock" />
+ <class name="org.lwjgl.opengl.MacOSXPbufferPeerInfo" />
+ <class name="org.lwjgl.opengl.MacOSXDisplay" />
+ <class name="org.lwjgl.opengl.MacOSXContextImplementation" />
+- </javah>
++ </javah> -->
+
+ <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.headers}" force="yes">
+ <class name="org.lwjgl.opengl.AWTSurfaceLock" />
@@ -298,13 +298,13 @@
- </tokenfilter>
- </filterchain>
- </loadfile>
-- <loadfile srcfile="${lwjgl.src.native}/macosx/org_lwjgl_MacOSXSysImplementation.h" property="lwjgl.native.macosx.version">
-+<!-- <loadfile srcfile="${lwjgl.src.native}/macosx/org_lwjgl_MacOSXSysImplementation.h" property="lwjgl.native.macosx.version">
- <filterchain>
- <tokenfilter>
- <containsstring contains="#define org_lwjgl_MacOSXSysImplementation_JNI_VERSION"/>
- </tokenfilter>
- </filterchain>
-- </loadfile>
-+ </loadfile> -->
- <echo>
- lwjgl.java.windows.version = ${lwjgl.java.windows.version}
- lwjgl.native.windows.version = ${lwjgl.native.windows.version}
+ </tokenfilter>
+ </filterchain>
+ </loadfile>
+- <loadfile srcfile="${lwjgl.src.native}/macosx/org_lwjgl_MacOSXSysImplementation.h" property="lwjgl.native.macosx.version">
++<!-- <loadfile srcfile="${lwjgl.src.native}/macosx/org_lwjgl_MacOSXSysImplementation.h" property="lwjgl.native.macosx.version">
+ <filterchain>
+ <tokenfilter>
+ <containsstring contains="#define org_lwjgl_MacOSXSysImplementation_JNI_VERSION"/>
+ </tokenfilter>
+ </filterchain>
+- </loadfile>
++ </loadfile> -->
+ <echo>
+ lwjgl.java.windows.version = ${lwjgl.java.windows.version}
+ lwjgl.native.windows.version = ${lwjgl.native.windows.version}
--- a/platform_build/build-applet.xml
+++ b/platform_build/build-applet.xml
@@ -1,7 +1,7 @@
- <project name="applet">
-
- <!-- Create our packer task -->
-- <taskdef name="pack200" classname="com.sun.tools.apache.ant.pack200.Pack200Task" classpath="platform_build/Pack200Task.jar"/>
-+<!-- <taskdef name="pack200" classname="com.sun.tools.apache.ant.pack200.Pack200Task" classpath="platform_build/Pack200Task.jar"/> -->
-
- <target name="applet" depends="all">
- <antcall target="-applet">
+ <project name="applet">
+
+ <!-- Create our packer task -->
+- <taskdef name="pack200" classname="com.sun.tools.apache.ant.pack200.Pack200Task" classpath="platform_build/Pack200Task.jar"/>
++<!-- <taskdef name="pack200" classname="com.sun.tools.apache.ant.pack200.Pack200Task" classpath="platform_build/Pack200Task.jar"/> -->
+
+ <target name="applet" depends="all">
+ <antcall target="-applet">
--- a/src/java/org/lwjgl/MacOSXSysImplementation.java
+++ b/src/java/org/lwjgl/MacOSXSysImplementation.java
@@ -33,7 +33,7 @@
-
- import java.awt.Toolkit;
-
--import com.apple.eio.FileManager;
-+//import com.apple.eio.FileManager;
-
- /**
- *
+
+ import java.awt.Toolkit;
+
+-import com.apple.eio.FileManager;
++//import com.apple.eio.FileManager;
+
+ /**
+ *
@@ -55,7 +55,7 @@
-
- public boolean openURL(String url) {
- try {
-- FileManager.openURL(url);
-+// FileManager.openURL(url);
- return true;
- } catch (Exception e) {
- LWJGLUtil.log("Exception occurred while trying to invoke browser: " + e);
+
+ public boolean openURL(String url) {
+ try {
+- FileManager.openURL(url);
++// FileManager.openURL(url);
+ return true;
+ } catch (Exception e) {
+ LWJGLUtil.log("Exception occurred while trying to invoke browser: " + e);
--- a/src/java/org/lwjgl/opengl/MacOSXDisplay.java
+++ b/src/java/org/lwjgl/opengl/MacOSXDisplay.java
@@ -54,9 +54,9 @@
- import org.lwjgl.LWJGLException;
- import org.lwjgl.LWJGLUtil;
-
--import com.apple.eawt.Application;
--import com.apple.eawt.ApplicationAdapter;
--import com.apple.eawt.ApplicationEvent;
-+//import com.apple.eawt.Application;
-+//import com.apple.eawt.ApplicationAdapter;
-+//import com.apple.eawt.ApplicationEvent;
-
- final class MacOSXDisplay implements DisplayImplementation {
- private static final int PBUFFER_HANDLE_SIZE = 24;
+ import org.lwjgl.LWJGLException;
+ import org.lwjgl.LWJGLUtil;
+
+-import com.apple.eawt.Application;
+-import com.apple.eawt.ApplicationAdapter;
+-import com.apple.eawt.ApplicationEvent;
++//import com.apple.eawt.Application;
++//import com.apple.eawt.ApplicationAdapter;
++//import com.apple.eawt.ApplicationEvent;
+
+ final class MacOSXDisplay implements DisplayImplementation {
+ private static final int PBUFFER_HANDLE_SIZE = 24;
@@ -77,11 +77,11 @@
- try {
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws Exception {
-- Application.getApplication().addApplicationListener(new ApplicationAdapter() {
-+/* Application.getApplication().addApplicationListener(new ApplicationAdapter() {
- public final void handleQuit(ApplicationEvent event) {
- doHandleQuit();
- }
-- });
-+ }); */
- return null;
- }
- });
+ try {
+ AccessController.doPrivileged(new PrivilegedExceptionAction() {
+ public Object run() throws Exception {
+- Application.getApplication().addApplicationListener(new ApplicationAdapter() {
++/* Application.getApplication().addApplicationListener(new ApplicationAdapter() {
+ public final void handleQuit(ApplicationEvent event) {
+ doHandleQuit();
+ }
+- });
++ }); */
+ return null;
+ }
+ });
diff --git a/debian/patches/02systemjinput b/debian/patches/02systemjinput
index bd80ced..6b6a6dc 100644
--- a/debian/patches/02systemjinput
+++ b/debian/patches/02systemjinput
@@ -1,23 +1,23 @@
-Description: To find system jinput libraries
-Author: Gabriele Giacone <1o5g4r8o at gmail.com>
-
+Description: To find system jinput libraries
+Author: Gabriele Giacone <1o5g4r8o at gmail.com>
+
--- a/build.xml
+++ b/build.xml
@@ -340,7 +340,7 @@
-
- <!-- Compiles the Java source code -->
- <target name="compile" description="Compiles the java source code" depends="-initialize">
-- <javac debug="yes" destdir="${lwjgl.bin}" source="1.4" target="1.4" classpath="${lwjgl.lib}/jinput.jar:${lwjgl.lib}/AppleJavaExtensions.jar" taskname="core">
-+ <javac debug="yes" destdir="${lwjgl.bin}" source="1.4" target="1.4" classpath="/usr/share/java/jinput.jar:/usr/share/java/jutils.jar:${lwjgl.lib}/AppleJavaExtensions.jar" taskname="core">
- <src path="${lwjgl.src}/java/"/>
- <src path="${lwjgl.src}/generated/"/>
- <include name="org/lwjgl/*.java"/>
+
+ <!-- Compiles the Java source code -->
+ <target name="compile" description="Compiles the java source code" depends="-initialize">
+- <javac debug="yes" destdir="${lwjgl.bin}" source="1.4" target="1.4" classpath="${lwjgl.lib}/jinput.jar:${lwjgl.lib}/AppleJavaExtensions.jar" taskname="core">
++ <javac debug="yes" destdir="${lwjgl.bin}" source="1.4" target="1.4" classpath="/usr/share/java/jinput.jar:/usr/share/java/jutils.jar:${lwjgl.lib}/AppleJavaExtensions.jar" taskname="core">
+ <src path="${lwjgl.src}/java/"/>
+ <src path="${lwjgl.src}/generated/"/>
+ <include name="org/lwjgl/*.java"/>
@@ -481,7 +481,7 @@
- <os name="Mac OS X" />
- </condition>
- <property name="native_path_expanded" location="${native_path}"/>
-- <java classname="${test.mainclass}" classpath="res:${lwjgl.lib}/lwjgl.jar:${lwjgl.lib}/lwjgl_util.jar:${lwjgl.lib}/lwjgl_test.jar:${lwjgl.lib}/jinput.jar" fork="true">
-+ <java classname="${test.mainclass}" classpath="res:${lwjgl.lib}/lwjgl.jar:${lwjgl.lib}/lwjgl_util.jar:${lwjgl.lib}/lwjgl_test.jar:/usr/share/java/jinput.jar:/usr/share/java/jutils.jar" fork="true">
- <sysproperty key="org.lwjgl.util.Debug" value="true"/>
- <sysproperty key="java.library.path" value="${native_path_expanded}"/>
- <arg line="${args}"/>
+ <os name="Mac OS X" />
+ </condition>
+ <property name="native_path_expanded" location="${native_path}"/>
+- <java classname="${test.mainclass}" classpath="res:${lwjgl.lib}/lwjgl.jar:${lwjgl.lib}/lwjgl_util.jar:${lwjgl.lib}/lwjgl_test.jar:${lwjgl.lib}/jinput.jar" fork="true">
++ <java classname="${test.mainclass}" classpath="res:${lwjgl.lib}/lwjgl.jar:${lwjgl.lib}/lwjgl_util.jar:${lwjgl.lib}/lwjgl_test.jar:/usr/share/java/jinput.jar:/usr/share/java/jutils.jar" fork="true">
+ <sysproperty key="org.lwjgl.util.Debug" value="true"/>
+ <sysproperty key="java.library.path" value="${native_path_expanded}"/>
+ <arg line="${args}"/>
diff --git a/debian/patches/03javadoc b/debian/patches/03javadoc
new file mode 100644
index 0000000..1091f6f
--- /dev/null
+++ b/debian/patches/03javadoc
@@ -0,0 +1,13 @@
+Description: Upstream changes introduced in version 2.4.2+dfsg-4
+Author: Gabriele Giacone <1o5g4r8o at gmail.com>
+
+--- lwjgl-2.4.2+dfsg.orig/build.xml
++++ lwjgl-2.4.2+dfsg/build.xml
+@@ -491,6 +491,7 @@
+ <!-- Creates the Javadoc -->
+ <target name="javadoc" description="Creates javadoc from java source code">
+ <javadoc destdir="${lwjgl.docs}/javadoc" classpath="${lwjgl.lib}/jinput.jar" author="true" version="true" use="true" source="1.4" windowtitle="LWJGL API" useexternalfile="true">
++ <link href="/usr/share/doc/default-jdk-doc/api/" />
+ <fileset refid="lwjgl.javadoc.fileset" />
+ <doctitle><![CDATA[<h1>Lightweight Java Game Toolkit</h1>]]></doctitle>
+ <bottom><![CDATA[<i>Copyright © 2002-2009 lwjgl.org. All Rights Reserved.</i>]]></bottom>
diff --git a/debian/patches/series b/debian/patches/series
index 7260f1a..23dbd68 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
00nomacosx
01allarchs
02systemjinput
+03javadoc
diff --git a/debian/rules b/debian/rules
index 27eb2c3..077bca8 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,6 +7,7 @@ TAR := ../$(NAME)_$(VERSION).orig.tar.gz
TARDFSG := ../$(NAME)_$(VERSION)+dfsg.orig.tar.gz
export JAVA_HOME=/usr/lib/jvm/default-java
+export CLASSPATH=/usr/share/java/jinput.jar:/usr/share/java/jutils.jar
%:
dh $@
@@ -30,6 +31,7 @@ get-orig-source:
uscan --verbose --download-version $(VERSION) \
--force-download --repack --no-symlink --rename
mkdir $(TMPDIR) && tar -C $(TMPDIR) -zxf $(TAR) && rm $(TAR)
+ cd $(TMPDIR) && find . -type f -exec fromdos {} \;
echo "The following files will not be included in Debian tarball:"
cd $(TMPDIR) && find . \( -name '*.class' -o -name '*.jar' \
-o -path './src/generated/*' -o -path './src/native/generated/*' \) \
@@ -37,4 +39,3 @@ get-orig-source:
ZIP=--best tar --exclude-vcs --exclude src/generated \
--exclude src/native/generated -zcf $(TARDFSG) $(TMPDIR)
rm -rf $(TMPDIR)
-
diff --git a/platform_build/build-applet.xml b/platform_build/build-applet.xml
index eb2e085..abf00c9 100644
--- a/platform_build/build-applet.xml
+++ b/platform_build/build-applet.xml
@@ -1,151 +1,151 @@
-<project name="applet">
-
- <!-- Create our packer task -->
- <taskdef name="pack200" classname="com.sun.tools.apache.ant.pack200.Pack200Task" classpath="platform_build/Pack200Task.jar"/>
-
- <target name="applet" depends="all">
- <antcall target="-applet">
- <param name="keystore" value="applet/lwjglkeystore"/>
- <param name="alias" value="lwjgl"/>
- <param name="password" value="123456"/>
- </antcall>
- </target>
-
- <target name="applet-release">
- <input message="Please enter the keystore" addproperty="keystore.location" defaultvalue="applet/lwjglkeystore"/>
- <input message="Please enter the keystore alias" addproperty="keystore.alias" defaultvalue="lwjgl"/>
- <input message="Please type the password for the keystore" addproperty="sign.pwd" defaultvalue="123456"/>
-
- <antcall target="-applet">
- <!--
- <param name="keystore" value="signing/matzon_java_code_signing.keystore"/>
- <param name="alias" value="oddlabs_java_code_signing"/>
- <param name="password" value="${sign.pwd}"/>
- -->
- <param name="keystore" value="${keystore.location}"/>
- <param name="alias" value="${keystore.alias}"/>
- <param name="password" value="${sign.pwd}"/>
- </antcall>
- </target>
-
- <target name="-applet">
-
- <!-- Create lwjgl_applet.jar -->
- <jar destfile="applet/lwjgl_applet.jar" taskname="lwjgl_applet.jar">
- <fileset refid="lwjgl_applet.fileset" />
- </jar>
-
- <!-- create each of the native jars -->
- <jar destfile="applet/windows_natives.jar" taskname="windows_natives.jar">
- <fileset dir="${lwjgl.lib}/windows">
- <patternset refid="lwjgl-windows.fileset"/>
- </fileset>
- </jar>
- <signjar jar="applet/windows_natives.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
-
- <jar destfile="applet/linux_natives.jar" taskname="linux_natives.jar">
- <fileset dir="${lwjgl.lib}/linux">
- <patternset refid="lwjgl-linux.fileset"/>
- </fileset>
- </jar>
- <signjar jar="applet/linux_natives.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
-
- <jar destfile="applet/macosx_natives.jar" taskname="macosx_natives.jar">
- <fileset dir="${lwjgl.lib}/macosx">
- <patternset refid="lwjgl-macosx.fileset"/>
- </fileset>
- </jar>
- <signjar jar="applet/macosx_natives.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
-
- <jar destfile="applet/solaris_natives.jar" taskname="solaris_natives.jar">
- <fileset dir="${lwjgl.lib}/solaris">
- <patternset refid="lwjgl-solaris.fileset"/>
- </fileset>
- </jar>
- <signjar jar="applet/solaris_natives.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
-
- <jar destfile="${lwjgl.lib}/lwjgl_util_applet.jar" update="true">
- <fileset dir="${lwjgl.res}" includes="applet*"/>
- </jar>
-
- <copy file="${lwjgl.lib}/lwjgl.jar" todir="applet" overwrite="true"/>
- <copy file="${lwjgl.lib}/lwjgl-debug.jar" todir="applet" overwrite="true"/>
- <copy file="${lwjgl.lib}/lwjgl_util_applet.jar" todir="applet" overwrite="true"/>
- <copy file="${lwjgl.lib}/lwjgl_util.jar" todir="applet" overwrite="true"/>
- <copy file="${lwjgl.lib}/jinput.jar" todir="applet" overwrite="true"/>
- <copy file="${lwjgl.lib}/lzma.jar" todir="applet" overwrite="true"/>
- <zip destfile="applet/res.jar">
- <zipfileset dir="${lwjgl.res}" includes="Footsteps.wav, ILtest.tga, Missing_you.mod"/>
- </zip>
- <signjar jar="applet/lwjgl_util_applet.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
- <signjar jar="applet/lzma.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
-
- <!-- LZMA only, for 1.4 only clients -->
- <antcall target="compress-resource">
- <param name="input" value="applet/lwjgl.jar"/>
- <param name="output" value="applet/lwjgl.jar.lzma"/>
- </antcall>
- <antcall target="compress-resource">
- <param name="input" value="applet/lwjgl-debug.jar"/>
- <param name="output" value="applet/lwjgl-debug.jar.lzma"/>
- </antcall>
-
- <antcall target="compress-resource">
- <param name="input" value="applet/lwjgl_util.jar"/>
- <param name="output" value="applet/lwjgl_util.jar.lzma"/>
- </antcall>
- <antcall target="compress-resource">
- <param name="input" value="applet/jinput.jar"/>
- <param name="output" value="applet/jinput.jar.lzma"/>
- </antcall>
- <antcall target="compress-resource">
- <param name="input" value="applet/lwjgl_applet.jar"/>
- <param name="output" value="applet/lwjgl_applet.jar.lzma"/>
- </antcall>
- <antcall target="compress-resource">
- <param name="input" value="applet/windows_natives.jar"/>
- <param name="output" value="applet/windows_natives.jar.lzma"/>
- </antcall>
- <antcall target="compress-sign-class">
- <param name="dir" value="applet/"/>
- <param name="jarfile" value="lwjgl"/>
- </antcall>
- <antcall target="compress-sign-class">
- <param name="dir" value="applet/"/>
- <param name="jarfile" value="lwjgl-debug"/>
- </antcall>
- <antcall target="compress-sign-class">
- <param name="dir" value="applet/"/>
- <param name="jarfile" value="lwjgl_util"/>
- </antcall>
- <antcall target="compress-sign-class">
- <param name="dir" value="applet/"/>
- <param name="jarfile" value="jinput"/>
- </antcall>
- <antcall target="compress-sign-class">
- <param name="dir" value="applet/"/>
- <param name="jarfile" value="lwjgl_applet"/>
- </antcall>
- <antcall target="compress-resource">
- <param name="input" value="applet/windows_natives.jar"/>
- <param name="output" value="applet/windows_natives.jar.lzma"/>
- </antcall>
- <antcall target="compress-resource">
- <param name="input" value="applet/macosx_natives.jar"/>
- <param name="output" value="applet/macosx_natives.jar.lzma"/>
- </antcall>
- <antcall target="compress-resource">
- <param name="input" value="applet/linux_natives.jar"/>
- <param name="output" value="applet/linux_natives.jar.lzma"/>
- </antcall>
- <antcall target="compress-resource">
- <param name="input" value="applet/solaris_natives.jar"/>
- <param name="output" value="applet/solaris_natives.jar.lzma"/>
- </antcall>
-
- <antcall target="compress-resource">
- <param name="input" value="applet/res.jar"/>
- <param name="output" value="applet/res.jar.lzma"/>
- </antcall>
- </target>
+<project name="applet">
+
+ <!-- Create our packer task -->
+ <taskdef name="pack200" classname="com.sun.tools.apache.ant.pack200.Pack200Task" classpath="platform_build/Pack200Task.jar"/>
+
+ <target name="applet" depends="all">
+ <antcall target="-applet">
+ <param name="keystore" value="applet/lwjglkeystore"/>
+ <param name="alias" value="lwjgl"/>
+ <param name="password" value="123456"/>
+ </antcall>
+ </target>
+
+ <target name="applet-release">
+ <input message="Please enter the keystore" addproperty="keystore.location" defaultvalue="applet/lwjglkeystore"/>
+ <input message="Please enter the keystore alias" addproperty="keystore.alias" defaultvalue="lwjgl"/>
+ <input message="Please type the password for the keystore" addproperty="sign.pwd" defaultvalue="123456"/>
+
+ <antcall target="-applet">
+ <!--
+ <param name="keystore" value="signing/matzon_java_code_signing.keystore"/>
+ <param name="alias" value="oddlabs_java_code_signing"/>
+ <param name="password" value="${sign.pwd}"/>
+ -->
+ <param name="keystore" value="${keystore.location}"/>
+ <param name="alias" value="${keystore.alias}"/>
+ <param name="password" value="${sign.pwd}"/>
+ </antcall>
+ </target>
+
+ <target name="-applet">
+
+ <!-- Create lwjgl_applet.jar -->
+ <jar destfile="applet/lwjgl_applet.jar" taskname="lwjgl_applet.jar">
+ <fileset refid="lwjgl_applet.fileset" />
+ </jar>
+
+ <!-- create each of the native jars -->
+ <jar destfile="applet/windows_natives.jar" taskname="windows_natives.jar">
+ <fileset dir="${lwjgl.lib}/windows">
+ <patternset refid="lwjgl-windows.fileset"/>
+ </fileset>
+ </jar>
+ <signjar jar="applet/windows_natives.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
+
+ <jar destfile="applet/linux_natives.jar" taskname="linux_natives.jar">
+ <fileset dir="${lwjgl.lib}/linux">
+ <patternset refid="lwjgl-linux.fileset"/>
+ </fileset>
+ </jar>
+ <signjar jar="applet/linux_natives.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
+
+ <jar destfile="applet/macosx_natives.jar" taskname="macosx_natives.jar">
+ <fileset dir="${lwjgl.lib}/macosx">
+ <patternset refid="lwjgl-macosx.fileset"/>
+ </fileset>
+ </jar>
+ <signjar jar="applet/macosx_natives.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
+
+ <jar destfile="applet/solaris_natives.jar" taskname="solaris_natives.jar">
+ <fileset dir="${lwjgl.lib}/solaris">
+ <patternset refid="lwjgl-solaris.fileset"/>
+ </fileset>
+ </jar>
+ <signjar jar="applet/solaris_natives.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
+
+ <jar destfile="${lwjgl.lib}/lwjgl_util_applet.jar" update="true">
+ <fileset dir="${lwjgl.res}" includes="applet*"/>
+ </jar>
+
+ <copy file="${lwjgl.lib}/lwjgl.jar" todir="applet" overwrite="true"/>
+ <copy file="${lwjgl.lib}/lwjgl-debug.jar" todir="applet" overwrite="true"/>
+ <copy file="${lwjgl.lib}/lwjgl_util_applet.jar" todir="applet" overwrite="true"/>
+ <copy file="${lwjgl.lib}/lwjgl_util.jar" todir="applet" overwrite="true"/>
+ <copy file="${lwjgl.lib}/jinput.jar" todir="applet" overwrite="true"/>
+ <copy file="${lwjgl.lib}/lzma.jar" todir="applet" overwrite="true"/>
+ <zip destfile="applet/res.jar">
+ <zipfileset dir="${lwjgl.res}" includes="Footsteps.wav, ILtest.tga, Missing_you.mod"/>
+ </zip>
+ <signjar jar="applet/lwjgl_util_applet.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
+ <signjar jar="applet/lzma.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
+
+ <!-- LZMA only, for 1.4 only clients -->
+ <antcall target="compress-resource">
+ <param name="input" value="applet/lwjgl.jar"/>
+ <param name="output" value="applet/lwjgl.jar.lzma"/>
+ </antcall>
+ <antcall target="compress-resource">
+ <param name="input" value="applet/lwjgl-debug.jar"/>
+ <param name="output" value="applet/lwjgl-debug.jar.lzma"/>
+ </antcall>
+
+ <antcall target="compress-resource">
+ <param name="input" value="applet/lwjgl_util.jar"/>
+ <param name="output" value="applet/lwjgl_util.jar.lzma"/>
+ </antcall>
+ <antcall target="compress-resource">
+ <param name="input" value="applet/jinput.jar"/>
+ <param name="output" value="applet/jinput.jar.lzma"/>
+ </antcall>
+ <antcall target="compress-resource">
+ <param name="input" value="applet/lwjgl_applet.jar"/>
+ <param name="output" value="applet/lwjgl_applet.jar.lzma"/>
+ </antcall>
+ <antcall target="compress-resource">
+ <param name="input" value="applet/windows_natives.jar"/>
+ <param name="output" value="applet/windows_natives.jar.lzma"/>
+ </antcall>
+ <antcall target="compress-sign-class">
+ <param name="dir" value="applet/"/>
+ <param name="jarfile" value="lwjgl"/>
+ </antcall>
+ <antcall target="compress-sign-class">
+ <param name="dir" value="applet/"/>
+ <param name="jarfile" value="lwjgl-debug"/>
+ </antcall>
+ <antcall target="compress-sign-class">
+ <param name="dir" value="applet/"/>
+ <param name="jarfile" value="lwjgl_util"/>
+ </antcall>
+ <antcall target="compress-sign-class">
+ <param name="dir" value="applet/"/>
+ <param name="jarfile" value="jinput"/>
+ </antcall>
+ <antcall target="compress-sign-class">
+ <param name="dir" value="applet/"/>
+ <param name="jarfile" value="lwjgl_applet"/>
+ </antcall>
+ <antcall target="compress-resource">
+ <param name="input" value="applet/windows_natives.jar"/>
+ <param name="output" value="applet/windows_natives.jar.lzma"/>
+ </antcall>
+ <antcall target="compress-resource">
+ <param name="input" value="applet/macosx_natives.jar"/>
+ <param name="output" value="applet/macosx_natives.jar.lzma"/>
+ </antcall>
+ <antcall target="compress-resource">
+ <param name="input" value="applet/linux_natives.jar"/>
+ <param name="output" value="applet/linux_natives.jar.lzma"/>
+ </antcall>
+ <antcall target="compress-resource">
+ <param name="input" value="applet/solaris_natives.jar"/>
+ <param name="output" value="applet/solaris_natives.jar.lzma"/>
+ </antcall>
+
+ <antcall target="compress-resource">
+ <param name="input" value="applet/res.jar"/>
+ <param name="output" value="applet/res.jar.lzma"/>
+ </antcall>
+ </target>
</project>
\ No newline at end of file
diff --git a/platform_build/build-definitions.xml b/platform_build/build-definitions.xml
index 8c52402..bca0657 100644
--- a/platform_build/build-definitions.xml
+++ b/platform_build/build-definitions.xml
@@ -1,159 +1,159 @@
-<project name="definitions">
- <!-- ================================================================== -->
- <!-- Global properties for build -->
- <!-- ================================================================== -->
- <property name="lwjgl.src" location="src" />
- <property name="lwjgl.src.native" location="${lwjgl.src}/native" />
- <property name="lwjgl.src.headers" location="${lwjgl.src.native}/common" />
- <property name="lwjgl.src.templates" location="${lwjgl.src}/templates" />
- <property name="lwjgl.bin" location="bin" />
- <property name="lwjgl.lib" location="libs" />
- <property name="lwjgl.dist" location="dist" />
- <property name="lwjgl.docs" location="doc" />
- <property name="lwjgl.temp" location="temp" />
- <property name="lwjgl.res" location="res" />
- <property name="lwjgl.version" value="2.4.2" />
-
- <property name="opengl-template-pattern" value="org/lwjgl/opengl/GL*.java,org/lwjgl/opengl/ARB*.java,org/lwjgl/opengl/AMD*.java,org/lwjgl/opengl/APPLE*.java,org/lwjgl/opengl/ATI*.java,org/lwjgl/opengl/EXT*.java,org/lwjgl/opengl/NV*.java,org/lwjgl/opengl/NVX*.java,org/lwjgl/opengl/HP*.java,org/lwjgl/opengl/IBM*.java,org/lwjgl/opengl/SUN*.java,org/lwjgl/opengl/SGIS*.java,org/lwjgl/opengl/GREMEDY*.java"/>
- <!-- ================================================================== -->
- <!-- Filesets used for targets -->
- <!-- ================================================================== -->
-
- <!-- Files to include in the lwjgl.jar file -->
- <fileset id="lwjgl.fileset" dir="${lwjgl.bin}">
- <include name="org/**/*" />
- <exclude name="org/lwjgl/d3d/**" />
- <exclude name="org/lwjgl/test/**" />
- <exclude name="org/lwjgl/util/**" />
- <exclude name="org/lwjgl/examples/**" />
- </fileset>
-
- <fileset id="lwjgl_util_applet.fileset" dir="${lwjgl.bin}">
- <exclude name="**.*"/>
- <include name="org/lwjgl/util/applet/**"/>
- </fileset>
-
- <!-- Files to include in the lwjgl_test.jar file -->
- <fileset id="lwjgl_test.fileset" dir="${lwjgl.bin}">
- <exclude name="**.*" />
- <include name="org/lwjgl/test/**" />
- <include name="org/lwjgl/examples/**" />
- </fileset>
-
- <!-- More files to include in the lwjgl_test.jar file -->
- <fileset id="lwjgl_test_extra.fileset" dir="${lwjgl.src}/java">
- <exclude name="**.*" />
- <include name="org/lwjgl/test/opengl/shaders/shaderFP.fp" />
- <include name="org/lwjgl/test/opengl/shaders/shaderFP.vp" />
- <include name="org/lwjgl/test/opengl/shaders/shaderFSH.fsh" />
- <include name="org/lwjgl/test/opengl/shaders/shaderFSH.vsh" />
- <include name="org/lwjgl/test/opengl/shaders/shaderVP.vp" />
- <include name="org/lwjgl/test/opengl/shaders/shaderVSH.vsh" />
- <include name="org/lwjgl/test/opengl/shaders/shaderUNI.vsh" />
- </fileset>
-
- <!-- Files to include in the lwjgl_util.jar file -->
- <fileset id="lwjgl_util.fileset" dir="${lwjgl.bin}">
- <exclude name="**.*" />
- <exclude name="org/lwjgl/util/generator/**" />
- <exclude name="org/lwjgl/util/applet/**" />
- <include name="org/lwjgl/util/**" />
- </fileset>
-
- <!-- Files to include in the lwjgl_applet.jar file -->
- <fileset id="lwjgl_applet.fileset" dir="${lwjgl.bin}">
- <exclude name="**.*"/>
- <include name="org/lwjgl/test/applet/**"/>
- <include name="org/lwjgl/test/opengl/awt/AWTGearsCanvas.class"/>
- </fileset>
-
- <!-- Files to make Javadoc from -->
- <fileset id="lwjgl.javadoc.fileset" dir="${lwjgl.src}">
- <include name="**/*.java" />
- <exclude name="native/**" />
- <exclude name="templates/**" />
- <exclude name="java/org/lwjgl/test/**" />
- <exclude name="java/org/lwjgl/examples/**" />
- <exclude name="java/org/lwjgl/util/generator/**" />
- </fileset>
-
- <!-- Files to include in doc package -->
- <patternset id="lwjgl-docs.fileset">
- <include name="CREDITS" />
- <include name="LICENSE" />
- <include name="README" />
- <include name="lwjgl_hidden_switches.text" />
- <include name="3rdparty/*" />
- </patternset>
-
- <!-- Files to include in windows package -->
- <patternset id="lwjgl-windows.fileset">
- <include name="lwjgl.dll" />
- <include name="lwjgl64.dll" />
- <include name="OpenAL32.dll" />
- <include name="OpenAL64.dll" />
- <include name="jinput-dx8*.dll" />
- <include name="jinput-raw*.dll" />
- </patternset>
-
- <!-- Files to include in linux, glibc2.3 package -->
- <patternset id="lwjgl-linux.fileset">
- <include name="liblwjgl*.so" />
- <include name="libopenal*.so" />
- <include name="libjinput-linux.so" />
- <include name="libjinput-linux64.so" />
- </patternset>
-
- <!-- Files to include in mac os x package -->
- <patternset id="lwjgl-macosx.fileset">
- <include name="liblwjgl.jnilib" />
- <include name="openal.dylib" />
- <include name="libjinput-osx.jnilib" />
- <include name="libjinput-osx-legacy.jnilib" />
- </patternset>
-
- <!-- Files to include in solaris package -->
- <patternset id="lwjgl-solaris.fileset">
- <include name="liblwjgl*.so" />
- <include name="libopenal.so" />
- </patternset>
-
- <!-- Files to include in source distribution -->
- <fileset id="lwjgl.source.fileset" dir=".">
- <include name="build.xml" />
- <include name="src/**" />
- <include name="platform_build/**/*" />
- </fileset>
-
- <!-- files in the base package -->
- <patternset id="lwjgl_base">
- <include name="**" />
- <exclude name="res/ILtest.*" />
- <exclude name="res/Missing_you.mod" />
- <exclude name="res/phero*.*" />
- </patternset>
-
- <!-- files in the optional package -->
- <patternset id="lwjgl_optional">
- <include name="res/**" />
- <exclude name="res/logo/**" />
- <exclude name="res/spaceinvaders/**" />
- <exclude name="res/*.wav" />
- <exclude name="res/*.xpm" />
- <include name="doc/CREDITS" />
- <include name="doc/LICENSE" />
- <include name="doc/README" />
- </patternset>
-
- <!-- files in the lwjgl_applet package -->
- <patternset id="lwjgl_applet">
- <include name="applet/**" />
- <exclude name="applet/appletviewer.policy" />
- <exclude name="applet/lwjglkeystore" />
- </patternset>
-
- <uptodate property="lwjgl.main.built" targetfile="${lwjgl.lib}/windows/lwjgl.dll" >
- <srcfiles dir= "${lwjgl.src.native}/common" includes="*.c*"/>
- <srcfiles dir= "${lwjgl.src.native}/windows" includes="*.c"/>
- </uptodate>
+<project name="definitions">
+ <!-- ================================================================== -->
+ <!-- Global properties for build -->
+ <!-- ================================================================== -->
+ <property name="lwjgl.src" location="src" />
+ <property name="lwjgl.src.native" location="${lwjgl.src}/native" />
+ <property name="lwjgl.src.headers" location="${lwjgl.src.native}/common" />
+ <property name="lwjgl.src.templates" location="${lwjgl.src}/templates" />
+ <property name="lwjgl.bin" location="bin" />
+ <property name="lwjgl.lib" location="libs" />
+ <property name="lwjgl.dist" location="dist" />
+ <property name="lwjgl.docs" location="doc" />
+ <property name="lwjgl.temp" location="temp" />
+ <property name="lwjgl.res" location="res" />
+ <property name="lwjgl.version" value="2.4.2" />
+
+ <property name="opengl-template-pattern" value="org/lwjgl/opengl/GL*.java,org/lwjgl/opengl/ARB*.java,org/lwjgl/opengl/AMD*.java,org/lwjgl/opengl/APPLE*.java,org/lwjgl/opengl/ATI*.java,org/lwjgl/opengl/EXT*.java,org/lwjgl/opengl/NV*.java,org/lwjgl/opengl/NVX*.java,org/lwjgl/opengl/HP*.java,org/lwjgl/opengl/IBM*.java,org/lwjgl/opengl/SUN*.java,org/lwjgl/opengl/SGIS*.java,org/lwjgl/opengl/GREMEDY*.java"/>
+ <!-- ================================================================== -->
+ <!-- Filesets used for targets -->
+ <!-- ================================================================== -->
+
+ <!-- Files to include in the lwjgl.jar file -->
+ <fileset id="lwjgl.fileset" dir="${lwjgl.bin}">
+ <include name="org/**/*" />
+ <exclude name="org/lwjgl/d3d/**" />
+ <exclude name="org/lwjgl/test/**" />
+ <exclude name="org/lwjgl/util/**" />
+ <exclude name="org/lwjgl/examples/**" />
+ </fileset>
+
+ <fileset id="lwjgl_util_applet.fileset" dir="${lwjgl.bin}">
+ <exclude name="**.*"/>
+ <include name="org/lwjgl/util/applet/**"/>
+ </fileset>
+
+ <!-- Files to include in the lwjgl_test.jar file -->
+ <fileset id="lwjgl_test.fileset" dir="${lwjgl.bin}">
+ <exclude name="**.*" />
+ <include name="org/lwjgl/test/**" />
+ <include name="org/lwjgl/examples/**" />
+ </fileset>
+
+ <!-- More files to include in the lwjgl_test.jar file -->
+ <fileset id="lwjgl_test_extra.fileset" dir="${lwjgl.src}/java">
+ <exclude name="**.*" />
+ <include name="org/lwjgl/test/opengl/shaders/shaderFP.fp" />
+ <include name="org/lwjgl/test/opengl/shaders/shaderFP.vp" />
+ <include name="org/lwjgl/test/opengl/shaders/shaderFSH.fsh" />
+ <include name="org/lwjgl/test/opengl/shaders/shaderFSH.vsh" />
+ <include name="org/lwjgl/test/opengl/shaders/shaderVP.vp" />
+ <include name="org/lwjgl/test/opengl/shaders/shaderVSH.vsh" />
+ <include name="org/lwjgl/test/opengl/shaders/shaderUNI.vsh" />
+ </fileset>
+
+ <!-- Files to include in the lwjgl_util.jar file -->
+ <fileset id="lwjgl_util.fileset" dir="${lwjgl.bin}">
+ <exclude name="**.*" />
+ <exclude name="org/lwjgl/util/generator/**" />
+ <exclude name="org/lwjgl/util/applet/**" />
+ <include name="org/lwjgl/util/**" />
+ </fileset>
+
+ <!-- Files to include in the lwjgl_applet.jar file -->
+ <fileset id="lwjgl_applet.fileset" dir="${lwjgl.bin}">
+ <exclude name="**.*"/>
+ <include name="org/lwjgl/test/applet/**"/>
+ <include name="org/lwjgl/test/opengl/awt/AWTGearsCanvas.class"/>
+ </fileset>
+
+ <!-- Files to make Javadoc from -->
+ <fileset id="lwjgl.javadoc.fileset" dir="${lwjgl.src}">
+ <include name="**/*.java" />
+ <exclude name="native/**" />
+ <exclude name="templates/**" />
+ <exclude name="java/org/lwjgl/test/**" />
+ <exclude name="java/org/lwjgl/examples/**" />
+ <exclude name="java/org/lwjgl/util/generator/**" />
+ </fileset>
+
+ <!-- Files to include in doc package -->
+ <patternset id="lwjgl-docs.fileset">
+ <include name="CREDITS" />
+ <include name="LICENSE" />
+ <include name="README" />
+ <include name="lwjgl_hidden_switches.text" />
+ <include name="3rdparty/*" />
+ </patternset>
+
+ <!-- Files to include in windows package -->
+ <patternset id="lwjgl-windows.fileset">
+ <include name="lwjgl.dll" />
+ <include name="lwjgl64.dll" />
+ <include name="OpenAL32.dll" />
+ <include name="OpenAL64.dll" />
+ <include name="jinput-dx8*.dll" />
+ <include name="jinput-raw*.dll" />
+ </patternset>
+
+ <!-- Files to include in linux, glibc2.3 package -->
+ <patternset id="lwjgl-linux.fileset">
+ <include name="liblwjgl*.so" />
+ <include name="libopenal*.so" />
+ <include name="libjinput-linux.so" />
+ <include name="libjinput-linux64.so" />
+ </patternset>
+
+ <!-- Files to include in mac os x package -->
+ <patternset id="lwjgl-macosx.fileset">
+ <include name="liblwjgl.jnilib" />
+ <include name="openal.dylib" />
+ <include name="libjinput-osx.jnilib" />
+ <include name="libjinput-osx-legacy.jnilib" />
+ </patternset>
+
+ <!-- Files to include in solaris package -->
+ <patternset id="lwjgl-solaris.fileset">
+ <include name="liblwjgl*.so" />
+ <include name="libopenal.so" />
+ </patternset>
+
+ <!-- Files to include in source distribution -->
+ <fileset id="lwjgl.source.fileset" dir=".">
+ <include name="build.xml" />
+ <include name="src/**" />
+ <include name="platform_build/**/*" />
+ </fileset>
+
+ <!-- files in the base package -->
+ <patternset id="lwjgl_base">
+ <include name="**" />
+ <exclude name="res/ILtest.*" />
+ <exclude name="res/Missing_you.mod" />
+ <exclude name="res/phero*.*" />
+ </patternset>
+
+ <!-- files in the optional package -->
+ <patternset id="lwjgl_optional">
+ <include name="res/**" />
+ <exclude name="res/logo/**" />
+ <exclude name="res/spaceinvaders/**" />
+ <exclude name="res/*.wav" />
+ <exclude name="res/*.xpm" />
+ <include name="doc/CREDITS" />
+ <include name="doc/LICENSE" />
+ <include name="doc/README" />
+ </patternset>
+
+ <!-- files in the lwjgl_applet package -->
+ <patternset id="lwjgl_applet">
+ <include name="applet/**" />
+ <exclude name="applet/appletviewer.policy" />
+ <exclude name="applet/lwjglkeystore" />
+ </patternset>
+
+ <uptodate property="lwjgl.main.built" targetfile="${lwjgl.lib}/windows/lwjgl.dll" >
+ <srcfiles dir= "${lwjgl.src.native}/common" includes="*.c*"/>
+ <srcfiles dir= "${lwjgl.src.native}/windows" includes="*.c"/>
+ </uptodate>
</project>
\ No newline at end of file
diff --git a/platform_build/build-generator.xml b/platform_build/build-generator.xml
index 67bfe17..8e9a596 100644
--- a/platform_build/build-generator.xml
+++ b/platform_build/build-generator.xml
@@ -1,143 +1,143 @@
-<project name="generator">
-
- <!-- clean the generated files -->
- <target name="clean-generated" description="Deletes the generated java and native source">
- <delete quiet="true" failonerror="false">
- <fileset dir="${lwjgl.src}/generated" includes="**"/>
- <fileset dir="${lwjgl.src.native}/generated" includes="**"/>
- </delete>
- </target>
-
- <!-- Compiles the Java generator source code -->
- <target name="generators" description="Compiles the native method generators">
- <javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/util/generator/**.java" source="1.5" target="1.5" taskname="generator">
- <compilerarg value="-Xlint:all"/>
- </javac>
- <javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" source="1.4" target="1.4" taskname="generator">
- <include name="org/lwjgl/opengl/GLSync.java"/>
- <include name="org/lwjgl/opengl/PointerWrapper.java"/>
- </javac>
- </target>
-
- <!-- Proxy target to generate it all -->
- <target name="generate-all" depends="generate-openal, generate-opengl, generate-opengl-capabilities, generate-opengl-references" description="Generates java and native source"/>
-
- <target name="generate-debug" depends="generate-openal-debug, generate-opengl-debug, generate-opengl-capabilities-debug, generate-opengl-references" description="Generates java and native source"/>
-
- <!-- Generate OpenAL -->
- <target name="generate-openal" depends="generators" description="Generates java and native source for AL">
- <apply executable="apt" parallel="true">
- <arg value="-nocompile"/>
- <arg value="-factory"/>
- <arg value="org.lwjgl.util.generator.GeneratorProcessorFactory"/>
- <arg value="-cp"/>
- <arg path="${lwjgl.src}/java:${lwjgl.src.templates}:${lwjgl.bin}:${java.class.path}"/>
- <arg value="-s"/>
- <arg path="${lwjgl.src}/generated"/>
- <arg value="-d"/>
- <arg path="${lwjgl.src.native}/generated"/>
- <arg value="-Atypemap=org.lwjgl.util.generator.ALTypeMap"/>
- <fileset dir="${lwjgl.src.templates}" includes="org/lwjgl/openal/AL10.java, org/lwjgl/openal/AL11.java"/>
- </apply>
- </target>
-
- <!-- Generate OpenAL [DEBUG] -->
- <target name="generate-openal-debug" depends="generators" description="Generates java and native source for AL">
- <apply executable="apt" parallel="true">
- <arg value="-nocompile"/>
- <arg value="-factory"/>
- <arg value="org.lwjgl.util.generator.GeneratorProcessorFactory"/>
- <arg value="-cp"/>
- <arg path="${lwjgl.src}/java:${lwjgl.src.templates}:${lwjgl.bin}:${java.class.path}"/>
- <arg value="-s"/>
- <arg path="${lwjgl.src}/generated"/>
- <arg value="-d"/>
- <arg path="${lwjgl.src.native}/generated"/>
- <arg value="-Atypemap=org.lwjgl.util.generator.ALTypeMap"/>
- <arg value="-Ageneratechecks"/>
- <fileset dir="${lwjgl.src.templates}" includes="org/lwjgl/openal/AL10.java, org/lwjgl/openal/AL11.java"/>
- </apply>
- </target>
-
- <!-- Generate OpenGL -->
- <target name="generate-opengl" depends="generators" description="Generates java and native source for GL">
- <apply executable="apt" parallel="true">
- <arg value="-nocompile"/>
- <arg value="-factory"/>
- <arg value="org.lwjgl.util.generator.GeneratorProcessorFactory"/>
- <arg value="-cp"/>
- <arg path="${lwjgl.src}/java:${lwjgl.src.templates}:${lwjgl.bin}:${java.class.path}"/>
- <arg value="-s"/>
- <arg path="${lwjgl.src}/generated"/>
- <arg value="-d"/>
- <arg path="${lwjgl.src.native}/generated"/>
- <arg value="-Acontextspecific"/>
- <arg value="-Atypemap=org.lwjgl.util.generator.GLTypeMap"/>
- <fileset dir="${lwjgl.src.templates}" includes="${opengl-template-pattern}"/>
- </apply>
- </target>
-
- <!-- Generate OpenGL [DEBUG] -->
- <target name="generate-opengl-debug" depends="generators" description="Generates java and native source for GL">
- <apply executable="apt" parallel="true">
- <arg value="-nocompile"/>
- <arg value="-factory"/>
- <arg value="org.lwjgl.util.generator.GeneratorProcessorFactory"/>
- <arg value="-cp"/>
- <arg path="${lwjgl.src}/java:${lwjgl.src.templates}:${lwjgl.bin}:${java.class.path}"/>
- <arg value="-s"/>
- <arg path="${lwjgl.src}/generated"/>
- <arg value="-d"/>
- <arg path="${lwjgl.src.native}/generated"/>
- <arg value="-Ageneratechecks"/>
- <arg value="-Acontextspecific"/>
- <arg value="-Atypemap=org.lwjgl.util.generator.GLTypeMap"/>
- <fileset dir="${lwjgl.src.templates}" includes="${opengl-template-pattern}"/>
- </apply>
- </target>
-
- <!-- Generate references -->
- <target name="generate-opengl-references" depends="generators" description="Generates java and native source for GL">
- <apply executable="apt" parallel="true">
- <arg value="-nocompile"/>
- <arg value="-factory"/>
- <arg value="org.lwjgl.util.generator.ReferencesGeneratorProcessorFactory"/>
- <arg value="-cp"/>
- <arg path="${lwjgl.src}/java:${lwjgl.src.templates}:${lwjgl.bin}:${java.class.path}"/>
- <arg value="-s"/>
- <arg path="${lwjgl.src}/generated"/>
- <fileset dir="${lwjgl.src.templates}" includes="${opengl-template-pattern}"/>
- </apply>
- </target>
-
- <!-- Generate context capabilities -->
- <target name="generate-opengl-capabilities" depends="generators" description="Generates java and native source for GL">
- <apply executable="apt" parallel="true">
- <arg value="-nocompile"/>
- <arg value="-factory"/>
- <arg value="org.lwjgl.util.generator.ContextGeneratorProcessorFactory"/>
- <arg value="-cp"/>
- <arg path="${lwjgl.src}/java:${lwjgl.src.templates}:${lwjgl.bin}:${java.class.path}"/>
- <arg value="-s"/>
- <arg path="${lwjgl.src}/generated"/>
- <arg value="-Acontextspecific"/>
- <fileset dir="${lwjgl.src.templates}" includes="${opengl-template-pattern}"/>
- </apply>
- </target>
-
- <!-- Generate context capabilities [DEBUG] -->
- <target name="generate-opengl-capabilities-debug" depends="generators" description="Generates java and native source for GL">
- <apply executable="apt" parallel="true">
- <arg value="-nocompile"/>
- <arg value="-factory"/>
- <arg value="org.lwjgl.util.generator.ContextGeneratorProcessorFactory"/>
- <arg value="-cp"/>
- <arg path="${lwjgl.src}/java:${lwjgl.src.templates}:${lwjgl.bin}:${java.class.path}"/>
- <arg value="-s"/>
- <arg path="${lwjgl.src}/generated"/>
- <arg value="-Ageneratechecks"/>
- <arg value="-Acontextspecific"/>
- <fileset dir="${lwjgl.src.templates}" includes="${opengl-template-pattern}"/>
- </apply>
- </target>
-</project>
+<project name="generator">
+
+ <!-- clean the generated files -->
+ <target name="clean-generated" description="Deletes the generated java and native source">
+ <delete quiet="true" failonerror="false">
+ <fileset dir="${lwjgl.src}/generated" includes="**"/>
+ <fileset dir="${lwjgl.src.native}/generated" includes="**"/>
+ </delete>
+ </target>
+
+ <!-- Compiles the Java generator source code -->
+ <target name="generators" description="Compiles the native method generators">
+ <javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/util/generator/**.java" source="1.5" target="1.5" taskname="generator">
+ <compilerarg value="-Xlint:all"/>
+ </javac>
+ <javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" source="1.4" target="1.4" taskname="generator">
+ <include name="org/lwjgl/opengl/GLSync.java"/>
+ <include name="org/lwjgl/opengl/PointerWrapper.java"/>
+ </javac>
+ </target>
+
+ <!-- Proxy target to generate it all -->
+ <target name="generate-all" depends="generate-openal, generate-opengl, generate-opengl-capabilities, generate-opengl-references" description="Generates java and native source"/>
+
+ <target name="generate-debug" depends="generate-openal-debug, generate-opengl-debug, generate-opengl-capabilities-debug, generate-opengl-references" description="Generates java and native source"/>
+
+ <!-- Generate OpenAL -->
+ <target name="generate-openal" depends="generators" description="Generates java and native source for AL">
+ <apply executable="apt" parallel="true">
+ <arg value="-nocompile"/>
+ <arg value="-factory"/>
+ <arg value="org.lwjgl.util.generator.GeneratorProcessorFactory"/>
+ <arg value="-cp"/>
+ <arg path="${lwjgl.src}/java:${lwjgl.src.templates}:${lwjgl.bin}:${java.class.path}"/>
+ <arg value="-s"/>
+ <arg path="${lwjgl.src}/generated"/>
+ <arg value="-d"/>
+ <arg path="${lwjgl.src.native}/generated"/>
+ <arg value="-Atypemap=org.lwjgl.util.generator.ALTypeMap"/>
+ <fileset dir="${lwjgl.src.templates}" includes="org/lwjgl/openal/AL10.java, org/lwjgl/openal/AL11.java"/>
+ </apply>
+ </target>
+
+ <!-- Generate OpenAL [DEBUG] -->
+ <target name="generate-openal-debug" depends="generators" description="Generates java and native source for AL">
+ <apply executable="apt" parallel="true">
+ <arg value="-nocompile"/>
+ <arg value="-factory"/>
+ <arg value="org.lwjgl.util.generator.GeneratorProcessorFactory"/>
+ <arg value="-cp"/>
+ <arg path="${lwjgl.src}/java:${lwjgl.src.templates}:${lwjgl.bin}:${java.class.path}"/>
+ <arg value="-s"/>
+ <arg path="${lwjgl.src}/generated"/>
+ <arg value="-d"/>
+ <arg path="${lwjgl.src.native}/generated"/>
+ <arg value="-Atypemap=org.lwjgl.util.generator.ALTypeMap"/>
+ <arg value="-Ageneratechecks"/>
+ <fileset dir="${lwjgl.src.templates}" includes="org/lwjgl/openal/AL10.java, org/lwjgl/openal/AL11.java"/>
+ </apply>
+ </target>
+
+ <!-- Generate OpenGL -->
+ <target name="generate-opengl" depends="generators" description="Generates java and native source for GL">
+ <apply executable="apt" parallel="true">
+ <arg value="-nocompile"/>
+ <arg value="-factory"/>
+ <arg value="org.lwjgl.util.generator.GeneratorProcessorFactory"/>
+ <arg value="-cp"/>
+ <arg path="${lwjgl.src}/java:${lwjgl.src.templates}:${lwjgl.bin}:${java.class.path}"/>
+ <arg value="-s"/>
+ <arg path="${lwjgl.src}/generated"/>
+ <arg value="-d"/>
+ <arg path="${lwjgl.src.native}/generated"/>
+ <arg value="-Acontextspecific"/>
+ <arg value="-Atypemap=org.lwjgl.util.generator.GLTypeMap"/>
+ <fileset dir="${lwjgl.src.templates}" includes="${opengl-template-pattern}"/>
+ </apply>
+ </target>
+
+ <!-- Generate OpenGL [DEBUG] -->
+ <target name="generate-opengl-debug" depends="generators" description="Generates java and native source for GL">
+ <apply executable="apt" parallel="true">
+ <arg value="-nocompile"/>
+ <arg value="-factory"/>
+ <arg value="org.lwjgl.util.generator.GeneratorProcessorFactory"/>
+ <arg value="-cp"/>
+ <arg path="${lwjgl.src}/java:${lwjgl.src.templates}:${lwjgl.bin}:${java.class.path}"/>
+ <arg value="-s"/>
+ <arg path="${lwjgl.src}/generated"/>
+ <arg value="-d"/>
+ <arg path="${lwjgl.src.native}/generated"/>
+ <arg value="-Ageneratechecks"/>
+ <arg value="-Acontextspecific"/>
+ <arg value="-Atypemap=org.lwjgl.util.generator.GLTypeMap"/>
+ <fileset dir="${lwjgl.src.templates}" includes="${opengl-template-pattern}"/>
+ </apply>
+ </target>
+
+ <!-- Generate references -->
+ <target name="generate-opengl-references" depends="generators" description="Generates java and native source for GL">
+ <apply executable="apt" parallel="true">
+ <arg value="-nocompile"/>
+ <arg value="-factory"/>
+ <arg value="org.lwjgl.util.generator.ReferencesGeneratorProcessorFactory"/>
+ <arg value="-cp"/>
+ <arg path="${lwjgl.src}/java:${lwjgl.src.templates}:${lwjgl.bin}:${java.class.path}"/>
+ <arg value="-s"/>
+ <arg path="${lwjgl.src}/generated"/>
+ <fileset dir="${lwjgl.src.templates}" includes="${opengl-template-pattern}"/>
+ </apply>
+ </target>
+
+ <!-- Generate context capabilities -->
+ <target name="generate-opengl-capabilities" depends="generators" description="Generates java and native source for GL">
+ <apply executable="apt" parallel="true">
+ <arg value="-nocompile"/>
+ <arg value="-factory"/>
+ <arg value="org.lwjgl.util.generator.ContextGeneratorProcessorFactory"/>
+ <arg value="-cp"/>
+ <arg path="${lwjgl.src}/java:${lwjgl.src.templates}:${lwjgl.bin}:${java.class.path}"/>
+ <arg value="-s"/>
+ <arg path="${lwjgl.src}/generated"/>
+ <arg value="-Acontextspecific"/>
+ <fileset dir="${lwjgl.src.templates}" includes="${opengl-template-pattern}"/>
+ </apply>
+ </target>
+
+ <!-- Generate context capabilities [DEBUG] -->
+ <target name="generate-opengl-capabilities-debug" depends="generators" description="Generates java and native source for GL">
+ <apply executable="apt" parallel="true">
+ <arg value="-nocompile"/>
+ <arg value="-factory"/>
+ <arg value="org.lwjgl.util.generator.ContextGeneratorProcessorFactory"/>
+ <arg value="-cp"/>
+ <arg path="${lwjgl.src}/java:${lwjgl.src.templates}:${lwjgl.bin}:${java.class.path}"/>
+ <arg value="-s"/>
+ <arg path="${lwjgl.src}/generated"/>
+ <arg value="-Ageneratechecks"/>
+ <arg value="-Acontextspecific"/>
+ <fileset dir="${lwjgl.src.templates}" includes="${opengl-template-pattern}"/>
+ </apply>
+ </target>
+</project>
diff --git a/platform_build/build-webstart.xml b/platform_build/build-webstart.xml
index ad3bf05..875254c 100644
--- a/platform_build/build-webstart.xml
+++ b/platform_build/build-webstart.xml
@@ -1,61 +1,61 @@
-<project name="webstart">
- <target name="webstart_demo" depends="jars">
- <antcall target="-webstart_demo">
- <param name="keystore" value="applet/lwjglkeystore"/>
- <param name="alias" value="lwjgl"/>
- <param name="password" value="123456"/>
- </antcall>
- </target>
-
- <target name="webstart_demo-release" depends="jars">
- <input message="Please type the password for the keystore" addproperty="sign.pwd"/>
-
- <antcall target="-webstart_demo">
- <param name="keystore" value="signing/matzon_java_code_signing.keystore"/>
- <param name="alias" value="oddlabs_java_code_signing"/>
- <param name="password" value="${sign.pwd}"/>
- </antcall>
- </target>
-
- <!-- -->
- <target name="-webstart_demo" description="Using released files, creates the necessary files used for jnlp demos">
-
- <!-- delete existing temp -->
- <delete dir="${lwjgl.temp}"/>
-
- <!-- unzip common files -->
- <unzip src="${lwjgl.dist}/lwjgl-${lwjgl.version}.zip" dest="${lwjgl.temp}/jnlp/temp" overwrite="true"/>
-
- <!-- move files to unified structure -->
- <move todir="${lwjgl.temp}/jnlp/temp">
- <fileset dir="${lwjgl.temp}/jnlp/temp/lwjgl-${lwjgl.version}/">
- <include name="**"/>
- </fileset>
- </move>
-
- <!-- move relevant files to root -->
- <move todir="${lwjgl.temp}/jnlp/" flatten="true">
- <fileset dir="${lwjgl.temp}/jnlp/temp">
- <include name="**/**.jar"/>
- </fileset>
- </move>
-
- <!-- create native jars -->
- <jar destfile="${lwjgl.temp}/jnlp/native_windows.jar" basedir="${lwjgl.temp}/jnlp/temp/native/windows"/>
- <jar destfile="${lwjgl.temp}/jnlp/native_linux.jar" basedir="${lwjgl.temp}/jnlp/temp/native/linux"/>
- <jar destfile="${lwjgl.temp}/jnlp/native_macosx.jar" basedir="${lwjgl.temp}/jnlp/temp/native/macosx"/>
- <jar destfile="${lwjgl.temp}/jnlp/native_solaris.jar" basedir="${lwjgl.temp}/jnlp/temp/native/solaris"/>
-
- <!-- create media jar -->
- <jar destfile="${lwjgl.temp}/jnlp/media.jar" basedir="${lwjgl.res}"/>
-
- <!-- sign 'em -->
- <signjar jar="${lwjgl.temp}/jnlp/lwjgl.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
- <signjar jar="${lwjgl.temp}/jnlp/lwjgl_util.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
- <signjar jar="${lwjgl.temp}/jnlp/native_solaris.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
- <signjar jar="${lwjgl.temp}/jnlp/native_linux.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
- <signjar jar="${lwjgl.temp}/jnlp/native_macosx.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
- <signjar jar="${lwjgl.temp}/jnlp/native_windows.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
- <signjar jar="${lwjgl.temp}/jnlp/jinput.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
- </target>
+<project name="webstart">
+ <target name="webstart_demo" depends="jars">
+ <antcall target="-webstart_demo">
+ <param name="keystore" value="applet/lwjglkeystore"/>
+ <param name="alias" value="lwjgl"/>
+ <param name="password" value="123456"/>
+ </antcall>
+ </target>
+
+ <target name="webstart_demo-release" depends="jars">
+ <input message="Please type the password for the keystore" addproperty="sign.pwd"/>
+
+ <antcall target="-webstart_demo">
+ <param name="keystore" value="signing/matzon_java_code_signing.keystore"/>
+ <param name="alias" value="oddlabs_java_code_signing"/>
+ <param name="password" value="${sign.pwd}"/>
+ </antcall>
+ </target>
+
+ <!-- -->
+ <target name="-webstart_demo" description="Using released files, creates the necessary files used for jnlp demos">
+
+ <!-- delete existing temp -->
+ <delete dir="${lwjgl.temp}"/>
+
+ <!-- unzip common files -->
+ <unzip src="${lwjgl.dist}/lwjgl-${lwjgl.version}.zip" dest="${lwjgl.temp}/jnlp/temp" overwrite="true"/>
+
+ <!-- move files to unified structure -->
+ <move todir="${lwjgl.temp}/jnlp/temp">
+ <fileset dir="${lwjgl.temp}/jnlp/temp/lwjgl-${lwjgl.version}/">
+ <include name="**"/>
+ </fileset>
+ </move>
+
+ <!-- move relevant files to root -->
+ <move todir="${lwjgl.temp}/jnlp/" flatten="true">
+ <fileset dir="${lwjgl.temp}/jnlp/temp">
+ <include name="**/**.jar"/>
+ </fileset>
+ </move>
+
+ <!-- create native jars -->
+ <jar destfile="${lwjgl.temp}/jnlp/native_windows.jar" basedir="${lwjgl.temp}/jnlp/temp/native/windows"/>
+ <jar destfile="${lwjgl.temp}/jnlp/native_linux.jar" basedir="${lwjgl.temp}/jnlp/temp/native/linux"/>
+ <jar destfile="${lwjgl.temp}/jnlp/native_macosx.jar" basedir="${lwjgl.temp}/jnlp/temp/native/macosx"/>
+ <jar destfile="${lwjgl.temp}/jnlp/native_solaris.jar" basedir="${lwjgl.temp}/jnlp/temp/native/solaris"/>
+
+ <!-- create media jar -->
+ <jar destfile="${lwjgl.temp}/jnlp/media.jar" basedir="${lwjgl.res}"/>
+
+ <!-- sign 'em -->
+ <signjar jar="${lwjgl.temp}/jnlp/lwjgl.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
+ <signjar jar="${lwjgl.temp}/jnlp/lwjgl_util.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
+ <signjar jar="${lwjgl.temp}/jnlp/native_solaris.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
+ <signjar jar="${lwjgl.temp}/jnlp/native_linux.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
+ <signjar jar="${lwjgl.temp}/jnlp/native_macosx.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
+ <signjar jar="${lwjgl.temp}/jnlp/native_windows.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
+ <signjar jar="${lwjgl.temp}/jnlp/jinput.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
+ </target>
</project>
\ No newline at end of file
diff --git a/platform_build/mingw_ant/build.xml b/platform_build/mingw_ant/build.xml
index 2244ce9..0fba3c1 100644
--- a/platform_build/mingw_ant/build.xml
+++ b/platform_build/mingw_ant/build.xml
@@ -1,66 +1,66 @@
-<?xml version="1.0"?>
-
-<project name="lwjgl native code, native code" basedir="../../bin/lwjgl" default="compile">
- <property name="native" location="../../src/native"/>
- <property environment="env"/>
- <property name="mingwprefix" location="x86_64-pc-mingw32-"/>
- <property name="mingwhome" location="c:/MinGW64"/>
- <property name="strip" location="${mingwhome}/${mingwprefix}strip"/>
- <property name="gcc" location="${mingwhome}/${mingwprefix}gcc"/>
- <property name="dlltool" location="${mingwhome}/${mingwprefix}dlltool"/>
- <property name="dllname" value="lwjgl64.dll"/>
-
- <target name="compile_dir">
- <apply dir="." failonerror="true" executable="${gcc}" dest="." skipemptyfilesets="true">
- <arg line="-c -Wall -O2 -std=gnu99 -D_JNI_IMPLEMENTATION_"/>
- <arg value="-I${dxhome}/include"/>
- <arg value="-I${alhome}/include"/>
- <arg value="-I${jdkhome}/include"/>
- <arg value="-I${jdkhome}/include/win32"/>
- <arg value="-I${native}/common"/>
- <arg value="-I${native}/windows"/>
- <srcfile/>
- <fileset dir="${native}/windows" includes="*.c"/>
- <fileset dir="${native}/common" includes="*.c"/>
- <fileset dir="${native}/generated" includes="*.c"/>
- <mapper type="glob" from="*.c" to="*.o"/>
- </apply>
- </target>
-
- <target name="link">
- <echo file="jawt.def">
- EXPORTS
- JAWT_GetAWT
- </echo>
- <exec dir="." executable="${dlltool}" failonerror="true">
- <arg line="--def jawt.def --kill-at --dllname jawt.dll --output-lib libjawt.a"/>
- </exec>
- <apply dir="." parallel="true" executable="${gcc}" failonerror="true">
- <arg value="-Wl,--kill-at"/>
- <arg line="-shared -o ${dllname}"/>
- <srcfile/>
- <arg line="libjawt.a"/>
- <arg value="-L${java.home}/../lib"/>
- <arg value="-L${alhome}/libs"/>
- <arg line="${libs}"/>
- <fileset dir="." includes="*.o"/>
- </apply>
- </target>
-
- <target name="clean">
- <delete>
- <fileset dir="." includes="*.o"/>
- <fileset dir="." includes="*.dll"/>
- </delete>
- </target>
-
- <target name="compile">
- <property name="libs" value="-lkernel32 -lole32 -lopengl32 -lversion -luser32 -lgdi32 -ladvapi32 -lwinmm"/>
- <antcall target="compile_dir"/>
- <antcall target="link"/>
- <apply dir="." executable="${strip}">
- <fileset file="${dllname}"/>
- </apply>
- </target>
-</project>
-
+<?xml version="1.0"?>
+
+<project name="lwjgl native code, native code" basedir="../../bin/lwjgl" default="compile">
+ <property name="native" location="../../src/native"/>
+ <property environment="env"/>
+ <property name="mingwprefix" location="x86_64-pc-mingw32-"/>
+ <property name="mingwhome" location="c:/MinGW64"/>
+ <property name="strip" location="${mingwhome}/${mingwprefix}strip"/>
+ <property name="gcc" location="${mingwhome}/${mingwprefix}gcc"/>
+ <property name="dlltool" location="${mingwhome}/${mingwprefix}dlltool"/>
+ <property name="dllname" value="lwjgl64.dll"/>
+
+ <target name="compile_dir">
+ <apply dir="." failonerror="true" executable="${gcc}" dest="." skipemptyfilesets="true">
+ <arg line="-c -Wall -O2 -std=gnu99 -D_JNI_IMPLEMENTATION_"/>
+ <arg value="-I${dxhome}/include"/>
+ <arg value="-I${alhome}/include"/>
+ <arg value="-I${jdkhome}/include"/>
+ <arg value="-I${jdkhome}/include/win32"/>
+ <arg value="-I${native}/common"/>
+ <arg value="-I${native}/windows"/>
+ <srcfile/>
+ <fileset dir="${native}/windows" includes="*.c"/>
+ <fileset dir="${native}/common" includes="*.c"/>
+ <fileset dir="${native}/generated" includes="*.c"/>
+ <mapper type="glob" from="*.c" to="*.o"/>
+ </apply>
+ </target>
+
+ <target name="link">
+ <echo file="jawt.def">
+ EXPORTS
+ JAWT_GetAWT
+ </echo>
+ <exec dir="." executable="${dlltool}" failonerror="true">
+ <arg line="--def jawt.def --kill-at --dllname jawt.dll --output-lib libjawt.a"/>
+ </exec>
+ <apply dir="." parallel="true" executable="${gcc}" failonerror="true">
+ <arg value="-Wl,--kill-at"/>
+ <arg line="-shared -o ${dllname}"/>
+ <srcfile/>
+ <arg line="libjawt.a"/>
+ <arg value="-L${java.home}/../lib"/>
+ <arg value="-L${alhome}/libs"/>
+ <arg line="${libs}"/>
+ <fileset dir="." includes="*.o"/>
+ </apply>
+ </target>
+
+ <target name="clean">
+ <delete>
+ <fileset dir="." includes="*.o"/>
+ <fileset dir="." includes="*.dll"/>
+ </delete>
+ </target>
+
+ <target name="compile">
+ <property name="libs" value="-lkernel32 -lole32 -lopengl32 -lversion -luser32 -lgdi32 -ladvapi32 -lwinmm"/>
+ <antcall target="compile_dir"/>
+ <antcall target="link"/>
+ <apply dir="." executable="${strip}">
+ <fileset file="${dllname}"/>
+ </apply>
+ </target>
+</project>
+
diff --git a/platform_build/windows_ant/build.xml b/platform_build/windows_ant/build.xml
index 83a8f10..4ac4610 100644
--- a/platform_build/windows_ant/build.xml
+++ b/platform_build/windows_ant/build.xml
@@ -1,60 +1,60 @@
-<?xml version="1.0"?>
-
-<project name="lwjgl native code, native code" basedir="../../bin/lwjgl" default="compile">
- <property name="native" location="../../src/native"/>
- <property environment="env"/>
- <property name="sdkhome" location="${env.MSSDK}"/>
-
- <target name="compile_dir">
- <apply dir="." failonerror="true" executable="cl" dest="." skipemptyfilesets="true">
- <arg line="/Ox /W2 /nologo /Ox /Ob2 /Oi /Ot /Oy /FD /EHsc /MT /Gy /W2 /nologo /c"/>
- <arg value="/I${sdkhome}\include"/>
- <arg value="/I${java.home}\..\include"/>
- <arg value="/I${java.home}\..\include\win32"/>
- <arg value="/I${native}\common"/>
- <arg value="/I${native}\windows"/>
- <srcfile/>
- <fileset dir="${native}/windows" includes="*.c"/>
- <fileset dir="${native}/common" includes="*.c"/>
- <fileset dir="${native}/generated" includes="*.c"/>
- <mapper type="glob" from="*.c" to="*.obj"/>
- </apply>
- </target>
-
- <target name="link">
- <apply dir="." parallel="true" executable="cl" failonerror="true">
- <arg line="/LD /nologo"/>
- <srcfile/>
- <arg line="/Fe${dllname} /link"/>
- <arg value="/LIBPATH:${java.home}\..\lib"/>
- <arg value="/LIBPATH:${sdkhomelib}"/>
- <arg value="/OPT:REF"/>
- <arg value="/OPT:ICF"/>
- <arg line="/DLL /DELAYLOAD:jawt.dll ${libs}"/>
- <fileset dir="." includes="*.obj"/>
- </apply>
- </target>
-
- <target name="clean">
- <delete>
- <fileset dir="." includes="*.obj"/>
- <fileset dir="." includes="*.dll"/>
- <fileset dir="." includes="*.exp"/>
- <fileset dir="." includes="*.lib"/>
- </delete>
- </target>
-
- <target name="compile">
- <condition property="sdkhomelib" value="${sdkhome}\lib" else="${sdkhome}\lib\x64">
- <equals arg1="${os.arch}" arg2="x86"/>
- </condition>
- <condition property="dllname" value="lwjgl.dll" else="lwjgl64.dll">
- <equals arg1="${os.arch}" arg2="x86"/>
- </condition>
- <echo message="${sdkhomelib}"/>
- <property name="libs" value="Kernel32.lib ole32.lib OpenGL32.Lib Version.lib user32.lib Gdi32.lib Advapi32.lib jawt.lib delayimp.lib winmm.lib Comctl32.lib"/>
- <antcall target="compile_dir"/>
- <antcall target="link"/>
- </target>
-</project>
-
+<?xml version="1.0"?>
+
+<project name="lwjgl native code, native code" basedir="../../bin/lwjgl" default="compile">
+ <property name="native" location="../../src/native"/>
+ <property environment="env"/>
+ <property name="sdkhome" location="${env.MSSDK}"/>
+
+ <target name="compile_dir">
+ <apply dir="." failonerror="true" executable="cl" dest="." skipemptyfilesets="true">
+ <arg line="/Ox /W2 /nologo /Ox /Ob2 /Oi /Ot /Oy /FD /EHsc /MT /Gy /W2 /nologo /c"/>
+ <arg value="/I${sdkhome}\include"/>
+ <arg value="/I${java.home}\..\include"/>
+ <arg value="/I${java.home}\..\include\win32"/>
+ <arg value="/I${native}\common"/>
+ <arg value="/I${native}\windows"/>
+ <srcfile/>
+ <fileset dir="${native}/windows" includes="*.c"/>
+ <fileset dir="${native}/common" includes="*.c"/>
+ <fileset dir="${native}/generated" includes="*.c"/>
+ <mapper type="glob" from="*.c" to="*.obj"/>
+ </apply>
+ </target>
+
+ <target name="link">
+ <apply dir="." parallel="true" executable="cl" failonerror="true">
+ <arg line="/LD /nologo"/>
+ <srcfile/>
+ <arg line="/Fe${dllname} /link"/>
+ <arg value="/LIBPATH:${java.home}\..\lib"/>
+ <arg value="/LIBPATH:${sdkhomelib}"/>
+ <arg value="/OPT:REF"/>
+ <arg value="/OPT:ICF"/>
+ <arg line="/DLL /DELAYLOAD:jawt.dll ${libs}"/>
+ <fileset dir="." includes="*.obj"/>
+ </apply>
+ </target>
+
+ <target name="clean">
+ <delete>
+ <fileset dir="." includes="*.obj"/>
+ <fileset dir="." includes="*.dll"/>
+ <fileset dir="." includes="*.exp"/>
+ <fileset dir="." includes="*.lib"/>
+ </delete>
+ </target>
+
+ <target name="compile">
+ <condition property="sdkhomelib" value="${sdkhome}\lib" else="${sdkhome}\lib\x64">
+ <equals arg1="${os.arch}" arg2="x86"/>
+ </condition>
+ <condition property="dllname" value="lwjgl.dll" else="lwjgl64.dll">
+ <equals arg1="${os.arch}" arg2="x86"/>
+ </condition>
+ <echo message="${sdkhomelib}"/>
+ <property name="libs" value="Kernel32.lib ole32.lib OpenGL32.Lib Version.lib user32.lib Gdi32.lib Advapi32.lib jawt.lib delayimp.lib winmm.lib Comctl32.lib"/>
+ <antcall target="compile_dir"/>
+ <antcall target="link"/>
+ </target>
+</project>
+
diff --git a/src/java/org/lwjgl/BufferChecks.java b/src/java/org/lwjgl/BufferChecks.java
index 16141d1..e982e8b 100644
--- a/src/java/org/lwjgl/BufferChecks.java
+++ b/src/java/org/lwjgl/BufferChecks.java
@@ -1,191 +1,191 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl;
-
-import java.nio.Buffer;
-import java.nio.ByteBuffer;
-import java.nio.DoubleBuffer;
-import java.nio.FloatBuffer;
-import java.nio.IntBuffer;
-import java.nio.ShortBuffer;
-import java.nio.LongBuffer;
-
-/**
- * <p>A class to check buffer boundaries in general. If there is unsufficient space
- * in the buffer when the call is made then a buffer overflow would otherwise
- * occur and cause unexpected behaviour, a crash, or worse, a security risk.
- *
- * Internal class, don't use.
- * </p>
- * @author cix_foo <cix_foo at users.sourceforge.net>
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3279 $
- * $Id: BufferChecks.java 3279 2010-03-11 21:06:49Z spasi $
- */
-public class BufferChecks {
- /** Static methods only! */
- private BufferChecks() {
- }
-
- /**
- * Helper methods to ensure a function pointer is not-null (0)
- */
- public static void checkFunctionAddress(long pointer) {
- if (pointer == 0) {
- throw new IllegalStateException("Function is not supported");
- }
- }
-
- /**
- * Helper methods to ensure a ByteBuffer is null-terminated
- */
- public static void checkNullTerminated(ByteBuffer buf) {
- if (buf.get(buf.limit() - 1) != 0) {
- throw new IllegalArgumentException("Missing null termination");
- }
- }
-
- public static void checkNullTerminated(ByteBuffer buf, int count) {
- int nullFound = 0;
- for ( int i = buf.position(); i < buf.limit(); i++ ) {
- if ( buf.get(i) == 0 )
- nullFound++;
- }
-
- if ( nullFound < count )
- throw new IllegalArgumentException("Missing null termination");
- }
-
- /** Helper methods to ensure an IntBuffer is null-terminated */
- public static void checkNullTerminated(IntBuffer buf) {
- if ( buf.get(buf.limit() - 1) != 0 ) {
- throw new IllegalArgumentException("Missing null termination");
- }
- }
-
- public static void checkNotNull(Object o) {
- if (o == null)
- throw new IllegalArgumentException("Null argument");
- }
-
- /**
- * Helper methods to ensure a buffer is direct (and, implicitly, non-null).
- */
- public static void checkDirect(ByteBuffer buf) {
- if (!buf.isDirect()) {
- throw new IllegalArgumentException("ByteBuffer is not direct");
- }
- }
-
- public static void checkDirect(ShortBuffer buf) {
- if (!buf.isDirect()) {
- throw new IllegalArgumentException("ShortBuffer is not direct");
- }
- }
-
- public static void checkDirect(IntBuffer buf) {
- if (!buf.isDirect()) {
- throw new IllegalArgumentException("IntBuffer is not direct");
- }
- }
-
- public static void checkDirect(LongBuffer buf) {
- if (!buf.isDirect()) {
- throw new IllegalArgumentException("LongBuffer is not direct");
- }
- }
-
- public static void checkDirect(FloatBuffer buf) {
- if (!buf.isDirect()) {
- throw new IllegalArgumentException("FloatBuffer is not direct");
- }
- }
-
- public static void checkDirect(DoubleBuffer buf) {
- if (!buf.isDirect()) {
- throw new IllegalArgumentException("DoubleBuffer is not direct");
- }
- }
-
- /**
- * This is a separate call to help inline checkBufferSize.
- */
- private static void throwBufferSizeException(Buffer buf, int size) {
- throw new IllegalArgumentException("Number of remaining buffer elements is " + buf.remaining() + ", must be at least " + size);
- }
-
- /**
- * Helper method to ensure a buffer is big enough to receive data from a
- * glGet* operation.
- *
- * @param buf
- * The buffer to check
- * @param size
- * The minimum buffer size
- * @throws IllegalArgumentException
- */
- public static void checkBufferSize(Buffer buf, int size) {
- if (buf.remaining() < size) {
- throwBufferSizeException(buf, size);
- }
- }
-
- public static void checkBuffer(ByteBuffer buf, int size) {
- checkBufferSize(buf, size);
- checkDirect(buf);
- }
-
- public static void checkBuffer(ShortBuffer buf, int size) {
- checkBufferSize(buf, size);
- checkDirect(buf);
- }
-
- public static void checkBuffer(IntBuffer buf, int size) {
- checkBufferSize(buf, size);
- checkDirect(buf);
- }
-
- public static void checkBuffer(LongBuffer buf, int size) {
- checkBufferSize(buf, size);
- checkDirect(buf);
- }
-
- public static void checkBuffer(FloatBuffer buf, int size) {
- checkBufferSize(buf, size);
- checkDirect(buf);
- }
-
- public static void checkBuffer(DoubleBuffer buf, int size) {
- checkBufferSize(buf, size);
- checkDirect(buf);
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl;
+
+import java.nio.Buffer;
+import java.nio.ByteBuffer;
+import java.nio.DoubleBuffer;
+import java.nio.FloatBuffer;
+import java.nio.IntBuffer;
+import java.nio.ShortBuffer;
+import java.nio.LongBuffer;
+
+/**
+ * <p>A class to check buffer boundaries in general. If there is unsufficient space
+ * in the buffer when the call is made then a buffer overflow would otherwise
+ * occur and cause unexpected behaviour, a crash, or worse, a security risk.
+ *
+ * Internal class, don't use.
+ * </p>
+ * @author cix_foo <cix_foo at users.sourceforge.net>
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3279 $
+ * $Id: BufferChecks.java 3279 2010-03-11 21:06:49Z spasi $
+ */
+public class BufferChecks {
+ /** Static methods only! */
+ private BufferChecks() {
+ }
+
+ /**
+ * Helper methods to ensure a function pointer is not-null (0)
+ */
+ public static void checkFunctionAddress(long pointer) {
+ if (pointer == 0) {
+ throw new IllegalStateException("Function is not supported");
+ }
+ }
+
+ /**
+ * Helper methods to ensure a ByteBuffer is null-terminated
+ */
+ public static void checkNullTerminated(ByteBuffer buf) {
+ if (buf.get(buf.limit() - 1) != 0) {
+ throw new IllegalArgumentException("Missing null termination");
+ }
+ }
+
+ public static void checkNullTerminated(ByteBuffer buf, int count) {
+ int nullFound = 0;
+ for ( int i = buf.position(); i < buf.limit(); i++ ) {
+ if ( buf.get(i) == 0 )
+ nullFound++;
+ }
+
+ if ( nullFound < count )
+ throw new IllegalArgumentException("Missing null termination");
+ }
+
+ /** Helper methods to ensure an IntBuffer is null-terminated */
+ public static void checkNullTerminated(IntBuffer buf) {
+ if ( buf.get(buf.limit() - 1) != 0 ) {
+ throw new IllegalArgumentException("Missing null termination");
+ }
+ }
+
+ public static void checkNotNull(Object o) {
+ if (o == null)
+ throw new IllegalArgumentException("Null argument");
+ }
+
+ /**
+ * Helper methods to ensure a buffer is direct (and, implicitly, non-null).
+ */
+ public static void checkDirect(ByteBuffer buf) {
+ if (!buf.isDirect()) {
+ throw new IllegalArgumentException("ByteBuffer is not direct");
+ }
+ }
+
+ public static void checkDirect(ShortBuffer buf) {
+ if (!buf.isDirect()) {
+ throw new IllegalArgumentException("ShortBuffer is not direct");
+ }
+ }
+
+ public static void checkDirect(IntBuffer buf) {
+ if (!buf.isDirect()) {
+ throw new IllegalArgumentException("IntBuffer is not direct");
+ }
+ }
+
+ public static void checkDirect(LongBuffer buf) {
+ if (!buf.isDirect()) {
+ throw new IllegalArgumentException("LongBuffer is not direct");
+ }
+ }
+
+ public static void checkDirect(FloatBuffer buf) {
+ if (!buf.isDirect()) {
+ throw new IllegalArgumentException("FloatBuffer is not direct");
+ }
+ }
+
+ public static void checkDirect(DoubleBuffer buf) {
+ if (!buf.isDirect()) {
+ throw new IllegalArgumentException("DoubleBuffer is not direct");
+ }
+ }
+
+ /**
+ * This is a separate call to help inline checkBufferSize.
+ */
+ private static void throwBufferSizeException(Buffer buf, int size) {
+ throw new IllegalArgumentException("Number of remaining buffer elements is " + buf.remaining() + ", must be at least " + size);
+ }
+
+ /**
+ * Helper method to ensure a buffer is big enough to receive data from a
+ * glGet* operation.
+ *
+ * @param buf
+ * The buffer to check
+ * @param size
+ * The minimum buffer size
+ * @throws IllegalArgumentException
+ */
+ public static void checkBufferSize(Buffer buf, int size) {
+ if (buf.remaining() < size) {
+ throwBufferSizeException(buf, size);
+ }
+ }
+
+ public static void checkBuffer(ByteBuffer buf, int size) {
+ checkBufferSize(buf, size);
+ checkDirect(buf);
+ }
+
+ public static void checkBuffer(ShortBuffer buf, int size) {
+ checkBufferSize(buf, size);
+ checkDirect(buf);
+ }
+
+ public static void checkBuffer(IntBuffer buf, int size) {
+ checkBufferSize(buf, size);
+ checkDirect(buf);
+ }
+
+ public static void checkBuffer(LongBuffer buf, int size) {
+ checkBufferSize(buf, size);
+ checkDirect(buf);
+ }
+
+ public static void checkBuffer(FloatBuffer buf, int size) {
+ checkBufferSize(buf, size);
+ checkDirect(buf);
+ }
+
+ public static void checkBuffer(DoubleBuffer buf, int size) {
+ checkBufferSize(buf, size);
+ checkDirect(buf);
+ }
+}
diff --git a/src/java/org/lwjgl/BufferUtils.java b/src/java/org/lwjgl/BufferUtils.java
index a5caf01..1c81fd3 100644
--- a/src/java/org/lwjgl/BufferUtils.java
+++ b/src/java/org/lwjgl/BufferUtils.java
@@ -1,148 +1,148 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl;
-
-import java.nio.Buffer;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.nio.CharBuffer;
-import java.nio.DoubleBuffer;
-import java.nio.FloatBuffer;
-import java.nio.IntBuffer;
-import java.nio.LongBuffer;
-import java.nio.ShortBuffer;
-
-/**
- * Some often-used Buffer code for creating native buffers of the appropriate size.
- *
- * @author $Author: matzon $
- * @version $Revision: 2983 $
- * $Id: BufferUtils.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-public final class BufferUtils {
-
- /**
- * Construct a direct native-ordered bytebuffer with the specified size.
- * @param size The size, in bytes
- * @return a ByteBuffer
- */
- public static ByteBuffer createByteBuffer(int size) {
- return ByteBuffer.allocateDirect(size).order(ByteOrder.nativeOrder());
- }
-
- /**
- * Construct a direct native-order shortbuffer with the specified number
- * of elements.
- * @param size The size, in shorts
- * @return a ShortBuffer
- */
- public static ShortBuffer createShortBuffer(int size) {
- return createByteBuffer(size << 1).asShortBuffer();
- }
-
- /**
- * Construct a direct native-order charbuffer with the specified number
- * of elements.
- * @param size The size, in chars
- * @return an CharBuffer
- */
- public static CharBuffer createCharBuffer(int size) {
- return createByteBuffer(size << 1).asCharBuffer();
- }
-
- /**
- * Construct a direct native-order intbuffer with the specified number
- * of elements.
- * @param size The size, in ints
- * @return an IntBuffer
- */
- public static IntBuffer createIntBuffer(int size) {
- return createByteBuffer(size << 2).asIntBuffer();
- }
-
- /**
- * Construct a direct native-order longbuffer with the specified number
- * of elements.
- * @param size The size, in longs
- * @return an LongBuffer
- */
- public static LongBuffer createLongBuffer(int size) {
- return createByteBuffer(size << 3).asLongBuffer();
- }
-
- /**
- * Construct a direct native-order floatbuffer with the specified number
- * of elements.
- * @param size The size, in floats
- * @return a FloatBuffer
- */
- public static FloatBuffer createFloatBuffer(int size) {
- return createByteBuffer(size << 2).asFloatBuffer();
- }
-
- /**
- * Construct a direct native-order doublebuffer with the specified number
- * of elements.
- * @param size The size, in floats
- * @return a FloatBuffer
- */
- public static DoubleBuffer createDoubleBuffer(int size) {
- return createByteBuffer(size << 3).asDoubleBuffer();
- }
-
- /**
- * @return n, where buffer_element_size=2^n.
- */
- public static int getElementSizeExponent(Buffer buf) {
- if (buf instanceof ByteBuffer)
- return 0;
- else if (buf instanceof ShortBuffer || buf instanceof CharBuffer)
- return 1;
- else if (buf instanceof FloatBuffer || buf instanceof IntBuffer)
- return 2;
- else if (buf instanceof LongBuffer || buf instanceof DoubleBuffer)
- return 3;
- else
- throw new IllegalStateException("Unsupported buffer type: " + buf);
- }
-
- /**
- * A helper function which is used to get the byte offset in an arbitrary buffer
- * based on its position
- * @return the position of the buffer, in BYTES
- */
- public static int getOffset(Buffer buffer) {
- return buffer.position() << getElementSizeExponent(buffer);
- }
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl;
+
+import java.nio.Buffer;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.CharBuffer;
+import java.nio.DoubleBuffer;
+import java.nio.FloatBuffer;
+import java.nio.IntBuffer;
+import java.nio.LongBuffer;
+import java.nio.ShortBuffer;
+
+/**
+ * Some often-used Buffer code for creating native buffers of the appropriate size.
+ *
+ * @author $Author: matzon $
+ * @version $Revision: 2983 $
+ * $Id: BufferUtils.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+public final class BufferUtils {
+
+ /**
+ * Construct a direct native-ordered bytebuffer with the specified size.
+ * @param size The size, in bytes
+ * @return a ByteBuffer
+ */
+ public static ByteBuffer createByteBuffer(int size) {
+ return ByteBuffer.allocateDirect(size).order(ByteOrder.nativeOrder());
+ }
+
+ /**
+ * Construct a direct native-order shortbuffer with the specified number
+ * of elements.
+ * @param size The size, in shorts
+ * @return a ShortBuffer
+ */
+ public static ShortBuffer createShortBuffer(int size) {
+ return createByteBuffer(size << 1).asShortBuffer();
+ }
+
+ /**
+ * Construct a direct native-order charbuffer with the specified number
+ * of elements.
+ * @param size The size, in chars
+ * @return an CharBuffer
+ */
+ public static CharBuffer createCharBuffer(int size) {
+ return createByteBuffer(size << 1).asCharBuffer();
+ }
+
+ /**
+ * Construct a direct native-order intbuffer with the specified number
+ * of elements.
+ * @param size The size, in ints
+ * @return an IntBuffer
+ */
+ public static IntBuffer createIntBuffer(int size) {
+ return createByteBuffer(size << 2).asIntBuffer();
+ }
+
+ /**
+ * Construct a direct native-order longbuffer with the specified number
+ * of elements.
+ * @param size The size, in longs
+ * @return an LongBuffer
+ */
+ public static LongBuffer createLongBuffer(int size) {
+ return createByteBuffer(size << 3).asLongBuffer();
+ }
+
+ /**
+ * Construct a direct native-order floatbuffer with the specified number
+ * of elements.
+ * @param size The size, in floats
+ * @return a FloatBuffer
+ */
+ public static FloatBuffer createFloatBuffer(int size) {
+ return createByteBuffer(size << 2).asFloatBuffer();
+ }
+
+ /**
+ * Construct a direct native-order doublebuffer with the specified number
+ * of elements.
+ * @param size The size, in floats
+ * @return a FloatBuffer
+ */
+ public static DoubleBuffer createDoubleBuffer(int size) {
+ return createByteBuffer(size << 3).asDoubleBuffer();
+ }
+
+ /**
+ * @return n, where buffer_element_size=2^n.
+ */
+ public static int getElementSizeExponent(Buffer buf) {
+ if (buf instanceof ByteBuffer)
+ return 0;
+ else if (buf instanceof ShortBuffer || buf instanceof CharBuffer)
+ return 1;
+ else if (buf instanceof FloatBuffer || buf instanceof IntBuffer)
+ return 2;
+ else if (buf instanceof LongBuffer || buf instanceof DoubleBuffer)
+ return 3;
+ else
+ throw new IllegalStateException("Unsupported buffer type: " + buf);
+ }
+
+ /**
+ * A helper function which is used to get the byte offset in an arbitrary buffer
+ * based on its position
+ * @return the position of the buffer, in BYTES
+ */
+ public static int getOffset(Buffer buffer) {
+ return buffer.position() << getElementSizeExponent(buffer);
+ }
+
+}
diff --git a/src/java/org/lwjgl/DefaultSysImplementation.java b/src/java/org/lwjgl/DefaultSysImplementation.java
index 98f7260..c52e777 100644
--- a/src/java/org/lwjgl/DefaultSysImplementation.java
+++ b/src/java/org/lwjgl/DefaultSysImplementation.java
@@ -1,56 +1,56 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl;
-
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3055 $
- * $Id: DefaultSysImplementation.java 3055 2008-04-30 14:58:47Z elias_naur $
- */
-abstract class DefaultSysImplementation implements SysImplementation {
- public native int getJNIVersion();
- public native void setDebug(boolean debug);
-
- public long getTimerResolution() {
- return 1000;
- }
-
- public boolean has64Bit() {
- return false;
- }
-
- public abstract long getTime();
- public abstract void alert(String title, String message);
- public abstract String getClipboard();
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl;
+
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3055 $
+ * $Id: DefaultSysImplementation.java 3055 2008-04-30 14:58:47Z elias_naur $
+ */
+abstract class DefaultSysImplementation implements SysImplementation {
+ public native int getJNIVersion();
+ public native void setDebug(boolean debug);
+
+ public long getTimerResolution() {
+ return 1000;
+ }
+
+ public boolean has64Bit() {
+ return false;
+ }
+
+ public abstract long getTime();
+ public abstract void alert(String title, String message);
+ public abstract String getClipboard();
+}
diff --git a/src/java/org/lwjgl/J2SESysImplementation.java b/src/java/org/lwjgl/J2SESysImplementation.java
index bf1b669..790c67c 100644
--- a/src/java/org/lwjgl/J2SESysImplementation.java
+++ b/src/java/org/lwjgl/J2SESysImplementation.java
@@ -1,73 +1,73 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl;
-
-import javax.swing.JOptionPane;
-import javax.swing.UIManager;
-
-/**
- * A SysImplementation which delegates as much as it can to J2SE.
- * <p>
- * @author $Author: matzon $
- * @version $Revision: 2983 $
- * $Id: J2SESysImplementation.java 2983 2008-04-07 18:36:09Z matzon $
- */
-abstract class J2SESysImplementation extends DefaultSysImplementation {
-
- public long getTime() {
- return System.currentTimeMillis();
- }
-
- public void alert(String title, String message) {
- try {
- UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
- } catch(Exception e) {
- LWJGLUtil.log("Caught exception while setting LAF: " + e);
- }
- JOptionPane.showMessageDialog(null, message, title, JOptionPane.WARNING_MESSAGE);
- }
-
- public String getClipboard() {
- try {
- java.awt.datatransfer.Clipboard clipboard = java.awt.Toolkit.getDefaultToolkit().getSystemClipboard();
- java.awt.datatransfer.Transferable transferable = clipboard.getContents(null);
- if (transferable.isDataFlavorSupported(java.awt.datatransfer.DataFlavor.stringFlavor)) {
- return (String)transferable.getTransferData(java.awt.datatransfer.DataFlavor.stringFlavor);
- }
- } catch (Exception e) {
- LWJGLUtil.log("Exception while getting clipboard: " + e);
- }
- return null;
- }
-
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl;
+
+import javax.swing.JOptionPane;
+import javax.swing.UIManager;
+
+/**
+ * A SysImplementation which delegates as much as it can to J2SE.
+ * <p>
+ * @author $Author: matzon $
+ * @version $Revision: 2983 $
+ * $Id: J2SESysImplementation.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+abstract class J2SESysImplementation extends DefaultSysImplementation {
+
+ public long getTime() {
+ return System.currentTimeMillis();
+ }
+
+ public void alert(String title, String message) {
+ try {
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch(Exception e) {
+ LWJGLUtil.log("Caught exception while setting LAF: " + e);
+ }
+ JOptionPane.showMessageDialog(null, message, title, JOptionPane.WARNING_MESSAGE);
+ }
+
+ public String getClipboard() {
+ try {
+ java.awt.datatransfer.Clipboard clipboard = java.awt.Toolkit.getDefaultToolkit().getSystemClipboard();
+ java.awt.datatransfer.Transferable transferable = clipboard.getContents(null);
+ if (transferable.isDataFlavorSupported(java.awt.datatransfer.DataFlavor.stringFlavor)) {
+ return (String)transferable.getTransferData(java.awt.datatransfer.DataFlavor.stringFlavor);
+ }
+ } catch (Exception e) {
+ LWJGLUtil.log("Exception while getting clipboard: " + e);
+ }
+ return null;
+ }
+
+
+}
diff --git a/src/java/org/lwjgl/LWJGLException.java b/src/java/org/lwjgl/LWJGLException.java
index d104152..9404e06 100644
--- a/src/java/org/lwjgl/LWJGLException.java
+++ b/src/java/org/lwjgl/LWJGLException.java
@@ -1,79 +1,79 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl;
-
-/**
- * <p>
- * This exception is supplied to make exception handling more generic for LWJGL
- * specific exceptions
- * </p>
- *
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 2983 $
- * $Id: LWJGLException.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public class LWJGLException extends Exception {
-
- private static final long serialVersionUID = 1L;
-
- /**
- * Plain c'tor
- */
- public LWJGLException() {
- super();
- }
-
- /**
- * Creates a new LWJGLException
- *
- * @param msg
- * String identifier for exception
- */
- public LWJGLException(String msg) {
- super(msg);
- }
-
- /**
- * @param message
- * @param cause
- */
- public LWJGLException(String message, Throwable cause) {
- super(message, cause);
- }
-
- /**
- * @param cause
- */
- public LWJGLException(Throwable cause) {
- super(cause);
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl;
+
+/**
+ * <p>
+ * This exception is supplied to make exception handling more generic for LWJGL
+ * specific exceptions
+ * </p>
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 2983 $
+ * $Id: LWJGLException.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public class LWJGLException extends Exception {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Plain c'tor
+ */
+ public LWJGLException() {
+ super();
+ }
+
+ /**
+ * Creates a new LWJGLException
+ *
+ * @param msg
+ * String identifier for exception
+ */
+ public LWJGLException(String msg) {
+ super(msg);
+ }
+
+ /**
+ * @param message
+ * @param cause
+ */
+ public LWJGLException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * @param cause
+ */
+ public LWJGLException(Throwable cause) {
+ super(cause);
+ }
+}
diff --git a/src/java/org/lwjgl/LWJGLUtil.java b/src/java/org/lwjgl/LWJGLUtil.java
index 3515478..86ab4f6 100644
--- a/src/java/org/lwjgl/LWJGLUtil.java
+++ b/src/java/org/lwjgl/LWJGLUtil.java
@@ -1,491 +1,491 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl;
-
-import java.io.File;
-import java.lang.reflect.Method;
-import java.nio.ByteBuffer;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-
-/**
- * <p>
- * Internal library methods
- * </p>
- *
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 2983 $
- * $Id: LWJGLUtil.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public class LWJGLUtil {
- public static final int PLATFORM_LINUX = 1;
- public static final int PLATFORM_MACOSX = 2;
- public static final int PLATFORM_WINDOWS = 3;
- public static final String PLATFORM_LINUX_NAME = "linux";
- public static final String PLATFORM_MACOSX_NAME = "macosx";
- public static final String PLATFORM_WINDOWS_NAME = "windows";
-
- /** LWJGL Logo - 16 by 16 pixels */
- public static final ByteBuffer LWJGLIcon16x16 = BufferUtils.createByteBuffer(16 * 16 * 4).put(new byte[] {
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, -1, -1, -62, -41, -24, -1, 116, -92, -53, -1, 80, -117,
- -67, -1, 84, -114, -65, -1, -122, -81, -46, -1, -25, -17, -10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -11, -11, -11, -1,
- -115, -113, -111, -1, 118, -126, -115, -1, 125, -115, -101, -1, -124, -103, -86, -1, -108, -73, -43, -1,
- 58, 125, -75, -1, 72, -122, -70, -1, -38, -25, -15, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -12, -8, -5, -1, -100, -98, -96, -1, 0, 0, 0, -1, 0, 0, 0, -1,
- 0, 0, 0, -1, 0, 0, 0, -1, -28, -28, -28, -1, -124, -83, -48, -1, 58, 125, -75, -1, 91, -110, -63, -1, -4,
- -3, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -111, -74, -43,
- -1, 95, 95, 95, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 34, 34, 34, -1, -1, -1, -1, -1, -24, -16, -10,
- -1, 57, 124, -75, -1, 58, 125, -75, -1, -60, -40, -23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -58, -39, -23, -1, -127, -85, -50, -1, 29, 29, 29, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0,
- -1, 102, 102, 102, -1, -1, -1, -1, -1, -48, -32, -19, -1, 58, 125, -75, -1, 58, 125, -75, -1, -115, -76,
- -44, -1, -1, -1, -1, -1, -14, -14, -14, -1, -91, -91, -91, -1, -33, -33, -33, -1, -94, -63, -36, -1, -80,
- -59, -42, -1, 10, 10, 10, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, -88, -88, -88, -1, -1, -1, -1, -1,
- -105, -70, -40, -1, 58, 125, -75, -1, 58, 125, -75, -1, 113, -95, -54, -1, -1, -1, -1, -1, -95, -95, -95,
- -1, 0, 0, 0, -1, 1, 1, 1, -1, 35, 35, 35, -1, -52, -52, -52, -1, -48, -48, -48, -1, -91, -91, -91, -1,
- -124, -124, -124, -1, 92, 92, 92, -1, -17, -17, -17, -1, -1, -1, -1, -1, 96, -106, -61, -1, 58, 125, -75,
- -1, 58, 125, -75, -1, 109, -98, -56, -1, -1, -1, -1, -1, 94, 94, 94, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0,
- -1, -49, -49, -49, -1, 31, 31, 31, -1, 3, 3, 3, -1, 43, 43, 43, -1, 108, 108, 108, -1, -58, -58, -58, -1,
- -6, -4, -3, -1, -98, -65, -38, -1, 119, -91, -52, -1, 76, -119, -68, -1, 124, -88, -50, -1, -1, -1, -1, -1,
- 27, 27, 27, -1, 0, 0, 0, -1, 0, 0, 0, -1, 23, 23, 23, -1, -42, -42, -42, -1, 1, 1, 1, -1, 0, 0, 0, -1, 0,
- 0, 0, -1, 0, 0, 0, -1, 82, 82, 82, -1, -27, -27, -27, -1, 61, 61, 61, -1, 104, 104, 104, -1, -90, -90, -89,
- -1, -38, -34, -31, -1, -1, -1, -1, -1, 116, 116, 116, -1, 14, 14, 14, -1, 0, 0, 0, -1, 89, 89, 89, -1,
- -107, -107, -107, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, -111, -111, -111, -1, -101, -101,
- -101, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 2, 2, 2, -1, 67, 67, 67, -1, -1, -1, -1, -1, -18, -18,
- -18, -1, -116, -116, -116, -1, -65, -65, -65, -1, 86, 86, 86, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0,
- 0, 0, -1, -45, -45, -45, -1, 88, 88, 88, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 51, 51,
- 51, -1, -1, -1, -1, -1, -1, -1, -1, -1, -4, -3, -2, -1, -1, -1, -1, -1, -64, -64, -64, -1, 64, 64, 64, -1,
- 2, 2, 2, -1, 0, 0, 0, -1, 27, 27, 27, -1, -5, -5, -5, -1, 23, 23, 23, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0,
- 0, -1, 0, 0, 0, -1, 120, 120, 120, -1, -1, -1, -1, -1, -1, -1, -1, -1, -46, -31, -18, -1, 126, -87, -50,
- -1, -32, -22, -13, -1, -1, -1, -1, -1, -44, -44, -44, -1, 109, 109, 109, -1, -124, -124, -124, -1, -45,
- -45, -45, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, -67, -67, -67, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -2, -2, -2, -1, 102, -102, -59, -1, 61, 127, -74, -1, -126, -84, -48, -1, -28, -19,
- -11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -27, -27, -27, -1, 45, 45, 45, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0,
- 0, -1, 12, 12, 12, -1, -10, -10, -10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -30, -20, -12,
- -1, 77, -119, -68, -1, 58, 125, -75, -1, 62, -128, -74, -1, -121, -80, -46, -1, -25, -17, -10, -1, -1, -1,
- -1, -1, -2, -2, -2, -1, -68, -68, -68, -1, 79, 79, 79, -1, 3, 3, 3, -1, 74, 74, 74, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -21, -14, -8, -1, -116, -77, -44, -1, 86, -112,
- -64, -1, 80, -116, -67, -1, 119, -91, -52, -1, -19, -13, -8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -33, -33, -33, -1, -26, -26, -26, -1, -1, -1, -1, -1
- });
-
- /** LWJGL Logo - 32 by 32 pixels */
- public static final ByteBuffer LWJGLIcon32x32 = BufferUtils.createByteBuffer(32 * 32 * 4).put(new byte[] {
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -6, -4, -3, -1, -53, -35,
- -20, -1, -109, -73, -42, -1, 111, -96, -55, -1, 92, -109, -62, -1, 96, -106, -61, -1, 122, -89, -51, -1,
- -84, -56, -32, -1, -19, -13, -8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -4, -3, -2, -1, -75, -50, -29, -1, 90, -110, -63, -1,
- 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1,
- 58, 125, -75, -1, 69, -123, -71, -1, -95, -63, -36, -1, -4, -3, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -4, -4, -4, -1, -30, -22, -15, -1, -72, -49, -29, -1, -82, -55, -32,
- -1, -93, -62, -36, -1, -104, -70, -40, -1, -116, -77, -45, -1, -127, -84, -49, -1, 110, -97, -56, -1, 61,
- 127, -74, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 114, -94, -54, -1, -11, -8, -5, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -40, -40, -40, -1, 49, 49, 49, -1, 36, 36, 36, -1, 49, 49, 49, -1, 64,
- 64, 64, -1, 82, 82, 82, -1, 101, 101, 101, -1, 116, 116, 116, -1, -113, -113, -113, -1, -9, -8, -8, -1,
- -84, -56, -33, -1, 59, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 121, -89, -51,
- -1, -4, -3, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -2, -2, -2, -1, 104, 104, 104, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0,
- 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, -74, -74, -74, -1, -2, -2, -2, -1, -122, -82,
- -47, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, -82, -54, -31, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -45, -30, -18,
- -1, -31, -22, -14, -1, 40, 40, 40, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0,
- 0, 0, -1, 0, 0, 0, -1, 2, 2, 2, -1, -34, -34, -34, -1, -1, -1, -1, -1, -11, -8, -5, -1, 91, -110, -63, -1,
- 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 72, -122, -70, -1, -12, -8, -5, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -20, -13, -8, -1, 100, -103, -59, -1, -41, -39, -37,
- -1, 5, 5, 5, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1,
- 36, 36, 36, -1, -2, -2, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -64, -43, -25, -1, 57, 124, -75, -1, 58,
- 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, -85, -56, -32, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -2, -1, -1, -1, 120, -90, -52, -1, 123, -89, -51, -1, -98, -98, -98, -1, 0, 0, 0, -1, 0, 0,
- 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 101, 101, 101, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -30, -20, -12, -1, 55, 123, -76, -1, 58, 125, -75, -1, 58, 125,
- -75, -1, 58, 125, -75, -1, 102, -102, -59, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -61,
- -41, -24, -1, 57, 125, -75, -1, -78, -52, -31, -1, 88, 88, 88, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1,
- 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, -87, -87, -87, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -68, -46, -27, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125,
- -75, -1, 64, -127, -73, -1, -18, -12, -7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -6, -4, -3, -1, 90, -110, -63, -1, 61,
- 127, -74, -1, -35, -27, -19, -1, 28, 28, 28, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0,
- 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 7, 7, 7, -1, -25, -25, -25, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -123, -82, -47, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 57,
- 125, -75, -1, -52, -34, -20, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -2,
- -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -70, -46, -27, -1, 58, 125, -75, -1, 87, -112, -65,
- -1, -48, -47, -47, -1, 3, 3, 3, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0,
- 0, -1, 0, 0, 0, -1, 51, 51, 51, -1, -3, -3, -3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -5, -4, -3, -1, 80,
- -117, -67, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 57, 125, -75, -1,
- -79, -52, -30, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -54, -54, -54, -1, 55, 55, 55, -1, 97,
- 97, 97, -1, -94, -94, -94, -1, -35, -35, -35, -1, -28, -20, -13, -1, -79, -53, -31, -1, -76, -51, -30, -1,
- -26, -26, -26, -1, 35, 35, 35, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0,
- 0, -1, 0, 0, 0, -1, 114, 114, 114, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -40, -27, -16, -1,
- 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1,
- -96, -64, -37, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 102, 102, 102, -1, 0, 0, 0, -1, 0, 0, 0,
- -1, 0, 0, 0, -1, 6, 6, 6, -1, 39, 39, 39, -1, 102, 102, 102, -1, -44, -44, -44, -1, -1, -1, -1, -1, -10,
- -10, -10, -1, -48, -48, -48, -1, -105, -105, -105, -1, 94, 94, 94, -1, 39, 39, 39, -1, 4, 4, 4, -1, 0, 0,
- 0, -1, 3, 3, 3, -1, -64, -64, -64, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -94, -63, -37, -1,
- 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1,
- -98, -65, -38, -1, -1, -1, -1, -1, -1, -1, -1, -1, -5, -5, -5, -1, 37, 37, 37, -1, 0, 0, 0, -1, 0, 0, 0,
- -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 92, 92, 92, -1, -1, -1, -1, -1, -22, -22, -22, -1,
- -113, -113, -113, -1, -75, -75, -75, -1, -23, -23, -23, -1, -3, -3, -3, -1, -25, -25, -25, -1, -78, -78,
- -78, -1, -67, -67, -67, -1, -2, -2, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 107, -99, -57,
- -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75,
- -1, -95, -63, -36, -1, -1, -1, -1, -1, -1, -1, -1, -1, -37, -37, -37, -1, 3, 3, 3, -1, 0, 0, 0, -1, 0, 0,
- 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, -125, -125, -125, -1, -1, -1, -1, -1, 95, 95,
- 95, -1, 0, 0, 0, -1, 0, 0, 0, -1, 11, 11, 11, -1, 55, 55, 55, -1, 118, 118, 118, -1, -73, -73, -73, -1,
- -16, -16, -16, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -16, -11, -7, -1, 75, -120, -69, -1, 61,
- 127, -74, -1, 57, 124, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1,
- -78, -52, -30, -1, -1, -1, -1, -1, -1, -1, -1, -1, -102, -102, -102, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0,
- -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, -59, -59, -59, -1, -9, -9, -9, -1, 29, 29, 29, -1,
- 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 7, 7, 7, -1, 60, 60, 60, -1,
- -33, -33, -33, -1, -1, -1, -1, -1, -5, -4, -3, -1, -4, -3, -2, -1, -13, -9, -6, -1, -52, -35, -21, -1, -98,
- -66, -38, -1, 114, -95, -55, -1, 76, -119, -69, -1, 58, 125, -75, -1, -55, -36, -21, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 86, 86, 86, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0,
- -1, 15, 15, 15, -1, -7, -7, -7, -1, -47, -47, -47, -1, 3, 3, 3, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1,
- 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, -114, -114, -114, -1, -1, -1, -1, -1, -7,
- -7, -7, -1, -124, -124, -124, -1, 112, 112, 112, -1, -80, -80, -80, -1, -22, -22, -22, -1, -1, -1, -1, -1,
- -7, -5, -4, -1, -36, -24, -14, -1, -10, -7, -4, -1, -1, -1, -1, -1, -1, -1, -1, -1, 21, 21, 21, -1, 0, 0,
- 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 78, 78, 78, -1, -1, -1, -1, -1,
- -111, -111, -111, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0,
- 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, -69, -69, -69, -1, -1, -1, -1, -1, -98, -98, -98, -1, 0, 0, 0, -1, 0, 0,
- 0, -1, 0, 0, 0, -1, 4, 4, 4, -1, 47, 47, 47, -1, 112, 112, 112, -1, -80, -80, -80, -1, -26, -26, -26, -1,
- -2, -2, -2, -1, -1, -1, -1, -1, 57, 57, 57, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0,
- 0, -1, 0, 0, 0, -1, -112, -112, -112, -1, -1, -1, -1, -1, 77, 77, 77, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0,
- 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 16, 16, 16, -1, -16, -16, -16, -1,
- -1, -1, -1, -1, 90, 90, 90, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0,
- -1, 0, 0, 0, -1, 9, 9, 9, -1, 50, 50, 50, -1, -79, -79, -79, -1, -10, -10, -10, -1, -95, -95, -95, -1, 53,
- 53, 53, -1, 2, 2, 2, -1, 0, 0, 0, -1, 0, 0, 0, -1, 2, 2, 2, -1, -47, -47, -47, -1, -11, -11, -11, -1, 19,
- 19, 19, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0,
- 0, 0, -1, 69, 69, 69, -1, -2, -2, -2, -1, -8, -8, -8, -1, 29, 29, 29, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0,
- 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 43, 43, 43, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -4, -4, -4, -1, -66, -66, -66, -1, 80, 80, 80, -1, 5, 5, 5, -1, 37, 37, 37, -1,
- -7, -7, -7, -1, -62, -62, -62, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0,
- 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, -122, -122, -122, -1, -1, -1, -1, -1, -46, -46, -46, -1, 1,
- 1, 1, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0,
- 0, -1, 0, 0, 0, -1, 67, 67, 67, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -2,
- -2, -1, -36, -36, -36, -1, -32, -32, -32, -1, -1, -1, -1, -1, -107, -107, -107, -1, 0, 0, 0, -1, 0, 0, 0,
- -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 1, 1, 1, -1, -56, -56,
- -56, -1, -1, -1, -1, -1, -114, -114, -114, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0,
- -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, -120, -120, -120, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -33, -33, -33, -1, 41, 41, 41, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0,
- 0, 0, -1, 0, 0, 0, -1, 24, 24, 24, -1, -11, -11, -11, -1, -1, -1, -1, -1, 74, 74, 74, -1, 0, 0, 0, -1, 0,
- 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0,
- 0, -1, -49, -49, -49, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -15, -10, -6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -7, -7, -7, -1, -75, -75, -75, -1, 75,
- 75, 75, -1, 6, 6, 6, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 82, 82, 82, -1, -1, -1, -1,
- -1, -8, -8, -8, -1, 16, 16, 16, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0,
- 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 28, 28, 28, -1, -8, -8, -8, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -122, -81, -47, -1, -112, -75, -43, -1, -22, -15, -9,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -37, -37, -37, -1, 120, 120, 120, -1,
- 27, 27, 27, -1, 0, 0, 0, -1, 0, 0, 0, -1, -106, -106, -106, -1, -1, -1, -1, -1, -58, -58, -58, -1, 0, 0, 0,
- -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1,
- 0, 0, 0, -1, 90, 90, 90, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -61, -40, -23, -1, 58, 125, -75, -1, 67, -125, -72, -1, -108, -72, -42, -1, -19, -13,
- -8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -12, -12, -12, -1, -89, -89, -89,
- -1, -123, -123, -123, -1, -12, -12, -12, -1, -1, -1, -1, -1, -122, -122, -122, -1, 0, 0, 0, -1, 0, 0, 0,
- -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1,
- -99, -99, -99, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -6, -5, -3, -1, 93, -108, -62, -1, 58, 125, -75, -1, 58, 125, -75, -1, 70, -123, -71, -1, -104,
- -69, -40, -1, -17, -12, -7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -101, -101, -101, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0,
- -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 5, 5, 5, -1, -35, -35, -35, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -59, -39, -23, -1, 59, 126, -74, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 72, -122, -70,
- -1, -98, -66, -38, -1, -14, -10, -6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -5, -5, -5, -1, -114, -114, -114, -1, 37, 37, 37, -1, 1, 1, 1, -1, 0, 0, 0, -1, 0, 0, 0,
- -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 44, 44, 44, -1, -4, -4, -4, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -113, -75, -43, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75,
- -1, 74, -121, -69, -1, -93, -62, -36, -1, -13, -9, -6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -6, -6, -6, -1, -80, -80, -80, -1, 69, 69, 69, -1, 4, 4, 4, -1, 0, 0, 0,
- -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 110, 110, 110, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -4, -3,
- -2, -1, -123, -81, -47, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58,
- 125, -75, -1, 58, 125, -75, -1, 77, -119, -68, -1, -88, -59, -34, -1, -10, -7, -4, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -2, -2, -1, -46, -46, -46, -1, 104, 104,
- 104, -1, 14, 14, 14, -1, 0, 0, 0, -1, 1, 1, 1, -1, -72, -72, -72, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -2, -2, -1, -1, -79, -53, -30, -1, 76, -119, -68, -1, 57, 125, -75, -1, 58, 125, -75, -1,
- 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 77, -119, -68, -1, -65, -44, -25,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -20, -20, -20, -1, -109, -109, -109, -1, -101, -101, -101, -1, -3, -3, -3, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -13, -9, -6, -1, -75, -50, -29, -1, -127,
- -84, -48, -1, 101, -103, -59, -1, 97, -105, -60, -1, 108, -98, -56, -1, -113, -75, -43, -1, -59, -39, -23,
- -1, -9, -6, -4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1
- });
-
- /** Debug flag. */
- public static final boolean DEBUG = getPrivilegedBoolean("org.lwjgl.util.Debug");
-
- static {
- LWJGLIcon16x16.flip();
- LWJGLIcon32x32.flip();
- }
-
- /**
- * @see #PLATFORM_WINDOWS
- * @see #PLATFORM_LINUX
- * @see #PLATFORM_MACOSX
- * @return the current platform type
- */
- public static int getPlatform() {
- String osName = getPrivilegedProperty("os.name");
-
- if (osName.startsWith("Windows")) {
- return PLATFORM_WINDOWS;
- } else if (osName.startsWith("Linux") || osName.startsWith("FreeBSD") || osName.startsWith("SunOS")) {
- return PLATFORM_LINUX;
- } else if (osName.startsWith("Mac OS X")) {
- return PLATFORM_MACOSX;
- } else {
- throw new LinkageError("Unknown platform: " + osName);
- }
- }
-
-
- /**
- * @see #PLATFORM_WINDOWS_NAME
- * @see #PLATFORM_LINUX_NAME
- * @see #PLATFORM_MACOSX_NAME
- * @return current platform name
- */
- public static String getPlatformName() {
- switch (LWJGLUtil.getPlatform()) {
- case LWJGLUtil.PLATFORM_LINUX:
- return PLATFORM_LINUX_NAME;
- case LWJGLUtil.PLATFORM_MACOSX:
- return PLATFORM_MACOSX_NAME;
- case LWJGLUtil.PLATFORM_WINDOWS:
- return PLATFORM_WINDOWS_NAME;
- default:
- return "unknown";
- }
- }
-
- /**
- * Locates the paths required by a library.
- *
- * @param libname Local Library Name to search the classloader with ("openal").
- * @param platform_lib_name The native library name ("libopenal.so")
- * @param classloader The classloader to ask for library paths
- * @return Paths to located libraries, if any
- */
- public static String[] getLibraryPaths(String libname, String platform_lib_name, ClassLoader classloader) {
- return getLibraryPaths(libname, new String[]{platform_lib_name}, classloader);
- }
-
- /**
- * Locates the paths required by a library.
- *
- * @param libname Local Library Name to search the classloader with ("openal").
- * @param platform_lib_names The list of possible library names ("libopenal.so")
- * @param classloader The classloader to ask for library paths
- * @return Paths to located libraries, if any
- */
- public static String[] getLibraryPaths(String libname, String[] platform_lib_names, ClassLoader classloader) {
- // need to pass path of possible locations of library to native side
- List possible_paths = new ArrayList();
-
- String classloader_path = getPathFromClassLoader(libname, classloader);
- if (classloader_path != null) {
- log("getPathFromClassLoader: Path found: " + classloader_path);
- possible_paths.add(classloader_path);
- }
-
- for (int i = 0; i < platform_lib_names.length; i++) {
- String platform_lib_name = platform_lib_names[i];
- String lwjgl_classloader_path = getPathFromClassLoader("lwjgl", classloader);
- if (lwjgl_classloader_path != null) {
- log("getPathFromClassLoader: Path found: " + lwjgl_classloader_path);
- possible_paths.add(lwjgl_classloader_path.substring(0, lwjgl_classloader_path.lastIndexOf(File.separator))
- + File.separator + platform_lib_name);
- }
-
- // add Installer path
- String alternative_path = getPrivilegedProperty("org.lwjgl.librarypath");
- if (alternative_path != null) {
- possible_paths.add(alternative_path + File.separator + platform_lib_name);
- }
-
- // Add all possible paths from java.library.path
- String java_library_path = getPrivilegedProperty("java.library.path");
-
- StringTokenizer st = new StringTokenizer(java_library_path, File.pathSeparator);
- while (st.hasMoreTokens()) {
- String path = st.nextToken();
- possible_paths.add(path + File.separator + platform_lib_name);
- }
-
- //add current path
- String current_dir = getPrivilegedProperty("user.dir");
- possible_paths.add(current_dir + File.separator + platform_lib_name);
-
- //add pure library (no path, let OS search)
- possible_paths.add(platform_lib_name);
- }
-
- //create needed string array
- String[] paths = new String[possible_paths.size()];
- possible_paths.toArray(paths);
- return paths;
- }
-
- static void execPrivileged(final String[] cmd_array) throws Exception {
- try {
- Process process = (Process)AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws Exception {
- return Runtime.getRuntime().exec(cmd_array);
- }
- });
- // Close unused streams to make sure the child process won't hang
- process.getInputStream().close();
- process.getOutputStream().close();
- process.getErrorStream().close();
- } catch (PrivilegedActionException e) {
- throw (Exception)e.getCause();
- }
- }
-
- private static String getPrivilegedProperty(final String property_name) {
- return (String)AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return System.getProperty(property_name);
- }
- });
- }
-
- /**
- * Tries to locate named library from the current ClassLoader
- * This method exists because native libraries are loaded from native code, and as such
- * is exempt from ClassLoader library loading rutines. It therefore always fails.
- * We therefore invoke the protected method of the ClassLoader to see if it can
- * locate it.
- *
- * @param libname Name of library to search for
- * @param classloader Classloader to use
- * @return Absolute path to library if found, otherwise null
- */
- private static String getPathFromClassLoader(final String libname, final ClassLoader classloader) {
- try {
- log("getPathFromClassLoader: searching for: " + libname);
- Class c = classloader.getClass();
- while (c != null) {
- final Class clazz = c;
- try {
- return (String)AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws Exception {
- Method findLibrary = clazz.getDeclaredMethod("findLibrary", new Class[]{String.class});
- findLibrary.setAccessible(true);
- Object[] arguments = new Object[] {libname};
- String path = (String)findLibrary.invoke(classloader, arguments);
- return path;
- }
- });
- } catch (PrivilegedActionException e) {
- log("Failed to locate findLibrary method: " + e.getCause());
- c = c.getSuperclass();
- }
- }
- } catch (Exception e) {
- log("Failure locating " + e + " using classloader:" + e);
- }
- return null;
- }
-
- /**
- * Gets a boolean property as a privileged action.
- */
- private static boolean getPrivilegedBoolean(final String property_name) {
- Boolean value = (Boolean)AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return new Boolean(Boolean.getBoolean(property_name));
- }
- });
- return value.booleanValue();
- }
-
- /**
- * Prints the given message to System.err if DEBUG is true.
- *
- * @param msg Message to print
- */
- public static void log(String msg) {
- if (DEBUG) {
- System.err.println(msg);
- }
- }
-
- /**
- * Method to determine if the current system is running a version of
- * Mac OS X better than the given version. This is only useful for Mac OS X
- * specific code and will not work for any other platform.
- */
- public static boolean isMacOSXEqualsOrBetterThan(int major_required, int minor_required) {
- String os_version = getPrivilegedProperty("os.version");
- StringTokenizer version_tokenizer = new StringTokenizer(os_version, ".");
- int major;
- int minor;
- try {
- String major_str = version_tokenizer.nextToken();
- String minor_str = version_tokenizer.nextToken();
- major = Integer.parseInt(major_str);
- minor = Integer.parseInt(minor_str);
- } catch (Exception e) {
- LWJGLUtil.log("Exception occurred while trying to determine OS version: " + e);
- // Best guess, no
- return false;
- }
- return major > major_required || (major == major_required && minor >= minor_required);
- }
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl;
+
+import java.io.File;
+import java.lang.reflect.Method;
+import java.nio.ByteBuffer;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+
+/**
+ * <p>
+ * Internal library methods
+ * </p>
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 2983 $
+ * $Id: LWJGLUtil.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public class LWJGLUtil {
+ public static final int PLATFORM_LINUX = 1;
+ public static final int PLATFORM_MACOSX = 2;
+ public static final int PLATFORM_WINDOWS = 3;
+ public static final String PLATFORM_LINUX_NAME = "linux";
+ public static final String PLATFORM_MACOSX_NAME = "macosx";
+ public static final String PLATFORM_WINDOWS_NAME = "windows";
+
+ /** LWJGL Logo - 16 by 16 pixels */
+ public static final ByteBuffer LWJGLIcon16x16 = BufferUtils.createByteBuffer(16 * 16 * 4).put(new byte[] {
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, -1, -1, -62, -41, -24, -1, 116, -92, -53, -1, 80, -117,
+ -67, -1, 84, -114, -65, -1, -122, -81, -46, -1, -25, -17, -10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -11, -11, -11, -1,
+ -115, -113, -111, -1, 118, -126, -115, -1, 125, -115, -101, -1, -124, -103, -86, -1, -108, -73, -43, -1,
+ 58, 125, -75, -1, 72, -122, -70, -1, -38, -25, -15, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -12, -8, -5, -1, -100, -98, -96, -1, 0, 0, 0, -1, 0, 0, 0, -1,
+ 0, 0, 0, -1, 0, 0, 0, -1, -28, -28, -28, -1, -124, -83, -48, -1, 58, 125, -75, -1, 91, -110, -63, -1, -4,
+ -3, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -111, -74, -43,
+ -1, 95, 95, 95, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 34, 34, 34, -1, -1, -1, -1, -1, -24, -16, -10,
+ -1, 57, 124, -75, -1, 58, 125, -75, -1, -60, -40, -23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -58, -39, -23, -1, -127, -85, -50, -1, 29, 29, 29, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0,
+ -1, 102, 102, 102, -1, -1, -1, -1, -1, -48, -32, -19, -1, 58, 125, -75, -1, 58, 125, -75, -1, -115, -76,
+ -44, -1, -1, -1, -1, -1, -14, -14, -14, -1, -91, -91, -91, -1, -33, -33, -33, -1, -94, -63, -36, -1, -80,
+ -59, -42, -1, 10, 10, 10, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, -88, -88, -88, -1, -1, -1, -1, -1,
+ -105, -70, -40, -1, 58, 125, -75, -1, 58, 125, -75, -1, 113, -95, -54, -1, -1, -1, -1, -1, -95, -95, -95,
+ -1, 0, 0, 0, -1, 1, 1, 1, -1, 35, 35, 35, -1, -52, -52, -52, -1, -48, -48, -48, -1, -91, -91, -91, -1,
+ -124, -124, -124, -1, 92, 92, 92, -1, -17, -17, -17, -1, -1, -1, -1, -1, 96, -106, -61, -1, 58, 125, -75,
+ -1, 58, 125, -75, -1, 109, -98, -56, -1, -1, -1, -1, -1, 94, 94, 94, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0,
+ -1, -49, -49, -49, -1, 31, 31, 31, -1, 3, 3, 3, -1, 43, 43, 43, -1, 108, 108, 108, -1, -58, -58, -58, -1,
+ -6, -4, -3, -1, -98, -65, -38, -1, 119, -91, -52, -1, 76, -119, -68, -1, 124, -88, -50, -1, -1, -1, -1, -1,
+ 27, 27, 27, -1, 0, 0, 0, -1, 0, 0, 0, -1, 23, 23, 23, -1, -42, -42, -42, -1, 1, 1, 1, -1, 0, 0, 0, -1, 0,
+ 0, 0, -1, 0, 0, 0, -1, 82, 82, 82, -1, -27, -27, -27, -1, 61, 61, 61, -1, 104, 104, 104, -1, -90, -90, -89,
+ -1, -38, -34, -31, -1, -1, -1, -1, -1, 116, 116, 116, -1, 14, 14, 14, -1, 0, 0, 0, -1, 89, 89, 89, -1,
+ -107, -107, -107, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, -111, -111, -111, -1, -101, -101,
+ -101, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 2, 2, 2, -1, 67, 67, 67, -1, -1, -1, -1, -1, -18, -18,
+ -18, -1, -116, -116, -116, -1, -65, -65, -65, -1, 86, 86, 86, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0,
+ 0, 0, -1, -45, -45, -45, -1, 88, 88, 88, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 51, 51,
+ 51, -1, -1, -1, -1, -1, -1, -1, -1, -1, -4, -3, -2, -1, -1, -1, -1, -1, -64, -64, -64, -1, 64, 64, 64, -1,
+ 2, 2, 2, -1, 0, 0, 0, -1, 27, 27, 27, -1, -5, -5, -5, -1, 23, 23, 23, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0,
+ 0, -1, 0, 0, 0, -1, 120, 120, 120, -1, -1, -1, -1, -1, -1, -1, -1, -1, -46, -31, -18, -1, 126, -87, -50,
+ -1, -32, -22, -13, -1, -1, -1, -1, -1, -44, -44, -44, -1, 109, 109, 109, -1, -124, -124, -124, -1, -45,
+ -45, -45, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, -67, -67, -67, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -2, -2, -2, -1, 102, -102, -59, -1, 61, 127, -74, -1, -126, -84, -48, -1, -28, -19,
+ -11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -27, -27, -27, -1, 45, 45, 45, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0,
+ 0, -1, 12, 12, 12, -1, -10, -10, -10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -30, -20, -12,
+ -1, 77, -119, -68, -1, 58, 125, -75, -1, 62, -128, -74, -1, -121, -80, -46, -1, -25, -17, -10, -1, -1, -1,
+ -1, -1, -2, -2, -2, -1, -68, -68, -68, -1, 79, 79, 79, -1, 3, 3, 3, -1, 74, 74, 74, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -21, -14, -8, -1, -116, -77, -44, -1, 86, -112,
+ -64, -1, 80, -116, -67, -1, 119, -91, -52, -1, -19, -13, -8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -33, -33, -33, -1, -26, -26, -26, -1, -1, -1, -1, -1
+ });
+
+ /** LWJGL Logo - 32 by 32 pixels */
+ public static final ByteBuffer LWJGLIcon32x32 = BufferUtils.createByteBuffer(32 * 32 * 4).put(new byte[] {
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -6, -4, -3, -1, -53, -35,
+ -20, -1, -109, -73, -42, -1, 111, -96, -55, -1, 92, -109, -62, -1, 96, -106, -61, -1, 122, -89, -51, -1,
+ -84, -56, -32, -1, -19, -13, -8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -4, -3, -2, -1, -75, -50, -29, -1, 90, -110, -63, -1,
+ 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1,
+ 58, 125, -75, -1, 69, -123, -71, -1, -95, -63, -36, -1, -4, -3, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -4, -4, -4, -1, -30, -22, -15, -1, -72, -49, -29, -1, -82, -55, -32,
+ -1, -93, -62, -36, -1, -104, -70, -40, -1, -116, -77, -45, -1, -127, -84, -49, -1, 110, -97, -56, -1, 61,
+ 127, -74, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 114, -94, -54, -1, -11, -8, -5, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -40, -40, -40, -1, 49, 49, 49, -1, 36, 36, 36, -1, 49, 49, 49, -1, 64,
+ 64, 64, -1, 82, 82, 82, -1, 101, 101, 101, -1, 116, 116, 116, -1, -113, -113, -113, -1, -9, -8, -8, -1,
+ -84, -56, -33, -1, 59, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 121, -89, -51,
+ -1, -4, -3, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -2, -2, -2, -1, 104, 104, 104, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0,
+ 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, -74, -74, -74, -1, -2, -2, -2, -1, -122, -82,
+ -47, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, -82, -54, -31, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -45, -30, -18,
+ -1, -31, -22, -14, -1, 40, 40, 40, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0,
+ 0, 0, -1, 0, 0, 0, -1, 2, 2, 2, -1, -34, -34, -34, -1, -1, -1, -1, -1, -11, -8, -5, -1, 91, -110, -63, -1,
+ 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 72, -122, -70, -1, -12, -8, -5, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -20, -13, -8, -1, 100, -103, -59, -1, -41, -39, -37,
+ -1, 5, 5, 5, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1,
+ 36, 36, 36, -1, -2, -2, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -64, -43, -25, -1, 57, 124, -75, -1, 58,
+ 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, -85, -56, -32, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -2, -1, -1, -1, 120, -90, -52, -1, 123, -89, -51, -1, -98, -98, -98, -1, 0, 0, 0, -1, 0, 0,
+ 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 101, 101, 101, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -30, -20, -12, -1, 55, 123, -76, -1, 58, 125, -75, -1, 58, 125,
+ -75, -1, 58, 125, -75, -1, 102, -102, -59, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -61,
+ -41, -24, -1, 57, 125, -75, -1, -78, -52, -31, -1, 88, 88, 88, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1,
+ 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, -87, -87, -87, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -68, -46, -27, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125,
+ -75, -1, 64, -127, -73, -1, -18, -12, -7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -6, -4, -3, -1, 90, -110, -63, -1, 61,
+ 127, -74, -1, -35, -27, -19, -1, 28, 28, 28, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0,
+ 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 7, 7, 7, -1, -25, -25, -25, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -123, -82, -47, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 57,
+ 125, -75, -1, -52, -34, -20, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -2,
+ -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -70, -46, -27, -1, 58, 125, -75, -1, 87, -112, -65,
+ -1, -48, -47, -47, -1, 3, 3, 3, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0,
+ 0, -1, 0, 0, 0, -1, 51, 51, 51, -1, -3, -3, -3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -5, -4, -3, -1, 80,
+ -117, -67, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 57, 125, -75, -1,
+ -79, -52, -30, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -54, -54, -54, -1, 55, 55, 55, -1, 97,
+ 97, 97, -1, -94, -94, -94, -1, -35, -35, -35, -1, -28, -20, -13, -1, -79, -53, -31, -1, -76, -51, -30, -1,
+ -26, -26, -26, -1, 35, 35, 35, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0,
+ 0, -1, 0, 0, 0, -1, 114, 114, 114, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -40, -27, -16, -1,
+ 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1,
+ -96, -64, -37, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 102, 102, 102, -1, 0, 0, 0, -1, 0, 0, 0,
+ -1, 0, 0, 0, -1, 6, 6, 6, -1, 39, 39, 39, -1, 102, 102, 102, -1, -44, -44, -44, -1, -1, -1, -1, -1, -10,
+ -10, -10, -1, -48, -48, -48, -1, -105, -105, -105, -1, 94, 94, 94, -1, 39, 39, 39, -1, 4, 4, 4, -1, 0, 0,
+ 0, -1, 3, 3, 3, -1, -64, -64, -64, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -94, -63, -37, -1,
+ 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1,
+ -98, -65, -38, -1, -1, -1, -1, -1, -1, -1, -1, -1, -5, -5, -5, -1, 37, 37, 37, -1, 0, 0, 0, -1, 0, 0, 0,
+ -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 92, 92, 92, -1, -1, -1, -1, -1, -22, -22, -22, -1,
+ -113, -113, -113, -1, -75, -75, -75, -1, -23, -23, -23, -1, -3, -3, -3, -1, -25, -25, -25, -1, -78, -78,
+ -78, -1, -67, -67, -67, -1, -2, -2, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 107, -99, -57,
+ -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75,
+ -1, -95, -63, -36, -1, -1, -1, -1, -1, -1, -1, -1, -1, -37, -37, -37, -1, 3, 3, 3, -1, 0, 0, 0, -1, 0, 0,
+ 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, -125, -125, -125, -1, -1, -1, -1, -1, 95, 95,
+ 95, -1, 0, 0, 0, -1, 0, 0, 0, -1, 11, 11, 11, -1, 55, 55, 55, -1, 118, 118, 118, -1, -73, -73, -73, -1,
+ -16, -16, -16, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -16, -11, -7, -1, 75, -120, -69, -1, 61,
+ 127, -74, -1, 57, 124, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1,
+ -78, -52, -30, -1, -1, -1, -1, -1, -1, -1, -1, -1, -102, -102, -102, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0,
+ -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, -59, -59, -59, -1, -9, -9, -9, -1, 29, 29, 29, -1,
+ 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 7, 7, 7, -1, 60, 60, 60, -1,
+ -33, -33, -33, -1, -1, -1, -1, -1, -5, -4, -3, -1, -4, -3, -2, -1, -13, -9, -6, -1, -52, -35, -21, -1, -98,
+ -66, -38, -1, 114, -95, -55, -1, 76, -119, -69, -1, 58, 125, -75, -1, -55, -36, -21, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 86, 86, 86, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0,
+ -1, 15, 15, 15, -1, -7, -7, -7, -1, -47, -47, -47, -1, 3, 3, 3, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1,
+ 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, -114, -114, -114, -1, -1, -1, -1, -1, -7,
+ -7, -7, -1, -124, -124, -124, -1, 112, 112, 112, -1, -80, -80, -80, -1, -22, -22, -22, -1, -1, -1, -1, -1,
+ -7, -5, -4, -1, -36, -24, -14, -1, -10, -7, -4, -1, -1, -1, -1, -1, -1, -1, -1, -1, 21, 21, 21, -1, 0, 0,
+ 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 78, 78, 78, -1, -1, -1, -1, -1,
+ -111, -111, -111, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0,
+ 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, -69, -69, -69, -1, -1, -1, -1, -1, -98, -98, -98, -1, 0, 0, 0, -1, 0, 0,
+ 0, -1, 0, 0, 0, -1, 4, 4, 4, -1, 47, 47, 47, -1, 112, 112, 112, -1, -80, -80, -80, -1, -26, -26, -26, -1,
+ -2, -2, -2, -1, -1, -1, -1, -1, 57, 57, 57, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0,
+ 0, -1, 0, 0, 0, -1, -112, -112, -112, -1, -1, -1, -1, -1, 77, 77, 77, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0,
+ 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 16, 16, 16, -1, -16, -16, -16, -1,
+ -1, -1, -1, -1, 90, 90, 90, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0,
+ -1, 0, 0, 0, -1, 9, 9, 9, -1, 50, 50, 50, -1, -79, -79, -79, -1, -10, -10, -10, -1, -95, -95, -95, -1, 53,
+ 53, 53, -1, 2, 2, 2, -1, 0, 0, 0, -1, 0, 0, 0, -1, 2, 2, 2, -1, -47, -47, -47, -1, -11, -11, -11, -1, 19,
+ 19, 19, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0,
+ 0, 0, -1, 69, 69, 69, -1, -2, -2, -2, -1, -8, -8, -8, -1, 29, 29, 29, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0,
+ 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 43, 43, 43, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -4, -4, -4, -1, -66, -66, -66, -1, 80, 80, 80, -1, 5, 5, 5, -1, 37, 37, 37, -1,
+ -7, -7, -7, -1, -62, -62, -62, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0,
+ 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, -122, -122, -122, -1, -1, -1, -1, -1, -46, -46, -46, -1, 1,
+ 1, 1, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0,
+ 0, -1, 0, 0, 0, -1, 67, 67, 67, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -2,
+ -2, -1, -36, -36, -36, -1, -32, -32, -32, -1, -1, -1, -1, -1, -107, -107, -107, -1, 0, 0, 0, -1, 0, 0, 0,
+ -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 1, 1, 1, -1, -56, -56,
+ -56, -1, -1, -1, -1, -1, -114, -114, -114, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0,
+ -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, -120, -120, -120, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -33, -33, -33, -1, 41, 41, 41, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0,
+ 0, 0, -1, 0, 0, 0, -1, 24, 24, 24, -1, -11, -11, -11, -1, -1, -1, -1, -1, 74, 74, 74, -1, 0, 0, 0, -1, 0,
+ 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0,
+ 0, -1, -49, -49, -49, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -15, -10, -6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -7, -7, -7, -1, -75, -75, -75, -1, 75,
+ 75, 75, -1, 6, 6, 6, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 82, 82, 82, -1, -1, -1, -1,
+ -1, -8, -8, -8, -1, 16, 16, 16, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0,
+ 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 28, 28, 28, -1, -8, -8, -8, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -122, -81, -47, -1, -112, -75, -43, -1, -22, -15, -9,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -37, -37, -37, -1, 120, 120, 120, -1,
+ 27, 27, 27, -1, 0, 0, 0, -1, 0, 0, 0, -1, -106, -106, -106, -1, -1, -1, -1, -1, -58, -58, -58, -1, 0, 0, 0,
+ -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1,
+ 0, 0, 0, -1, 90, 90, 90, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -61, -40, -23, -1, 58, 125, -75, -1, 67, -125, -72, -1, -108, -72, -42, -1, -19, -13,
+ -8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -12, -12, -12, -1, -89, -89, -89,
+ -1, -123, -123, -123, -1, -12, -12, -12, -1, -1, -1, -1, -1, -122, -122, -122, -1, 0, 0, 0, -1, 0, 0, 0,
+ -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1,
+ -99, -99, -99, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -6, -5, -3, -1, 93, -108, -62, -1, 58, 125, -75, -1, 58, 125, -75, -1, 70, -123, -71, -1, -104,
+ -69, -40, -1, -17, -12, -7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -101, -101, -101, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0,
+ -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 5, 5, 5, -1, -35, -35, -35, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -59, -39, -23, -1, 59, 126, -74, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 72, -122, -70,
+ -1, -98, -66, -38, -1, -14, -10, -6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -5, -5, -5, -1, -114, -114, -114, -1, 37, 37, 37, -1, 1, 1, 1, -1, 0, 0, 0, -1, 0, 0, 0,
+ -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 44, 44, 44, -1, -4, -4, -4, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -113, -75, -43, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75,
+ -1, 74, -121, -69, -1, -93, -62, -36, -1, -13, -9, -6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -6, -6, -6, -1, -80, -80, -80, -1, 69, 69, 69, -1, 4, 4, 4, -1, 0, 0, 0,
+ -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 110, 110, 110, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -4, -3,
+ -2, -1, -123, -81, -47, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58,
+ 125, -75, -1, 58, 125, -75, -1, 77, -119, -68, -1, -88, -59, -34, -1, -10, -7, -4, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -2, -2, -1, -46, -46, -46, -1, 104, 104,
+ 104, -1, 14, 14, 14, -1, 0, 0, 0, -1, 1, 1, 1, -1, -72, -72, -72, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -2, -2, -1, -1, -79, -53, -30, -1, 76, -119, -68, -1, 57, 125, -75, -1, 58, 125, -75, -1,
+ 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 58, 125, -75, -1, 77, -119, -68, -1, -65, -44, -25,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -20, -20, -20, -1, -109, -109, -109, -1, -101, -101, -101, -1, -3, -3, -3, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -13, -9, -6, -1, -75, -50, -29, -1, -127,
+ -84, -48, -1, 101, -103, -59, -1, 97, -105, -60, -1, 108, -98, -56, -1, -113, -75, -43, -1, -59, -39, -23,
+ -1, -9, -6, -4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1
+ });
+
+ /** Debug flag. */
+ public static final boolean DEBUG = getPrivilegedBoolean("org.lwjgl.util.Debug");
+
+ static {
+ LWJGLIcon16x16.flip();
+ LWJGLIcon32x32.flip();
+ }
+
+ /**
+ * @see #PLATFORM_WINDOWS
+ * @see #PLATFORM_LINUX
+ * @see #PLATFORM_MACOSX
+ * @return the current platform type
+ */
+ public static int getPlatform() {
+ String osName = getPrivilegedProperty("os.name");
+
+ if (osName.startsWith("Windows")) {
+ return PLATFORM_WINDOWS;
+ } else if (osName.startsWith("Linux") || osName.startsWith("FreeBSD") || osName.startsWith("SunOS")) {
+ return PLATFORM_LINUX;
+ } else if (osName.startsWith("Mac OS X")) {
+ return PLATFORM_MACOSX;
+ } else {
+ throw new LinkageError("Unknown platform: " + osName);
+ }
+ }
+
+
+ /**
+ * @see #PLATFORM_WINDOWS_NAME
+ * @see #PLATFORM_LINUX_NAME
+ * @see #PLATFORM_MACOSX_NAME
+ * @return current platform name
+ */
+ public static String getPlatformName() {
+ switch (LWJGLUtil.getPlatform()) {
+ case LWJGLUtil.PLATFORM_LINUX:
+ return PLATFORM_LINUX_NAME;
+ case LWJGLUtil.PLATFORM_MACOSX:
+ return PLATFORM_MACOSX_NAME;
+ case LWJGLUtil.PLATFORM_WINDOWS:
+ return PLATFORM_WINDOWS_NAME;
+ default:
+ return "unknown";
+ }
+ }
+
+ /**
+ * Locates the paths required by a library.
+ *
+ * @param libname Local Library Name to search the classloader with ("openal").
+ * @param platform_lib_name The native library name ("libopenal.so")
+ * @param classloader The classloader to ask for library paths
+ * @return Paths to located libraries, if any
+ */
+ public static String[] getLibraryPaths(String libname, String platform_lib_name, ClassLoader classloader) {
+ return getLibraryPaths(libname, new String[]{platform_lib_name}, classloader);
+ }
+
+ /**
+ * Locates the paths required by a library.
+ *
+ * @param libname Local Library Name to search the classloader with ("openal").
+ * @param platform_lib_names The list of possible library names ("libopenal.so")
+ * @param classloader The classloader to ask for library paths
+ * @return Paths to located libraries, if any
+ */
+ public static String[] getLibraryPaths(String libname, String[] platform_lib_names, ClassLoader classloader) {
+ // need to pass path of possible locations of library to native side
+ List possible_paths = new ArrayList();
+
+ String classloader_path = getPathFromClassLoader(libname, classloader);
+ if (classloader_path != null) {
+ log("getPathFromClassLoader: Path found: " + classloader_path);
+ possible_paths.add(classloader_path);
+ }
+
+ for (int i = 0; i < platform_lib_names.length; i++) {
+ String platform_lib_name = platform_lib_names[i];
+ String lwjgl_classloader_path = getPathFromClassLoader("lwjgl", classloader);
+ if (lwjgl_classloader_path != null) {
+ log("getPathFromClassLoader: Path found: " + lwjgl_classloader_path);
+ possible_paths.add(lwjgl_classloader_path.substring(0, lwjgl_classloader_path.lastIndexOf(File.separator))
+ + File.separator + platform_lib_name);
+ }
+
+ // add Installer path
+ String alternative_path = getPrivilegedProperty("org.lwjgl.librarypath");
+ if (alternative_path != null) {
+ possible_paths.add(alternative_path + File.separator + platform_lib_name);
+ }
+
+ // Add all possible paths from java.library.path
+ String java_library_path = getPrivilegedProperty("java.library.path");
+
+ StringTokenizer st = new StringTokenizer(java_library_path, File.pathSeparator);
+ while (st.hasMoreTokens()) {
+ String path = st.nextToken();
+ possible_paths.add(path + File.separator + platform_lib_name);
+ }
+
+ //add current path
+ String current_dir = getPrivilegedProperty("user.dir");
+ possible_paths.add(current_dir + File.separator + platform_lib_name);
+
+ //add pure library (no path, let OS search)
+ possible_paths.add(platform_lib_name);
+ }
+
+ //create needed string array
+ String[] paths = new String[possible_paths.size()];
+ possible_paths.toArray(paths);
+ return paths;
+ }
+
+ static void execPrivileged(final String[] cmd_array) throws Exception {
+ try {
+ Process process = (Process)AccessController.doPrivileged(new PrivilegedExceptionAction() {
+ public Object run() throws Exception {
+ return Runtime.getRuntime().exec(cmd_array);
+ }
+ });
+ // Close unused streams to make sure the child process won't hang
+ process.getInputStream().close();
+ process.getOutputStream().close();
+ process.getErrorStream().close();
+ } catch (PrivilegedActionException e) {
+ throw (Exception)e.getCause();
+ }
+ }
+
+ private static String getPrivilegedProperty(final String property_name) {
+ return (String)AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ return System.getProperty(property_name);
+ }
+ });
+ }
+
+ /**
+ * Tries to locate named library from the current ClassLoader
+ * This method exists because native libraries are loaded from native code, and as such
+ * is exempt from ClassLoader library loading rutines. It therefore always fails.
+ * We therefore invoke the protected method of the ClassLoader to see if it can
+ * locate it.
+ *
+ * @param libname Name of library to search for
+ * @param classloader Classloader to use
+ * @return Absolute path to library if found, otherwise null
+ */
+ private static String getPathFromClassLoader(final String libname, final ClassLoader classloader) {
+ try {
+ log("getPathFromClassLoader: searching for: " + libname);
+ Class c = classloader.getClass();
+ while (c != null) {
+ final Class clazz = c;
+ try {
+ return (String)AccessController.doPrivileged(new PrivilegedExceptionAction() {
+ public Object run() throws Exception {
+ Method findLibrary = clazz.getDeclaredMethod("findLibrary", new Class[]{String.class});
+ findLibrary.setAccessible(true);
+ Object[] arguments = new Object[] {libname};
+ String path = (String)findLibrary.invoke(classloader, arguments);
+ return path;
+ }
+ });
+ } catch (PrivilegedActionException e) {
+ log("Failed to locate findLibrary method: " + e.getCause());
+ c = c.getSuperclass();
+ }
+ }
+ } catch (Exception e) {
+ log("Failure locating " + e + " using classloader:" + e);
+ }
+ return null;
+ }
+
+ /**
+ * Gets a boolean property as a privileged action.
+ */
+ private static boolean getPrivilegedBoolean(final String property_name) {
+ Boolean value = (Boolean)AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ return new Boolean(Boolean.getBoolean(property_name));
+ }
+ });
+ return value.booleanValue();
+ }
+
+ /**
+ * Prints the given message to System.err if DEBUG is true.
+ *
+ * @param msg Message to print
+ */
+ public static void log(String msg) {
+ if (DEBUG) {
+ System.err.println(msg);
+ }
+ }
+
+ /**
+ * Method to determine if the current system is running a version of
+ * Mac OS X better than the given version. This is only useful for Mac OS X
+ * specific code and will not work for any other platform.
+ */
+ public static boolean isMacOSXEqualsOrBetterThan(int major_required, int minor_required) {
+ String os_version = getPrivilegedProperty("os.version");
+ StringTokenizer version_tokenizer = new StringTokenizer(os_version, ".");
+ int major;
+ int minor;
+ try {
+ String major_str = version_tokenizer.nextToken();
+ String minor_str = version_tokenizer.nextToken();
+ major = Integer.parseInt(major_str);
+ minor = Integer.parseInt(minor_str);
+ } catch (Exception e) {
+ LWJGLUtil.log("Exception occurred while trying to determine OS version: " + e);
+ // Best guess, no
+ return false;
+ }
+ return major > major_required || (major == major_required && minor >= minor_required);
+ }
+
+}
diff --git a/src/java/org/lwjgl/LinuxSysImplementation.java b/src/java/org/lwjgl/LinuxSysImplementation.java
index fc9bb97..8d57248 100644
--- a/src/java/org/lwjgl/LinuxSysImplementation.java
+++ b/src/java/org/lwjgl/LinuxSysImplementation.java
@@ -1,76 +1,76 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl;
-
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3298 $
- * $Id: LinuxSysImplementation.java 3298 2010-03-28 23:11:17Z matzon $
- */
-final class LinuxSysImplementation extends J2SESysImplementation {
- private final static int JNI_VERSION = 18;
-
- static {
- java.awt.Toolkit.getDefaultToolkit(); // This will make sure libjawt.so is loaded
- }
-
- public int getRequiredJNIVersion() {
- return JNI_VERSION;
- }
-
- public boolean openURL(final String url) {
- // Linux may as well resort to pure Java hackery, as there's no Linux native way of doing it
- // right anyway.
-
- String[] browsers = {"xdg-open", "firefox", "mozilla", "opera", "konqueror", "nautilus", "galeon", "netscape"};
-
- for (int i = 0; i < browsers.length; i ++) {
- final String browser = browsers[i];
- try {
- LWJGLUtil.execPrivileged(new String[] { browser, url });
- return true;
- } catch (Exception e) {
- // Ignore
- e.printStackTrace(System.err);
- }
- }
-
- // Seems to have failed
- return false;
- }
-
- public boolean has64Bit() {
- return true;
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl;
+
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3298 $
+ * $Id: LinuxSysImplementation.java 3298 2010-03-28 23:11:17Z matzon $
+ */
+final class LinuxSysImplementation extends J2SESysImplementation {
+ private final static int JNI_VERSION = 18;
+
+ static {
+ java.awt.Toolkit.getDefaultToolkit(); // This will make sure libjawt.so is loaded
+ }
+
+ public int getRequiredJNIVersion() {
+ return JNI_VERSION;
+ }
+
+ public boolean openURL(final String url) {
+ // Linux may as well resort to pure Java hackery, as there's no Linux native way of doing it
+ // right anyway.
+
+ String[] browsers = {"xdg-open", "firefox", "mozilla", "opera", "konqueror", "nautilus", "galeon", "netscape"};
+
+ for (int i = 0; i < browsers.length; i ++) {
+ final String browser = browsers[i];
+ try {
+ LWJGLUtil.execPrivileged(new String[] { browser, url });
+ return true;
+ } catch (Exception e) {
+ // Ignore
+ e.printStackTrace(System.err);
+ }
+ }
+
+ // Seems to have failed
+ return false;
+ }
+
+ public boolean has64Bit() {
+ return true;
+ }
+}
diff --git a/src/java/org/lwjgl/MacOSXSysImplementation.java b/src/java/org/lwjgl/MacOSXSysImplementation.java
index fdf2fe3..8da1e92 100644
--- a/src/java/org/lwjgl/MacOSXSysImplementation.java
+++ b/src/java/org/lwjgl/MacOSXSysImplementation.java
@@ -1,65 +1,65 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl;
-
-import java.awt.Toolkit;
-
-import com.apple.eio.FileManager;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3298 $
- * $Id: MacOSXSysImplementation.java 3298 2010-03-28 23:11:17Z matzon $
- */
-final class MacOSXSysImplementation extends J2SESysImplementation {
- private final static int JNI_VERSION = 18;
-
- static {
- // Make sure AWT is properly initialized. This avoids hangs on Mac OS X 10.3
- Toolkit.getDefaultToolkit();
- }
-
- public int getRequiredJNIVersion() {
- return JNI_VERSION;
- }
-
- public boolean openURL(String url) {
- try {
- FileManager.openURL(url);
- return true;
- } catch (Exception e) {
- LWJGLUtil.log("Exception occurred while trying to invoke browser: " + e);
- return false;
- }
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl;
+
+import java.awt.Toolkit;
+
+import com.apple.eio.FileManager;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3298 $
+ * $Id: MacOSXSysImplementation.java 3298 2010-03-28 23:11:17Z matzon $
+ */
+final class MacOSXSysImplementation extends J2SESysImplementation {
+ private final static int JNI_VERSION = 18;
+
+ static {
+ // Make sure AWT is properly initialized. This avoids hangs on Mac OS X 10.3
+ Toolkit.getDefaultToolkit();
+ }
+
+ public int getRequiredJNIVersion() {
+ return JNI_VERSION;
+ }
+
+ public boolean openURL(String url) {
+ try {
+ FileManager.openURL(url);
+ return true;
+ } catch (Exception e) {
+ LWJGLUtil.log("Exception occurred while trying to invoke browser: " + e);
+ return false;
+ }
+ }
+}
diff --git a/src/java/org/lwjgl/Sys.java b/src/java/org/lwjgl/Sys.java
index 51916ce..c1e0344 100644
--- a/src/java/org/lwjgl/Sys.java
+++ b/src/java/org/lwjgl/Sys.java
@@ -1,247 +1,247 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl;
-
-import java.io.File;
-import java.lang.reflect.Method;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedExceptionAction;
-
-import org.lwjgl.input.Mouse;
-
-/**
- * <p>
- * System class (named Sys so as not to conflict with java.lang.System)
- * </p>
- * @author cix_foo <cix_foo at users.sourceforge.net>
- * @version $Revision: 3328 $
- * $Id: Sys.java 3328 2010-04-15 18:03:54Z matzon $
- */
-public final class Sys {
- /** The native library name */
- private static final String JNI_LIBRARY_NAME = "lwjgl";
-
- /** Current version of library */
- private static final String VERSION = "2.4.2";
-
- /** The implementation instance to delegate platform specific behavior to */
- private final static SysImplementation implementation;
-
- private final static String POSTFIX64BIT = "64";
-
- private static void doLoadLibrary(final String lib_name) {
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- String library_path = System.getProperty("org.lwjgl.librarypath");
- if (library_path != null) {
- System.load(library_path + File.separator +
- System.mapLibraryName(lib_name));
- } else {
- System.loadLibrary(lib_name);
- }
- return null;
- }
- });
- }
-
- private static void loadLibrary(final String lib_name) {
- try {
- doLoadLibrary(lib_name);
- } catch (UnsatisfiedLinkError e) {
- if (implementation.has64Bit()) {
- try {
- doLoadLibrary(lib_name + POSTFIX64BIT);
- return;
- } catch (UnsatisfiedLinkError e2) {
- LWJGLUtil.log("Failed to load 64 bit library: " + e2.getMessage());
- }
- }
- // Throw original error
- throw e;
- }
- }
-
- static {
- implementation = createImplementation();
- loadLibrary(JNI_LIBRARY_NAME);
-
- int native_jni_version = implementation.getJNIVersion();
- int required_version = implementation.getRequiredJNIVersion();
- if (native_jni_version != required_version)
- throw new LinkageError("Version mismatch: jar version is '" + required_version +
- "', native libary version is '" + native_jni_version + "'");
- implementation.setDebug(LWJGLUtil.DEBUG);
- }
-
- private static SysImplementation createImplementation() {
- switch (LWJGLUtil.getPlatform()) {
- case LWJGLUtil.PLATFORM_LINUX:
- return new LinuxSysImplementation();
- case LWJGLUtil.PLATFORM_WINDOWS:
- return new WindowsSysImplementation();
- case LWJGLUtil.PLATFORM_MACOSX:
- return new MacOSXSysImplementation();
- default:
- throw new IllegalStateException("Unsupported platform");
- }
- }
-
- /**
- * No constructor for Sys.
- */
- private Sys() {
- }
-
- /**
- * Return the version of the core LWJGL libraries as a String.
- */
- public static String getVersion() {
- return VERSION;
- }
-
- /**
- * Initialization. This is just a dummy method to trigger the static constructor.
- */
- public static void initialize() {
- }
-
- /**
- * Obtains the number of ticks that the hires timer does in a second. This method is fast;
- * it should be called as frequently as possible, as it recalibrates the timer.
- *
- * @return timer resolution in ticks per second or 0 if no timer is present.
- */
- public static long getTimerResolution() {
- return implementation.getTimerResolution();
- }
-
- /**
- * Gets the current value of the hires timer, in ticks. When the Sys class is first loaded
- * the hires timer is reset to 0. If no hires timer is present then this method will always
- * return 0.<p><strong>NOTEZ BIEN</strong> that the hires timer WILL wrap around.
- *
- * @return the current hires time, in ticks (always >= 0)
- */
- public static long getTime() {
- return implementation.getTime() & 0x7FFFFFFFFFFFFFFFL;
- }
-
- /**
- * Attempt to display a modal alert to the user. This method should be used
- * when a game fails to initialize properly or crashes out losing its display
- * in the process. It is provided because AWT may not be available on the target
- * platform, although on Mac and Linux and other platforms supporting AWT we
- * delegate the task to AWT instead of doing it ourselves.
- * <p>
- * The alert should display the title and the message and then the current
- * thread should block until the user dismisses the alert - typically with an
- * OK button click.
- * <p>
- * It may be that the user's system has no windowing system installed for some
- * reason, in which case this method may do nothing at all, or attempt to provide
- * some console output.
- *
- * @param title The title of the alert. We suggest using the title of your game.
- * @param message The message text for the alert.
- */
- public static void alert(String title, String message) {
- boolean grabbed = Mouse.isGrabbed();
- if (grabbed) {
- Mouse.setGrabbed(false);
- }
- if (title == null)
- title = "";
- if (message == null)
- message = "";
- implementation.alert(title, message);
- if (grabbed) {
- Mouse.setGrabbed(true);
- }
- }
-
- /**
- * Open the system web browser and point it at the specified URL. It is recommended
- * that this not be called whilst your game is running, but on application exit in
- * a shutdown hook, as the screen resolution will not be reset when the browser is
- * brought into view.
- * <p>
- * There is no guarantee that this will work, nor that we can detect if it has
- * failed - hence we don't return success code or throw an Exception. This is just a
- * best attempt at opening the URL given - don't rely on it to work!
- * <p>
- * @param url The URL. Ensure that the URL is properly encoded.
- * @return false if we are CERTAIN the call has failed
- */
- public static boolean openURL(String url) {
- // Attempt to use Webstart if we have it available
- try {
- // Lookup the javax.jnlp.BasicService object
- final Class serviceManagerClass = Class.forName("javax.jnlp.ServiceManager");
- Method lookupMethod = (Method)AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws Exception {
- return serviceManagerClass.getMethod("lookup", new Class[] {String.class});
- }
- });
- Object basicService = lookupMethod.invoke(serviceManagerClass, new Object[] {"javax.jnlp.BasicService"});
- final Class basicServiceClass = Class.forName("javax.jnlp.BasicService");
- Method showDocumentMethod = (Method)AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws Exception {
- return basicServiceClass.getMethod("showDocument", new Class[] {URL.class});
- }
- });
- try {
- Boolean ret = (Boolean) showDocumentMethod.invoke(basicService, new Object[] {new URL(url)});
- return ret.booleanValue();
- } catch (MalformedURLException e) {
- e.printStackTrace(System.err);
- return false;
- }
- } catch (Exception ue) {
- return implementation.openURL(url);
- }
- }
-
- /**
- * Get the contents of the system clipboard. The system might not have a
- * clipboard (particularly if it doesn't even have a keyboard) in which case
- * we return null. Otherwise we return a String, which may be the empty
- * string "".
- *
- * @return a String, or null if there is no system clipboard.
- */
- public static String getClipboard() {
- return implementation.getClipboard();
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl;
+
+import java.io.File;
+import java.lang.reflect.Method;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedExceptionAction;
+
+import org.lwjgl.input.Mouse;
+
+/**
+ * <p>
+ * System class (named Sys so as not to conflict with java.lang.System)
+ * </p>
+ * @author cix_foo <cix_foo at users.sourceforge.net>
+ * @version $Revision: 3328 $
+ * $Id: Sys.java 3328 2010-04-15 18:03:54Z matzon $
+ */
+public final class Sys {
+ /** The native library name */
+ private static final String JNI_LIBRARY_NAME = "lwjgl";
+
+ /** Current version of library */
+ private static final String VERSION = "2.4.2";
+
+ /** The implementation instance to delegate platform specific behavior to */
+ private final static SysImplementation implementation;
+
+ private final static String POSTFIX64BIT = "64";
+
+ private static void doLoadLibrary(final String lib_name) {
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ String library_path = System.getProperty("org.lwjgl.librarypath");
+ if (library_path != null) {
+ System.load(library_path + File.separator +
+ System.mapLibraryName(lib_name));
+ } else {
+ System.loadLibrary(lib_name);
+ }
+ return null;
+ }
+ });
+ }
+
+ private static void loadLibrary(final String lib_name) {
+ try {
+ doLoadLibrary(lib_name);
+ } catch (UnsatisfiedLinkError e) {
+ if (implementation.has64Bit()) {
+ try {
+ doLoadLibrary(lib_name + POSTFIX64BIT);
+ return;
+ } catch (UnsatisfiedLinkError e2) {
+ LWJGLUtil.log("Failed to load 64 bit library: " + e2.getMessage());
+ }
+ }
+ // Throw original error
+ throw e;
+ }
+ }
+
+ static {
+ implementation = createImplementation();
+ loadLibrary(JNI_LIBRARY_NAME);
+
+ int native_jni_version = implementation.getJNIVersion();
+ int required_version = implementation.getRequiredJNIVersion();
+ if (native_jni_version != required_version)
+ throw new LinkageError("Version mismatch: jar version is '" + required_version +
+ "', native libary version is '" + native_jni_version + "'");
+ implementation.setDebug(LWJGLUtil.DEBUG);
+ }
+
+ private static SysImplementation createImplementation() {
+ switch (LWJGLUtil.getPlatform()) {
+ case LWJGLUtil.PLATFORM_LINUX:
+ return new LinuxSysImplementation();
+ case LWJGLUtil.PLATFORM_WINDOWS:
+ return new WindowsSysImplementation();
+ case LWJGLUtil.PLATFORM_MACOSX:
+ return new MacOSXSysImplementation();
+ default:
+ throw new IllegalStateException("Unsupported platform");
+ }
+ }
+
+ /**
+ * No constructor for Sys.
+ */
+ private Sys() {
+ }
+
+ /**
+ * Return the version of the core LWJGL libraries as a String.
+ */
+ public static String getVersion() {
+ return VERSION;
+ }
+
+ /**
+ * Initialization. This is just a dummy method to trigger the static constructor.
+ */
+ public static void initialize() {
+ }
+
+ /**
+ * Obtains the number of ticks that the hires timer does in a second. This method is fast;
+ * it should be called as frequently as possible, as it recalibrates the timer.
+ *
+ * @return timer resolution in ticks per second or 0 if no timer is present.
+ */
+ public static long getTimerResolution() {
+ return implementation.getTimerResolution();
+ }
+
+ /**
+ * Gets the current value of the hires timer, in ticks. When the Sys class is first loaded
+ * the hires timer is reset to 0. If no hires timer is present then this method will always
+ * return 0.<p><strong>NOTEZ BIEN</strong> that the hires timer WILL wrap around.
+ *
+ * @return the current hires time, in ticks (always >= 0)
+ */
+ public static long getTime() {
+ return implementation.getTime() & 0x7FFFFFFFFFFFFFFFL;
+ }
+
+ /**
+ * Attempt to display a modal alert to the user. This method should be used
+ * when a game fails to initialize properly or crashes out losing its display
+ * in the process. It is provided because AWT may not be available on the target
+ * platform, although on Mac and Linux and other platforms supporting AWT we
+ * delegate the task to AWT instead of doing it ourselves.
+ * <p>
+ * The alert should display the title and the message and then the current
+ * thread should block until the user dismisses the alert - typically with an
+ * OK button click.
+ * <p>
+ * It may be that the user's system has no windowing system installed for some
+ * reason, in which case this method may do nothing at all, or attempt to provide
+ * some console output.
+ *
+ * @param title The title of the alert. We suggest using the title of your game.
+ * @param message The message text for the alert.
+ */
+ public static void alert(String title, String message) {
+ boolean grabbed = Mouse.isGrabbed();
+ if (grabbed) {
+ Mouse.setGrabbed(false);
+ }
+ if (title == null)
+ title = "";
+ if (message == null)
+ message = "";
+ implementation.alert(title, message);
+ if (grabbed) {
+ Mouse.setGrabbed(true);
+ }
+ }
+
+ /**
+ * Open the system web browser and point it at the specified URL. It is recommended
+ * that this not be called whilst your game is running, but on application exit in
+ * a shutdown hook, as the screen resolution will not be reset when the browser is
+ * brought into view.
+ * <p>
+ * There is no guarantee that this will work, nor that we can detect if it has
+ * failed - hence we don't return success code or throw an Exception. This is just a
+ * best attempt at opening the URL given - don't rely on it to work!
+ * <p>
+ * @param url The URL. Ensure that the URL is properly encoded.
+ * @return false if we are CERTAIN the call has failed
+ */
+ public static boolean openURL(String url) {
+ // Attempt to use Webstart if we have it available
+ try {
+ // Lookup the javax.jnlp.BasicService object
+ final Class serviceManagerClass = Class.forName("javax.jnlp.ServiceManager");
+ Method lookupMethod = (Method)AccessController.doPrivileged(new PrivilegedExceptionAction() {
+ public Object run() throws Exception {
+ return serviceManagerClass.getMethod("lookup", new Class[] {String.class});
+ }
+ });
+ Object basicService = lookupMethod.invoke(serviceManagerClass, new Object[] {"javax.jnlp.BasicService"});
+ final Class basicServiceClass = Class.forName("javax.jnlp.BasicService");
+ Method showDocumentMethod = (Method)AccessController.doPrivileged(new PrivilegedExceptionAction() {
+ public Object run() throws Exception {
+ return basicServiceClass.getMethod("showDocument", new Class[] {URL.class});
+ }
+ });
+ try {
+ Boolean ret = (Boolean) showDocumentMethod.invoke(basicService, new Object[] {new URL(url)});
+ return ret.booleanValue();
+ } catch (MalformedURLException e) {
+ e.printStackTrace(System.err);
+ return false;
+ }
+ } catch (Exception ue) {
+ return implementation.openURL(url);
+ }
+ }
+
+ /**
+ * Get the contents of the system clipboard. The system might not have a
+ * clipboard (particularly if it doesn't even have a keyboard) in which case
+ * we return null. Otherwise we return a String, which may be the empty
+ * string "".
+ *
+ * @return a String, or null if there is no system clipboard.
+ */
+ public static String getClipboard() {
+ return implementation.getClipboard();
+ }
+}
diff --git a/src/java/org/lwjgl/SysImplementation.java b/src/java/org/lwjgl/SysImplementation.java
index 10a1c7b..3dcda4e 100644
--- a/src/java/org/lwjgl/SysImplementation.java
+++ b/src/java/org/lwjgl/SysImplementation.java
@@ -1,76 +1,76 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl;
-
-/**
- *
- * System class platform specific method interface
- *
- * @author cix_foo <cix_foo at users.sourceforge.net>
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3054 $
- * $Id: SysImplementation.java 3054 2008-04-30 14:34:54Z elias_naur $
- */
-interface SysImplementation {
- /**
- * Return the required version of the native library
- */
- int getRequiredJNIVersion();
-
- /**
- * Return the version of the native library
- */
- int getJNIVersion();
-
- void setDebug(boolean debug);
-
- /**
- * Obtains the number of ticks that the hires timer does in a second.
- *
- * @return timer resolution in ticks per second or 0 if no timer is present.
- */
- long getTimerResolution();
-
- long getTime();
-
- void alert(String title, String message);
-
- boolean openURL(String url);
-
- String getClipboard();
-
- /**
- * Returns true there exists a separate 64 bit library
- * on the platform
- */
- boolean has64Bit();
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl;
+
+/**
+ *
+ * System class platform specific method interface
+ *
+ * @author cix_foo <cix_foo at users.sourceforge.net>
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3054 $
+ * $Id: SysImplementation.java 3054 2008-04-30 14:34:54Z elias_naur $
+ */
+interface SysImplementation {
+ /**
+ * Return the required version of the native library
+ */
+ int getRequiredJNIVersion();
+
+ /**
+ * Return the version of the native library
+ */
+ int getJNIVersion();
+
+ void setDebug(boolean debug);
+
+ /**
+ * Obtains the number of ticks that the hires timer does in a second.
+ *
+ * @return timer resolution in ticks per second or 0 if no timer is present.
+ */
+ long getTimerResolution();
+
+ long getTime();
+
+ void alert(String title, String message);
+
+ boolean openURL(String url);
+
+ String getClipboard();
+
+ /**
+ * Returns true there exists a separate 64 bit library
+ * on the platform
+ */
+ boolean has64Bit();
+}
diff --git a/src/java/org/lwjgl/WindowsSysImplementation.java b/src/java/org/lwjgl/WindowsSysImplementation.java
index 0c9cac9..578fc65 100644
--- a/src/java/org/lwjgl/WindowsSysImplementation.java
+++ b/src/java/org/lwjgl/WindowsSysImplementation.java
@@ -1,119 +1,119 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl;
-
-import java.security.PrivilegedExceptionAction;
-import java.security.PrivilegedActionException;
-import java.security.AccessController;
-import java.lang.reflect.Method;
-
-import org.lwjgl.opengl.Display;
-
-/**
- * <p>
- * @author $Author: spasi $
- * @version $Revision: 3300 $
- * $Id: WindowsSysImplementation.java 3300 2010-03-31 20:56:07Z spasi $
- */
-final class WindowsSysImplementation extends DefaultSysImplementation {
- private final static int JNI_VERSION = 22;
-
- static {
- Sys.initialize();
- }
-
- public int getRequiredJNIVersion() {
- return JNI_VERSION;
- }
-
- public long getTimerResolution() {
- return 1000;
- }
-
- public long getTime() {
- return nGetTime();
- }
- private static native long nGetTime();
-
- public final boolean has64Bit() {
- return true;
- }
-
- private static long getHwnd() {
- if (!Display.isCreated())
- return 0;
- /* Use reflection since we can't make Display.getImplementation
- * public
- */
- try {
- Long hwnd_obj = (Long)AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws Exception {
- Method getImplementation_method = Display.class.getDeclaredMethod("getImplementation", null);
- getImplementation_method.setAccessible(true);
- Object display_impl = getImplementation_method.invoke(null, null);
- Class WindowsDisplay_class = Class.forName("org.lwjgl.opengl.WindowsDisplay");
- Method getHwnd_method = WindowsDisplay_class.getDeclaredMethod("getHwnd", null);
- getHwnd_method.setAccessible(true);
- Long hwnd = (Long)getHwnd_method.invoke(display_impl, null);
- return hwnd;
- }
- });
- return hwnd_obj.longValue();
- } catch (PrivilegedActionException e) {
- throw new Error(e);
- }
- }
-
- public void alert(String title, String message) {
- if(!Display.isCreated()) {
- initCommonControls();
- }
- nAlert(getHwnd(), title, message);
- }
- private static native void nAlert(long parent_hwnd, String title, String message);
- private static native void initCommonControls();
-
- public boolean openURL(final String url) {
- try {
- LWJGLUtil.execPrivileged(new String[]{"rundll32", "url.dll,FileProtocolHandler", url});
- return true;
- } catch (Exception e) {
- LWJGLUtil.log("Failed to open url (" + url + "): " + e.getMessage());
- return false;
- }
- }
-
- public String getClipboard() {
- return nGetClipboard();
- }
- private static native String nGetClipboard();
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl;
+
+import java.security.PrivilegedExceptionAction;
+import java.security.PrivilegedActionException;
+import java.security.AccessController;
+import java.lang.reflect.Method;
+
+import org.lwjgl.opengl.Display;
+
+/**
+ * <p>
+ * @author $Author: spasi $
+ * @version $Revision: 3300 $
+ * $Id: WindowsSysImplementation.java 3300 2010-03-31 20:56:07Z spasi $
+ */
+final class WindowsSysImplementation extends DefaultSysImplementation {
+ private final static int JNI_VERSION = 22;
+
+ static {
+ Sys.initialize();
+ }
+
+ public int getRequiredJNIVersion() {
+ return JNI_VERSION;
+ }
+
+ public long getTimerResolution() {
+ return 1000;
+ }
+
+ public long getTime() {
+ return nGetTime();
+ }
+ private static native long nGetTime();
+
+ public final boolean has64Bit() {
+ return true;
+ }
+
+ private static long getHwnd() {
+ if (!Display.isCreated())
+ return 0;
+ /* Use reflection since we can't make Display.getImplementation
+ * public
+ */
+ try {
+ Long hwnd_obj = (Long)AccessController.doPrivileged(new PrivilegedExceptionAction() {
+ public Object run() throws Exception {
+ Method getImplementation_method = Display.class.getDeclaredMethod("getImplementation", null);
+ getImplementation_method.setAccessible(true);
+ Object display_impl = getImplementation_method.invoke(null, null);
+ Class WindowsDisplay_class = Class.forName("org.lwjgl.opengl.WindowsDisplay");
+ Method getHwnd_method = WindowsDisplay_class.getDeclaredMethod("getHwnd", null);
+ getHwnd_method.setAccessible(true);
+ Long hwnd = (Long)getHwnd_method.invoke(display_impl, null);
+ return hwnd;
+ }
+ });
+ return hwnd_obj.longValue();
+ } catch (PrivilegedActionException e) {
+ throw new Error(e);
+ }
+ }
+
+ public void alert(String title, String message) {
+ if(!Display.isCreated()) {
+ initCommonControls();
+ }
+ nAlert(getHwnd(), title, message);
+ }
+ private static native void nAlert(long parent_hwnd, String title, String message);
+ private static native void initCommonControls();
+
+ public boolean openURL(final String url) {
+ try {
+ LWJGLUtil.execPrivileged(new String[]{"rundll32", "url.dll,FileProtocolHandler", url});
+ return true;
+ } catch (Exception e) {
+ LWJGLUtil.log("Failed to open url (" + url + "): " + e.getMessage());
+ return false;
+ }
+ }
+
+ public String getClipboard() {
+ return nGetClipboard();
+ }
+ private static native String nGetClipboard();
+}
diff --git a/src/java/org/lwjgl/examples/Game.java b/src/java/org/lwjgl/examples/Game.java
index 8dc2147..8bb7d8c 100644
--- a/src/java/org/lwjgl/examples/Game.java
+++ b/src/java/org/lwjgl/examples/Game.java
@@ -1,193 +1,193 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.examples;
-
-import org.lwjgl.Sys;
-import org.lwjgl.input.Keyboard;
-import org.lwjgl.openal.AL;
-import org.lwjgl.opengl.Display;
-import org.lwjgl.opengl.GL11;
-
-/**
- *
- * This is a <em>very basic</em> skeleton to init a game and run it.
- *
- * @author $Author: matzon $
- * @version $Revision: 3108 $
- * $Id: Game.java 3108 2008-07-02 20:00:49Z matzon $
- */
-public class Game {
-
- /** Game title */
- public static final String GAME_TITLE = "My Game";
-
- /** Desired frame time */
- private static final int FRAMERATE = 60;
-
- /** Exit the game */
- private static boolean finished;
-
- /** A rotating square! */
- private static float angle;
-
- /**
- * No constructor needed - this class is static
- */
- private Game() {}
-
- /**
- * Application init
- * @param args Commandline args
- */
- public static void main(String[] args) {
- try {
- init();
- run();
- } catch (Exception e) {
- e.printStackTrace(System.err);
- Sys.alert(GAME_TITLE, "An error occured and the game will exit.");
- } finally {
- cleanup();
- }
-
- System.exit(0);
- }
-
- /**
- * Initialise the game
- * @throws Exception if init fails
- */
- private static void init() throws Exception {
- // Create a fullscreen window with 1:1 orthographic 2D projection, and with
- // mouse, keyboard, and gamepad inputs.
- Display.setTitle(GAME_TITLE);
- Display.setFullscreen(true);
-
- // Enable vsync if we can
- Display.setVSyncEnabled(true);
-
- Display.create();
-
- // Start up the sound system
- AL.create();
-
- // TODO: Load in your textures etc here
-
- // Put the window into orthographic projection mode with 1:1 pixel ratio.
- // We haven't used GLU here to do this to avoid an unnecessary dependency.
- GL11.glMatrixMode(GL11.GL_PROJECTION);
- GL11.glLoadIdentity();
- GL11.glOrtho(0.0, Display.getDisplayMode().getWidth(), 0.0, Display.getDisplayMode().getHeight(), -1.0, 1.0);
- GL11.glMatrixMode(GL11.GL_MODELVIEW);
- GL11.glLoadIdentity();
- GL11.glViewport(0, 0, Display.getDisplayMode().getWidth(), Display.getDisplayMode().getHeight());
-
- }
-
- /**
- * Runs the game (the "main loop")
- */
- private static void run() {
- while (!finished) {
- // Always call Window.update(), all the time
- Display.update();
-
- if (Display.isCloseRequested()) {
- // Check for O/S close requests
- finished = true;
- } else if (Display.isActive()) {
- // The window is in the foreground, so we should play the game
- logic();
- render();
- Display.sync(FRAMERATE);
- } else {
- // The window is not in the foreground, so we can allow other stuff to run and
- // infrequently update
- try {
- Thread.sleep(100);
- } catch (InterruptedException e) {
- }
- logic();
- if (Display.isVisible() || Display.isDirty()) {
- // Only bother rendering if the window is visible or dirty
- render();
- }
- }
- }
- }
-
- /**
- * Do any game-specific cleanup
- */
- private static void cleanup() {
- // TODO: save anything you want to disk here
-
- // Stop the sound
- AL.destroy();
-
- // Close the window
- Display.destroy();
- }
-
- /**
- * Do all calculations, handle input, etc.
- */
- private static void logic() {
- // Example input handler: we'll check for the ESC key and finish the game instantly when it's pressed
- if (Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)) {
- finished = true;
- }
-
- // TODO: all your game logic goes here.
- angle += 2.0f % 360;
- }
-
- /**
- * Render the current frame
- */
- private static void render() {
- GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_STENCIL_BUFFER_BIT);
-
- // TODO: all your rendering goes here
- GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
- GL11.glPushMatrix();
- GL11.glTranslatef(Display.getDisplayMode().getWidth() / 2, Display.getDisplayMode().getHeight() / 2, 0.0f);
- GL11.glRotatef(angle, 0, 0, 1.0f);
- GL11.glBegin(GL11.GL_QUADS);
- GL11.glVertex2i(-50, -50);
- GL11.glVertex2i(50, -50);
- GL11.glVertex2i(50, 50);
- GL11.glVertex2i(-50, 50);
- GL11.glEnd();
- GL11.glPopMatrix();
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.examples;
+
+import org.lwjgl.Sys;
+import org.lwjgl.input.Keyboard;
+import org.lwjgl.openal.AL;
+import org.lwjgl.opengl.Display;
+import org.lwjgl.opengl.GL11;
+
+/**
+ *
+ * This is a <em>very basic</em> skeleton to init a game and run it.
+ *
+ * @author $Author: matzon $
+ * @version $Revision: 3108 $
+ * $Id: Game.java 3108 2008-07-02 20:00:49Z matzon $
+ */
+public class Game {
+
+ /** Game title */
+ public static final String GAME_TITLE = "My Game";
+
+ /** Desired frame time */
+ private static final int FRAMERATE = 60;
+
+ /** Exit the game */
+ private static boolean finished;
+
+ /** A rotating square! */
+ private static float angle;
+
+ /**
+ * No constructor needed - this class is static
+ */
+ private Game() {}
+
+ /**
+ * Application init
+ * @param args Commandline args
+ */
+ public static void main(String[] args) {
+ try {
+ init();
+ run();
+ } catch (Exception e) {
+ e.printStackTrace(System.err);
+ Sys.alert(GAME_TITLE, "An error occured and the game will exit.");
+ } finally {
+ cleanup();
+ }
+
+ System.exit(0);
+ }
+
+ /**
+ * Initialise the game
+ * @throws Exception if init fails
+ */
+ private static void init() throws Exception {
+ // Create a fullscreen window with 1:1 orthographic 2D projection, and with
+ // mouse, keyboard, and gamepad inputs.
+ Display.setTitle(GAME_TITLE);
+ Display.setFullscreen(true);
+
+ // Enable vsync if we can
+ Display.setVSyncEnabled(true);
+
+ Display.create();
+
+ // Start up the sound system
+ AL.create();
+
+ // TODO: Load in your textures etc here
+
+ // Put the window into orthographic projection mode with 1:1 pixel ratio.
+ // We haven't used GLU here to do this to avoid an unnecessary dependency.
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+ GL11.glLoadIdentity();
+ GL11.glOrtho(0.0, Display.getDisplayMode().getWidth(), 0.0, Display.getDisplayMode().getHeight(), -1.0, 1.0);
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ GL11.glLoadIdentity();
+ GL11.glViewport(0, 0, Display.getDisplayMode().getWidth(), Display.getDisplayMode().getHeight());
+
+ }
+
+ /**
+ * Runs the game (the "main loop")
+ */
+ private static void run() {
+ while (!finished) {
+ // Always call Window.update(), all the time
+ Display.update();
+
+ if (Display.isCloseRequested()) {
+ // Check for O/S close requests
+ finished = true;
+ } else if (Display.isActive()) {
+ // The window is in the foreground, so we should play the game
+ logic();
+ render();
+ Display.sync(FRAMERATE);
+ } else {
+ // The window is not in the foreground, so we can allow other stuff to run and
+ // infrequently update
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException e) {
+ }
+ logic();
+ if (Display.isVisible() || Display.isDirty()) {
+ // Only bother rendering if the window is visible or dirty
+ render();
+ }
+ }
+ }
+ }
+
+ /**
+ * Do any game-specific cleanup
+ */
+ private static void cleanup() {
+ // TODO: save anything you want to disk here
+
+ // Stop the sound
+ AL.destroy();
+
+ // Close the window
+ Display.destroy();
+ }
+
+ /**
+ * Do all calculations, handle input, etc.
+ */
+ private static void logic() {
+ // Example input handler: we'll check for the ESC key and finish the game instantly when it's pressed
+ if (Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)) {
+ finished = true;
+ }
+
+ // TODO: all your game logic goes here.
+ angle += 2.0f % 360;
+ }
+
+ /**
+ * Render the current frame
+ */
+ private static void render() {
+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_STENCIL_BUFFER_BIT);
+
+ // TODO: all your rendering goes here
+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
+ GL11.glPushMatrix();
+ GL11.glTranslatef(Display.getDisplayMode().getWidth() / 2, Display.getDisplayMode().getHeight() / 2, 0.0f);
+ GL11.glRotatef(angle, 0, 0, 1.0f);
+ GL11.glBegin(GL11.GL_QUADS);
+ GL11.glVertex2i(-50, -50);
+ GL11.glVertex2i(50, -50);
+ GL11.glVertex2i(50, 50);
+ GL11.glVertex2i(-50, 50);
+ GL11.glEnd();
+ GL11.glPopMatrix();
+ }
+}
diff --git a/src/java/org/lwjgl/examples/spaceinvaders/AlienEntity.java b/src/java/org/lwjgl/examples/spaceinvaders/AlienEntity.java
index f1db4b7..56e265f 100644
--- a/src/java/org/lwjgl/examples/spaceinvaders/AlienEntity.java
+++ b/src/java/org/lwjgl/examples/spaceinvaders/AlienEntity.java
@@ -1,157 +1,157 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.examples.spaceinvaders;
-
-/**
- * An entity which represents one of our space invader aliens.
- *
- * @author Kevin Glass
- * @author Brian Matzon
- */
-public class AlienEntity extends Entity {
-
- /** Movement made downwards when a border is hit */
- private static final int DOWNWARD_MOVEMENT = 10;
-
- /** Border at which player dies */
- private static final int BOTTOM_BORDER = 570;
-
- /** Right border at which to shift direction */
- private static final int RIGHT_BORDER = 750;
-
- /** Left border at which to shift direction */
- private static final int LEFT_BORDER = 10;
-
- /** The speed at which the alient moves horizontally */
- private float moveSpeed = 75;
-
- /** The game in which the entity exists */
- private Game game;
-
- /** The animation frames */
- private Sprite[] frames = new Sprite[4];
-
- /** The time since the last frame change took place */
- private long lastFrameChange;
-
- /** The frame duration in milliseconds, i.e. how long any given frame of animation lasts */
- private long frameDuration = 250;
-
- /** The current frame of animation being displayed */
- private int frameNumber;
-
- /**
- * Create a new alien entity
- *
- * @param game The game in which this entity is being created
- * @param x The intial x location of this alien
- * @param y The intial y location of this alient
- */
- public AlienEntity(Game game, int x, int y) {
- super(game.getSprite("alien.gif"), x, y);
-
- // setup the animatin frames
- frames[0] = sprite;
- frames[1] = game.getSprite("alien2.gif");
- frames[2] = sprite;
- frames[3] = game.getSprite("alien3.gif");
-
- this.game = game;
- dx = -moveSpeed;
- }
-
- /**
- * Request that this alien moved based on time elapsed
- *
- * @param delta The time that has elapsed since last move
- */
- public void move(long delta) {
- // since the move tells us how much time has passed
- // by we can use it to drive the animation, however
- // its the not the prettiest solution
- lastFrameChange += delta;
-
- // if we need to change the frame, update the frame number
- // and flip over the sprite in use
- if (lastFrameChange > frameDuration) {
- // reset our frame change time counter
- lastFrameChange = 0;
-
- // update the frame
- frameNumber++;
- if (frameNumber >= frames.length) {
- frameNumber = 0;
- }
-
- sprite = frames[frameNumber];
- }
-
- // if we have reached the left hand side of the screen and
- // are moving left then request a logic update
- if ((dx < 0) && (x < LEFT_BORDER)) {
- game.updateLogic();
- }
- // and vice vesa, if we have reached the right hand side of
- // the screen and are moving right, request a logic update
- if ((dx > 0) && (x > RIGHT_BORDER)) {
- game.updateLogic();
- }
-
- // proceed with normal move
- super.move(delta);
- }
-
- /**
- * Update the game logic related to aliens
- */
- public void doLogic() {
- // swap over horizontal movement and move down the
- // screen a bit
- dx = -dx;
- y += DOWNWARD_MOVEMENT;
-
- // if we've reached the bottom of the screen then the player
- // dies
- if (y > BOTTOM_BORDER) {
- game.notifyDeath();
- }
- }
-
- /**
- * Notification that this alien has collided with another entity
- *
- * @param other The other entity
- */
- public void collidedWith(Entity other) {
- // collisions with aliens are handled elsewhere
- }
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.examples.spaceinvaders;
+
+/**
+ * An entity which represents one of our space invader aliens.
+ *
+ * @author Kevin Glass
+ * @author Brian Matzon
+ */
+public class AlienEntity extends Entity {
+
+ /** Movement made downwards when a border is hit */
+ private static final int DOWNWARD_MOVEMENT = 10;
+
+ /** Border at which player dies */
+ private static final int BOTTOM_BORDER = 570;
+
+ /** Right border at which to shift direction */
+ private static final int RIGHT_BORDER = 750;
+
+ /** Left border at which to shift direction */
+ private static final int LEFT_BORDER = 10;
+
+ /** The speed at which the alient moves horizontally */
+ private float moveSpeed = 75;
+
+ /** The game in which the entity exists */
+ private Game game;
+
+ /** The animation frames */
+ private Sprite[] frames = new Sprite[4];
+
+ /** The time since the last frame change took place */
+ private long lastFrameChange;
+
+ /** The frame duration in milliseconds, i.e. how long any given frame of animation lasts */
+ private long frameDuration = 250;
+
+ /** The current frame of animation being displayed */
+ private int frameNumber;
+
+ /**
+ * Create a new alien entity
+ *
+ * @param game The game in which this entity is being created
+ * @param x The intial x location of this alien
+ * @param y The intial y location of this alient
+ */
+ public AlienEntity(Game game, int x, int y) {
+ super(game.getSprite("alien.gif"), x, y);
+
+ // setup the animatin frames
+ frames[0] = sprite;
+ frames[1] = game.getSprite("alien2.gif");
+ frames[2] = sprite;
+ frames[3] = game.getSprite("alien3.gif");
+
+ this.game = game;
+ dx = -moveSpeed;
+ }
+
+ /**
+ * Request that this alien moved based on time elapsed
+ *
+ * @param delta The time that has elapsed since last move
+ */
+ public void move(long delta) {
+ // since the move tells us how much time has passed
+ // by we can use it to drive the animation, however
+ // its the not the prettiest solution
+ lastFrameChange += delta;
+
+ // if we need to change the frame, update the frame number
+ // and flip over the sprite in use
+ if (lastFrameChange > frameDuration) {
+ // reset our frame change time counter
+ lastFrameChange = 0;
+
+ // update the frame
+ frameNumber++;
+ if (frameNumber >= frames.length) {
+ frameNumber = 0;
+ }
+
+ sprite = frames[frameNumber];
+ }
+
+ // if we have reached the left hand side of the screen and
+ // are moving left then request a logic update
+ if ((dx < 0) && (x < LEFT_BORDER)) {
+ game.updateLogic();
+ }
+ // and vice vesa, if we have reached the right hand side of
+ // the screen and are moving right, request a logic update
+ if ((dx > 0) && (x > RIGHT_BORDER)) {
+ game.updateLogic();
+ }
+
+ // proceed with normal move
+ super.move(delta);
+ }
+
+ /**
+ * Update the game logic related to aliens
+ */
+ public void doLogic() {
+ // swap over horizontal movement and move down the
+ // screen a bit
+ dx = -dx;
+ y += DOWNWARD_MOVEMENT;
+
+ // if we've reached the bottom of the screen then the player
+ // dies
+ if (y > BOTTOM_BORDER) {
+ game.notifyDeath();
+ }
+ }
+
+ /**
+ * Notification that this alien has collided with another entity
+ *
+ * @param other The other entity
+ */
+ public void collidedWith(Entity other) {
+ // collisions with aliens are handled elsewhere
+ }
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/examples/spaceinvaders/Entity.java b/src/java/org/lwjgl/examples/spaceinvaders/Entity.java
index cfc54ed..ca9e09b 100644
--- a/src/java/org/lwjgl/examples/spaceinvaders/Entity.java
+++ b/src/java/org/lwjgl/examples/spaceinvaders/Entity.java
@@ -1,184 +1,184 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.examples.spaceinvaders;
-
-import java.awt.Rectangle;
-
-/**
- * An entity represents any element that appears in the game. The
- * entity is responsible for resolving collisions and movement
- * based on a set of properties defined either by subclass or externally.
- *
- * Note that doubles are used for positions. This may seem strange
- * given that pixels locations are integers. However, using double means
- * that an entity can move a partial pixel. It doesn't of course mean that
- * they will be display half way through a pixel but allows us not lose
- * accuracy as we move.
- *
- * @author Kevin Glass
- */
-public abstract class Entity {
-
- /** The current x location of this entity */
- protected float x;
-
- /** The current y location of this entity */
- protected float y;
-
- /** The sprite that represents this entity */
- protected Sprite sprite;
-
- /** The current speed of this entity horizontally (pixels/sec) */
- protected float dx;
-
- /** The current speed of this entity vertically (pixels/sec) */
- protected float dy;
-
- /** The rectangle used for this entity during collisions resolution */
- private Rectangle me = new Rectangle();
-
- /** The rectangle used for other entities during collision resolution */
- private Rectangle him = new Rectangle();
-
- /**
- * Construct a entity based on a sprite image and a location.
- *
- * @param ref The reference to the image to be displayed for this entity
- * @param x The initial x location of this entity
- * @param y The initial y location of this entity
- */
- public Entity(Sprite sprite, int x, int y) {
- this.sprite = sprite;
- this.x = x;
- this.y = y;
- }
-
- /**
- * Request that this entity move itself based on a certain ammount
- * of time passing.
- *
- * @param delta The ammount of time that has passed in milliseconds
- */
- public void move(long delta) {
- // update the location of the entity based on move speeds
- x += (delta * dx) / 1000;
- y += (delta * dy) / 1000;
- }
-
- /**
- * Set the horizontal speed of this entity
- *
- * @param dx The horizontal speed of this entity (pixels/sec)
- */
- public void setHorizontalMovement(float dx) {
- this.dx = dx;
- }
-
- /**
- * Set the vertical speed of this entity
- *
- * @param dy The vertical speed of this entity (pixels/sec)
- */
- public void setVerticalMovement(float dy) {
- this.dy = dy;
- }
-
- /**
- * Get the horizontal speed of this entity
- *
- * @return The horizontal speed of this entity (pixels/sec)
- */
- public float getHorizontalMovement() {
- return dx;
- }
-
- /**
- * Get the vertical speed of this entity
- *
- * @return The vertical speed of this entity (pixels/sec)
- */
- public float getVerticalMovement() {
- return dy;
- }
-
- /**
- * Draw this entity to the graphics context provided
- */
- public void draw() {
- sprite.draw((int) x, (int) y);
- }
-
- /**
- * Do the logic associated with this entity. This method
- * will be called periodically based on game events
- */
- public void doLogic() {
- }
-
- /**
- * Get the x location of this entity
- *
- * @return The x location of this entity
- */
- public int getX() {
- return (int) x;
- }
-
- /**
- * Get the y location of this entity
- *
- * @return The y location of this entity
- */
- public int getY() {
- return (int) y;
- }
-
- /**
- * Check if this entity collised with another.
- *
- * @param other The other entity to check collision against
- * @return True if the entities collide with each other
- */
- public boolean collidesWith(Entity other) {
- me.setBounds((int) x, (int) y, sprite.getWidth(), sprite.getHeight());
- him.setBounds((int) other.x, (int) other.y, other.sprite.getWidth(), other.sprite.getHeight());
-
- return me.intersects(him);
- }
-
- /**
- * Notification that this entity collided with another.
- *
- * @param other The entity with which this entity collided.
- */
- public abstract void collidedWith(Entity other);
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.examples.spaceinvaders;
+
+import java.awt.Rectangle;
+
+/**
+ * An entity represents any element that appears in the game. The
+ * entity is responsible for resolving collisions and movement
+ * based on a set of properties defined either by subclass or externally.
+ *
+ * Note that doubles are used for positions. This may seem strange
+ * given that pixels locations are integers. However, using double means
+ * that an entity can move a partial pixel. It doesn't of course mean that
+ * they will be display half way through a pixel but allows us not lose
+ * accuracy as we move.
+ *
+ * @author Kevin Glass
+ */
+public abstract class Entity {
+
+ /** The current x location of this entity */
+ protected float x;
+
+ /** The current y location of this entity */
+ protected float y;
+
+ /** The sprite that represents this entity */
+ protected Sprite sprite;
+
+ /** The current speed of this entity horizontally (pixels/sec) */
+ protected float dx;
+
+ /** The current speed of this entity vertically (pixels/sec) */
+ protected float dy;
+
+ /** The rectangle used for this entity during collisions resolution */
+ private Rectangle me = new Rectangle();
+
+ /** The rectangle used for other entities during collision resolution */
+ private Rectangle him = new Rectangle();
+
+ /**
+ * Construct a entity based on a sprite image and a location.
+ *
+ * @param ref The reference to the image to be displayed for this entity
+ * @param x The initial x location of this entity
+ * @param y The initial y location of this entity
+ */
+ public Entity(Sprite sprite, int x, int y) {
+ this.sprite = sprite;
+ this.x = x;
+ this.y = y;
+ }
+
+ /**
+ * Request that this entity move itself based on a certain ammount
+ * of time passing.
+ *
+ * @param delta The ammount of time that has passed in milliseconds
+ */
+ public void move(long delta) {
+ // update the location of the entity based on move speeds
+ x += (delta * dx) / 1000;
+ y += (delta * dy) / 1000;
+ }
+
+ /**
+ * Set the horizontal speed of this entity
+ *
+ * @param dx The horizontal speed of this entity (pixels/sec)
+ */
+ public void setHorizontalMovement(float dx) {
+ this.dx = dx;
+ }
+
+ /**
+ * Set the vertical speed of this entity
+ *
+ * @param dy The vertical speed of this entity (pixels/sec)
+ */
+ public void setVerticalMovement(float dy) {
+ this.dy = dy;
+ }
+
+ /**
+ * Get the horizontal speed of this entity
+ *
+ * @return The horizontal speed of this entity (pixels/sec)
+ */
+ public float getHorizontalMovement() {
+ return dx;
+ }
+
+ /**
+ * Get the vertical speed of this entity
+ *
+ * @return The vertical speed of this entity (pixels/sec)
+ */
+ public float getVerticalMovement() {
+ return dy;
+ }
+
+ /**
+ * Draw this entity to the graphics context provided
+ */
+ public void draw() {
+ sprite.draw((int) x, (int) y);
+ }
+
+ /**
+ * Do the logic associated with this entity. This method
+ * will be called periodically based on game events
+ */
+ public void doLogic() {
+ }
+
+ /**
+ * Get the x location of this entity
+ *
+ * @return The x location of this entity
+ */
+ public int getX() {
+ return (int) x;
+ }
+
+ /**
+ * Get the y location of this entity
+ *
+ * @return The y location of this entity
+ */
+ public int getY() {
+ return (int) y;
+ }
+
+ /**
+ * Check if this entity collised with another.
+ *
+ * @param other The other entity to check collision against
+ * @return True if the entities collide with each other
+ */
+ public boolean collidesWith(Entity other) {
+ me.setBounds((int) x, (int) y, sprite.getWidth(), sprite.getHeight());
+ him.setBounds((int) other.x, (int) other.y, other.sprite.getWidth(), other.sprite.getHeight());
+
+ return me.intersects(him);
+ }
+
+ /**
+ * Notification that this entity collided with another.
+ *
+ * @param other The entity with which this entity collided.
+ */
+ public abstract void collidedWith(Entity other);
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/examples/spaceinvaders/Game.java b/src/java/org/lwjgl/examples/spaceinvaders/Game.java
index f4c9e29..051dba4 100644
--- a/src/java/org/lwjgl/examples/spaceinvaders/Game.java
+++ b/src/java/org/lwjgl/examples/spaceinvaders/Game.java
@@ -1,614 +1,614 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.examples.spaceinvaders;
-
-import java.util.ArrayList;
-
-import org.lwjgl.LWJGLException;
-import org.lwjgl.Sys;
-import org.lwjgl.input.Keyboard;
-import org.lwjgl.input.Mouse;
-import org.lwjgl.opengl.Display;
-import org.lwjgl.opengl.DisplayMode;
-import org.lwjgl.opengl.GL11;
-
-/**
- * The main hook of our game. This class with both act as a manager
- * for the display and central mediator for the game logic.
- *
- * Display management will consist of a loop that cycles round all
- * entities in the game asking them to move and then drawing them
- * in the appropriate place. With the help of an inner class it
- * will also allow the player to control the main ship.
- *
- * As a mediator it will be informed when entities within our game
- * detect events (e.g. alient killed, played died) and will take
- * appropriate game actions.
- *
- * <p>
- * NOTE:<br>
- * This game is a LWJGLized implementation of the Space Invaders game by Kevin
- * Glass. The original implementation is renderer agnostic and supports other
- * OpenGL implementations as well as Java2D. This version has been made specific
- * for LWJGL, and has added input control as well as sound (which the original doesn't,
- * at the time of writing).
- * You can find the original article here:<br>
- * <a href="http://www.cokeandcode.com/" target="_blank">http://www.cokeandcode.com</a>
- * </p>
- *
- * @author Kevin Glass
- * @author Brian Matzon
- */
-public class Game {
-
- /** The normal title of the window */
- private String WINDOW_TITLE = "Space Invaders 104 (for LWJGL)";
-
- /** The width of the game display area */
- private int width = 800;
-
- /** The height of the game display area */
- private int height = 600;
-
- /** The loader responsible for converting images into OpenGL textures */
- private TextureLoader textureLoader;
-
- /** The list of all the entities that exist in our game */
- private ArrayList entities = new ArrayList();
-
- /** The list of entities that need to be removed from the game this loop */
- private ArrayList removeList = new ArrayList();
-
- /** The entity representing the player */
- private ShipEntity ship;
-
- /** List of shots */
- private ShotEntity[] shots;
-
- /** The message to display which waiting for a key press */
- private Sprite message;
-
- /** The sprite containing the "Press Any Key" message */
- private Sprite pressAnyKey;
-
- /** The sprite containing the "You win!" message */
- private Sprite youWin;
-
- /** The sprite containing the "You lose!" message */
- private Sprite gotYou;
-
- /** Last shot index */
- private int shotIndex;
-
- /** The speed at which the player's ship should move (pixels/sec) */
- private float moveSpeed = 300;
-
- /** The time at which last fired a shot */
- private long lastFire = 0;
-
- /** The interval between our players shot (ms) */
- private long firingInterval = 500;
-
- /** The number of aliens left on the screen */
- private int alienCount;
-
- /** True if we're holding up game play until a key has been pressed */
- private boolean waitingForKeyPress = true;
-
- /** True if game logic needs to be applied this loop, normally as a result of a game event */
- private boolean logicRequiredThisLoop = false;
-
- /** The time at which the last rendering looped started from the point of view of the game logic */
- private long lastLoopTime = getTime();
-
- /** True if the fire key has been released */
- private boolean fireHasBeenReleased = false;
-
- /** The time since the last record of fps */
- private long lastFpsTime = 0;
-
- /** The recorded fps */
- private int fps;
-
- private static long timerTicksPerSecond = Sys.getTimerResolution();
-
- /** True if the game is currently "running", i.e. the game loop is looping */
- public static boolean gameRunning = true;
-
- /** SoundManager to make sound with */
- private SoundManager soundManager;
-
- /** Whether we're running in fullscreen mode */
- private boolean fullscreen;
-
- /** ID of shot effect */
- private int SOUND_SHOT;
-
- /** ID of hit effect */
- private int SOUND_HIT;
-
- /** ID of start sound */
- private int SOUND_START;
-
- /** ID of win sound */
- private int SOUND_WIN;
-
- /** ID of loose sound */
- private int SOUND_LOOSE;
-
- /** Mouse movement on x axis */
- private int mouseX;
-
- /** Is this an application or applet */
- private static boolean isApplication = false;
-
- /**
- * Construct our game and set it running.
- * @param fullscreen
- *
- * @param renderingType The type of rendering to use (should be one of the contansts from ResourceFactory)
- */
- public Game(boolean fullscreen) {
- this.fullscreen = fullscreen;
- initialize();
- }
-
- /**
- * Get the high resolution time in milliseconds
- *
- * @return The high resolution time in milliseconds
- */
- public static long getTime() {
- // we get the "timer ticks" from the high resolution timer
- // multiply by 1000 so our end result is in milliseconds
- // then divide by the number of ticks in a second giving
- // us a nice clear time in milliseconds
- return (Sys.getTime() * 1000) / timerTicksPerSecond;
- }
-
- /**
- * Sleep for a fixed number of milliseconds.
- *
- * @param duration The amount of time in milliseconds to sleep for
- */
- public static void sleep(long duration) {
- try {
- Thread.sleep((duration * timerTicksPerSecond) / 1000);
- } catch (InterruptedException inte) {
- }
- }
-
- /**
- * Intialise the common elements for the game
- */
- public void initialize() {
- // initialize the window beforehand
- try {
- setDisplayMode();
- Display.setTitle(WINDOW_TITLE);
- Display.setFullscreen(fullscreen);
- Display.create();
-
- // grab the mouse, dont want that hideous cursor when we're playing!
- if (isApplication) {
- Mouse.setGrabbed(true);
- }
-
- // enable textures since we're going to use these for our sprites
- GL11.glEnable(GL11.GL_TEXTURE_2D);
-
- // disable the OpenGL depth test since we're rendering 2D graphics
- GL11.glDisable(GL11.GL_DEPTH_TEST);
-
- GL11.glMatrixMode(GL11.GL_PROJECTION);
- GL11.glLoadIdentity();
-
- GL11.glOrtho(0, width, height, 0, -1, 1);
- GL11.glMatrixMode(GL11.GL_MODELVIEW);
- GL11.glLoadIdentity();
- GL11.glViewport(0, 0, width, height);
-
- textureLoader = new TextureLoader();
-
- // create our sound manager, and initialize it with 7 channels
- // 1 channel for sounds, 6 for effects - this should be enough
- // since we have a most 4 shots on screen at any one time, which leaves
- // us with 2 channels for explosions.
- soundManager = new SoundManager();
- soundManager.initialize(8);
-
- // load our sound data
- SOUND_SHOT = soundManager.addSound("shot.wav");
- SOUND_HIT = soundManager.addSound("hit.wav");
- SOUND_START = soundManager.addSound("start.wav");
- SOUND_WIN = soundManager.addSound("win.wav");
- SOUND_LOOSE = soundManager.addSound("loose.wav");
- } catch (LWJGLException le) {
- System.out.println("Game exiting - exception in initialization:");
- le.printStackTrace();
- Game.gameRunning = false;
- return;
- }
-
- // get our sprites
- gotYou = getSprite("gotyou.gif");
- pressAnyKey = getSprite("pressanykey.gif");
- youWin = getSprite("youwin.gif");
-
- message = pressAnyKey;
-
- // setup 5 shots
- shots = new ShotEntity[5];
- for (int i = 0; i < shots.length; i++) {
- shots[i] = new ShotEntity(this, "shot.gif", 0, 0);
- }
-
- // setup the initial game state
- startGame();
- }
-
- /**
- * Sets the display mode for fullscreen mode
- */
- private boolean setDisplayMode() {
- try {
- // get modes
- DisplayMode[] dm = org.lwjgl.util.Display.getAvailableDisplayModes(width, height, -1, -1, -1, -1, 60, 60);
-
- org.lwjgl.util.Display.setDisplayMode(dm, new String[] {
- "width=" + width,
- "height=" + height,
- "freq=" + 60,
- "bpp=" + org.lwjgl.opengl.Display.getDisplayMode().getBitsPerPixel()
- });
- return true;
- } catch (Exception e) {
- e.printStackTrace();
- System.out.println("Unable to enter fullscreen, continuing in windowed mode");
- }
-
- return false;
- }
-
- /**
- * Start a fresh game, this should clear out any old data and
- * create a new set.
- */
- private void startGame() {
- // clear out any existing entities and intialise a new set
- entities.clear();
- initEntities();
- }
-
- /**
- * Initialise the starting state of the entities (ship and aliens). Each
- * entitiy will be added to the overall list of entities in the game.
- */
- private void initEntities() {
- // create the player ship and place it roughly in the center of the screen
- ship = new ShipEntity(this, "ship.gif", 370, 550);
- entities.add(ship);
-
- // create a block of aliens (5 rows, by 12 aliens, spaced evenly)
- alienCount = 0;
- for (int row = 0; row < 5; row++) {
- for (int x = 0; x < 12; x++) {
- Entity alien = new AlienEntity(this, 100 + (x * 50), (50) + row * 30);
- entities.add(alien);
- alienCount++;
- }
- }
- }
-
- /**
- * Notification from a game entity that the logic of the game
- * should be run at the next opportunity (normally as a result of some
- * game event)
- */
- public void updateLogic() {
- logicRequiredThisLoop = true;
- }
-
- /**
- * Remove an entity from the game. The entity removed will
- * no longer move or be drawn.
- *
- * @param entity The entity that should be removed
- */
- public void removeEntity(Entity entity) {
- removeList.add(entity);
- }
-
- /**
- * Notification that the player has died.
- */
- public void notifyDeath() {
- if (!waitingForKeyPress) {
- soundManager.playSound(SOUND_LOOSE);
- }
- message = gotYou;
- waitingForKeyPress = true;
- }
-
- /**
- * Notification that the player has won since all the aliens
- * are dead.
- */
- public void notifyWin() {
- message = youWin;
- waitingForKeyPress = true;
- soundManager.playSound(SOUND_WIN);
- }
-
- /**
- * Notification that an alien has been killed
- */
- public void notifyAlienKilled() {
- // reduce the alient count, if there are none left, the player has won!
- alienCount--;
-
- if (alienCount == 0) {
- notifyWin();
- }
-
- // if there are still some aliens left then they all need to get faster, so
- // speed up all the existing aliens
- for (int i = 0; i < entities.size(); i++) {
- Entity entity = (Entity) entities.get(i);
-
- if (entity instanceof AlienEntity) {
- // speed up by 2%
- entity.setHorizontalMovement(entity.getHorizontalMovement() * 1.02f);
- }
- }
-
- soundManager.playEffect(SOUND_HIT);
- }
-
- /**
- * Attempt to fire a shot from the player. Its called "try"
- * since we must first check that the player can fire at this
- * point, i.e. has he/she waited long enough between shots
- */
- public void tryToFire() {
- // check that we have waiting long enough to fire
- if (System.currentTimeMillis() - lastFire < firingInterval) {
- return;
- }
-
- // if we waited long enough, create the shot entity, and record the time.
- lastFire = System.currentTimeMillis();
- ShotEntity shot = shots[shotIndex++ % shots.length];
- shot.reinitialize(ship.getX() + 10, ship.getY() - 30);
- entities.add(shot);
-
- soundManager.playEffect(SOUND_SHOT);
- }
-
- /**
- * Run the main game loop. This method keeps rendering the scene
- * and requesting that the callback update its screen.
- */
- private void gameLoop() {
- while (Game.gameRunning) {
- // clear screen
- GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
- GL11.glMatrixMode(GL11.GL_MODELVIEW);
- GL11.glLoadIdentity();
-
- // let subsystem paint
- frameRendering();
-
- // update window contents
- Display.update();
- }
-
- // clean up
- soundManager.destroy();
- Display.destroy();
- }
-
- /**
- * Notification that a frame is being rendered. Responsible for
- * running game logic and rendering the scene.
- */
- public void frameRendering() {
- //SystemTimer.sleep(lastLoopTime+10-SystemTimer.getTime());
- Display.sync(60);
-
- // work out how long its been since the last update, this
- // will be used to calculate how far the entities should
- // move this loop
- long delta = getTime() - lastLoopTime;
- lastLoopTime = getTime();
- lastFpsTime += delta;
- fps++;
-
- // update our FPS counter if a second has passed
- if (lastFpsTime >= 1000) {
- Display.setTitle(WINDOW_TITLE + " (FPS: " + fps + ")");
- lastFpsTime = 0;
- fps = 0;
- }
-
- // cycle round asking each entity to move itself
- if (!waitingForKeyPress && !soundManager.isPlayingSound()) {
- for (int i = 0; i < entities.size(); i++) {
- Entity entity = (Entity) entities.get(i);
- entity.move(delta);
- }
- }
-
- // cycle round drawing all the entities we have in the game
- for (int i = 0; i < entities.size(); i++) {
- Entity entity = (Entity) entities.get(i);
- entity.draw();
- }
-
- // brute force collisions, compare every entity against
- // every other entity. If any of them collide notify
- // both entities that the collision has occured
- for (int p = 0; p < entities.size(); p++) {
- for (int s = p + 1; s < entities.size(); s++) {
- Entity me = (Entity) entities.get(p);
- Entity him = (Entity) entities.get(s);
-
- if (me.collidesWith(him)) {
- me.collidedWith(him);
- him.collidedWith(me);
- }
- }
- }
-
- // remove any entity that has been marked for clear up
- entities.removeAll(removeList);
- removeList.clear();
-
- // if a game event has indicated that game logic should
- // be resolved, cycle round every entity requesting that
- // their personal logic should be considered.
- if (logicRequiredThisLoop) {
- for (int i = 0; i < entities.size(); i++) {
- Entity entity = (Entity) entities.get(i);
- entity.doLogic();
- }
-
- logicRequiredThisLoop = false;
- }
-
- // if we're waiting for an "any key" press then draw the
- // current message
- if (waitingForKeyPress) {
- message.draw(325, 250);
- }
-
- // resolve the movemfent of the ship. First assume the ship
- // isn't moving. If either cursor key is pressed then
- // update the movement appropraitely
- ship.setHorizontalMovement(0);
-
- // get mouse movement on x axis. We need to get it now, since
- // we can only call getDX ONCE! - secondary calls will yield 0, since
- // there haven't been any movement since last call.
- mouseX = Mouse.getDX();
-
- // we delegate input checking to submethod since we want to check
- // for keyboard, mouse & controller
- boolean leftPressed = hasInput(Keyboard.KEY_LEFT);
- boolean rightPressed = hasInput(Keyboard.KEY_RIGHT);
- boolean firePressed = hasInput(Keyboard.KEY_SPACE);
-
- if (!waitingForKeyPress && !soundManager.isPlayingSound()) {
- if ((leftPressed) && (!rightPressed)) {
- ship.setHorizontalMovement(-moveSpeed);
- } else if ((rightPressed) && (!leftPressed)) {
- ship.setHorizontalMovement(moveSpeed);
- }
-
- // if we're pressing fire, attempt to fire
- if (firePressed) {
- tryToFire();
- }
- } else {
- if (!firePressed) {
- fireHasBeenReleased = true;
- }
- if ((firePressed) && (fireHasBeenReleased) && !soundManager.isPlayingSound()) {
- waitingForKeyPress = false;
- fireHasBeenReleased = false;
- startGame();
- soundManager.playSound(SOUND_START);
- }
- }
-
- // if escape has been pressed, stop the game
- if ((Display.isCloseRequested() || Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)) && isApplication) {
- Game.gameRunning = false;
- }
- }
-
- /**
- * @param key_left
- * @return
- */
- private boolean hasInput(int direction) {
- switch(direction) {
- case Keyboard.KEY_LEFT:
- return
- Keyboard.isKeyDown(Keyboard.KEY_LEFT) ||
- mouseX < 0;
-
- case Keyboard.KEY_RIGHT:
- return
- Keyboard.isKeyDown(Keyboard.KEY_RIGHT) ||
- mouseX > 0;
-
- case Keyboard.KEY_SPACE:
- return
- Keyboard.isKeyDown(Keyboard.KEY_SPACE) ||
- Mouse.isButtonDown(0);
- }
- return false;
- }
-
- /**
- * The entry point into the game. We'll simply create an
- * instance of class which will start the display and game
- * loop.
- *
- * @param argv The arguments that are passed into our game
- */
- public static void main(String argv[]) {
- isApplication = true;
- System.out.println("Use -fullscreen for fullscreen mode");
- new Game((argv.length > 0 && argv[0].equalsIgnoreCase("-fullscreen"))).execute();
- System.exit(0);
- }
-
- /**
- *
- */
- public void execute() {
- gameLoop();
- }
-
- /**
- * Create or get a sprite which displays the image that is pointed
- * to in the classpath by "ref"
- *
- * @param ref A reference to the image to load
- * @return A sprite that can be drawn onto the current graphics context.
- */
- public Sprite getSprite(String ref) {
- return new Sprite(textureLoader, ref);
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.examples.spaceinvaders;
+
+import java.util.ArrayList;
+
+import org.lwjgl.LWJGLException;
+import org.lwjgl.Sys;
+import org.lwjgl.input.Keyboard;
+import org.lwjgl.input.Mouse;
+import org.lwjgl.opengl.Display;
+import org.lwjgl.opengl.DisplayMode;
+import org.lwjgl.opengl.GL11;
+
+/**
+ * The main hook of our game. This class with both act as a manager
+ * for the display and central mediator for the game logic.
+ *
+ * Display management will consist of a loop that cycles round all
+ * entities in the game asking them to move and then drawing them
+ * in the appropriate place. With the help of an inner class it
+ * will also allow the player to control the main ship.
+ *
+ * As a mediator it will be informed when entities within our game
+ * detect events (e.g. alient killed, played died) and will take
+ * appropriate game actions.
+ *
+ * <p>
+ * NOTE:<br>
+ * This game is a LWJGLized implementation of the Space Invaders game by Kevin
+ * Glass. The original implementation is renderer agnostic and supports other
+ * OpenGL implementations as well as Java2D. This version has been made specific
+ * for LWJGL, and has added input control as well as sound (which the original doesn't,
+ * at the time of writing).
+ * You can find the original article here:<br>
+ * <a href="http://www.cokeandcode.com/" target="_blank">http://www.cokeandcode.com</a>
+ * </p>
+ *
+ * @author Kevin Glass
+ * @author Brian Matzon
+ */
+public class Game {
+
+ /** The normal title of the window */
+ private String WINDOW_TITLE = "Space Invaders 104 (for LWJGL)";
+
+ /** The width of the game display area */
+ private int width = 800;
+
+ /** The height of the game display area */
+ private int height = 600;
+
+ /** The loader responsible for converting images into OpenGL textures */
+ private TextureLoader textureLoader;
+
+ /** The list of all the entities that exist in our game */
+ private ArrayList entities = new ArrayList();
+
+ /** The list of entities that need to be removed from the game this loop */
+ private ArrayList removeList = new ArrayList();
+
+ /** The entity representing the player */
+ private ShipEntity ship;
+
+ /** List of shots */
+ private ShotEntity[] shots;
+
+ /** The message to display which waiting for a key press */
+ private Sprite message;
+
+ /** The sprite containing the "Press Any Key" message */
+ private Sprite pressAnyKey;
+
+ /** The sprite containing the "You win!" message */
+ private Sprite youWin;
+
+ /** The sprite containing the "You lose!" message */
+ private Sprite gotYou;
+
+ /** Last shot index */
+ private int shotIndex;
+
+ /** The speed at which the player's ship should move (pixels/sec) */
+ private float moveSpeed = 300;
+
+ /** The time at which last fired a shot */
+ private long lastFire = 0;
+
+ /** The interval between our players shot (ms) */
+ private long firingInterval = 500;
+
+ /** The number of aliens left on the screen */
+ private int alienCount;
+
+ /** True if we're holding up game play until a key has been pressed */
+ private boolean waitingForKeyPress = true;
+
+ /** True if game logic needs to be applied this loop, normally as a result of a game event */
+ private boolean logicRequiredThisLoop = false;
+
+ /** The time at which the last rendering looped started from the point of view of the game logic */
+ private long lastLoopTime = getTime();
+
+ /** True if the fire key has been released */
+ private boolean fireHasBeenReleased = false;
+
+ /** The time since the last record of fps */
+ private long lastFpsTime = 0;
+
+ /** The recorded fps */
+ private int fps;
+
+ private static long timerTicksPerSecond = Sys.getTimerResolution();
+
+ /** True if the game is currently "running", i.e. the game loop is looping */
+ public static boolean gameRunning = true;
+
+ /** SoundManager to make sound with */
+ private SoundManager soundManager;
+
+ /** Whether we're running in fullscreen mode */
+ private boolean fullscreen;
+
+ /** ID of shot effect */
+ private int SOUND_SHOT;
+
+ /** ID of hit effect */
+ private int SOUND_HIT;
+
+ /** ID of start sound */
+ private int SOUND_START;
+
+ /** ID of win sound */
+ private int SOUND_WIN;
+
+ /** ID of loose sound */
+ private int SOUND_LOOSE;
+
+ /** Mouse movement on x axis */
+ private int mouseX;
+
+ /** Is this an application or applet */
+ private static boolean isApplication = false;
+
+ /**
+ * Construct our game and set it running.
+ * @param fullscreen
+ *
+ * @param renderingType The type of rendering to use (should be one of the contansts from ResourceFactory)
+ */
+ public Game(boolean fullscreen) {
+ this.fullscreen = fullscreen;
+ initialize();
+ }
+
+ /**
+ * Get the high resolution time in milliseconds
+ *
+ * @return The high resolution time in milliseconds
+ */
+ public static long getTime() {
+ // we get the "timer ticks" from the high resolution timer
+ // multiply by 1000 so our end result is in milliseconds
+ // then divide by the number of ticks in a second giving
+ // us a nice clear time in milliseconds
+ return (Sys.getTime() * 1000) / timerTicksPerSecond;
+ }
+
+ /**
+ * Sleep for a fixed number of milliseconds.
+ *
+ * @param duration The amount of time in milliseconds to sleep for
+ */
+ public static void sleep(long duration) {
+ try {
+ Thread.sleep((duration * timerTicksPerSecond) / 1000);
+ } catch (InterruptedException inte) {
+ }
+ }
+
+ /**
+ * Intialise the common elements for the game
+ */
+ public void initialize() {
+ // initialize the window beforehand
+ try {
+ setDisplayMode();
+ Display.setTitle(WINDOW_TITLE);
+ Display.setFullscreen(fullscreen);
+ Display.create();
+
+ // grab the mouse, dont want that hideous cursor when we're playing!
+ if (isApplication) {
+ Mouse.setGrabbed(true);
+ }
+
+ // enable textures since we're going to use these for our sprites
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+
+ // disable the OpenGL depth test since we're rendering 2D graphics
+ GL11.glDisable(GL11.GL_DEPTH_TEST);
+
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+ GL11.glLoadIdentity();
+
+ GL11.glOrtho(0, width, height, 0, -1, 1);
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ GL11.glLoadIdentity();
+ GL11.glViewport(0, 0, width, height);
+
+ textureLoader = new TextureLoader();
+
+ // create our sound manager, and initialize it with 7 channels
+ // 1 channel for sounds, 6 for effects - this should be enough
+ // since we have a most 4 shots on screen at any one time, which leaves
+ // us with 2 channels for explosions.
+ soundManager = new SoundManager();
+ soundManager.initialize(8);
+
+ // load our sound data
+ SOUND_SHOT = soundManager.addSound("shot.wav");
+ SOUND_HIT = soundManager.addSound("hit.wav");
+ SOUND_START = soundManager.addSound("start.wav");
+ SOUND_WIN = soundManager.addSound("win.wav");
+ SOUND_LOOSE = soundManager.addSound("loose.wav");
+ } catch (LWJGLException le) {
+ System.out.println("Game exiting - exception in initialization:");
+ le.printStackTrace();
+ Game.gameRunning = false;
+ return;
+ }
+
+ // get our sprites
+ gotYou = getSprite("gotyou.gif");
+ pressAnyKey = getSprite("pressanykey.gif");
+ youWin = getSprite("youwin.gif");
+
+ message = pressAnyKey;
+
+ // setup 5 shots
+ shots = new ShotEntity[5];
+ for (int i = 0; i < shots.length; i++) {
+ shots[i] = new ShotEntity(this, "shot.gif", 0, 0);
+ }
+
+ // setup the initial game state
+ startGame();
+ }
+
+ /**
+ * Sets the display mode for fullscreen mode
+ */
+ private boolean setDisplayMode() {
+ try {
+ // get modes
+ DisplayMode[] dm = org.lwjgl.util.Display.getAvailableDisplayModes(width, height, -1, -1, -1, -1, 60, 60);
+
+ org.lwjgl.util.Display.setDisplayMode(dm, new String[] {
+ "width=" + width,
+ "height=" + height,
+ "freq=" + 60,
+ "bpp=" + org.lwjgl.opengl.Display.getDisplayMode().getBitsPerPixel()
+ });
+ return true;
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.out.println("Unable to enter fullscreen, continuing in windowed mode");
+ }
+
+ return false;
+ }
+
+ /**
+ * Start a fresh game, this should clear out any old data and
+ * create a new set.
+ */
+ private void startGame() {
+ // clear out any existing entities and intialise a new set
+ entities.clear();
+ initEntities();
+ }
+
+ /**
+ * Initialise the starting state of the entities (ship and aliens). Each
+ * entitiy will be added to the overall list of entities in the game.
+ */
+ private void initEntities() {
+ // create the player ship and place it roughly in the center of the screen
+ ship = new ShipEntity(this, "ship.gif", 370, 550);
+ entities.add(ship);
+
+ // create a block of aliens (5 rows, by 12 aliens, spaced evenly)
+ alienCount = 0;
+ for (int row = 0; row < 5; row++) {
+ for (int x = 0; x < 12; x++) {
+ Entity alien = new AlienEntity(this, 100 + (x * 50), (50) + row * 30);
+ entities.add(alien);
+ alienCount++;
+ }
+ }
+ }
+
+ /**
+ * Notification from a game entity that the logic of the game
+ * should be run at the next opportunity (normally as a result of some
+ * game event)
+ */
+ public void updateLogic() {
+ logicRequiredThisLoop = true;
+ }
+
+ /**
+ * Remove an entity from the game. The entity removed will
+ * no longer move or be drawn.
+ *
+ * @param entity The entity that should be removed
+ */
+ public void removeEntity(Entity entity) {
+ removeList.add(entity);
+ }
+
+ /**
+ * Notification that the player has died.
+ */
+ public void notifyDeath() {
+ if (!waitingForKeyPress) {
+ soundManager.playSound(SOUND_LOOSE);
+ }
+ message = gotYou;
+ waitingForKeyPress = true;
+ }
+
+ /**
+ * Notification that the player has won since all the aliens
+ * are dead.
+ */
+ public void notifyWin() {
+ message = youWin;
+ waitingForKeyPress = true;
+ soundManager.playSound(SOUND_WIN);
+ }
+
+ /**
+ * Notification that an alien has been killed
+ */
+ public void notifyAlienKilled() {
+ // reduce the alient count, if there are none left, the player has won!
+ alienCount--;
+
+ if (alienCount == 0) {
+ notifyWin();
+ }
+
+ // if there are still some aliens left then they all need to get faster, so
+ // speed up all the existing aliens
+ for (int i = 0; i < entities.size(); i++) {
+ Entity entity = (Entity) entities.get(i);
+
+ if (entity instanceof AlienEntity) {
+ // speed up by 2%
+ entity.setHorizontalMovement(entity.getHorizontalMovement() * 1.02f);
+ }
+ }
+
+ soundManager.playEffect(SOUND_HIT);
+ }
+
+ /**
+ * Attempt to fire a shot from the player. Its called "try"
+ * since we must first check that the player can fire at this
+ * point, i.e. has he/she waited long enough between shots
+ */
+ public void tryToFire() {
+ // check that we have waiting long enough to fire
+ if (System.currentTimeMillis() - lastFire < firingInterval) {
+ return;
+ }
+
+ // if we waited long enough, create the shot entity, and record the time.
+ lastFire = System.currentTimeMillis();
+ ShotEntity shot = shots[shotIndex++ % shots.length];
+ shot.reinitialize(ship.getX() + 10, ship.getY() - 30);
+ entities.add(shot);
+
+ soundManager.playEffect(SOUND_SHOT);
+ }
+
+ /**
+ * Run the main game loop. This method keeps rendering the scene
+ * and requesting that the callback update its screen.
+ */
+ private void gameLoop() {
+ while (Game.gameRunning) {
+ // clear screen
+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ GL11.glLoadIdentity();
+
+ // let subsystem paint
+ frameRendering();
+
+ // update window contents
+ Display.update();
+ }
+
+ // clean up
+ soundManager.destroy();
+ Display.destroy();
+ }
+
+ /**
+ * Notification that a frame is being rendered. Responsible for
+ * running game logic and rendering the scene.
+ */
+ public void frameRendering() {
+ //SystemTimer.sleep(lastLoopTime+10-SystemTimer.getTime());
+ Display.sync(60);
+
+ // work out how long its been since the last update, this
+ // will be used to calculate how far the entities should
+ // move this loop
+ long delta = getTime() - lastLoopTime;
+ lastLoopTime = getTime();
+ lastFpsTime += delta;
+ fps++;
+
+ // update our FPS counter if a second has passed
+ if (lastFpsTime >= 1000) {
+ Display.setTitle(WINDOW_TITLE + " (FPS: " + fps + ")");
+ lastFpsTime = 0;
+ fps = 0;
+ }
+
+ // cycle round asking each entity to move itself
+ if (!waitingForKeyPress && !soundManager.isPlayingSound()) {
+ for (int i = 0; i < entities.size(); i++) {
+ Entity entity = (Entity) entities.get(i);
+ entity.move(delta);
+ }
+ }
+
+ // cycle round drawing all the entities we have in the game
+ for (int i = 0; i < entities.size(); i++) {
+ Entity entity = (Entity) entities.get(i);
+ entity.draw();
+ }
+
+ // brute force collisions, compare every entity against
+ // every other entity. If any of them collide notify
+ // both entities that the collision has occured
+ for (int p = 0; p < entities.size(); p++) {
+ for (int s = p + 1; s < entities.size(); s++) {
+ Entity me = (Entity) entities.get(p);
+ Entity him = (Entity) entities.get(s);
+
+ if (me.collidesWith(him)) {
+ me.collidedWith(him);
+ him.collidedWith(me);
+ }
+ }
+ }
+
+ // remove any entity that has been marked for clear up
+ entities.removeAll(removeList);
+ removeList.clear();
+
+ // if a game event has indicated that game logic should
+ // be resolved, cycle round every entity requesting that
+ // their personal logic should be considered.
+ if (logicRequiredThisLoop) {
+ for (int i = 0; i < entities.size(); i++) {
+ Entity entity = (Entity) entities.get(i);
+ entity.doLogic();
+ }
+
+ logicRequiredThisLoop = false;
+ }
+
+ // if we're waiting for an "any key" press then draw the
+ // current message
+ if (waitingForKeyPress) {
+ message.draw(325, 250);
+ }
+
+ // resolve the movemfent of the ship. First assume the ship
+ // isn't moving. If either cursor key is pressed then
+ // update the movement appropraitely
+ ship.setHorizontalMovement(0);
+
+ // get mouse movement on x axis. We need to get it now, since
+ // we can only call getDX ONCE! - secondary calls will yield 0, since
+ // there haven't been any movement since last call.
+ mouseX = Mouse.getDX();
+
+ // we delegate input checking to submethod since we want to check
+ // for keyboard, mouse & controller
+ boolean leftPressed = hasInput(Keyboard.KEY_LEFT);
+ boolean rightPressed = hasInput(Keyboard.KEY_RIGHT);
+ boolean firePressed = hasInput(Keyboard.KEY_SPACE);
+
+ if (!waitingForKeyPress && !soundManager.isPlayingSound()) {
+ if ((leftPressed) && (!rightPressed)) {
+ ship.setHorizontalMovement(-moveSpeed);
+ } else if ((rightPressed) && (!leftPressed)) {
+ ship.setHorizontalMovement(moveSpeed);
+ }
+
+ // if we're pressing fire, attempt to fire
+ if (firePressed) {
+ tryToFire();
+ }
+ } else {
+ if (!firePressed) {
+ fireHasBeenReleased = true;
+ }
+ if ((firePressed) && (fireHasBeenReleased) && !soundManager.isPlayingSound()) {
+ waitingForKeyPress = false;
+ fireHasBeenReleased = false;
+ startGame();
+ soundManager.playSound(SOUND_START);
+ }
+ }
+
+ // if escape has been pressed, stop the game
+ if ((Display.isCloseRequested() || Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)) && isApplication) {
+ Game.gameRunning = false;
+ }
+ }
+
+ /**
+ * @param key_left
+ * @return
+ */
+ private boolean hasInput(int direction) {
+ switch(direction) {
+ case Keyboard.KEY_LEFT:
+ return
+ Keyboard.isKeyDown(Keyboard.KEY_LEFT) ||
+ mouseX < 0;
+
+ case Keyboard.KEY_RIGHT:
+ return
+ Keyboard.isKeyDown(Keyboard.KEY_RIGHT) ||
+ mouseX > 0;
+
+ case Keyboard.KEY_SPACE:
+ return
+ Keyboard.isKeyDown(Keyboard.KEY_SPACE) ||
+ Mouse.isButtonDown(0);
+ }
+ return false;
+ }
+
+ /**
+ * The entry point into the game. We'll simply create an
+ * instance of class which will start the display and game
+ * loop.
+ *
+ * @param argv The arguments that are passed into our game
+ */
+ public static void main(String argv[]) {
+ isApplication = true;
+ System.out.println("Use -fullscreen for fullscreen mode");
+ new Game((argv.length > 0 && argv[0].equalsIgnoreCase("-fullscreen"))).execute();
+ System.exit(0);
+ }
+
+ /**
+ *
+ */
+ public void execute() {
+ gameLoop();
+ }
+
+ /**
+ * Create or get a sprite which displays the image that is pointed
+ * to in the classpath by "ref"
+ *
+ * @param ref A reference to the image to load
+ * @return A sprite that can be drawn onto the current graphics context.
+ */
+ public Sprite getSprite(String ref) {
+ return new Sprite(textureLoader, ref);
+ }
+}
diff --git a/src/java/org/lwjgl/examples/spaceinvaders/GameApplet.java b/src/java/org/lwjgl/examples/spaceinvaders/GameApplet.java
index a1ac0cc..32386df 100644
--- a/src/java/org/lwjgl/examples/spaceinvaders/GameApplet.java
+++ b/src/java/org/lwjgl/examples/spaceinvaders/GameApplet.java
@@ -1,104 +1,104 @@
-package org.lwjgl.examples.spaceinvaders;
-
-
-import java.applet.Applet;
-import java.awt.BorderLayout;
-import java.awt.Canvas;
-import org.lwjgl.LWJGLException;
-import org.lwjgl.opengl.Display;
-
-public class GameApplet extends Applet {
-
- /** The Canvas where the LWJGL Display is added */
- Canvas display_parent;
-
- /** Thread which runs the main game loop */
- Thread gameThread;
-
- /** The Game instance */
- Game game;
-
- /**
- * Once the Canvas is created its add notify method will call this method to
- * start the LWJGL Display and game loop in another thread.
- */
- public void startLWJGL() {
- gameThread = new Thread() {
- public void run() {
-
- try {
- Display.setParent(display_parent);
-
- } catch (LWJGLException e) {
- e.printStackTrace();
- }
- // start game
- game = new Game(false);
- game.execute();
- }
- };
- gameThread.start();
- }
-
-
- /**
- * Tell game loop to stop running, after which the LWJGL Display will be destoryed.
- * The main thread will wait for the Display.destroy() to complete
- */
- private void stopLWJGL() {
- Game.gameRunning = false;
- try {
- gameThread.join();
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
- public void start() {
-
- }
-
- public void stop() {
-
- }
-
- /**
- * Applet Destroy method will remove the canvas, before canvas is destroyed it will notify
- * stopLWJGL() to stop main game loop and to destroy the Display
- */
- public void destroy() {
- remove(display_parent);
- super.destroy();
- System.out.println("Clear up");
- }
-
- /**
- * initialise applet by adding a canvas to it, this canvas will start the LWJGL Display and game loop
- * in another thread. It will also stop the game loop and destroy the display on canvas removal when
- * applet is destroyed.
- */
- public void init() {
- setLayout(new BorderLayout());
- try {
- display_parent = new Canvas() {
- public final void addNotify() {
- super.addNotify();
- startLWJGL();
- }
- public final void removeNotify() {
- stopLWJGL();
- super.removeNotify();
- }
- };
- display_parent.setSize(getWidth(),getHeight());
- add(display_parent);
- display_parent.setFocusable(true);
- display_parent.requestFocus();
- display_parent.setIgnoreRepaint(true);
- setVisible(true);
- } catch (Exception e) {
- System.err.println(e);
- throw new RuntimeException("Unable to create display");
- }
- }
+package org.lwjgl.examples.spaceinvaders;
+
+
+import java.applet.Applet;
+import java.awt.BorderLayout;
+import java.awt.Canvas;
+import org.lwjgl.LWJGLException;
+import org.lwjgl.opengl.Display;
+
+public class GameApplet extends Applet {
+
+ /** The Canvas where the LWJGL Display is added */
+ Canvas display_parent;
+
+ /** Thread which runs the main game loop */
+ Thread gameThread;
+
+ /** The Game instance */
+ Game game;
+
+ /**
+ * Once the Canvas is created its add notify method will call this method to
+ * start the LWJGL Display and game loop in another thread.
+ */
+ public void startLWJGL() {
+ gameThread = new Thread() {
+ public void run() {
+
+ try {
+ Display.setParent(display_parent);
+
+ } catch (LWJGLException e) {
+ e.printStackTrace();
+ }
+ // start game
+ game = new Game(false);
+ game.execute();
+ }
+ };
+ gameThread.start();
+ }
+
+
+ /**
+ * Tell game loop to stop running, after which the LWJGL Display will be destoryed.
+ * The main thread will wait for the Display.destroy() to complete
+ */
+ private void stopLWJGL() {
+ Game.gameRunning = false;
+ try {
+ gameThread.join();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void start() {
+
+ }
+
+ public void stop() {
+
+ }
+
+ /**
+ * Applet Destroy method will remove the canvas, before canvas is destroyed it will notify
+ * stopLWJGL() to stop main game loop and to destroy the Display
+ */
+ public void destroy() {
+ remove(display_parent);
+ super.destroy();
+ System.out.println("Clear up");
+ }
+
+ /**
+ * initialise applet by adding a canvas to it, this canvas will start the LWJGL Display and game loop
+ * in another thread. It will also stop the game loop and destroy the display on canvas removal when
+ * applet is destroyed.
+ */
+ public void init() {
+ setLayout(new BorderLayout());
+ try {
+ display_parent = new Canvas() {
+ public final void addNotify() {
+ super.addNotify();
+ startLWJGL();
+ }
+ public final void removeNotify() {
+ stopLWJGL();
+ super.removeNotify();
+ }
+ };
+ display_parent.setSize(getWidth(),getHeight());
+ add(display_parent);
+ display_parent.setFocusable(true);
+ display_parent.requestFocus();
+ display_parent.setIgnoreRepaint(true);
+ setVisible(true);
+ } catch (Exception e) {
+ System.err.println(e);
+ throw new RuntimeException("Unable to create display");
+ }
+ }
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/examples/spaceinvaders/ShipEntity.java b/src/java/org/lwjgl/examples/spaceinvaders/ShipEntity.java
index 0e33a3b..3f56801 100644
--- a/src/java/org/lwjgl/examples/spaceinvaders/ShipEntity.java
+++ b/src/java/org/lwjgl/examples/spaceinvaders/ShipEntity.java
@@ -1,98 +1,98 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.examples.spaceinvaders;
-
-/**
- * The entity that represents the players ship
- *
- * @author Kevin Glass
- * @author Brian Matzon
- */
-public class ShipEntity extends Entity {
-
- /** Right border at which to disallow further movement */
- private static final int RIGHT_BORDER = 750;
-
- /** Left border at which to disallow further movement */
- private static final int LEFT_BORDER = 10;
-
- /** The game in which the ship exists */
- private Game game;
-
- /**
- * Create a new entity to represent the players ship
- *
- * @param game The game in which the ship is being created
- * @param ref The reference to the sprite to show for the ship
- * @param x The initial x location of the player's ship
- * @param y The initial y location of the player's ship
- */
- public ShipEntity(Game game,String ref,int x,int y) {
- super(game.getSprite(ref), x, y);
-
- this.game = game;
- }
-
- /**
- * Request that the ship move itself based on an elapsed ammount of
- * time
- *
- * @param delta The time that has elapsed since last move (ms)
- */
- public void move(long delta) {
- // if we're moving left and have reached the left hand side
- // of the screen, don't move
- if ((dx < 0) && (x < LEFT_BORDER)) {
- return;
- }
- // if we're moving right and have reached the right hand side
- // of the screen, don't move
- if ((dx > 0) && (x > RIGHT_BORDER)) {
- return;
- }
-
- super.move(delta);
- }
-
- /**
- * Notification that the player's ship has collided with something
- *
- * @param other The entity with which the ship has collided
- */
- public void collidedWith(Entity other) {
- // if its an alien, notify the game that the player
- // is dead
- if (other instanceof AlienEntity) {
- game.notifyDeath();
- }
- }
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.examples.spaceinvaders;
+
+/**
+ * The entity that represents the players ship
+ *
+ * @author Kevin Glass
+ * @author Brian Matzon
+ */
+public class ShipEntity extends Entity {
+
+ /** Right border at which to disallow further movement */
+ private static final int RIGHT_BORDER = 750;
+
+ /** Left border at which to disallow further movement */
+ private static final int LEFT_BORDER = 10;
+
+ /** The game in which the ship exists */
+ private Game game;
+
+ /**
+ * Create a new entity to represent the players ship
+ *
+ * @param game The game in which the ship is being created
+ * @param ref The reference to the sprite to show for the ship
+ * @param x The initial x location of the player's ship
+ * @param y The initial y location of the player's ship
+ */
+ public ShipEntity(Game game,String ref,int x,int y) {
+ super(game.getSprite(ref), x, y);
+
+ this.game = game;
+ }
+
+ /**
+ * Request that the ship move itself based on an elapsed ammount of
+ * time
+ *
+ * @param delta The time that has elapsed since last move (ms)
+ */
+ public void move(long delta) {
+ // if we're moving left and have reached the left hand side
+ // of the screen, don't move
+ if ((dx < 0) && (x < LEFT_BORDER)) {
+ return;
+ }
+ // if we're moving right and have reached the right hand side
+ // of the screen, don't move
+ if ((dx > 0) && (x > RIGHT_BORDER)) {
+ return;
+ }
+
+ super.move(delta);
+ }
+
+ /**
+ * Notification that the player's ship has collided with something
+ *
+ * @param other The entity with which the ship has collided
+ */
+ public void collidedWith(Entity other) {
+ // if its an alien, notify the game that the player
+ // is dead
+ if (other instanceof AlienEntity) {
+ game.notifyDeath();
+ }
+ }
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/examples/spaceinvaders/ShotEntity.java b/src/java/org/lwjgl/examples/spaceinvaders/ShotEntity.java
index 1d3335e..eceafb0 100644
--- a/src/java/org/lwjgl/examples/spaceinvaders/ShotEntity.java
+++ b/src/java/org/lwjgl/examples/spaceinvaders/ShotEntity.java
@@ -1,120 +1,120 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.examples.spaceinvaders;
-
-/**
- * An entity representing a shot fired by the player's ship
- *
- * @author Kevin Glass
- * @author Brian Matzon
- */
-public class ShotEntity extends Entity {
-
- /** Top border at which shots are outside */
- private static final int TOP_BORDER = -100;
-
- /** The vertical speed at which the players shot moves */
- private float moveSpeed = -300;
-
- /** The game in which this entity exists */
- private Game game;
-
- /** True if this shot has been "used", i.e. its hit something */
- private boolean used = false;
-
- /**
- * Create a new shot from the player
- *
- * @param game The game in which the shot has been created
- * @param sprite The sprite representing this shot
- * @param x The initial x location of the shot
- * @param y The initial y location of the shot
- */
- public ShotEntity(Game game, String sprite, int x, int y) {
- super(game.getSprite(sprite), x, y);
-
- this.game = game;
- dy = moveSpeed;
- }
-
- /**
- * Reinitializes this entity, for reuse
- *
- * @param x new x coordinate
- * @param y new y coordinate
- */
- public void reinitialize(int x, int y) {
- this.x = x;
- this.y = y;
- used = false;
- }
-
- /**
- * Request that this shot moved based on time elapsed
- *
- * @param delta The time that has elapsed since last move
- */
- public void move(long delta) {
- // proceed with normal move
- super.move(delta);
-
- // if we shot off the screen, remove ourselfs
- if (y < TOP_BORDER) {
- game.removeEntity(this);
- }
- }
-
- /**
- * Notification that this shot has collided with another
- * entity
- *
- * @param other The other entity with which we've collided
- */
- public void collidedWith(Entity other) {
- // prevents double kills, if we've already hit something,
- // don't collide
- if (used) {
- return;
- }
-
- // if we've hit an alien, kill it!
- if (other instanceof AlienEntity) {
- // remove the affected entities
- game.removeEntity(this);
- game.removeEntity(other);
-
- // notify the game that the alien has been killed
- game.notifyAlienKilled();
- used = true;
- }
- }
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.examples.spaceinvaders;
+
+/**
+ * An entity representing a shot fired by the player's ship
+ *
+ * @author Kevin Glass
+ * @author Brian Matzon
+ */
+public class ShotEntity extends Entity {
+
+ /** Top border at which shots are outside */
+ private static final int TOP_BORDER = -100;
+
+ /** The vertical speed at which the players shot moves */
+ private float moveSpeed = -300;
+
+ /** The game in which this entity exists */
+ private Game game;
+
+ /** True if this shot has been "used", i.e. its hit something */
+ private boolean used = false;
+
+ /**
+ * Create a new shot from the player
+ *
+ * @param game The game in which the shot has been created
+ * @param sprite The sprite representing this shot
+ * @param x The initial x location of the shot
+ * @param y The initial y location of the shot
+ */
+ public ShotEntity(Game game, String sprite, int x, int y) {
+ super(game.getSprite(sprite), x, y);
+
+ this.game = game;
+ dy = moveSpeed;
+ }
+
+ /**
+ * Reinitializes this entity, for reuse
+ *
+ * @param x new x coordinate
+ * @param y new y coordinate
+ */
+ public void reinitialize(int x, int y) {
+ this.x = x;
+ this.y = y;
+ used = false;
+ }
+
+ /**
+ * Request that this shot moved based on time elapsed
+ *
+ * @param delta The time that has elapsed since last move
+ */
+ public void move(long delta) {
+ // proceed with normal move
+ super.move(delta);
+
+ // if we shot off the screen, remove ourselfs
+ if (y < TOP_BORDER) {
+ game.removeEntity(this);
+ }
+ }
+
+ /**
+ * Notification that this shot has collided with another
+ * entity
+ *
+ * @param other The other entity with which we've collided
+ */
+ public void collidedWith(Entity other) {
+ // prevents double kills, if we've already hit something,
+ // don't collide
+ if (used) {
+ return;
+ }
+
+ // if we've hit an alien, kill it!
+ if (other instanceof AlienEntity) {
+ // remove the affected entities
+ game.removeEntity(this);
+ game.removeEntity(other);
+
+ // notify the game that the alien has been killed
+ game.notifyAlienKilled();
+ used = true;
+ }
+ }
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/examples/spaceinvaders/SoundManager.java b/src/java/org/lwjgl/examples/spaceinvaders/SoundManager.java
index d3bcae3..e0e78d6 100644
--- a/src/java/org/lwjgl/examples/spaceinvaders/SoundManager.java
+++ b/src/java/org/lwjgl/examples/spaceinvaders/SoundManager.java
@@ -1,189 +1,189 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.examples.spaceinvaders;
-
-import java.nio.IntBuffer;
-
-import org.lwjgl.BufferUtils;
-import org.lwjgl.LWJGLException;
-import org.lwjgl.openal.AL;
-import org.lwjgl.openal.AL10;
-import org.lwjgl.util.WaveData;
-
-
-/**
- * <p>
- * Simple sound manager for OpenAL using n sources accessed in
- * a round robin schedule. Source n is reserved for a single buffer and checking for
- * whether it's playing.
- * </p>
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 2983 $
- * $Id: SoundManager.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public class SoundManager {
-
- /** We support at most 256 buffers*/
- private int[] buffers = new int[256];
-
- /** Number of sources is limited tby user (and hardware) */
- private int[] sources;
-
- /** Our internal scratch buffer */
- private IntBuffer scratchBuffer = BufferUtils.createIntBuffer(256);
-
- /** Whether we're running in no sound mode */
- private boolean soundOutput;
-
- /** Current index in our buffers */
- private int bufferIndex;
-
- /** Current index in our source list */
- private int sourceIndex;
-
- /**
- * Creates a new SoundManager
- */
- public SoundManager() {
- }
-
- /**
- * Plays a sound effect
- * @param buffer Buffer index to play gotten from addSound
- */
- public void playEffect(int buffer) {
- if(soundOutput) {
- // make sure we never choose last channel, since it is used for special sounds
- int channel = sources[(sourceIndex++ % (sources.length-1))];
-
- // link buffer and source, and play it
- AL10.alSourcei(channel, AL10.AL_BUFFER, buffers[buffer]);
- AL10.alSourcePlay(channel);
- }
- }
-
- /**
- * Plays a sound on last source
- * @param buffer Buffer index to play gotten from addSound
- */
- public void playSound(int buffer) {
- if(soundOutput) {
- AL10.alSourcei(sources[sources.length-1], AL10.AL_BUFFER, buffers[buffer]);
- AL10.alSourcePlay(sources[sources.length-1]);
- }
- }
-
- /**
- * Whether a sound is playing on last source
- * @return true if a source is playing right now on source n
- */
- public boolean isPlayingSound() {
- return AL10.alGetSourcei(sources[sources.length-1], AL10.AL_SOURCE_STATE) == AL10.AL_PLAYING;
- }
-
- /**
- * Initializes the SoundManager
- *
- * @param sources Number of sources to create
- */
- public void initialize(int channels) {
- try {
- AL.create();
-
- // allocate sources
- scratchBuffer.limit(channels);
- AL10.alGenSources(scratchBuffer);
- scratchBuffer.rewind();
- scratchBuffer.get(sources = new int[channels]);
-
- // could we allocate all channels?
- if(AL10.alGetError() != AL10.AL_NO_ERROR) {
- throw new LWJGLException("Unable to allocate " + channels + " sources");
- }
-
- // we have sound
- soundOutput = true;
- } catch (LWJGLException le) {
- le.printStackTrace();
- System.out.println("Sound disabled");
- }
- }
-
- /**
- * Adds a sound to the Sound Managers pool
- *
- * @param path Path to file to load
- * @return index into SoundManagers buffer list
- */
- public int addSound(String path) {
- // Generate 1 buffer entry
- scratchBuffer.rewind().position(0).limit(1);
- AL10.alGenBuffers(scratchBuffer);
- buffers[bufferIndex] = scratchBuffer.get(0);
-
- // load wave data from buffer
- WaveData wavefile = WaveData.create("spaceinvaders/" + path);
-
- // copy to buffers
- AL10.alBufferData(buffers[bufferIndex], wavefile.format, wavefile.data, wavefile.samplerate);
-
- // unload file again
- wavefile.dispose();
-
- // return index for this sound
- return bufferIndex++;
- }
-
- /**
- * Destroy this SoundManager
- */
- public void destroy() {
- if(soundOutput) {
-
- // stop playing sounds
- scratchBuffer.position(0).limit(sources.length);
- scratchBuffer.put(sources).flip();
- AL10.alSourceStop(scratchBuffer);
-
- // destroy sources
- AL10.alDeleteSources(scratchBuffer);
-
- // destroy buffers
- scratchBuffer.position(0).limit(bufferIndex);
- scratchBuffer.put(buffers, 0, bufferIndex).flip();
- AL10.alDeleteBuffers(scratchBuffer);
-
- // destory OpenAL
- AL.destroy();
- }
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.examples.spaceinvaders;
+
+import java.nio.IntBuffer;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.LWJGLException;
+import org.lwjgl.openal.AL;
+import org.lwjgl.openal.AL10;
+import org.lwjgl.util.WaveData;
+
+
+/**
+ * <p>
+ * Simple sound manager for OpenAL using n sources accessed in
+ * a round robin schedule. Source n is reserved for a single buffer and checking for
+ * whether it's playing.
+ * </p>
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 2983 $
+ * $Id: SoundManager.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public class SoundManager {
+
+ /** We support at most 256 buffers*/
+ private int[] buffers = new int[256];
+
+ /** Number of sources is limited tby user (and hardware) */
+ private int[] sources;
+
+ /** Our internal scratch buffer */
+ private IntBuffer scratchBuffer = BufferUtils.createIntBuffer(256);
+
+ /** Whether we're running in no sound mode */
+ private boolean soundOutput;
+
+ /** Current index in our buffers */
+ private int bufferIndex;
+
+ /** Current index in our source list */
+ private int sourceIndex;
+
+ /**
+ * Creates a new SoundManager
+ */
+ public SoundManager() {
+ }
+
+ /**
+ * Plays a sound effect
+ * @param buffer Buffer index to play gotten from addSound
+ */
+ public void playEffect(int buffer) {
+ if(soundOutput) {
+ // make sure we never choose last channel, since it is used for special sounds
+ int channel = sources[(sourceIndex++ % (sources.length-1))];
+
+ // link buffer and source, and play it
+ AL10.alSourcei(channel, AL10.AL_BUFFER, buffers[buffer]);
+ AL10.alSourcePlay(channel);
+ }
+ }
+
+ /**
+ * Plays a sound on last source
+ * @param buffer Buffer index to play gotten from addSound
+ */
+ public void playSound(int buffer) {
+ if(soundOutput) {
+ AL10.alSourcei(sources[sources.length-1], AL10.AL_BUFFER, buffers[buffer]);
+ AL10.alSourcePlay(sources[sources.length-1]);
+ }
+ }
+
+ /**
+ * Whether a sound is playing on last source
+ * @return true if a source is playing right now on source n
+ */
+ public boolean isPlayingSound() {
+ return AL10.alGetSourcei(sources[sources.length-1], AL10.AL_SOURCE_STATE) == AL10.AL_PLAYING;
+ }
+
+ /**
+ * Initializes the SoundManager
+ *
+ * @param sources Number of sources to create
+ */
+ public void initialize(int channels) {
+ try {
+ AL.create();
+
+ // allocate sources
+ scratchBuffer.limit(channels);
+ AL10.alGenSources(scratchBuffer);
+ scratchBuffer.rewind();
+ scratchBuffer.get(sources = new int[channels]);
+
+ // could we allocate all channels?
+ if(AL10.alGetError() != AL10.AL_NO_ERROR) {
+ throw new LWJGLException("Unable to allocate " + channels + " sources");
+ }
+
+ // we have sound
+ soundOutput = true;
+ } catch (LWJGLException le) {
+ le.printStackTrace();
+ System.out.println("Sound disabled");
+ }
+ }
+
+ /**
+ * Adds a sound to the Sound Managers pool
+ *
+ * @param path Path to file to load
+ * @return index into SoundManagers buffer list
+ */
+ public int addSound(String path) {
+ // Generate 1 buffer entry
+ scratchBuffer.rewind().position(0).limit(1);
+ AL10.alGenBuffers(scratchBuffer);
+ buffers[bufferIndex] = scratchBuffer.get(0);
+
+ // load wave data from buffer
+ WaveData wavefile = WaveData.create("spaceinvaders/" + path);
+
+ // copy to buffers
+ AL10.alBufferData(buffers[bufferIndex], wavefile.format, wavefile.data, wavefile.samplerate);
+
+ // unload file again
+ wavefile.dispose();
+
+ // return index for this sound
+ return bufferIndex++;
+ }
+
+ /**
+ * Destroy this SoundManager
+ */
+ public void destroy() {
+ if(soundOutput) {
+
+ // stop playing sounds
+ scratchBuffer.position(0).limit(sources.length);
+ scratchBuffer.put(sources).flip();
+ AL10.alSourceStop(scratchBuffer);
+
+ // destroy sources
+ AL10.alDeleteSources(scratchBuffer);
+
+ // destroy buffers
+ scratchBuffer.position(0).limit(bufferIndex);
+ scratchBuffer.put(buffers, 0, bufferIndex).flip();
+ AL10.alDeleteBuffers(scratchBuffer);
+
+ // destory OpenAL
+ AL.destroy();
+ }
+ }
+}
diff --git a/src/java/org/lwjgl/examples/spaceinvaders/Sprite.java b/src/java/org/lwjgl/examples/spaceinvaders/Sprite.java
index 162af89..845346c 100644
--- a/src/java/org/lwjgl/examples/spaceinvaders/Sprite.java
+++ b/src/java/org/lwjgl/examples/spaceinvaders/Sprite.java
@@ -1,127 +1,127 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.examples.spaceinvaders;
-
-import java.io.IOException;
-
-import org.lwjgl.opengl.GL11;
-
-/**
- * Implementation of sprite that uses an OpenGL quad and a texture
- * to render a given image to the screen.
- *
- * @author Kevin Glass
- * @author Brian Matzon
- */
-public class Sprite {
-
- /** The texture that stores the image for this sprite */
- private Texture texture;
-
- /** The width in pixels of this sprite */
- private int width;
-
- /** The height in pixels of this sprite */
- private int height;
-
- /**
- * Create a new sprite from a specified image.
- *
- * @param window The window in which the sprite will be displayed
- * @param ref A reference to the image on which this sprite should be based
- */
- public Sprite(TextureLoader loader, String ref) {
- try {
- texture = loader.getTexture("spaceinvaders/" + ref);
- width = texture.getImageWidth();
- height = texture.getImageHeight();
- } catch (IOException ioe) {
- ioe.printStackTrace();
- System.exit(-1);
- }
- }
-
- /**
- * Get the width of this sprite in pixels
- *
- * @return The width of this sprite in pixels
- */
- public int getWidth() {
- return texture.getImageWidth();
- }
-
- /**
- * Get the height of this sprite in pixels
- *
- * @return The height of this sprite in pixels
- */
- public int getHeight() {
- return texture.getImageHeight();
- }
-
- /**
- * Draw the sprite at the specified location
- *
- * @param x The x location at which to draw this sprite
- * @param y The y location at which to draw this sprite
- */
- public void draw(int x, int y) {
- // store the current model matrix
- GL11.glPushMatrix();
-
- // bind to the appropriate texture for this sprite
- texture.bind();
-
- // translate to the right location and prepare to draw
- GL11.glTranslatef(x, y, 0);
-
- // draw a quad textured to match the sprite
- GL11.glBegin(GL11.GL_QUADS);
- {
- GL11.glTexCoord2f(0, 0);
- GL11.glVertex2f(0, 0);
-
- GL11.glTexCoord2f(0, texture.getHeight());
- GL11.glVertex2f(0, height);
-
- GL11.glTexCoord2f(texture.getWidth(), texture.getHeight());
- GL11.glVertex2f(width, height);
-
- GL11.glTexCoord2f(texture.getWidth(), 0);
- GL11.glVertex2f(width, 0);
- }
- GL11.glEnd();
-
- // restore the model view matrix to prevent contamination
- GL11.glPopMatrix();
- }
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.examples.spaceinvaders;
+
+import java.io.IOException;
+
+import org.lwjgl.opengl.GL11;
+
+/**
+ * Implementation of sprite that uses an OpenGL quad and a texture
+ * to render a given image to the screen.
+ *
+ * @author Kevin Glass
+ * @author Brian Matzon
+ */
+public class Sprite {
+
+ /** The texture that stores the image for this sprite */
+ private Texture texture;
+
+ /** The width in pixels of this sprite */
+ private int width;
+
+ /** The height in pixels of this sprite */
+ private int height;
+
+ /**
+ * Create a new sprite from a specified image.
+ *
+ * @param window The window in which the sprite will be displayed
+ * @param ref A reference to the image on which this sprite should be based
+ */
+ public Sprite(TextureLoader loader, String ref) {
+ try {
+ texture = loader.getTexture("spaceinvaders/" + ref);
+ width = texture.getImageWidth();
+ height = texture.getImageHeight();
+ } catch (IOException ioe) {
+ ioe.printStackTrace();
+ System.exit(-1);
+ }
+ }
+
+ /**
+ * Get the width of this sprite in pixels
+ *
+ * @return The width of this sprite in pixels
+ */
+ public int getWidth() {
+ return texture.getImageWidth();
+ }
+
+ /**
+ * Get the height of this sprite in pixels
+ *
+ * @return The height of this sprite in pixels
+ */
+ public int getHeight() {
+ return texture.getImageHeight();
+ }
+
+ /**
+ * Draw the sprite at the specified location
+ *
+ * @param x The x location at which to draw this sprite
+ * @param y The y location at which to draw this sprite
+ */
+ public void draw(int x, int y) {
+ // store the current model matrix
+ GL11.glPushMatrix();
+
+ // bind to the appropriate texture for this sprite
+ texture.bind();
+
+ // translate to the right location and prepare to draw
+ GL11.glTranslatef(x, y, 0);
+
+ // draw a quad textured to match the sprite
+ GL11.glBegin(GL11.GL_QUADS);
+ {
+ GL11.glTexCoord2f(0, 0);
+ GL11.glVertex2f(0, 0);
+
+ GL11.glTexCoord2f(0, texture.getHeight());
+ GL11.glVertex2f(0, height);
+
+ GL11.glTexCoord2f(texture.getWidth(), texture.getHeight());
+ GL11.glVertex2f(width, height);
+
+ GL11.glTexCoord2f(texture.getWidth(), 0);
+ GL11.glVertex2f(width, 0);
+ }
+ GL11.glEnd();
+
+ // restore the model view matrix to prevent contamination
+ GL11.glPopMatrix();
+ }
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/examples/spaceinvaders/Texture.java b/src/java/org/lwjgl/examples/spaceinvaders/Texture.java
index 58a964d..0503172 100644
--- a/src/java/org/lwjgl/examples/spaceinvaders/Texture.java
+++ b/src/java/org/lwjgl/examples/spaceinvaders/Texture.java
@@ -1,190 +1,190 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.examples.spaceinvaders;
-
-import org.lwjgl.opengl.GL11;
-
-/**
- * A texture to be bound within OpenGL. This object is responsible for
- * keeping track of a given OpenGL texture and for calculating the
- * texturing mapping coordinates of the full image.
- *
- * Since textures need to be powers of 2 the actual texture may be
- * considerably bigged that the source image and hence the texture
- * mapping coordinates need to be adjusted to matchup drawing the
- * sprite against the texture.
- *
- * @author Kevin Glass
- * @author Brian Matzon
- */
-public class Texture {
-
- /** The GL target type */
- private int target;
-
- /** The GL texture ID */
- private int textureID;
-
- /** The height of the image */
- private int height;
-
- /** The width of the image */
- private int width;
-
- /** The width of the texture */
- private int texWidth;
-
- /** The height of the texture */
- private int texHeight;
-
- /** The ratio of the width of the image to the texture */
- private float widthRatio;
-
- /** The ratio of the height of the image to the texture */
- private float heightRatio;
-
- /**
- * Create a new texture
- *
- * @param target The GL target
- * @param textureID The GL texture ID
- */
- public Texture(int target, int textureID) {
- this.target = target;
- this.textureID = textureID;
- }
-
- /**
- * Bind the specified GL context to a texture
- *
- * @param gl The GL context to bind to
- */
- public void bind() {
- GL11.glBindTexture(target, textureID);
- }
-
- /**
- * Set the height of the image
- *
- * @param height The height of the image
- */
- public void setHeight(int height) {
- this.height = height;
- setHeight();
- }
-
- /**
- * Set the width of the image
- *
- * @param width The width of the image
- */
- public void setWidth(int width) {
- this.width = width;
- setWidth();
- }
-
- /**
- * Get the height of the original image
- *
- * @return The height of the original image
- */
- public int getImageHeight() {
- return height;
- }
-
- /**
- * Get the width of the original image
- *
- * @return The width of the original image
- */
- public int getImageWidth() {
- return width;
- }
-
- /**
- * Get the height of the physical texture
- *
- * @return The height of physical texture
- */
- public float getHeight() {
- return heightRatio;
- }
-
- /**
- * Get the width of the physical texture
- *
- * @return The width of physical texture
- */
- public float getWidth() {
- return widthRatio;
- }
-
- /**
- * Set the height of this texture
- *
- * @param texHeight The height of the texture
- */
- public void setTextureHeight(int texHeight) {
- this.texHeight = texHeight;
- setHeight();
- }
-
- /**
- * Set the width of this texture
- *
- * @param texWidth The width of the texture
- */
- public void setTextureWidth(int texWidth) {
- this.texWidth = texWidth;
- setWidth();
- }
-
- /**
- * Set the height of the texture. This will update the
- * ratio also.
- */
- private void setHeight() {
- if (texHeight != 0) {
- heightRatio = ((float) height) / texHeight;
- }
- }
-
- /**
- * Set the width of the texture. This will update the
- * ratio also.
- */
- private void setWidth() {
- if (texWidth != 0) {
- widthRatio = ((float) width) / texWidth;
- }
- }
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.examples.spaceinvaders;
+
+import org.lwjgl.opengl.GL11;
+
+/**
+ * A texture to be bound within OpenGL. This object is responsible for
+ * keeping track of a given OpenGL texture and for calculating the
+ * texturing mapping coordinates of the full image.
+ *
+ * Since textures need to be powers of 2 the actual texture may be
+ * considerably bigged that the source image and hence the texture
+ * mapping coordinates need to be adjusted to matchup drawing the
+ * sprite against the texture.
+ *
+ * @author Kevin Glass
+ * @author Brian Matzon
+ */
+public class Texture {
+
+ /** The GL target type */
+ private int target;
+
+ /** The GL texture ID */
+ private int textureID;
+
+ /** The height of the image */
+ private int height;
+
+ /** The width of the image */
+ private int width;
+
+ /** The width of the texture */
+ private int texWidth;
+
+ /** The height of the texture */
+ private int texHeight;
+
+ /** The ratio of the width of the image to the texture */
+ private float widthRatio;
+
+ /** The ratio of the height of the image to the texture */
+ private float heightRatio;
+
+ /**
+ * Create a new texture
+ *
+ * @param target The GL target
+ * @param textureID The GL texture ID
+ */
+ public Texture(int target, int textureID) {
+ this.target = target;
+ this.textureID = textureID;
+ }
+
+ /**
+ * Bind the specified GL context to a texture
+ *
+ * @param gl The GL context to bind to
+ */
+ public void bind() {
+ GL11.glBindTexture(target, textureID);
+ }
+
+ /**
+ * Set the height of the image
+ *
+ * @param height The height of the image
+ */
+ public void setHeight(int height) {
+ this.height = height;
+ setHeight();
+ }
+
+ /**
+ * Set the width of the image
+ *
+ * @param width The width of the image
+ */
+ public void setWidth(int width) {
+ this.width = width;
+ setWidth();
+ }
+
+ /**
+ * Get the height of the original image
+ *
+ * @return The height of the original image
+ */
+ public int getImageHeight() {
+ return height;
+ }
+
+ /**
+ * Get the width of the original image
+ *
+ * @return The width of the original image
+ */
+ public int getImageWidth() {
+ return width;
+ }
+
+ /**
+ * Get the height of the physical texture
+ *
+ * @return The height of physical texture
+ */
+ public float getHeight() {
+ return heightRatio;
+ }
+
+ /**
+ * Get the width of the physical texture
+ *
+ * @return The width of physical texture
+ */
+ public float getWidth() {
+ return widthRatio;
+ }
+
+ /**
+ * Set the height of this texture
+ *
+ * @param texHeight The height of the texture
+ */
+ public void setTextureHeight(int texHeight) {
+ this.texHeight = texHeight;
+ setHeight();
+ }
+
+ /**
+ * Set the width of this texture
+ *
+ * @param texWidth The width of the texture
+ */
+ public void setTextureWidth(int texWidth) {
+ this.texWidth = texWidth;
+ setWidth();
+ }
+
+ /**
+ * Set the height of the texture. This will update the
+ * ratio also.
+ */
+ private void setHeight() {
+ if (texHeight != 0) {
+ heightRatio = ((float) height) / texHeight;
+ }
+ }
+
+ /**
+ * Set the width of the texture. This will update the
+ * ratio also.
+ */
+ private void setWidth() {
+ if (texWidth != 0) {
+ widthRatio = ((float) width) / texWidth;
+ }
+ }
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/examples/spaceinvaders/TextureLoader.java b/src/java/org/lwjgl/examples/spaceinvaders/TextureLoader.java
index fb3af5e..8a74484 100644
--- a/src/java/org/lwjgl/examples/spaceinvaders/TextureLoader.java
+++ b/src/java/org/lwjgl/examples/spaceinvaders/TextureLoader.java
@@ -1,285 +1,285 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.examples.spaceinvaders;
-
-import java.awt.Color;
-import java.awt.Graphics;
-import java.awt.color.ColorSpace;
-import java.awt.image.BufferedImage;
-import java.awt.image.ColorModel;
-import java.awt.image.ComponentColorModel;
-import java.awt.image.DataBuffer;
-import java.awt.image.DataBufferByte;
-import java.awt.image.Raster;
-import java.awt.image.WritableRaster;
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.net.URL;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.nio.IntBuffer;
-import java.util.HashMap;
-import java.util.Hashtable;
-
-import javax.imageio.ImageIO;
-
-import org.lwjgl.BufferUtils;
-import org.lwjgl.opengl.GL11;
-
-/**
- * A utility class to load textures for OpenGL. This source is based
- * on a texture that can be found in the Java Gaming (www.javagaming.org)
- * Wiki. It has been simplified slightly for explicit 2D graphics use.
- *
- * OpenGL uses a particular image format. Since the images that are
- * loaded from disk may not match this format this loader introduces
- * a intermediate image which the source image is copied into. In turn,
- * this image is used as source for the OpenGL texture.
- *
- * @author Kevin Glass
- * @author Brian Matzon
- */
-public class TextureLoader {
- /** The table of textures that have been loaded in this loader */
- private HashMap table = new HashMap();
-
- /** The colour model including alpha for the GL image */
- private ColorModel glAlphaColorModel;
-
- /** The colour model for the GL image */
- private ColorModel glColorModel;
-
- /** Scratch buffer for texture ID's */
- private IntBuffer textureIDBuffer = BufferUtils.createIntBuffer(1);
-
- /**
- * Create a new texture loader based on the game panel
- *
- * @param gl The GL content in which the textures should be loaded
- */
- public TextureLoader() {
- glAlphaColorModel = new ComponentColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB),
- new int[] {8,8,8,8},
- true,
- false,
- ComponentColorModel.TRANSLUCENT,
- DataBuffer.TYPE_BYTE);
-
- glColorModel = new ComponentColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB),
- new int[] {8,8,8,0},
- false,
- false,
- ComponentColorModel.OPAQUE,
- DataBuffer.TYPE_BYTE);
- }
-
- /**
- * Create a new texture ID
- *
- * @return A new texture ID
- */
- private int createTextureID() {
- GL11.glGenTextures(textureIDBuffer);
- return textureIDBuffer.get(0);
- }
-
- /**
- * Load a texture
- *
- * @param resourceName The location of the resource to load
- * @return The loaded texture
- * @throws IOException Indicates a failure to access the resource
- */
- public Texture getTexture(String resourceName) throws IOException {
- Texture tex = (Texture) table.get(resourceName);
-
- if (tex != null) {
- return tex;
- }
-
- tex = getTexture(resourceName,
- GL11.GL_TEXTURE_2D, // target
- GL11.GL_RGBA, // dst pixel format
- GL11.GL_LINEAR, // min filter (unused)
- GL11.GL_LINEAR);
-
- table.put(resourceName,tex);
-
- return tex;
- }
-
- /**
- * Load a texture into OpenGL from a image reference on
- * disk.
- *
- * @param resourceName The location of the resource to load
- * @param target The GL target to load the texture against
- * @param dstPixelFormat The pixel format of the screen
- * @param minFilter The minimising filter
- * @param magFilter The magnification filter
- * @return The loaded texture
- * @throws IOException Indicates a failure to access the resource
- */
- public Texture getTexture(String resourceName,
- int target,
- int dstPixelFormat,
- int minFilter,
- int magFilter) throws IOException {
- int srcPixelFormat = 0;
-
- // create the texture ID for this texture
- int textureID = createTextureID();
- Texture texture = new Texture(target,textureID);
-
- // bind this texture
- GL11.glBindTexture(target, textureID);
-
- BufferedImage bufferedImage = loadImage(resourceName);
- texture.setWidth(bufferedImage.getWidth());
- texture.setHeight(bufferedImage.getHeight());
-
- if (bufferedImage.getColorModel().hasAlpha()) {
- srcPixelFormat = GL11.GL_RGBA;
- } else {
- srcPixelFormat = GL11.GL_RGB;
- }
-
- // convert that image into a byte buffer of texture data
- ByteBuffer textureBuffer = convertImageData(bufferedImage,texture);
-
- if (target == GL11.GL_TEXTURE_2D) {
- GL11.glTexParameteri(target, GL11.GL_TEXTURE_MIN_FILTER, minFilter);
- GL11.glTexParameteri(target, GL11.GL_TEXTURE_MAG_FILTER, magFilter);
- }
-
- // produce a texture from the byte buffer
- GL11.glTexImage2D(target,
- 0,
- dstPixelFormat,
- get2Fold(bufferedImage.getWidth()),
- get2Fold(bufferedImage.getHeight()),
- 0,
- srcPixelFormat,
- GL11.GL_UNSIGNED_BYTE,
- textureBuffer );
-
- return texture;
- }
-
- /**
- * Get the closest greater power of 2 to the fold number
- *
- * @param fold The target number
- * @return The power of 2
- */
- private int get2Fold(int fold) {
- int ret = 2;
- while (ret < fold) {
- ret *= 2;
- }
- return ret;
- }
-
- /**
- * Convert the buffered image to a texture
- *
- * @param bufferedImage The image to convert to a texture
- * @param texture The texture to store the data into
- * @return A buffer containing the data
- */
- private ByteBuffer convertImageData(BufferedImage bufferedImage,Texture texture) {
- ByteBuffer imageBuffer = null;
- WritableRaster raster;
- BufferedImage texImage;
-
- int texWidth = 2;
- int texHeight = 2;
-
- // find the closest power of 2 for the width and height
- // of the produced texture
- while (texWidth < bufferedImage.getWidth()) {
- texWidth *= 2;
- }
- while (texHeight < bufferedImage.getHeight()) {
- texHeight *= 2;
- }
-
- texture.setTextureHeight(texHeight);
- texture.setTextureWidth(texWidth);
-
- // create a raster that can be used by OpenGL as a source
- // for a texture
- if (bufferedImage.getColorModel().hasAlpha()) {
- raster = Raster.createInterleavedRaster(DataBuffer.TYPE_BYTE,texWidth,texHeight,4,null);
- texImage = new BufferedImage(glAlphaColorModel,raster,false,new Hashtable());
- } else {
- raster = Raster.createInterleavedRaster(DataBuffer.TYPE_BYTE,texWidth,texHeight,3,null);
- texImage = new BufferedImage(glColorModel,raster,false,new Hashtable());
- }
-
- // copy the source image into the produced image
- Graphics g = texImage.getGraphics();
- g.setColor(new Color(0f,0f,0f,0f));
- g.fillRect(0,0,texWidth,texHeight);
- g.drawImage(bufferedImage,0,0,null);
-
- // build a byte buffer from the temporary image
- // that be used by OpenGL to produce a texture.
- byte[] data = ((DataBufferByte) texImage.getRaster().getDataBuffer()).getData();
-
- imageBuffer = ByteBuffer.allocateDirect(data.length);
- imageBuffer.order(ByteOrder.nativeOrder());
- imageBuffer.put(data, 0, data.length);
- imageBuffer.flip();
-
- return imageBuffer;
- }
-
- /**
- * Load a given resource as a buffered image
- *
- * @param ref The location of the resource to load
- * @return The loaded buffered image
- * @throws IOException Indicates a failure to find a resource
- */
- private BufferedImage loadImage(String ref) throws IOException {
- URL url = TextureLoader.class.getClassLoader().getResource(ref);
-
- if (url == null) {
- throw new IOException("Cannot find: " + ref);
- }
-
- BufferedImage bufferedImage = ImageIO.read(new BufferedInputStream(getClass().getClassLoader().getResourceAsStream(ref)));
-
- return bufferedImage;
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.examples.spaceinvaders;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.color.ColorSpace;
+import java.awt.image.BufferedImage;
+import java.awt.image.ColorModel;
+import java.awt.image.ComponentColorModel;
+import java.awt.image.DataBuffer;
+import java.awt.image.DataBufferByte;
+import java.awt.image.Raster;
+import java.awt.image.WritableRaster;
+import java.io.BufferedInputStream;
+import java.io.IOException;
+import java.net.URL;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.IntBuffer;
+import java.util.HashMap;
+import java.util.Hashtable;
+
+import javax.imageio.ImageIO;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.opengl.GL11;
+
+/**
+ * A utility class to load textures for OpenGL. This source is based
+ * on a texture that can be found in the Java Gaming (www.javagaming.org)
+ * Wiki. It has been simplified slightly for explicit 2D graphics use.
+ *
+ * OpenGL uses a particular image format. Since the images that are
+ * loaded from disk may not match this format this loader introduces
+ * a intermediate image which the source image is copied into. In turn,
+ * this image is used as source for the OpenGL texture.
+ *
+ * @author Kevin Glass
+ * @author Brian Matzon
+ */
+public class TextureLoader {
+ /** The table of textures that have been loaded in this loader */
+ private HashMap table = new HashMap();
+
+ /** The colour model including alpha for the GL image */
+ private ColorModel glAlphaColorModel;
+
+ /** The colour model for the GL image */
+ private ColorModel glColorModel;
+
+ /** Scratch buffer for texture ID's */
+ private IntBuffer textureIDBuffer = BufferUtils.createIntBuffer(1);
+
+ /**
+ * Create a new texture loader based on the game panel
+ *
+ * @param gl The GL content in which the textures should be loaded
+ */
+ public TextureLoader() {
+ glAlphaColorModel = new ComponentColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB),
+ new int[] {8,8,8,8},
+ true,
+ false,
+ ComponentColorModel.TRANSLUCENT,
+ DataBuffer.TYPE_BYTE);
+
+ glColorModel = new ComponentColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB),
+ new int[] {8,8,8,0},
+ false,
+ false,
+ ComponentColorModel.OPAQUE,
+ DataBuffer.TYPE_BYTE);
+ }
+
+ /**
+ * Create a new texture ID
+ *
+ * @return A new texture ID
+ */
+ private int createTextureID() {
+ GL11.glGenTextures(textureIDBuffer);
+ return textureIDBuffer.get(0);
+ }
+
+ /**
+ * Load a texture
+ *
+ * @param resourceName The location of the resource to load
+ * @return The loaded texture
+ * @throws IOException Indicates a failure to access the resource
+ */
+ public Texture getTexture(String resourceName) throws IOException {
+ Texture tex = (Texture) table.get(resourceName);
+
+ if (tex != null) {
+ return tex;
+ }
+
+ tex = getTexture(resourceName,
+ GL11.GL_TEXTURE_2D, // target
+ GL11.GL_RGBA, // dst pixel format
+ GL11.GL_LINEAR, // min filter (unused)
+ GL11.GL_LINEAR);
+
+ table.put(resourceName,tex);
+
+ return tex;
+ }
+
+ /**
+ * Load a texture into OpenGL from a image reference on
+ * disk.
+ *
+ * @param resourceName The location of the resource to load
+ * @param target The GL target to load the texture against
+ * @param dstPixelFormat The pixel format of the screen
+ * @param minFilter The minimising filter
+ * @param magFilter The magnification filter
+ * @return The loaded texture
+ * @throws IOException Indicates a failure to access the resource
+ */
+ public Texture getTexture(String resourceName,
+ int target,
+ int dstPixelFormat,
+ int minFilter,
+ int magFilter) throws IOException {
+ int srcPixelFormat = 0;
+
+ // create the texture ID for this texture
+ int textureID = createTextureID();
+ Texture texture = new Texture(target,textureID);
+
+ // bind this texture
+ GL11.glBindTexture(target, textureID);
+
+ BufferedImage bufferedImage = loadImage(resourceName);
+ texture.setWidth(bufferedImage.getWidth());
+ texture.setHeight(bufferedImage.getHeight());
+
+ if (bufferedImage.getColorModel().hasAlpha()) {
+ srcPixelFormat = GL11.GL_RGBA;
+ } else {
+ srcPixelFormat = GL11.GL_RGB;
+ }
+
+ // convert that image into a byte buffer of texture data
+ ByteBuffer textureBuffer = convertImageData(bufferedImage,texture);
+
+ if (target == GL11.GL_TEXTURE_2D) {
+ GL11.glTexParameteri(target, GL11.GL_TEXTURE_MIN_FILTER, minFilter);
+ GL11.glTexParameteri(target, GL11.GL_TEXTURE_MAG_FILTER, magFilter);
+ }
+
+ // produce a texture from the byte buffer
+ GL11.glTexImage2D(target,
+ 0,
+ dstPixelFormat,
+ get2Fold(bufferedImage.getWidth()),
+ get2Fold(bufferedImage.getHeight()),
+ 0,
+ srcPixelFormat,
+ GL11.GL_UNSIGNED_BYTE,
+ textureBuffer );
+
+ return texture;
+ }
+
+ /**
+ * Get the closest greater power of 2 to the fold number
+ *
+ * @param fold The target number
+ * @return The power of 2
+ */
+ private int get2Fold(int fold) {
+ int ret = 2;
+ while (ret < fold) {
+ ret *= 2;
+ }
+ return ret;
+ }
+
+ /**
+ * Convert the buffered image to a texture
+ *
+ * @param bufferedImage The image to convert to a texture
+ * @param texture The texture to store the data into
+ * @return A buffer containing the data
+ */
+ private ByteBuffer convertImageData(BufferedImage bufferedImage,Texture texture) {
+ ByteBuffer imageBuffer = null;
+ WritableRaster raster;
+ BufferedImage texImage;
+
+ int texWidth = 2;
+ int texHeight = 2;
+
+ // find the closest power of 2 for the width and height
+ // of the produced texture
+ while (texWidth < bufferedImage.getWidth()) {
+ texWidth *= 2;
+ }
+ while (texHeight < bufferedImage.getHeight()) {
+ texHeight *= 2;
+ }
+
+ texture.setTextureHeight(texHeight);
+ texture.setTextureWidth(texWidth);
+
+ // create a raster that can be used by OpenGL as a source
+ // for a texture
+ if (bufferedImage.getColorModel().hasAlpha()) {
+ raster = Raster.createInterleavedRaster(DataBuffer.TYPE_BYTE,texWidth,texHeight,4,null);
+ texImage = new BufferedImage(glAlphaColorModel,raster,false,new Hashtable());
+ } else {
+ raster = Raster.createInterleavedRaster(DataBuffer.TYPE_BYTE,texWidth,texHeight,3,null);
+ texImage = new BufferedImage(glColorModel,raster,false,new Hashtable());
+ }
+
+ // copy the source image into the produced image
+ Graphics g = texImage.getGraphics();
+ g.setColor(new Color(0f,0f,0f,0f));
+ g.fillRect(0,0,texWidth,texHeight);
+ g.drawImage(bufferedImage,0,0,null);
+
+ // build a byte buffer from the temporary image
+ // that be used by OpenGL to produce a texture.
+ byte[] data = ((DataBufferByte) texImage.getRaster().getDataBuffer()).getData();
+
+ imageBuffer = ByteBuffer.allocateDirect(data.length);
+ imageBuffer.order(ByteOrder.nativeOrder());
+ imageBuffer.put(data, 0, data.length);
+ imageBuffer.flip();
+
+ return imageBuffer;
+ }
+
+ /**
+ * Load a given resource as a buffered image
+ *
+ * @param ref The location of the resource to load
+ * @return The loaded buffered image
+ * @throws IOException Indicates a failure to find a resource
+ */
+ private BufferedImage loadImage(String ref) throws IOException {
+ URL url = TextureLoader.class.getClassLoader().getResource(ref);
+
+ if (url == null) {
+ throw new IOException("Cannot find: " + ref);
+ }
+
+ BufferedImage bufferedImage = ImageIO.read(new BufferedInputStream(getClass().getClassLoader().getResourceAsStream(ref)));
+
+ return bufferedImage;
+ }
+}
diff --git a/src/java/org/lwjgl/input/Controller.java b/src/java/org/lwjgl/input/Controller.java
index 9649df6..4d2c3f4 100644
--- a/src/java/org/lwjgl/input/Controller.java
+++ b/src/java/org/lwjgl/input/Controller.java
@@ -1,273 +1,273 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.input;
-
-/**
- * A game controller of some sort that will provide input. The controller
- * presents buttons and axes. Buttons are either pressed or not pressed. Axis
- * provide analogue values.
- *
- * @author Kevin Glass
- */
-public interface Controller {
- /**
- * Get the name assigned to this controller.
- *
- * @return The name assigned to this controller
- */
- public String getName();
-
- /**
- * Get the index of this controller in the collection
- *
- * @return The index of this controller in the collection
- */
- public int getIndex();
-
- /**
- * Retrieve the number of buttons available on this controller
- *
- * @return The number of butotns available on this controller
- */
- public int getButtonCount();
-
- /**
- * Get the name of the specified button. Be warned, often this is
- * as exciting as "Button X"
- *
- * @param index The index of the button whose name should be retrieved
- * @return The name of the button requested
- */
- public String getButtonName(int index);
-
- /**
- * Check if a button is currently pressed
- *
- * @param index The button to check
- * @return True if the button is currently pressed
- */
- public boolean isButtonPressed(int index);
-
- /**
- * Poll the controller for new data. This will also update
- * events
- */
- public void poll();
-
- /**
- * Get the X-Axis value of the POV on this controller
- *
- * @return The X-Axis value of the POV on this controller
- */
- public float getPovX();
-
- /**
- * Get the Y-Axis value of the POV on this controller
- *
- * @return The Y-Axis value of the POV on this controller
- */
- public float getPovY();
-
- /**
- * Get the dead zone for a specified axis
- *
- * @param index The index of the axis for which to retrieve the dead zone
- * @return The dead zone for the specified axis
- */
- public float getDeadZone(int index);
-
- /**
- * Set the dead zone for the specified axis
- *
- * @param index The index of hte axis for which to set the dead zone
- * @param zone The dead zone to use for the specified axis
- */
- public void setDeadZone(int index,float zone);
-
- /**
- * Retrieve the number of axes available on this controller.
- *
- * @return The number of axes available on this controller.
- */
- public int getAxisCount();
-
- /**
- * Get the name that's given to the specified axis
- *
- * @param index The index of the axis whose name should be retrieved
- * @return The name of the specified axis.
- */
- public String getAxisName(int index);
-
- /**
- * Retrieve the value thats currently available on a specified axis. The
- * value will always be between 1.0 and -1.0 and will calibrate as values
- * are passed read. It may be useful to get the player to wiggle the joystick
- * from side to side to get the calibration right.
- *
- * @param index The index of axis to be read
- * @return The value from the specified axis.
- */
- public float getAxisValue(int index);
-
- /**
- * Get the value from the X axis if there is one. If no X axis is
- * defined a zero value will be returned.
- *
- * @return The value from the X axis
- */
- public float getXAxisValue();
-
- /**
- * Get the dead zone for the X axis.
- *
- * @return The dead zone for the X axis
- */
- public float getXAxisDeadZone();
-
- /**
- * Set the dead zone for the X axis
- *
- * @param zone The dead zone to use for the X axis
- */
- public void setXAxisDeadZone(float zone);
-
- /**
- * Get the value from the Y axis if there is one. If no Y axis is
- * defined a zero value will be returned.
- *
- * @return The value from the Y axis
- */
- public float getYAxisValue();
-
- /**
- * Get the dead zone for the Y axis.
- *
- * @return The dead zone for the Y axis
- */
- public float getYAxisDeadZone();
-
- /**
- * Set the dead zone for the Y axis
- *
- * @param zone The dead zone to use for the Y axis
- */
- public void setYAxisDeadZone(float zone);
-
- /**
- * Get the value from the Z axis if there is one. If no Z axis is
- * defined a zero value will be returned.
- *
- * @return The value from the Z axis
- */
- public float getZAxisValue();
-
- /**
- * Get the dead zone for the Z axis.
- *
- * @return The dead zone for the Z axis
- */
- public float getZAxisDeadZone();
-
- /**
- * Set the dead zone for the Z axis
- *
- * @param zone The dead zone to use for the Z axis
- */
- public void setZAxisDeadZone(float zone);
-
- /**
- * Get the value from the RX axis if there is one. If no RX axis is
- * defined a zero value will be returned.
- *
- * @return The value from the RX axis
- */
- public float getRXAxisValue();
-
- /**
- * Get the dead zone for the RX axis.
- *
- * @return The dead zone for the RX axis
- */
- public float getRXAxisDeadZone();
-
- /**
- * Set the dead zone for the RX axis
- *
- * @param zone The dead zone to use for the RX axis
- */
- public void setRXAxisDeadZone(float zone);
-
- /**
- * Get the value from the RY axis if there is one. If no RY axis is
- * defined a zero value will be returned.
- *
- * @return The value from the RY axis
- */
- public float getRYAxisValue();
-
- /**
- * Get the dead zone for the RY axis.
- *
- * @return The dead zone for the RY axis
- */
- public float getRYAxisDeadZone();
-
- /**
- * Set the dead zone for the RY axis
- *
- * @param zone The dead zone to use for the RY axis
- */
- public void setRYAxisDeadZone(float zone);
-
- /**
- * Get the value from the RZ axis if there is one. If no RZ axis is
- * defined a zero value will be returned.
- *
- * @return The value from the RZ axis
- */
- public float getRZAxisValue();
-
- /**
- * Get the dead zone for the RZ axis.
- *
- * @return The dead zone for the RZ axis
- */
- public float getRZAxisDeadZone();
-
- /**
- * Set the dead zone for the RZ axis
- *
- * @param zone The dead zone to use for the RZ axis
- */
- public void setRZAxisDeadZone(float zone);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.input;
+
+/**
+ * A game controller of some sort that will provide input. The controller
+ * presents buttons and axes. Buttons are either pressed or not pressed. Axis
+ * provide analogue values.
+ *
+ * @author Kevin Glass
+ */
+public interface Controller {
+ /**
+ * Get the name assigned to this controller.
+ *
+ * @return The name assigned to this controller
+ */
+ public String getName();
+
+ /**
+ * Get the index of this controller in the collection
+ *
+ * @return The index of this controller in the collection
+ */
+ public int getIndex();
+
+ /**
+ * Retrieve the number of buttons available on this controller
+ *
+ * @return The number of butotns available on this controller
+ */
+ public int getButtonCount();
+
+ /**
+ * Get the name of the specified button. Be warned, often this is
+ * as exciting as "Button X"
+ *
+ * @param index The index of the button whose name should be retrieved
+ * @return The name of the button requested
+ */
+ public String getButtonName(int index);
+
+ /**
+ * Check if a button is currently pressed
+ *
+ * @param index The button to check
+ * @return True if the button is currently pressed
+ */
+ public boolean isButtonPressed(int index);
+
+ /**
+ * Poll the controller for new data. This will also update
+ * events
+ */
+ public void poll();
+
+ /**
+ * Get the X-Axis value of the POV on this controller
+ *
+ * @return The X-Axis value of the POV on this controller
+ */
+ public float getPovX();
+
+ /**
+ * Get the Y-Axis value of the POV on this controller
+ *
+ * @return The Y-Axis value of the POV on this controller
+ */
+ public float getPovY();
+
+ /**
+ * Get the dead zone for a specified axis
+ *
+ * @param index The index of the axis for which to retrieve the dead zone
+ * @return The dead zone for the specified axis
+ */
+ public float getDeadZone(int index);
+
+ /**
+ * Set the dead zone for the specified axis
+ *
+ * @param index The index of hte axis for which to set the dead zone
+ * @param zone The dead zone to use for the specified axis
+ */
+ public void setDeadZone(int index,float zone);
+
+ /**
+ * Retrieve the number of axes available on this controller.
+ *
+ * @return The number of axes available on this controller.
+ */
+ public int getAxisCount();
+
+ /**
+ * Get the name that's given to the specified axis
+ *
+ * @param index The index of the axis whose name should be retrieved
+ * @return The name of the specified axis.
+ */
+ public String getAxisName(int index);
+
+ /**
+ * Retrieve the value thats currently available on a specified axis. The
+ * value will always be between 1.0 and -1.0 and will calibrate as values
+ * are passed read. It may be useful to get the player to wiggle the joystick
+ * from side to side to get the calibration right.
+ *
+ * @param index The index of axis to be read
+ * @return The value from the specified axis.
+ */
+ public float getAxisValue(int index);
+
+ /**
+ * Get the value from the X axis if there is one. If no X axis is
+ * defined a zero value will be returned.
+ *
+ * @return The value from the X axis
+ */
+ public float getXAxisValue();
+
+ /**
+ * Get the dead zone for the X axis.
+ *
+ * @return The dead zone for the X axis
+ */
+ public float getXAxisDeadZone();
+
+ /**
+ * Set the dead zone for the X axis
+ *
+ * @param zone The dead zone to use for the X axis
+ */
+ public void setXAxisDeadZone(float zone);
+
+ /**
+ * Get the value from the Y axis if there is one. If no Y axis is
+ * defined a zero value will be returned.
+ *
+ * @return The value from the Y axis
+ */
+ public float getYAxisValue();
+
+ /**
+ * Get the dead zone for the Y axis.
+ *
+ * @return The dead zone for the Y axis
+ */
+ public float getYAxisDeadZone();
+
+ /**
+ * Set the dead zone for the Y axis
+ *
+ * @param zone The dead zone to use for the Y axis
+ */
+ public void setYAxisDeadZone(float zone);
+
+ /**
+ * Get the value from the Z axis if there is one. If no Z axis is
+ * defined a zero value will be returned.
+ *
+ * @return The value from the Z axis
+ */
+ public float getZAxisValue();
+
+ /**
+ * Get the dead zone for the Z axis.
+ *
+ * @return The dead zone for the Z axis
+ */
+ public float getZAxisDeadZone();
+
+ /**
+ * Set the dead zone for the Z axis
+ *
+ * @param zone The dead zone to use for the Z axis
+ */
+ public void setZAxisDeadZone(float zone);
+
+ /**
+ * Get the value from the RX axis if there is one. If no RX axis is
+ * defined a zero value will be returned.
+ *
+ * @return The value from the RX axis
+ */
+ public float getRXAxisValue();
+
+ /**
+ * Get the dead zone for the RX axis.
+ *
+ * @return The dead zone for the RX axis
+ */
+ public float getRXAxisDeadZone();
+
+ /**
+ * Set the dead zone for the RX axis
+ *
+ * @param zone The dead zone to use for the RX axis
+ */
+ public void setRXAxisDeadZone(float zone);
+
+ /**
+ * Get the value from the RY axis if there is one. If no RY axis is
+ * defined a zero value will be returned.
+ *
+ * @return The value from the RY axis
+ */
+ public float getRYAxisValue();
+
+ /**
+ * Get the dead zone for the RY axis.
+ *
+ * @return The dead zone for the RY axis
+ */
+ public float getRYAxisDeadZone();
+
+ /**
+ * Set the dead zone for the RY axis
+ *
+ * @param zone The dead zone to use for the RY axis
+ */
+ public void setRYAxisDeadZone(float zone);
+
+ /**
+ * Get the value from the RZ axis if there is one. If no RZ axis is
+ * defined a zero value will be returned.
+ *
+ * @return The value from the RZ axis
+ */
+ public float getRZAxisValue();
+
+ /**
+ * Get the dead zone for the RZ axis.
+ *
+ * @return The dead zone for the RZ axis
+ */
+ public float getRZAxisDeadZone();
+
+ /**
+ * Set the dead zone for the RZ axis
+ *
+ * @param zone The dead zone to use for the RZ axis
+ */
+ public void setRZAxisDeadZone(float zone);
+}
diff --git a/src/java/org/lwjgl/input/ControllerEvent.java b/src/java/org/lwjgl/input/ControllerEvent.java
index b4c2d3b..824036a 100644
--- a/src/java/org/lwjgl/input/ControllerEvent.java
+++ b/src/java/org/lwjgl/input/ControllerEvent.java
@@ -1,169 +1,169 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.input;
-
-/**
- * An event occuring on a controller.
- *
- * @author Kevin Glass
- */
-class ControllerEvent {
- /** Indicates the event was caused by a button */
- public static final int BUTTON = 1;
- /** Indicates the event was caused by a axis */
- public static final int AXIS = 2;
- /** Indicates the event was caused by a pov X */
- public static final int POVX = 3;
- /** Indicates the event was caused by a pov Y */
- public static final int POVY = 4;
-
- /** The controller generating the event */
- private Controller source;
- /** The index of the input (axis or button) that generated the event */
- private int index;
- /** Type of control that generated the event */
- private int type;
- /** True if this event was caused by the x axis */
- private boolean xaxis;
- /** True if this event was caused by the y axis */
- private boolean yaxis;
- /** The time stamp of this event */
- private long timeStamp;
-
- /**
- * Create a new event
- *
- * @param source The source of the event
- * @param timeStamp The time stamp given for this event
- * @param type The type of control generating this event
- * @param index The index of the input that generated the event
- * @param xaxis True if this event was caused by the x-axis
- * @param yaxis True if this event was caused by the y-axis
- */
- public ControllerEvent(Controller source,long timeStamp, int type,int index,boolean xaxis,boolean yaxis) {
- this.source = source;
- this.timeStamp = timeStamp;
- this.type = type;
- this.index = index;
- this.xaxis = xaxis;
- this.yaxis = yaxis;
- }
-
- /**
- * Get the time stamp given for this event. As with nanoTime()
- * this value means nothing other than giving ordering
- *
- * @return The time stamp given for this event
- */
- public long getTimeStamp() {
- return timeStamp;
- }
-
- /**
- * Get the controller that generated this event
- *
- * @return The controller that generated this event
- */
- public Controller getSource() {
- return source;
- }
-
- /**
- * Get the index of the control generating this event
- *
- * @return The index of the control generating this event
- */
- public int getControlIndex() {
- return index;
- }
-
- /**
- * Check if this event was generated by a button
- *
- * @return True if this event was generated by a button
- */
- public boolean isButton() {
- return type == BUTTON;
- }
-
- /**
- * Check if this event was generated by a axis
- *
- * @return True if this event was generated by a axis
- */
- public boolean isAxis() {
- return type == AXIS;
- }
-
- /**
- * Check if this event was generated by a pov
- *
- * @return True if this event was generated by a pov
- */
- public boolean isPovY() {
- return type == POVY;
- }
- /**
- *
- * Check if this event was generated by a pov
- *
- * @return True if this event was generated by a pov
- */
- public boolean isPovX() {
- return type == POVX;
- }
-
- /**
- * Check if this event was caused by the X axis
- *
- * @return True if this event was caused by the X axis
- */
- public boolean isXAxis() {
- return xaxis;
- }
-
- /**
- * Check if this event was caused by the Y axis
- *
- * @return True if this event was caused by the Y axis
- */
- public boolean isYAxis() {
- return yaxis;
- }
-
- /*
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return "["+source+" type="+type+" xaxis="+xaxis+" yaxis="+yaxis+"]";
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.input;
+
+/**
+ * An event occuring on a controller.
+ *
+ * @author Kevin Glass
+ */
+class ControllerEvent {
+ /** Indicates the event was caused by a button */
+ public static final int BUTTON = 1;
+ /** Indicates the event was caused by a axis */
+ public static final int AXIS = 2;
+ /** Indicates the event was caused by a pov X */
+ public static final int POVX = 3;
+ /** Indicates the event was caused by a pov Y */
+ public static final int POVY = 4;
+
+ /** The controller generating the event */
+ private Controller source;
+ /** The index of the input (axis or button) that generated the event */
+ private int index;
+ /** Type of control that generated the event */
+ private int type;
+ /** True if this event was caused by the x axis */
+ private boolean xaxis;
+ /** True if this event was caused by the y axis */
+ private boolean yaxis;
+ /** The time stamp of this event */
+ private long timeStamp;
+
+ /**
+ * Create a new event
+ *
+ * @param source The source of the event
+ * @param timeStamp The time stamp given for this event
+ * @param type The type of control generating this event
+ * @param index The index of the input that generated the event
+ * @param xaxis True if this event was caused by the x-axis
+ * @param yaxis True if this event was caused by the y-axis
+ */
+ public ControllerEvent(Controller source,long timeStamp, int type,int index,boolean xaxis,boolean yaxis) {
+ this.source = source;
+ this.timeStamp = timeStamp;
+ this.type = type;
+ this.index = index;
+ this.xaxis = xaxis;
+ this.yaxis = yaxis;
+ }
+
+ /**
+ * Get the time stamp given for this event. As with nanoTime()
+ * this value means nothing other than giving ordering
+ *
+ * @return The time stamp given for this event
+ */
+ public long getTimeStamp() {
+ return timeStamp;
+ }
+
+ /**
+ * Get the controller that generated this event
+ *
+ * @return The controller that generated this event
+ */
+ public Controller getSource() {
+ return source;
+ }
+
+ /**
+ * Get the index of the control generating this event
+ *
+ * @return The index of the control generating this event
+ */
+ public int getControlIndex() {
+ return index;
+ }
+
+ /**
+ * Check if this event was generated by a button
+ *
+ * @return True if this event was generated by a button
+ */
+ public boolean isButton() {
+ return type == BUTTON;
+ }
+
+ /**
+ * Check if this event was generated by a axis
+ *
+ * @return True if this event was generated by a axis
+ */
+ public boolean isAxis() {
+ return type == AXIS;
+ }
+
+ /**
+ * Check if this event was generated by a pov
+ *
+ * @return True if this event was generated by a pov
+ */
+ public boolean isPovY() {
+ return type == POVY;
+ }
+ /**
+ *
+ * Check if this event was generated by a pov
+ *
+ * @return True if this event was generated by a pov
+ */
+ public boolean isPovX() {
+ return type == POVX;
+ }
+
+ /**
+ * Check if this event was caused by the X axis
+ *
+ * @return True if this event was caused by the X axis
+ */
+ public boolean isXAxis() {
+ return xaxis;
+ }
+
+ /**
+ * Check if this event was caused by the Y axis
+ *
+ * @return True if this event was caused by the Y axis
+ */
+ public boolean isYAxis() {
+ return yaxis;
+ }
+
+ /*
+ * @see java.lang.Object#toString()
+ */
+ public String toString() {
+ return "["+source+" type="+type+" xaxis="+xaxis+" yaxis="+yaxis+"]";
+ }
+}
diff --git a/src/java/org/lwjgl/input/Controllers.java b/src/java/org/lwjgl/input/Controllers.java
index c43bfc0..13bca38 100644
--- a/src/java/org/lwjgl/input/Controllers.java
+++ b/src/java/org/lwjgl/input/Controllers.java
@@ -1,287 +1,287 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.input;
-
-import java.util.ArrayList;
-
-import net.java.games.input.ControllerEnvironment;
-
-import org.lwjgl.LWJGLException;
-
-/**
- * The collection of controllers currently connected.
- *
- * @author Kevin Glass
- */
-public class Controllers {
- /** The controllers available */
- private static ArrayList controllers = new ArrayList();
- /** The number of controllers */
- private static int controllerCount;
-
- /** The current list of events */
- private static ArrayList events = new ArrayList();
- /** The current event */
- private static ControllerEvent event;
-
- /** Whether controllers were created */
- private static boolean created;
-
- /**
- * Initialise the controllers collection
- *
- * @throws LWJGLException Indicates a failure to initialise the controller library.
- */
- public static void create() throws LWJGLException {
- if (created)
- return;
-
- try {
- ControllerEnvironment env = ControllerEnvironment.getDefaultEnvironment();
-
- net.java.games.input.Controller[] found = env.getControllers();
- ArrayList lollers = new ArrayList();
- for (int i=0;i<found.length;i++) {
- net.java.games.input.Controller c = found[i];
-
- if ((!c.getType().equals(net.java.games.input.Controller.Type.KEYBOARD)) &&
- (!c.getType().equals(net.java.games.input.Controller.Type.MOUSE))) {
- lollers.add(c);
- }
- }
-
- int length = lollers.size();
-
- for (int i=0;i<length;i++) {
- net.java.games.input.Controller c = (net.java.games.input.Controller) lollers.get(i);
-
- createController(c);
- }
-
- created = true;
- } catch (Throwable e) {
- throw new LWJGLException("Failed to initialise controllers",e);
- }
- }
-
- /**
- * Utility to create a controller based on its potential sub-controllers
- *
- * @param c The controller to add
- */
- private static void createController(net.java.games.input.Controller c) {
- net.java.games.input.Controller[] sub = c.getControllers();
- if (sub.length == 0) {
- JInputController controller = new JInputController(controllerCount,c);
-
- controllers.add(controller);
- controllerCount++;
- } else {
- for (int i=0;i<sub.length;i++) {
- createController(sub[i]);
- }
- }
- }
-
- /**
- * Get a controller from the collection
- *
- * @param index The index of the controller to retrieve
- * @return The controller requested
- */
- public static Controller getController(int index) {
- return (Controller) controllers.get(index);
- }
-
- /**
- * Retrieve a count of the number of controllers
- *
- * @return The number of controllers available
- */
- public static int getControllerCount() {
- return controllers.size();
- }
-
- /**
- * Poll the controllers available. This will both update their state
- * and generate events that must be cleared.
- */
- public static void poll() {
- for (int i=0;i<controllers.size();i++) {
- getController(i).poll();
- }
- }
-
- /**
- * Clear any events stored for the controllers in this set
- */
- public static void clearEvents() {
- events.clear();
- }
-
- /**
- * Move to the next event that has been stored.
- *
- * @return True if there is still an event to process
- */
- public static boolean next() {
- if (events.size() == 0) {
- event = null;
- return false;
- }
-
- event = (ControllerEvent) events.remove(0);
-
- return event != null;
- }
-
- /**
- * @return True if Controllers has been created
- */
- public static boolean isCreated() {
- return created;
- }
-
- /**
- * Destroys any resources used by the controllers
- */
- public static void destroy() {
-// FIXME! not currently possible to destroy a controller
-
-// if (!created)
-// return;
-// created = false;
-//
-// // nuke each controller
-// for (int i=0;i<controllers.size();i++) {
-// //
-// }
-//
-// // cleanup
-// event = null;
-// events.clear();
-// controllers.clear();
-// controllerCount = 0;
- }
-
- /**
- * Get the source of the current event
- *
- * @return The source of the current event
- */
- public static Controller getEventSource() {
- return event.getSource();
- }
-
- /**
- * Get the index of the control that caused the current event
- *
- * @return The index of the control that cause the current event
- */
- public static int getEventControlIndex() {
- return event.getControlIndex();
- }
-
- /**
- * Check if the current event was caused by a button
- *
- * @return True if the current event was caused by a button
- */
- public static boolean isEventButton() {
- return event.isButton();
- }
-
- /**
- * Check if the current event was caused by a axis
- *
- * @return True if the current event was caused by a axis
- */
- public static boolean isEventAxis() {
- return event.isAxis();
- }
-
- /**
- * Check if the current event was caused by movement on the x-axis
- *
- * @return True if the current event was cause by movement on the x-axis
- */
- public static boolean isEventXAxis() {
- return event.isXAxis();
- }
-
- /**
- * Check if the current event was caused by movement on the y-axis
- *
- * @return True if the current event was caused by movement on the y-axis
- */
- public static boolean isEventYAxis() {
- return event.isYAxis();
- }
-
- /**
- * Check if the current event was cause by the POV x-axis
- *
- * @return True if the current event was caused by the POV x-axis
- */
- public static boolean isEventPovX() {
- return event.isPovX();
- }
-
- /**
- * Check if the current event was cause by the POV x-axis
- *
- * @return True if the current event was caused by the POV x-axis
- */
- public static boolean isEventPovY() {
- return event.isPovY();
- }
-
- /**
- * Get the timestamp assigned to the current event
- *
- * @return The timestamp assigned ot the current event
- */
- public static long getEventNanoseconds() {
- return event.getTimeStamp();
- }
-
- /**
- * Add an event to the stack of events that have been caused
- *
- * @param event The event to add to the list
- */
- static void addEvent(ControllerEvent event) {
- if (event != null) {
- events.add(event);
- }
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.input;
+
+import java.util.ArrayList;
+
+import net.java.games.input.ControllerEnvironment;
+
+import org.lwjgl.LWJGLException;
+
+/**
+ * The collection of controllers currently connected.
+ *
+ * @author Kevin Glass
+ */
+public class Controllers {
+ /** The controllers available */
+ private static ArrayList controllers = new ArrayList();
+ /** The number of controllers */
+ private static int controllerCount;
+
+ /** The current list of events */
+ private static ArrayList events = new ArrayList();
+ /** The current event */
+ private static ControllerEvent event;
+
+ /** Whether controllers were created */
+ private static boolean created;
+
+ /**
+ * Initialise the controllers collection
+ *
+ * @throws LWJGLException Indicates a failure to initialise the controller library.
+ */
+ public static void create() throws LWJGLException {
+ if (created)
+ return;
+
+ try {
+ ControllerEnvironment env = ControllerEnvironment.getDefaultEnvironment();
+
+ net.java.games.input.Controller[] found = env.getControllers();
+ ArrayList lollers = new ArrayList();
+ for (int i=0;i<found.length;i++) {
+ net.java.games.input.Controller c = found[i];
+
+ if ((!c.getType().equals(net.java.games.input.Controller.Type.KEYBOARD)) &&
+ (!c.getType().equals(net.java.games.input.Controller.Type.MOUSE))) {
+ lollers.add(c);
+ }
+ }
+
+ int length = lollers.size();
+
+ for (int i=0;i<length;i++) {
+ net.java.games.input.Controller c = (net.java.games.input.Controller) lollers.get(i);
+
+ createController(c);
+ }
+
+ created = true;
+ } catch (Throwable e) {
+ throw new LWJGLException("Failed to initialise controllers",e);
+ }
+ }
+
+ /**
+ * Utility to create a controller based on its potential sub-controllers
+ *
+ * @param c The controller to add
+ */
+ private static void createController(net.java.games.input.Controller c) {
+ net.java.games.input.Controller[] sub = c.getControllers();
+ if (sub.length == 0) {
+ JInputController controller = new JInputController(controllerCount,c);
+
+ controllers.add(controller);
+ controllerCount++;
+ } else {
+ for (int i=0;i<sub.length;i++) {
+ createController(sub[i]);
+ }
+ }
+ }
+
+ /**
+ * Get a controller from the collection
+ *
+ * @param index The index of the controller to retrieve
+ * @return The controller requested
+ */
+ public static Controller getController(int index) {
+ return (Controller) controllers.get(index);
+ }
+
+ /**
+ * Retrieve a count of the number of controllers
+ *
+ * @return The number of controllers available
+ */
+ public static int getControllerCount() {
+ return controllers.size();
+ }
+
+ /**
+ * Poll the controllers available. This will both update their state
+ * and generate events that must be cleared.
+ */
+ public static void poll() {
+ for (int i=0;i<controllers.size();i++) {
+ getController(i).poll();
+ }
+ }
+
+ /**
+ * Clear any events stored for the controllers in this set
+ */
+ public static void clearEvents() {
+ events.clear();
+ }
+
+ /**
+ * Move to the next event that has been stored.
+ *
+ * @return True if there is still an event to process
+ */
+ public static boolean next() {
+ if (events.size() == 0) {
+ event = null;
+ return false;
+ }
+
+ event = (ControllerEvent) events.remove(0);
+
+ return event != null;
+ }
+
+ /**
+ * @return True if Controllers has been created
+ */
+ public static boolean isCreated() {
+ return created;
+ }
+
+ /**
+ * Destroys any resources used by the controllers
+ */
+ public static void destroy() {
+// FIXME! not currently possible to destroy a controller
+
+// if (!created)
+// return;
+// created = false;
+//
+// // nuke each controller
+// for (int i=0;i<controllers.size();i++) {
+// //
+// }
+//
+// // cleanup
+// event = null;
+// events.clear();
+// controllers.clear();
+// controllerCount = 0;
+ }
+
+ /**
+ * Get the source of the current event
+ *
+ * @return The source of the current event
+ */
+ public static Controller getEventSource() {
+ return event.getSource();
+ }
+
+ /**
+ * Get the index of the control that caused the current event
+ *
+ * @return The index of the control that cause the current event
+ */
+ public static int getEventControlIndex() {
+ return event.getControlIndex();
+ }
+
+ /**
+ * Check if the current event was caused by a button
+ *
+ * @return True if the current event was caused by a button
+ */
+ public static boolean isEventButton() {
+ return event.isButton();
+ }
+
+ /**
+ * Check if the current event was caused by a axis
+ *
+ * @return True if the current event was caused by a axis
+ */
+ public static boolean isEventAxis() {
+ return event.isAxis();
+ }
+
+ /**
+ * Check if the current event was caused by movement on the x-axis
+ *
+ * @return True if the current event was cause by movement on the x-axis
+ */
+ public static boolean isEventXAxis() {
+ return event.isXAxis();
+ }
+
+ /**
+ * Check if the current event was caused by movement on the y-axis
+ *
+ * @return True if the current event was caused by movement on the y-axis
+ */
+ public static boolean isEventYAxis() {
+ return event.isYAxis();
+ }
+
+ /**
+ * Check if the current event was cause by the POV x-axis
+ *
+ * @return True if the current event was caused by the POV x-axis
+ */
+ public static boolean isEventPovX() {
+ return event.isPovX();
+ }
+
+ /**
+ * Check if the current event was cause by the POV x-axis
+ *
+ * @return True if the current event was caused by the POV x-axis
+ */
+ public static boolean isEventPovY() {
+ return event.isPovY();
+ }
+
+ /**
+ * Get the timestamp assigned to the current event
+ *
+ * @return The timestamp assigned ot the current event
+ */
+ public static long getEventNanoseconds() {
+ return event.getTimeStamp();
+ }
+
+ /**
+ * Add an event to the stack of events that have been caused
+ *
+ * @param event The event to add to the list
+ */
+ static void addEvent(ControllerEvent event) {
+ if (event != null) {
+ events.add(event);
+ }
+ }
+}
diff --git a/src/java/org/lwjgl/input/Cursor.java b/src/java/org/lwjgl/input/Cursor.java
index e569c04..256e24c 100644
--- a/src/java/org/lwjgl/input/Cursor.java
+++ b/src/java/org/lwjgl/input/Cursor.java
@@ -1,330 +1,330 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.input;
-
-import java.nio.IntBuffer;
-
-import org.lwjgl.BufferUtils;
-import org.lwjgl.LWJGLException;
-import org.lwjgl.LWJGLUtil;
-import org.lwjgl.NondirectBufferWrapper;
-import org.lwjgl.Sys;
-
-/**
- *
- * A class representing a native cursor. Instances of this
- * class can be used with Mouse.setCursor(), if available.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: Cursor.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-public class Cursor {
- /** 1 bit transparency for native cursor */
- public static final int CURSOR_ONE_BIT_TRANSPARENCY = 1;
-
- /** 8 bit alhpa native cursor */
- public static final int CURSOR_8_BIT_ALPHA = 2;
-
- /** animation native cursor */
- public static final int CURSOR_ANIMATION = 4;
-
- /** First element to display */
- private final CursorElement[] cursors;
-
- /** Index into list of cursors */
- private int index = 0;
-
- private boolean destroyed;
-
- /**
- * Constructs a new Cursor, with the given parameters. Mouse must have been created before you can create
- * Cursor objects. Cursor images are in ARGB format, but only one bit transparancy is guaranteed to be supported.
- * So to maximize portability, lwjgl applications should only create cursor images with 0x00 or 0xff as alpha values.
- * The constructor will copy the images and delays, so there's no need to keep them around.
- *
- * @param width cursor image width
- * @param height cursor image height
- * @param xHotspot the x coordinate of the cursor hotspot
- * @param yHotspot the y coordinate of the cursor hotspot
- * @param numImages number of cursor images specified. Must be 1 if animations are not supported.
- * @param images A buffer containing the images. The origin is at the lower left corner, like OpenGL.
- * @param delays An int buffer of animation frame delays, if numImages is greater than 1, else null
- * @throws LWJGLException if the cursor could not be created for any reason
- */
- public Cursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws LWJGLException {
- synchronized (OpenGLPackageAccess.global_lock) {
- if ((getCapabilities() & CURSOR_ONE_BIT_TRANSPARENCY) == 0)
- throw new LWJGLException("Native cursors not supported");
- images = NondirectBufferWrapper.wrapBuffer(images, width*height*numImages);
- if (delays != null)
- delays = NondirectBufferWrapper.wrapBuffer(delays, numImages);
- if (!Mouse.isCreated())
- throw new IllegalStateException("Mouse must be created before creating cursor objects");
- if (width*height*numImages > images.remaining())
- throw new IllegalArgumentException("width*height*numImages > images.remaining()");
- if (xHotspot >= width || xHotspot < 0)
- throw new IllegalArgumentException("xHotspot > width || xHotspot < 0");
- if (yHotspot >= height || yHotspot < 0)
- throw new IllegalArgumentException("yHotspot > height || yHotspot < 0");
-
- Sys.initialize();
-
- // Hmm
- yHotspot = height - 1 - yHotspot;
-
- // create cursor (or cursors if multiple images supplied)
- cursors = createCursors(width, height, xHotspot, yHotspot, numImages, images, delays);
- }
- }
-
- /**
- * Gets the minimum size of a native cursor. Can only be called if
- * The Mouse is created and cursor caps includes at least
- * CURSOR_ONE_BIT_TRANSPARANCY.
- *
- * @return the maximum size of a native cursor
- */
- public static int getMinCursorSize() {
- synchronized (OpenGLPackageAccess.global_lock) {
- if (!Mouse.isCreated())
- throw new IllegalStateException("Mouse must be created.");
- return Mouse.getImplementation().getMinCursorSize();
- }
- }
-
- /**
- * Gets the maximum size of a native cursor. Can only be called if
- * The Mouse is created and cursor caps includes at least
- * CURSOR_ONE_BIT_TRANSPARANCY.
- *
- * @return the maximum size of a native cursor
- */
- public static int getMaxCursorSize() {
- synchronized (OpenGLPackageAccess.global_lock) {
- if (!Mouse.isCreated())
- throw new IllegalStateException("Mouse must be created.");
- return Mouse.getImplementation().getMaxCursorSize();
- }
- }
-
- /**
- * Get the capabilities of the native cursor. Return a bit mask of the native cursor capabilities.
- * The CURSOR_ONE_BIT_TRANSPARANCY indicates support for cursors with one bit transparancy,
- * the CURSOR_8_BIT_ALPHA indicates support for 8 bit alpha and CURSOR_ANIMATION indicates
- * support for cursor animations.
- *
- * @return A bit mask with native cursor capabilities.
- */
- public static int getCapabilities() {
- synchronized (OpenGLPackageAccess.global_lock) {
- if (Mouse.getImplementation() != null)
- return Mouse.getImplementation().getNativeCursorCapabilities();
- else
- return OpenGLPackageAccess.createImplementation().getNativeCursorCapabilities();
- }
- }
-
- /**
- * Creates the actual cursor, using a platform specific class
- */
- private static CursorElement[] createCursors(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws LWJGLException {
- // create copy and flip images to match ogl
- IntBuffer images_copy = BufferUtils.createIntBuffer(images.remaining());
- flipImages(width, height, numImages, images, images_copy);
-
- // Win32 doesn't (afaik) allow for animation based cursors, except when they're
- // in the .ani format, which we don't support.
- // The cursor animation was therefor developed using java side time tracking.
- // unfortunately X flickers when changing cursor. We therefore check for either
- // Win32 or X and do accordingly. This hasn't been implemented on Mac, but we
- // might want to split it into a X/Win/Mac cursor if it gets too cluttered
-
- CursorElement[] cursors;
- switch (LWJGLUtil.getPlatform()) {
- case LWJGLUtil.PLATFORM_MACOSX:
- /* Fall through */
- case LWJGLUtil.PLATFORM_WINDOWS:
- // create our cursor elements
- cursors = new CursorElement[numImages];
- for(int i=0; i<numImages; i++) {
-
- // iterate through the images, and make sure that the pixels are either 0xffxxxxxx or 0x00000000
- int size = width * height;
- for(int j=0; j<size; j++) {
- int index = j + (i*size);
- int alpha = images_copy.get(index) >> 24 & 0xff;
- if(alpha != 0xff) {
- images_copy.put(index, 0);
- }
- }
-
- Object handle = Mouse.getImplementation().createCursor(width, height, xHotspot, yHotspot, 1, images_copy, null);
- long delay = (delays != null) ? delays.get(i) : 0;
- long timeout = System.currentTimeMillis();
- cursors[i] = new CursorElement(handle, delay, timeout);
-
- // offset to next image
- images_copy.position(width*height*(i+1));
- }
- break;
- case LWJGLUtil.PLATFORM_LINUX:
- // create our cursor elements
- Object handle = Mouse.getImplementation().createCursor(width, height, xHotspot, yHotspot, numImages, images_copy, delays);
- CursorElement cursor_element = new CursorElement(handle, -1, -1);
- cursors = new CursorElement[]{cursor_element};
- break;
- default:
- throw new RuntimeException("Unknown OS");
- }
- return cursors;
- }
-
- /**
- * Flips the images so they're oriented according to opengl
- *
- * @param width Width of image
- * @param height Height of images
- * @param numImages How many images to flip
- * @param images Source images
- * @param images_copy Destination images
- */
- private static void flipImages(int width, int height, int numImages, IntBuffer images, IntBuffer images_copy) {
- for (int i = 0; i < numImages; i++) {
- int start_index = i*width*height;
- flipImage(width, height, start_index, images, images_copy);
- }
- }
-
- /**
- * @param width Width of image
- * @param height Height of images
- * @param start_index index into source buffer to copy to
- * @param images Source images
- * @param images_copy Destination images
- */
- private static void flipImage(int width, int height, int start_index, IntBuffer images, IntBuffer images_copy) {
- for (int y = 0; y < height>>1; y++) {
- int index_y_1 = y*width + start_index;
- int index_y_2 = (height - y - 1)*width + start_index;
- for (int x = 0; x < width; x++) {
- int index1 = index_y_1 + x;
- int index2 = index_y_2 + x;
- int temp_pixel = images.get(index1 + images.position());
- images_copy.put(index1, images.get(index2 + images.position()));
- images_copy.put(index2, temp_pixel);
- }
- }
- }
-
- /**
- * Gets the native handle associated with the cursor object.
- */
- Object getHandle() {
- checkValid();
- return cursors[index].cursorHandle;
- }
-
- private void checkValid() {
- if (destroyed)
- throw new IllegalStateException("The cursor is destroyed");
- }
-
- /**
- * Destroy the native cursor. If the cursor is current,
- * the current native cursor is set to null (the default
- * OS cursor)
- */
- public void destroy() {
- synchronized (OpenGLPackageAccess.global_lock) {
- if (destroyed)
- return;
- if (Mouse.getNativeCursor() == this) {
- try {
- Mouse.setNativeCursor(null);
- } catch (LWJGLException e) {
- // ignore
- }
- }
- for(int i=0; i<cursors.length; i++) {
- Mouse.getImplementation().destroyCursor(cursors[i].cursorHandle);
- }
- destroyed = true;
- }
- }
-
- /**
- * Sets the timout property to the time it should be changed
- */
- protected void setTimeout() {
- checkValid();
- cursors[index].timeout = System.currentTimeMillis() + cursors[index].delay;
- }
-
- /**
- * Determines whether this cursor has timed out
- * @return true if the this cursor has timed out, false if not
- */
- protected boolean hasTimedOut() {
- checkValid();
- return cursors.length > 1 && cursors[index].timeout < System.currentTimeMillis();
- }
-
- /**
- * Changes to the next cursor
- */
- protected void nextCursor() {
- checkValid();
- index = ++index % cursors.length;
- }
-
- /**
- * A single cursor element, used when animating
- */
- private static class CursorElement {
- /** Handle to cursor */
- final Object cursorHandle;
-
- /** How long a delay this element should have */
- final long delay;
-
- /** Absolute time this element times out */
- long timeout;
-
- CursorElement(Object cursorHandle, long delay, long timeout) {
- this.cursorHandle = cursorHandle;
- this.delay = delay;
- this.timeout = timeout;
- }
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.input;
+
+import java.nio.IntBuffer;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.LWJGLException;
+import org.lwjgl.LWJGLUtil;
+import org.lwjgl.NondirectBufferWrapper;
+import org.lwjgl.Sys;
+
+/**
+ *
+ * A class representing a native cursor. Instances of this
+ * class can be used with Mouse.setCursor(), if available.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: Cursor.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+public class Cursor {
+ /** 1 bit transparency for native cursor */
+ public static final int CURSOR_ONE_BIT_TRANSPARENCY = 1;
+
+ /** 8 bit alhpa native cursor */
+ public static final int CURSOR_8_BIT_ALPHA = 2;
+
+ /** animation native cursor */
+ public static final int CURSOR_ANIMATION = 4;
+
+ /** First element to display */
+ private final CursorElement[] cursors;
+
+ /** Index into list of cursors */
+ private int index = 0;
+
+ private boolean destroyed;
+
+ /**
+ * Constructs a new Cursor, with the given parameters. Mouse must have been created before you can create
+ * Cursor objects. Cursor images are in ARGB format, but only one bit transparancy is guaranteed to be supported.
+ * So to maximize portability, lwjgl applications should only create cursor images with 0x00 or 0xff as alpha values.
+ * The constructor will copy the images and delays, so there's no need to keep them around.
+ *
+ * @param width cursor image width
+ * @param height cursor image height
+ * @param xHotspot the x coordinate of the cursor hotspot
+ * @param yHotspot the y coordinate of the cursor hotspot
+ * @param numImages number of cursor images specified. Must be 1 if animations are not supported.
+ * @param images A buffer containing the images. The origin is at the lower left corner, like OpenGL.
+ * @param delays An int buffer of animation frame delays, if numImages is greater than 1, else null
+ * @throws LWJGLException if the cursor could not be created for any reason
+ */
+ public Cursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws LWJGLException {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if ((getCapabilities() & CURSOR_ONE_BIT_TRANSPARENCY) == 0)
+ throw new LWJGLException("Native cursors not supported");
+ images = NondirectBufferWrapper.wrapBuffer(images, width*height*numImages);
+ if (delays != null)
+ delays = NondirectBufferWrapper.wrapBuffer(delays, numImages);
+ if (!Mouse.isCreated())
+ throw new IllegalStateException("Mouse must be created before creating cursor objects");
+ if (width*height*numImages > images.remaining())
+ throw new IllegalArgumentException("width*height*numImages > images.remaining()");
+ if (xHotspot >= width || xHotspot < 0)
+ throw new IllegalArgumentException("xHotspot > width || xHotspot < 0");
+ if (yHotspot >= height || yHotspot < 0)
+ throw new IllegalArgumentException("yHotspot > height || yHotspot < 0");
+
+ Sys.initialize();
+
+ // Hmm
+ yHotspot = height - 1 - yHotspot;
+
+ // create cursor (or cursors if multiple images supplied)
+ cursors = createCursors(width, height, xHotspot, yHotspot, numImages, images, delays);
+ }
+ }
+
+ /**
+ * Gets the minimum size of a native cursor. Can only be called if
+ * The Mouse is created and cursor caps includes at least
+ * CURSOR_ONE_BIT_TRANSPARANCY.
+ *
+ * @return the maximum size of a native cursor
+ */
+ public static int getMinCursorSize() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if (!Mouse.isCreated())
+ throw new IllegalStateException("Mouse must be created.");
+ return Mouse.getImplementation().getMinCursorSize();
+ }
+ }
+
+ /**
+ * Gets the maximum size of a native cursor. Can only be called if
+ * The Mouse is created and cursor caps includes at least
+ * CURSOR_ONE_BIT_TRANSPARANCY.
+ *
+ * @return the maximum size of a native cursor
+ */
+ public static int getMaxCursorSize() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if (!Mouse.isCreated())
+ throw new IllegalStateException("Mouse must be created.");
+ return Mouse.getImplementation().getMaxCursorSize();
+ }
+ }
+
+ /**
+ * Get the capabilities of the native cursor. Return a bit mask of the native cursor capabilities.
+ * The CURSOR_ONE_BIT_TRANSPARANCY indicates support for cursors with one bit transparancy,
+ * the CURSOR_8_BIT_ALPHA indicates support for 8 bit alpha and CURSOR_ANIMATION indicates
+ * support for cursor animations.
+ *
+ * @return A bit mask with native cursor capabilities.
+ */
+ public static int getCapabilities() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if (Mouse.getImplementation() != null)
+ return Mouse.getImplementation().getNativeCursorCapabilities();
+ else
+ return OpenGLPackageAccess.createImplementation().getNativeCursorCapabilities();
+ }
+ }
+
+ /**
+ * Creates the actual cursor, using a platform specific class
+ */
+ private static CursorElement[] createCursors(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws LWJGLException {
+ // create copy and flip images to match ogl
+ IntBuffer images_copy = BufferUtils.createIntBuffer(images.remaining());
+ flipImages(width, height, numImages, images, images_copy);
+
+ // Win32 doesn't (afaik) allow for animation based cursors, except when they're
+ // in the .ani format, which we don't support.
+ // The cursor animation was therefor developed using java side time tracking.
+ // unfortunately X flickers when changing cursor. We therefore check for either
+ // Win32 or X and do accordingly. This hasn't been implemented on Mac, but we
+ // might want to split it into a X/Win/Mac cursor if it gets too cluttered
+
+ CursorElement[] cursors;
+ switch (LWJGLUtil.getPlatform()) {
+ case LWJGLUtil.PLATFORM_MACOSX:
+ /* Fall through */
+ case LWJGLUtil.PLATFORM_WINDOWS:
+ // create our cursor elements
+ cursors = new CursorElement[numImages];
+ for(int i=0; i<numImages; i++) {
+
+ // iterate through the images, and make sure that the pixels are either 0xffxxxxxx or 0x00000000
+ int size = width * height;
+ for(int j=0; j<size; j++) {
+ int index = j + (i*size);
+ int alpha = images_copy.get(index) >> 24 & 0xff;
+ if(alpha != 0xff) {
+ images_copy.put(index, 0);
+ }
+ }
+
+ Object handle = Mouse.getImplementation().createCursor(width, height, xHotspot, yHotspot, 1, images_copy, null);
+ long delay = (delays != null) ? delays.get(i) : 0;
+ long timeout = System.currentTimeMillis();
+ cursors[i] = new CursorElement(handle, delay, timeout);
+
+ // offset to next image
+ images_copy.position(width*height*(i+1));
+ }
+ break;
+ case LWJGLUtil.PLATFORM_LINUX:
+ // create our cursor elements
+ Object handle = Mouse.getImplementation().createCursor(width, height, xHotspot, yHotspot, numImages, images_copy, delays);
+ CursorElement cursor_element = new CursorElement(handle, -1, -1);
+ cursors = new CursorElement[]{cursor_element};
+ break;
+ default:
+ throw new RuntimeException("Unknown OS");
+ }
+ return cursors;
+ }
+
+ /**
+ * Flips the images so they're oriented according to opengl
+ *
+ * @param width Width of image
+ * @param height Height of images
+ * @param numImages How many images to flip
+ * @param images Source images
+ * @param images_copy Destination images
+ */
+ private static void flipImages(int width, int height, int numImages, IntBuffer images, IntBuffer images_copy) {
+ for (int i = 0; i < numImages; i++) {
+ int start_index = i*width*height;
+ flipImage(width, height, start_index, images, images_copy);
+ }
+ }
+
+ /**
+ * @param width Width of image
+ * @param height Height of images
+ * @param start_index index into source buffer to copy to
+ * @param images Source images
+ * @param images_copy Destination images
+ */
+ private static void flipImage(int width, int height, int start_index, IntBuffer images, IntBuffer images_copy) {
+ for (int y = 0; y < height>>1; y++) {
+ int index_y_1 = y*width + start_index;
+ int index_y_2 = (height - y - 1)*width + start_index;
+ for (int x = 0; x < width; x++) {
+ int index1 = index_y_1 + x;
+ int index2 = index_y_2 + x;
+ int temp_pixel = images.get(index1 + images.position());
+ images_copy.put(index1, images.get(index2 + images.position()));
+ images_copy.put(index2, temp_pixel);
+ }
+ }
+ }
+
+ /**
+ * Gets the native handle associated with the cursor object.
+ */
+ Object getHandle() {
+ checkValid();
+ return cursors[index].cursorHandle;
+ }
+
+ private void checkValid() {
+ if (destroyed)
+ throw new IllegalStateException("The cursor is destroyed");
+ }
+
+ /**
+ * Destroy the native cursor. If the cursor is current,
+ * the current native cursor is set to null (the default
+ * OS cursor)
+ */
+ public void destroy() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if (destroyed)
+ return;
+ if (Mouse.getNativeCursor() == this) {
+ try {
+ Mouse.setNativeCursor(null);
+ } catch (LWJGLException e) {
+ // ignore
+ }
+ }
+ for(int i=0; i<cursors.length; i++) {
+ Mouse.getImplementation().destroyCursor(cursors[i].cursorHandle);
+ }
+ destroyed = true;
+ }
+ }
+
+ /**
+ * Sets the timout property to the time it should be changed
+ */
+ protected void setTimeout() {
+ checkValid();
+ cursors[index].timeout = System.currentTimeMillis() + cursors[index].delay;
+ }
+
+ /**
+ * Determines whether this cursor has timed out
+ * @return true if the this cursor has timed out, false if not
+ */
+ protected boolean hasTimedOut() {
+ checkValid();
+ return cursors.length > 1 && cursors[index].timeout < System.currentTimeMillis();
+ }
+
+ /**
+ * Changes to the next cursor
+ */
+ protected void nextCursor() {
+ checkValid();
+ index = ++index % cursors.length;
+ }
+
+ /**
+ * A single cursor element, used when animating
+ */
+ private static class CursorElement {
+ /** Handle to cursor */
+ final Object cursorHandle;
+
+ /** How long a delay this element should have */
+ final long delay;
+
+ /** Absolute time this element times out */
+ long timeout;
+
+ CursorElement(Object cursorHandle, long delay, long timeout) {
+ this.cursorHandle = cursorHandle;
+ this.delay = delay;
+ this.timeout = timeout;
+ }
+ }
+}
diff --git a/src/java/org/lwjgl/input/JInputController.java b/src/java/org/lwjgl/input/JInputController.java
index 7a9aba9..2bf740d 100644
--- a/src/java/org/lwjgl/input/JInputController.java
+++ b/src/java/org/lwjgl/input/JInputController.java
@@ -1,512 +1,512 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.input;
-
-import java.util.ArrayList;
-
-import net.java.games.input.Component;
-import net.java.games.input.Event;
-import net.java.games.input.EventQueue;
-
-/**
- * A wrapper round a JInput controller that attempts to make the interface
- * more useable.
- *
- * @author Kevin Glass
- */
-class JInputController implements Controller {
- /** The JInput controller this class is wrapping */
- private net.java.games.input.Controller target;
- /** The index that has been assigned to this controller */
- private int index;
- /** The Buttons that have been detected on the JInput controller */
- private ArrayList buttons = new ArrayList();
- /** The Axes that have been detected on the JInput controller */
- private ArrayList axes = new ArrayList();
- /** The POVs that have been detected on the JInput controller */
- private ArrayList pov = new ArrayList();
- /** The state of the buttons last check */
- private boolean[] buttonState;
- /** The values that were read from the pov last check */
- private float[] povValues;
- /** The values that were read from the axes last check */
- private float[] axesValue;
- /** The maximum values read for each axis */
- private float[] axesMax;
- /** The dead zones for each axis */
- private float[] deadZones;
- /** The index of the X axis or -1 if no X axis is defined */
- private int xaxis = -1;
- /** The index of the Y axis or -1 if no Y axis is defined */
- private int yaxis = -1;
- /** The index of the X axis or -1 if no Z axis is defined */
- private int zaxis = -1;
- /** The index of the RX axis or -1 if no RX axis is defined */
- private int rxaxis = -1;
- /** The index of the RY axis or -1 if no RY axis is defined */
- private int ryaxis = -1;
- /** The index of the RZ axis or -1 if no RZ axis is defined */
- private int rzaxis = -1;
-
- /**
- * Create a new controller that wraps round a JInput controller and hopefully
- * makes it easier to use.
- *
- * @param index The index this controller has been assigned to
- * @param target The target JInput controller this class is wrapping
- */
- public JInputController(int index,net.java.games.input.Controller target) {
- this.target = target;
- this.index = index;
-
- Component[] sourceAxes = target.getComponents();
-
- for (int i=0;i<sourceAxes.length;i++) {
- if (sourceAxes[i].getIdentifier() instanceof Component.Identifier.Button) {
- buttons.add(sourceAxes[i]);
- } else if (sourceAxes[i].getIdentifier().equals(Component.Identifier.Axis.POV)) {
- pov.add(sourceAxes[i]);
- } else {
- axes.add(sourceAxes[i]);
- }
- }
-
- buttonState = new boolean[buttons.size()];
- povValues = new float[pov.size()];
- axesValue = new float[axes.size()];
- int buttonsCount = 0;
- int axesCount = 0;
-
- // initialise the state
- for (int i=0;i<sourceAxes.length;i++) {
- if (sourceAxes[i].getIdentifier() instanceof Component.Identifier.Button) {
- buttonState[buttonsCount] = sourceAxes[i].getPollData() != 0;
- buttonsCount++;
- } else if (sourceAxes[i].getIdentifier().equals(Component.Identifier.Axis.POV)) {
- // no account for POV yet
- // pov.add(sourceAxes[i]);
- } else {
- axesValue[axesCount] = sourceAxes[i].getPollData();
- if (sourceAxes[i].getIdentifier().equals(Component.Identifier.Axis.X)) {
- xaxis = axesCount;
- }
- if (sourceAxes[i].getIdentifier().equals(Component.Identifier.Axis.Y)) {
- yaxis = axesCount;
- }
- if (sourceAxes[i].getIdentifier().equals(Component.Identifier.Axis.Z)) {
- zaxis = axesCount;
- }
- if (sourceAxes[i].getIdentifier().equals(Component.Identifier.Axis.RX)) {
- rxaxis = axesCount;
- }
- if (sourceAxes[i].getIdentifier().equals(Component.Identifier.Axis.RY)) {
- ryaxis = axesCount;
- }
- if (sourceAxes[i].getIdentifier().equals(Component.Identifier.Axis.RZ)) {
- rzaxis = axesCount;
- }
-
- axesCount++;
- }
- }
-
- axesMax = new float[axes.size()];
- deadZones = new float[axes.size()];
-
- for (int i=0;i<axesMax.length;i++) {
- axesMax[i] = 1.0f;
- deadZones[i] = 0.05f;
- }
- }
-
- /*
- * @see org.lwjgl.input.Controller#getName()
- */
- public String getName() {
- String name = target.getName();
- return name;
- }
-
- /*
- * @see org.lwjgl.input.Controller#getIndex()
- */
- public int getIndex() {
- return index;
- }
-
- /*
- * @see org.lwjgl.input.Controller#getButtonCount()
- */
- public int getButtonCount() {
- return buttons.size();
- }
-
- /*
- * @see org.lwjgl.input.Controller#getButtonName(int)
- */
- public String getButtonName(int index) {
- Component button = (Component) buttons.get(index);
-
- return button.getName();
- }
-
- /*
- * @see org.lwjgl.input.Controller#isButtonPressed(int)
- */
- public boolean isButtonPressed(int index) {
- return buttonState[index];
- }
-
- /*
- * @see org.lwjgl.input.Controller#poll()
- */
- public void poll() {
- target.poll();
-
- Event event = new Event();
- EventQueue queue = target.getEventQueue();
-
- while (queue.getNextEvent(event)) {
- // handle button event
- if (buttons.contains(event.getComponent())) {
- Component button = event.getComponent();
- int buttonIndex = buttons.indexOf(button);
- buttonState[buttonIndex] = event.getValue() != 0;
-
- // fire button pressed event
- Controllers.addEvent(new ControllerEvent(this,event.getNanos(),ControllerEvent.BUTTON,buttonIndex,false,false));
- }
-
- // handle pov events
- if (pov.contains(event.getComponent())) {
- Component povComponent = event.getComponent();
- int povIndex = pov.indexOf(povComponent);
- float prevX = getPovX();
- float prevY = getPovY();
- povValues[povIndex] = event.getValue();
-
- if (prevX != getPovX()) {
- Controllers.addEvent(new ControllerEvent(this,event.getNanos(),ControllerEvent.POVX,0,false,false));
- }
- if (prevY != getPovY()) {
- Controllers.addEvent(new ControllerEvent(this,event.getNanos(),ControllerEvent.POVY,0,false,false));
- }
- }
-
- // handle axis updates
- if (axes.contains(event.getComponent())) {
- Component axis = event.getComponent();
- int axisIndex = axes.indexOf(axis);
- float value = axis.getPollData();
-
- // fixed dead zone since most axis don't report it :(
- if (Math.abs(value) < deadZones[axisIndex]) {
- value = 0;
- }
- if (Math.abs(value) < axis.getDeadZone()) {
- value = 0;
- }
- if (Math.abs(value) > axesMax[axisIndex]) {
- axesMax[axisIndex] = Math.abs(value);
- }
-
- // normalize the value based on maximum value read in the past
- value /= axesMax[axisIndex];
- // fire event
- Controllers.addEvent(new ControllerEvent(this,event.getNanos(),ControllerEvent.AXIS,axisIndex,
- axisIndex == xaxis,axisIndex == yaxis));
- axesValue[axisIndex] = value;
- }
- }
- }
-
- /*
- * @see org.lwjgl.input.Controller#getAxisCount()
- */
- public int getAxisCount() {
- return axes.size();
- }
-
- /*
- * @see org.lwjgl.input.Controller#getAxisName(int)
- */
- public String getAxisName(int index) {
- Component axis = (Component) axes.get(index);
-
- return axis.getName();
- }
-
- /*
- * @see org.lwjgl.input.Controller#getAxisValue(int)
- */
- public float getAxisValue(int index) {
- return axesValue[index];
- }
-
- /*
- * @see org.lwjgl.input.Controller#getXAxisValue()
- */
- public float getXAxisValue() {
- if (xaxis == -1) {
- return 0;
- }
-
- return getAxisValue(xaxis);
- }
-
- /*
- * @see org.lwjgl.input.Controller#getYAxisValue()
- */
- public float getYAxisValue() {
- if (yaxis == -1) {
- return 0;
- }
-
- return getAxisValue(yaxis);
- }
-
- /*
- * @see org.lwjgl.input.Controller#getXAxisDeadZone()
- */
- public float getXAxisDeadZone() {
- if (xaxis == -1) {
- return 0;
- }
-
- return getDeadZone(xaxis);
- }
-
- /*
- * @see org.lwjgl.input.Controller#getYAxisDeadZone()
- */
- public float getYAxisDeadZone() {
- if (yaxis == -1) {
- return 0;
- }
-
- return getDeadZone(yaxis);
- }
-
- /*
- * @see org.lwjgl.input.Controller#setXAxisDeadZone(float)
- */
- public void setXAxisDeadZone(float zone) {
- setDeadZone(xaxis,zone);
- }
-
- /*
- * @see org.lwjgl.input.Controller#setYAxisDeadZone(float)
- */
- public void setYAxisDeadZone(float zone) {
- setDeadZone(yaxis,zone);
- }
-
- /*
- * @see org.lwjgl.input.Controller#getDeadZone(int)
- */
- public float getDeadZone(int index) {
- return deadZones[index];
- }
-
- /*
- * @see org.lwjgl.input.Controller#setDeadZone(int, float)
- */
- public void setDeadZone(int index, float zone) {
- deadZones[index] = zone;
- }
-
- /*
- * @see org.lwjgl.input.Controller#getZAxisValue()
- */
- public float getZAxisValue() {
- if (zaxis == -1) {
- return 0;
- }
-
- return getAxisValue(zaxis);
- }
-
- /*
- * @see org.lwjgl.input.Controller#getZAxisDeadZone()
- */
- public float getZAxisDeadZone() {
- if (zaxis == -1) {
- return 0;
- }
-
- return getDeadZone(zaxis);
- }
-
- /*
- * @see org.lwjgl.input.Controller#setZAxisDeadZone(float)
- */
- public void setZAxisDeadZone(float zone) {
- setDeadZone(zaxis,zone);
- }
-
- /*
- * @see org.lwjgl.input.Controller#getRXAxisValue()
- */
- public float getRXAxisValue() {
- if (rxaxis == -1) {
- return 0;
- }
-
- return getAxisValue(rxaxis);
- }
-
- /*
- * @see org.lwjgl.input.Controller#getRXAxisDeadZone()
- */
- public float getRXAxisDeadZone() {
- if (rxaxis == -1) {
- return 0;
- }
-
- return getDeadZone(rxaxis);
- }
-
- /*
- * @see org.lwjgl.input.Controller#setRXAxisDeadZone(float)
- */
- public void setRXAxisDeadZone(float zone) {
- setDeadZone(rxaxis,zone);
- }
-
- /*
- * @see org.lwjgl.input.Controller#getRYAxisValue()
- */
- public float getRYAxisValue() {
- if (ryaxis == -1) {
- return 0;
- }
-
- return getAxisValue(ryaxis);
- }
-
- /*
- * @see org.lwjgl.input.Controller#getRYAxisDeadZone()
- */
- public float getRYAxisDeadZone() {
- if (ryaxis == -1) {
- return 0;
- }
-
- return getDeadZone(ryaxis);
- }
-
- /*
- * @see org.lwjgl.input.Controller#setRYAxisDeadZone(float)
- */
- public void setRYAxisDeadZone(float zone) {
- setDeadZone(ryaxis,zone);
- }
-
- /*
- * @see org.lwjgl.input.Controller#getRZAxisValue()
- */
- public float getRZAxisValue() {
- if (rzaxis == -1) {
- return 0;
- }
-
- return getAxisValue(rzaxis);
- }
-
- /*
- * @see org.lwjgl.input.Controller#getRZAxisDeadZone()
- */
- public float getRZAxisDeadZone() {
- if (rzaxis == -1) {
- return 0;
- }
-
- return getDeadZone(rzaxis);
- }
-
- /*
- * @see org.lwjgl.input.Controller#setRZAxisDeadZone(float)
- */
- public void setRZAxisDeadZone(float zone) {
- setDeadZone(rzaxis,zone);
- }
-
- /*
- * @see org.lwjgl.input.Controller#getPovX()
- */
- public float getPovX() {
- if (pov.size() == 0) {
- return 0;
- }
-
- float value = povValues[0];
-
- if ((value == Component.POV.DOWN_LEFT) ||
- (value == Component.POV.UP_LEFT) ||
- (value == Component.POV.LEFT)) {
- return -1;
- }
- if ((value == Component.POV.DOWN_RIGHT) ||
- (value == Component.POV.UP_RIGHT) ||
- (value == Component.POV.RIGHT)) {
- return 1;
- }
-
- return 0;
- }
-
- /*
- * @see org.lwjgl.input.Controller#getPovY()
- */
- public float getPovY() {
- if (pov.size() == 0) {
- return 0;
- }
-
- float value = povValues[0];
-
- if ((value == Component.POV.DOWN_LEFT) ||
- (value == Component.POV.DOWN_RIGHT) ||
- (value == Component.POV.DOWN)) {
- return 1;
- }
- if ((value == Component.POV.UP_LEFT) ||
- (value == Component.POV.UP_RIGHT) ||
- (value == Component.POV.UP)) {
- return -1;
- }
-
- return 0;
- }
-
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.input;
+
+import java.util.ArrayList;
+
+import net.java.games.input.Component;
+import net.java.games.input.Event;
+import net.java.games.input.EventQueue;
+
+/**
+ * A wrapper round a JInput controller that attempts to make the interface
+ * more useable.
+ *
+ * @author Kevin Glass
+ */
+class JInputController implements Controller {
+ /** The JInput controller this class is wrapping */
+ private net.java.games.input.Controller target;
+ /** The index that has been assigned to this controller */
+ private int index;
+ /** The Buttons that have been detected on the JInput controller */
+ private ArrayList buttons = new ArrayList();
+ /** The Axes that have been detected on the JInput controller */
+ private ArrayList axes = new ArrayList();
+ /** The POVs that have been detected on the JInput controller */
+ private ArrayList pov = new ArrayList();
+ /** The state of the buttons last check */
+ private boolean[] buttonState;
+ /** The values that were read from the pov last check */
+ private float[] povValues;
+ /** The values that were read from the axes last check */
+ private float[] axesValue;
+ /** The maximum values read for each axis */
+ private float[] axesMax;
+ /** The dead zones for each axis */
+ private float[] deadZones;
+ /** The index of the X axis or -1 if no X axis is defined */
+ private int xaxis = -1;
+ /** The index of the Y axis or -1 if no Y axis is defined */
+ private int yaxis = -1;
+ /** The index of the X axis or -1 if no Z axis is defined */
+ private int zaxis = -1;
+ /** The index of the RX axis or -1 if no RX axis is defined */
+ private int rxaxis = -1;
+ /** The index of the RY axis or -1 if no RY axis is defined */
+ private int ryaxis = -1;
+ /** The index of the RZ axis or -1 if no RZ axis is defined */
+ private int rzaxis = -1;
+
+ /**
+ * Create a new controller that wraps round a JInput controller and hopefully
+ * makes it easier to use.
+ *
+ * @param index The index this controller has been assigned to
+ * @param target The target JInput controller this class is wrapping
+ */
+ public JInputController(int index,net.java.games.input.Controller target) {
+ this.target = target;
+ this.index = index;
+
+ Component[] sourceAxes = target.getComponents();
+
+ for (int i=0;i<sourceAxes.length;i++) {
+ if (sourceAxes[i].getIdentifier() instanceof Component.Identifier.Button) {
+ buttons.add(sourceAxes[i]);
+ } else if (sourceAxes[i].getIdentifier().equals(Component.Identifier.Axis.POV)) {
+ pov.add(sourceAxes[i]);
+ } else {
+ axes.add(sourceAxes[i]);
+ }
+ }
+
+ buttonState = new boolean[buttons.size()];
+ povValues = new float[pov.size()];
+ axesValue = new float[axes.size()];
+ int buttonsCount = 0;
+ int axesCount = 0;
+
+ // initialise the state
+ for (int i=0;i<sourceAxes.length;i++) {
+ if (sourceAxes[i].getIdentifier() instanceof Component.Identifier.Button) {
+ buttonState[buttonsCount] = sourceAxes[i].getPollData() != 0;
+ buttonsCount++;
+ } else if (sourceAxes[i].getIdentifier().equals(Component.Identifier.Axis.POV)) {
+ // no account for POV yet
+ // pov.add(sourceAxes[i]);
+ } else {
+ axesValue[axesCount] = sourceAxes[i].getPollData();
+ if (sourceAxes[i].getIdentifier().equals(Component.Identifier.Axis.X)) {
+ xaxis = axesCount;
+ }
+ if (sourceAxes[i].getIdentifier().equals(Component.Identifier.Axis.Y)) {
+ yaxis = axesCount;
+ }
+ if (sourceAxes[i].getIdentifier().equals(Component.Identifier.Axis.Z)) {
+ zaxis = axesCount;
+ }
+ if (sourceAxes[i].getIdentifier().equals(Component.Identifier.Axis.RX)) {
+ rxaxis = axesCount;
+ }
+ if (sourceAxes[i].getIdentifier().equals(Component.Identifier.Axis.RY)) {
+ ryaxis = axesCount;
+ }
+ if (sourceAxes[i].getIdentifier().equals(Component.Identifier.Axis.RZ)) {
+ rzaxis = axesCount;
+ }
+
+ axesCount++;
+ }
+ }
+
+ axesMax = new float[axes.size()];
+ deadZones = new float[axes.size()];
+
+ for (int i=0;i<axesMax.length;i++) {
+ axesMax[i] = 1.0f;
+ deadZones[i] = 0.05f;
+ }
+ }
+
+ /*
+ * @see org.lwjgl.input.Controller#getName()
+ */
+ public String getName() {
+ String name = target.getName();
+ return name;
+ }
+
+ /*
+ * @see org.lwjgl.input.Controller#getIndex()
+ */
+ public int getIndex() {
+ return index;
+ }
+
+ /*
+ * @see org.lwjgl.input.Controller#getButtonCount()
+ */
+ public int getButtonCount() {
+ return buttons.size();
+ }
+
+ /*
+ * @see org.lwjgl.input.Controller#getButtonName(int)
+ */
+ public String getButtonName(int index) {
+ Component button = (Component) buttons.get(index);
+
+ return button.getName();
+ }
+
+ /*
+ * @see org.lwjgl.input.Controller#isButtonPressed(int)
+ */
+ public boolean isButtonPressed(int index) {
+ return buttonState[index];
+ }
+
+ /*
+ * @see org.lwjgl.input.Controller#poll()
+ */
+ public void poll() {
+ target.poll();
+
+ Event event = new Event();
+ EventQueue queue = target.getEventQueue();
+
+ while (queue.getNextEvent(event)) {
+ // handle button event
+ if (buttons.contains(event.getComponent())) {
+ Component button = event.getComponent();
+ int buttonIndex = buttons.indexOf(button);
+ buttonState[buttonIndex] = event.getValue() != 0;
+
+ // fire button pressed event
+ Controllers.addEvent(new ControllerEvent(this,event.getNanos(),ControllerEvent.BUTTON,buttonIndex,false,false));
+ }
+
+ // handle pov events
+ if (pov.contains(event.getComponent())) {
+ Component povComponent = event.getComponent();
+ int povIndex = pov.indexOf(povComponent);
+ float prevX = getPovX();
+ float prevY = getPovY();
+ povValues[povIndex] = event.getValue();
+
+ if (prevX != getPovX()) {
+ Controllers.addEvent(new ControllerEvent(this,event.getNanos(),ControllerEvent.POVX,0,false,false));
+ }
+ if (prevY != getPovY()) {
+ Controllers.addEvent(new ControllerEvent(this,event.getNanos(),ControllerEvent.POVY,0,false,false));
+ }
+ }
+
+ // handle axis updates
+ if (axes.contains(event.getComponent())) {
+ Component axis = event.getComponent();
+ int axisIndex = axes.indexOf(axis);
+ float value = axis.getPollData();
+
+ // fixed dead zone since most axis don't report it :(
+ if (Math.abs(value) < deadZones[axisIndex]) {
+ value = 0;
+ }
+ if (Math.abs(value) < axis.getDeadZone()) {
+ value = 0;
+ }
+ if (Math.abs(value) > axesMax[axisIndex]) {
+ axesMax[axisIndex] = Math.abs(value);
+ }
+
+ // normalize the value based on maximum value read in the past
+ value /= axesMax[axisIndex];
+ // fire event
+ Controllers.addEvent(new ControllerEvent(this,event.getNanos(),ControllerEvent.AXIS,axisIndex,
+ axisIndex == xaxis,axisIndex == yaxis));
+ axesValue[axisIndex] = value;
+ }
+ }
+ }
+
+ /*
+ * @see org.lwjgl.input.Controller#getAxisCount()
+ */
+ public int getAxisCount() {
+ return axes.size();
+ }
+
+ /*
+ * @see org.lwjgl.input.Controller#getAxisName(int)
+ */
+ public String getAxisName(int index) {
+ Component axis = (Component) axes.get(index);
+
+ return axis.getName();
+ }
+
+ /*
+ * @see org.lwjgl.input.Controller#getAxisValue(int)
+ */
+ public float getAxisValue(int index) {
+ return axesValue[index];
+ }
+
+ /*
+ * @see org.lwjgl.input.Controller#getXAxisValue()
+ */
+ public float getXAxisValue() {
+ if (xaxis == -1) {
+ return 0;
+ }
+
+ return getAxisValue(xaxis);
+ }
+
+ /*
+ * @see org.lwjgl.input.Controller#getYAxisValue()
+ */
+ public float getYAxisValue() {
+ if (yaxis == -1) {
+ return 0;
+ }
+
+ return getAxisValue(yaxis);
+ }
+
+ /*
+ * @see org.lwjgl.input.Controller#getXAxisDeadZone()
+ */
+ public float getXAxisDeadZone() {
+ if (xaxis == -1) {
+ return 0;
+ }
+
+ return getDeadZone(xaxis);
+ }
+
+ /*
+ * @see org.lwjgl.input.Controller#getYAxisDeadZone()
+ */
+ public float getYAxisDeadZone() {
+ if (yaxis == -1) {
+ return 0;
+ }
+
+ return getDeadZone(yaxis);
+ }
+
+ /*
+ * @see org.lwjgl.input.Controller#setXAxisDeadZone(float)
+ */
+ public void setXAxisDeadZone(float zone) {
+ setDeadZone(xaxis,zone);
+ }
+
+ /*
+ * @see org.lwjgl.input.Controller#setYAxisDeadZone(float)
+ */
+ public void setYAxisDeadZone(float zone) {
+ setDeadZone(yaxis,zone);
+ }
+
+ /*
+ * @see org.lwjgl.input.Controller#getDeadZone(int)
+ */
+ public float getDeadZone(int index) {
+ return deadZones[index];
+ }
+
+ /*
+ * @see org.lwjgl.input.Controller#setDeadZone(int, float)
+ */
+ public void setDeadZone(int index, float zone) {
+ deadZones[index] = zone;
+ }
+
+ /*
+ * @see org.lwjgl.input.Controller#getZAxisValue()
+ */
+ public float getZAxisValue() {
+ if (zaxis == -1) {
+ return 0;
+ }
+
+ return getAxisValue(zaxis);
+ }
+
+ /*
+ * @see org.lwjgl.input.Controller#getZAxisDeadZone()
+ */
+ public float getZAxisDeadZone() {
+ if (zaxis == -1) {
+ return 0;
+ }
+
+ return getDeadZone(zaxis);
+ }
+
+ /*
+ * @see org.lwjgl.input.Controller#setZAxisDeadZone(float)
+ */
+ public void setZAxisDeadZone(float zone) {
+ setDeadZone(zaxis,zone);
+ }
+
+ /*
+ * @see org.lwjgl.input.Controller#getRXAxisValue()
+ */
+ public float getRXAxisValue() {
+ if (rxaxis == -1) {
+ return 0;
+ }
+
+ return getAxisValue(rxaxis);
+ }
+
+ /*
+ * @see org.lwjgl.input.Controller#getRXAxisDeadZone()
+ */
+ public float getRXAxisDeadZone() {
+ if (rxaxis == -1) {
+ return 0;
+ }
+
+ return getDeadZone(rxaxis);
+ }
+
+ /*
+ * @see org.lwjgl.input.Controller#setRXAxisDeadZone(float)
+ */
+ public void setRXAxisDeadZone(float zone) {
+ setDeadZone(rxaxis,zone);
+ }
+
+ /*
+ * @see org.lwjgl.input.Controller#getRYAxisValue()
+ */
+ public float getRYAxisValue() {
+ if (ryaxis == -1) {
+ return 0;
+ }
+
+ return getAxisValue(ryaxis);
+ }
+
+ /*
+ * @see org.lwjgl.input.Controller#getRYAxisDeadZone()
+ */
+ public float getRYAxisDeadZone() {
+ if (ryaxis == -1) {
+ return 0;
+ }
+
+ return getDeadZone(ryaxis);
+ }
+
+ /*
+ * @see org.lwjgl.input.Controller#setRYAxisDeadZone(float)
+ */
+ public void setRYAxisDeadZone(float zone) {
+ setDeadZone(ryaxis,zone);
+ }
+
+ /*
+ * @see org.lwjgl.input.Controller#getRZAxisValue()
+ */
+ public float getRZAxisValue() {
+ if (rzaxis == -1) {
+ return 0;
+ }
+
+ return getAxisValue(rzaxis);
+ }
+
+ /*
+ * @see org.lwjgl.input.Controller#getRZAxisDeadZone()
+ */
+ public float getRZAxisDeadZone() {
+ if (rzaxis == -1) {
+ return 0;
+ }
+
+ return getDeadZone(rzaxis);
+ }
+
+ /*
+ * @see org.lwjgl.input.Controller#setRZAxisDeadZone(float)
+ */
+ public void setRZAxisDeadZone(float zone) {
+ setDeadZone(rzaxis,zone);
+ }
+
+ /*
+ * @see org.lwjgl.input.Controller#getPovX()
+ */
+ public float getPovX() {
+ if (pov.size() == 0) {
+ return 0;
+ }
+
+ float value = povValues[0];
+
+ if ((value == Component.POV.DOWN_LEFT) ||
+ (value == Component.POV.UP_LEFT) ||
+ (value == Component.POV.LEFT)) {
+ return -1;
+ }
+ if ((value == Component.POV.DOWN_RIGHT) ||
+ (value == Component.POV.UP_RIGHT) ||
+ (value == Component.POV.RIGHT)) {
+ return 1;
+ }
+
+ return 0;
+ }
+
+ /*
+ * @see org.lwjgl.input.Controller#getPovY()
+ */
+ public float getPovY() {
+ if (pov.size() == 0) {
+ return 0;
+ }
+
+ float value = povValues[0];
+
+ if ((value == Component.POV.DOWN_LEFT) ||
+ (value == Component.POV.DOWN_RIGHT) ||
+ (value == Component.POV.DOWN)) {
+ return 1;
+ }
+ if ((value == Component.POV.UP_LEFT) ||
+ (value == Component.POV.UP_RIGHT) ||
+ (value == Component.POV.UP)) {
+ return -1;
+ }
+
+ return 0;
+ }
+
+
+}
diff --git a/src/java/org/lwjgl/input/Keyboard.java b/src/java/org/lwjgl/input/Keyboard.java
index bc7ee26..10d8d14 100644
--- a/src/java/org/lwjgl/input/Keyboard.java
+++ b/src/java/org/lwjgl/input/Keyboard.java
@@ -1,602 +1,602 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.input;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-import java.nio.ByteBuffer;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.lwjgl.BufferUtils;
-import org.lwjgl.LWJGLException;
-import org.lwjgl.Sys;
-import org.lwjgl.opengl.Display;
-import org.lwjgl.opengl.InputImplementation;
-
-/**
- * <br>
- * A raw Keyboard interface. This can be used to poll the current state of the
- * keys, or read all the keyboard presses / releases since the last read.
- *
- * @author cix_foo <cix_foo at users.sourceforge.net>
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 2983 $
- * $Id: Keyboard.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public class Keyboard {
- /** Internal use - event size in bytes */
- public static final int EVENT_SIZE = 4 + 1 + 4 + 8 + 1;
-
- /**
- * The special character meaning that no
- * character was translated for the event.
- */
- public static final int CHAR_NONE = '\0';
-
- /**
- * The special keycode meaning that only the
- * translated character is valid.
- */
- public static final int KEY_NONE = 0x00;
-
- public static final int KEY_ESCAPE = 0x01;
- public static final int KEY_1 = 0x02;
- public static final int KEY_2 = 0x03;
- public static final int KEY_3 = 0x04;
- public static final int KEY_4 = 0x05;
- public static final int KEY_5 = 0x06;
- public static final int KEY_6 = 0x07;
- public static final int KEY_7 = 0x08;
- public static final int KEY_8 = 0x09;
- public static final int KEY_9 = 0x0A;
- public static final int KEY_0 = 0x0B;
- public static final int KEY_MINUS = 0x0C; /* - on main keyboard */
- public static final int KEY_EQUALS = 0x0D;
- public static final int KEY_BACK = 0x0E; /* backspace */
- public static final int KEY_TAB = 0x0F;
- public static final int KEY_Q = 0x10;
- public static final int KEY_W = 0x11;
- public static final int KEY_E = 0x12;
- public static final int KEY_R = 0x13;
- public static final int KEY_T = 0x14;
- public static final int KEY_Y = 0x15;
- public static final int KEY_U = 0x16;
- public static final int KEY_I = 0x17;
- public static final int KEY_O = 0x18;
- public static final int KEY_P = 0x19;
- public static final int KEY_LBRACKET = 0x1A;
- public static final int KEY_RBRACKET = 0x1B;
- public static final int KEY_RETURN = 0x1C; /* Enter on main keyboard */
- public static final int KEY_LCONTROL = 0x1D;
- public static final int KEY_A = 0x1E;
- public static final int KEY_S = 0x1F;
- public static final int KEY_D = 0x20;
- public static final int KEY_F = 0x21;
- public static final int KEY_G = 0x22;
- public static final int KEY_H = 0x23;
- public static final int KEY_J = 0x24;
- public static final int KEY_K = 0x25;
- public static final int KEY_L = 0x26;
- public static final int KEY_SEMICOLON = 0x27;
- public static final int KEY_APOSTROPHE = 0x28;
- public static final int KEY_GRAVE = 0x29; /* accent grave */
- public static final int KEY_LSHIFT = 0x2A;
- public static final int KEY_BACKSLASH = 0x2B;
- public static final int KEY_Z = 0x2C;
- public static final int KEY_X = 0x2D;
- public static final int KEY_C = 0x2E;
- public static final int KEY_V = 0x2F;
- public static final int KEY_B = 0x30;
- public static final int KEY_N = 0x31;
- public static final int KEY_M = 0x32;
- public static final int KEY_COMMA = 0x33;
- public static final int KEY_PERIOD = 0x34; /* . on main keyboard */
- public static final int KEY_SLASH = 0x35; /* / on main keyboard */
- public static final int KEY_RSHIFT = 0x36;
- public static final int KEY_MULTIPLY = 0x37; /* * on numeric keypad */
- public static final int KEY_LMENU = 0x38; /* left Alt */
- public static final int KEY_SPACE = 0x39;
- public static final int KEY_CAPITAL = 0x3A;
- public static final int KEY_F1 = 0x3B;
- public static final int KEY_F2 = 0x3C;
- public static final int KEY_F3 = 0x3D;
- public static final int KEY_F4 = 0x3E;
- public static final int KEY_F5 = 0x3F;
- public static final int KEY_F6 = 0x40;
- public static final int KEY_F7 = 0x41;
- public static final int KEY_F8 = 0x42;
- public static final int KEY_F9 = 0x43;
- public static final int KEY_F10 = 0x44;
- public static final int KEY_NUMLOCK = 0x45;
- public static final int KEY_SCROLL = 0x46; /* Scroll Lock */
- public static final int KEY_NUMPAD7 = 0x47;
- public static final int KEY_NUMPAD8 = 0x48;
- public static final int KEY_NUMPAD9 = 0x49;
- public static final int KEY_SUBTRACT = 0x4A; /* - on numeric keypad */
- public static final int KEY_NUMPAD4 = 0x4B;
- public static final int KEY_NUMPAD5 = 0x4C;
- public static final int KEY_NUMPAD6 = 0x4D;
- public static final int KEY_ADD = 0x4E; /* + on numeric keypad */
- public static final int KEY_NUMPAD1 = 0x4F;
- public static final int KEY_NUMPAD2 = 0x50;
- public static final int KEY_NUMPAD3 = 0x51;
- public static final int KEY_NUMPAD0 = 0x52;
- public static final int KEY_DECIMAL = 0x53; /* . on numeric keypad */
- public static final int KEY_F11 = 0x57;
- public static final int KEY_F12 = 0x58;
- public static final int KEY_F13 = 0x64; /* (NEC PC98) */
- public static final int KEY_F14 = 0x65; /* (NEC PC98) */
- public static final int KEY_F15 = 0x66; /* (NEC PC98) */
- public static final int KEY_KANA = 0x70; /* (Japanese keyboard) */
- public static final int KEY_CONVERT = 0x79; /* (Japanese keyboard) */
- public static final int KEY_NOCONVERT = 0x7B; /* (Japanese keyboard) */
- public static final int KEY_YEN = 0x7D; /* (Japanese keyboard) */
- public static final int KEY_NUMPADEQUALS = 0x8D; /* = on numeric keypad (NEC PC98) */
- public static final int KEY_CIRCUMFLEX = 0x90; /* (Japanese keyboard) */
- public static final int KEY_AT = 0x91; /* (NEC PC98) */
- public static final int KEY_COLON = 0x92; /* (NEC PC98) */
- public static final int KEY_UNDERLINE = 0x93; /* (NEC PC98) */
- public static final int KEY_KANJI = 0x94; /* (Japanese keyboard) */
- public static final int KEY_STOP = 0x95; /* (NEC PC98) */
- public static final int KEY_AX = 0x96; /* (Japan AX) */
- public static final int KEY_UNLABELED = 0x97; /* (J3100) */
- public static final int KEY_NUMPADENTER = 0x9C; /* Enter on numeric keypad */
- public static final int KEY_RCONTROL = 0x9D;
- public static final int KEY_NUMPADCOMMA = 0xB3; /* , on numeric keypad (NEC PC98) */
- public static final int KEY_DIVIDE = 0xB5; /* / on numeric keypad */
- public static final int KEY_SYSRQ = 0xB7;
- public static final int KEY_RMENU = 0xB8; /* right Alt */
- public static final int KEY_PAUSE = 0xC5; /* Pause */
- public static final int KEY_HOME = 0xC7; /* Home on arrow keypad */
- public static final int KEY_UP = 0xC8; /* UpArrow on arrow keypad */
- public static final int KEY_PRIOR = 0xC9; /* PgUp on arrow keypad */
- public static final int KEY_LEFT = 0xCB; /* LeftArrow on arrow keypad */
- public static final int KEY_RIGHT = 0xCD; /* RightArrow on arrow keypad */
- public static final int KEY_END = 0xCF; /* End on arrow keypad */
- public static final int KEY_DOWN = 0xD0; /* DownArrow on arrow keypad */
- public static final int KEY_NEXT = 0xD1; /* PgDn on arrow keypad */
- public static final int KEY_INSERT = 0xD2; /* Insert on arrow keypad */
- public static final int KEY_DELETE = 0xD3; /* Delete on arrow keypad */
- public static final int KEY_LMETA = 0xDB; /* Left Windows/Option key */
- /**
- * The left windows key, mapped to KEY_LMETA
- *
- * @deprecated Use KEY_LMETA instead
- */
- public static final int KEY_LWIN = KEY_LMETA; /* Left Windows key */
- public static final int KEY_RMETA = 0xDC; /* Right Windows/Option key */
- /**
- * The right windows key, mapped to KEY_RMETA
- *
- * @deprecated Use KEY_RMETA instead
- */
- public static final int KEY_RWIN = KEY_RMETA; /* Right Windows key */
- public static final int KEY_APPS = 0xDD; /* AppMenu key */
- public static final int KEY_POWER = 0xDE;
- public static final int KEY_SLEEP = 0xDF;
-
-/* public static final int STATE_ON = 0;
- public static final int STATE_OFF = 1;
- public static final int STATE_UNKNOWN = 2;
-*/
- public static final int KEYBOARD_SIZE = 256;
-
- /** Buffer size in events */
- private static final int BUFFER_SIZE = 50;
-
- /** Key names */
- private static final String[] keyName = new String[255];
- private static final Map keyMap = new HashMap(253);
- private static int counter;
-
- static {
- // Use reflection to find out key names
- Field[] field = Keyboard.class.getFields();
- try {
- for (int i = 0; i < field.length; i++) {
- if (Modifier.isStatic(field[i].getModifiers())
- && Modifier.isPublic(field[i].getModifiers())
- && Modifier.isFinal(field[i].getModifiers())
- && field[i].getType().equals(int.class)
- && field[i].getName().startsWith("KEY_")) {
-
- int key = field[i].getInt(null);
- String name = field[i].getName().substring(4);
- keyName[key] = name;
- keyMap.put(name, new Integer(key));
- counter ++;
- }
-
- }
- } catch (Exception e) {
- }
-
- }
-
- /** The number of keys supported */
- private static final int keyCount = counter;
-
- /** Has the keyboard been created? */
- private static boolean created;
-
- /** Are repeat events enabled? */
- private static boolean repeat_enabled;
-
- /** The keys status from the last poll */
- private static final ByteBuffer keyDownBuffer = BufferUtils.createByteBuffer(KEYBOARD_SIZE);
-
- /**
- * The key events from the last read: a sequence of pairs of key number,
- * followed by state. The state is followed by
- * a 4 byte code point representing the translated character.
- */
- private static ByteBuffer readBuffer;
-
- /** current event */
- private static KeyEvent current_event = new KeyEvent();
-
- /** scratch event */
- private static KeyEvent tmp_event = new KeyEvent();
-
- /** One time initialization */
- private static boolean initialized;
-
- private static InputImplementation implementation;
-
- /**
- * Keyboard cannot be constructed.
- */
- private Keyboard() {
- }
-
- /**
- * Static initialization
- */
- private static void initialize() {
- if (initialized)
- return;
- Sys.initialize();
- initialized = true;
- }
-
- /**
- * "Create" the keyboard with the given implementation. This is used
- * reflectively from AWTInputAdapter.
- *
- * @throws LWJGLException if the keyboard could not be created for any reason
- */
- private static void create(InputImplementation impl) throws LWJGLException {
- if (created)
- return;
- if (!initialized)
- initialize();
- implementation = impl;
- implementation.createKeyboard();
- created = true;
- readBuffer = ByteBuffer.allocate(EVENT_SIZE*BUFFER_SIZE);
- reset();
- }
-
- /**
- * "Create" the keyboard. The display must first have been created. The
- * reason for this is so the keyboard has a window to "focus" in.
- *
- * @throws LWJGLException if the keyboard could not be created for any reason
- */
- public static void create() throws LWJGLException {
- synchronized (OpenGLPackageAccess.global_lock) {
- if (!Display.isCreated()) throw new IllegalStateException("Display must be created.");
-
- create(OpenGLPackageAccess.createImplementation());
- }
- }
-
- private static void reset() {
- readBuffer.limit(0);
- for (int i = 0; i < keyDownBuffer.remaining(); i++)
- keyDownBuffer.put(i, (byte)0);
- current_event.reset();
- }
-
- /**
- * @return true if the keyboard has been created
- */
- public static boolean isCreated() {
- synchronized (OpenGLPackageAccess.global_lock) {
- return created;
- }
- }
-
- /**
- * "Destroy" the keyboard
- */
- public static void destroy() {
- synchronized (OpenGLPackageAccess.global_lock) {
- if (!created)
- return;
- created = false;
- implementation.destroyKeyboard();
- reset();
- }
- }
-
- /**
- * Polls the keyboard for its current state. Access the polled values using the
- * <code>isKeyDown</code> method.
- * By using this method, it is possible to "miss" keyboard keys if you don't
- * poll fast enough.
- *
- * To use buffered values, you have to call <code>next</code> for each event you
- * want to read. You can query which key caused the event by using
- * <code>getEventKey</code>. To get the state of that key, for that event, use
- * <code>getEventKeyState</code> - finally use <code>getEventCharacter</code> to get the
- * character for that event.
- *
- * NOTE: This method does not query the operating system for new events. To do that,
- * Display.processMessages() (or Display.update()) must be called first.
- *
- * @see org.lwjgl.input.Keyboard#isKeyDown(int key)
- * @see org.lwjgl.input.Keyboard#next()
- * @see org.lwjgl.input.Keyboard#getEventKey()
- * @see org.lwjgl.input.Keyboard#getEventKeyState()
- * @see org.lwjgl.input.Keyboard#getEventCharacter()
- */
- public static void poll() {
- synchronized (OpenGLPackageAccess.global_lock) {
- if (!created)
- throw new IllegalStateException("Keyboard must be created before you can poll the device");
- implementation.pollKeyboard(keyDownBuffer);
- read();
- }
- }
-
- private static void read() {
- readBuffer.compact();
- implementation.readKeyboard(readBuffer);
- readBuffer.flip();
- }
-
- /**
- * Checks to see if a key is down.
- * @param key Keycode to check
- * @return true if the key is down according to the last poll()
- */
- public static boolean isKeyDown(int key) {
- synchronized (OpenGLPackageAccess.global_lock) {
- if (!created)
- throw new IllegalStateException("Keyboard must be created before you can query key state");
- return keyDownBuffer.get(key) != 0;
- }
- }
-
- /**
- * Checks whether one of the state keys are "active"
- *
- * @param key State key to test (KEY_CAPITAL | KEY_NUMLOCK | KEY_SYSRQ)
- * @return STATE_ON if on, STATE_OFF if off and STATE_UNKNOWN if the state is unknown
- */
-/* public static int isStateKeySet(int key) {
- if (!created)
- throw new IllegalStateException("Keyboard must be created before you can query key state");
- return implementation.isStateKeySet(key);
- }
-*/
- /**
- * Gets a key's name
- * @param key The key
- * @return a String with the key's human readable name in it or null if the key is unnamed
- */
- public static synchronized String getKeyName(int key) {
- return keyName[key];
- }
-
- /**
- * Get's a key's index. If the key is unrecognised then KEY_NONE is returned.
- * @param keyName The key name
- */
- public static synchronized int getKeyIndex(String keyName) {
- Integer ret = (Integer) keyMap.get(keyName);
- if (ret == null)
- return KEY_NONE;
- else
- return ret.intValue();
- }
-
- /**
- * Gets the number of keyboard events waiting after doing a buffer enabled poll().
- * @return the number of keyboard events
- */
- public static int getNumKeyboardEvents() {
- synchronized (OpenGLPackageAccess.global_lock) {
- if (!created)
- throw new IllegalStateException("Keyboard must be created before you can read events");
- int old_position = readBuffer.position();
- int num_events = 0;
- while (readNext(tmp_event) && (!tmp_event.repeat || repeat_enabled))
- num_events++;
- readBuffer.position(old_position);
- return num_events;
- }
- }
-
- /**
- * Gets the next keyboard event. You can query which key caused the event by using
- * <code>getEventKey</code>. To get the state of that key, for that event, use
- * <code>getEventKeyState</code> - finally use <code>getEventCharacter</code> to get the
- * character for that event.
- *
- * @see org.lwjgl.input.Keyboard#getEventKey()
- * @see org.lwjgl.input.Keyboard#getEventKeyState()
- * @see org.lwjgl.input.Keyboard#getEventCharacter()
- * @return true if a keyboard event was read, false otherwise
- */
- public static boolean next() {
- synchronized (OpenGLPackageAccess.global_lock) {
- if (!created)
- throw new IllegalStateException("Keyboard must be created before you can read events");
-
- boolean result;
- while ((result = readNext(current_event)) && current_event.repeat && !repeat_enabled)
- ;
- return result;
- }
- }
-
- /**
- * Controls whether repeat events are reported or not. If repeat events
- * are enabled, key down events are reported when a key is pressed and held for
- * a OS dependent amount of time. To distinguish a repeat event from a normal event,
- * use isRepeatEvent().
- *
- * @see org.lwjgl.input.Keyboard#getEventKey()
- */
- public static void enableRepeatEvents(boolean enable) {
- synchronized (OpenGLPackageAccess.global_lock) {
- repeat_enabled = enable;
- }
- }
-
- /**
- * Check whether repeat events are currently reported or not.
- *
- * @return true is repeat events are reported, false if not.
- * @see org.lwjgl.input.Keyboard#getEventKey()
- */
- public static boolean areRepeatEventsEnabled() {
- synchronized (OpenGLPackageAccess.global_lock) {
- return repeat_enabled;
- }
- }
-
- private static boolean readNext(KeyEvent event) {
- if (readBuffer.hasRemaining()) {
- event.key = readBuffer.getInt() & 0xFF;
- event.state = readBuffer.get() != 0;
- event.character = readBuffer.getInt();
- event.nanos = readBuffer.getLong();
- event.repeat = readBuffer.get() == 1;
- return true;
- } else
- return false;
- }
-
- /**
- * @return Number of keys on this keyboard
- */
- public static int getKeyCount() {
- return keyCount;
- }
-
- /**
- * @return The character from the current event
- */
- public static char getEventCharacter() {
- synchronized (OpenGLPackageAccess.global_lock) {
- return (char)current_event.character;
- }
- }
-
- /**
- * Please note that the key code returned is NOT valid against the
- * current keyboard layout. To get the actual character pressed call
- * getEventCharacter
- *
- * @return The key from the current event
- */
- public static int getEventKey() {
- synchronized (OpenGLPackageAccess.global_lock) {
- return current_event.key;
- }
- }
-
- /**
- * Gets the state of the tkey that generated the
- * current event
- *
- * @return True if key was down, or false if released
- */
- public static boolean getEventKeyState() {
- synchronized (OpenGLPackageAccess.global_lock) {
- return current_event.state;
- }
- }
-
- /**
- * Gets the time in nanoseconds of the current event.
- * Only useful for relative comparisons with other
- * Keyboard events, as the absolute time has no defined
- * origin.
- * @return The time in nanoseconds of the current event
- */
- public static long getEventNanoseconds() {
- synchronized (OpenGLPackageAccess.global_lock) {
- return current_event.nanos;
- }
- }
-
- /**
- * @see org.lwjgl.input.Keyboard#enableRepeatEvents(boolean)
- * @return true if the current event is a repeat event, false if
- * the current event is not a repeat even or if repeat events are disabled.
- */
- public static boolean isRepeatEvent() {
- synchronized (OpenGLPackageAccess.global_lock) {
- return current_event.repeat;
- }
- }
-
- private final static class KeyEvent {
- /** The current keyboard character being examined */
- private int character;
-
- /** The current keyboard event key being examined */
- private int key;
-
- /** The current state of the key being examined in the event queue */
- private boolean state;
-
- /** The current event time */
- private long nanos;
-
- /** Is the current event a repeated event? */
- private boolean repeat;
-
- private void reset() {
- character = 0;
- key = 0;
- state = false;
- repeat = false;
- }
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.input;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.nio.ByteBuffer;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.LWJGLException;
+import org.lwjgl.Sys;
+import org.lwjgl.opengl.Display;
+import org.lwjgl.opengl.InputImplementation;
+
+/**
+ * <br>
+ * A raw Keyboard interface. This can be used to poll the current state of the
+ * keys, or read all the keyboard presses / releases since the last read.
+ *
+ * @author cix_foo <cix_foo at users.sourceforge.net>
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 2983 $
+ * $Id: Keyboard.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public class Keyboard {
+ /** Internal use - event size in bytes */
+ public static final int EVENT_SIZE = 4 + 1 + 4 + 8 + 1;
+
+ /**
+ * The special character meaning that no
+ * character was translated for the event.
+ */
+ public static final int CHAR_NONE = '\0';
+
+ /**
+ * The special keycode meaning that only the
+ * translated character is valid.
+ */
+ public static final int KEY_NONE = 0x00;
+
+ public static final int KEY_ESCAPE = 0x01;
+ public static final int KEY_1 = 0x02;
+ public static final int KEY_2 = 0x03;
+ public static final int KEY_3 = 0x04;
+ public static final int KEY_4 = 0x05;
+ public static final int KEY_5 = 0x06;
+ public static final int KEY_6 = 0x07;
+ public static final int KEY_7 = 0x08;
+ public static final int KEY_8 = 0x09;
+ public static final int KEY_9 = 0x0A;
+ public static final int KEY_0 = 0x0B;
+ public static final int KEY_MINUS = 0x0C; /* - on main keyboard */
+ public static final int KEY_EQUALS = 0x0D;
+ public static final int KEY_BACK = 0x0E; /* backspace */
+ public static final int KEY_TAB = 0x0F;
+ public static final int KEY_Q = 0x10;
+ public static final int KEY_W = 0x11;
+ public static final int KEY_E = 0x12;
+ public static final int KEY_R = 0x13;
+ public static final int KEY_T = 0x14;
+ public static final int KEY_Y = 0x15;
+ public static final int KEY_U = 0x16;
+ public static final int KEY_I = 0x17;
+ public static final int KEY_O = 0x18;
+ public static final int KEY_P = 0x19;
+ public static final int KEY_LBRACKET = 0x1A;
+ public static final int KEY_RBRACKET = 0x1B;
+ public static final int KEY_RETURN = 0x1C; /* Enter on main keyboard */
+ public static final int KEY_LCONTROL = 0x1D;
+ public static final int KEY_A = 0x1E;
+ public static final int KEY_S = 0x1F;
+ public static final int KEY_D = 0x20;
+ public static final int KEY_F = 0x21;
+ public static final int KEY_G = 0x22;
+ public static final int KEY_H = 0x23;
+ public static final int KEY_J = 0x24;
+ public static final int KEY_K = 0x25;
+ public static final int KEY_L = 0x26;
+ public static final int KEY_SEMICOLON = 0x27;
+ public static final int KEY_APOSTROPHE = 0x28;
+ public static final int KEY_GRAVE = 0x29; /* accent grave */
+ public static final int KEY_LSHIFT = 0x2A;
+ public static final int KEY_BACKSLASH = 0x2B;
+ public static final int KEY_Z = 0x2C;
+ public static final int KEY_X = 0x2D;
+ public static final int KEY_C = 0x2E;
+ public static final int KEY_V = 0x2F;
+ public static final int KEY_B = 0x30;
+ public static final int KEY_N = 0x31;
+ public static final int KEY_M = 0x32;
+ public static final int KEY_COMMA = 0x33;
+ public static final int KEY_PERIOD = 0x34; /* . on main keyboard */
+ public static final int KEY_SLASH = 0x35; /* / on main keyboard */
+ public static final int KEY_RSHIFT = 0x36;
+ public static final int KEY_MULTIPLY = 0x37; /* * on numeric keypad */
+ public static final int KEY_LMENU = 0x38; /* left Alt */
+ public static final int KEY_SPACE = 0x39;
+ public static final int KEY_CAPITAL = 0x3A;
+ public static final int KEY_F1 = 0x3B;
+ public static final int KEY_F2 = 0x3C;
+ public static final int KEY_F3 = 0x3D;
+ public static final int KEY_F4 = 0x3E;
+ public static final int KEY_F5 = 0x3F;
+ public static final int KEY_F6 = 0x40;
+ public static final int KEY_F7 = 0x41;
+ public static final int KEY_F8 = 0x42;
+ public static final int KEY_F9 = 0x43;
+ public static final int KEY_F10 = 0x44;
+ public static final int KEY_NUMLOCK = 0x45;
+ public static final int KEY_SCROLL = 0x46; /* Scroll Lock */
+ public static final int KEY_NUMPAD7 = 0x47;
+ public static final int KEY_NUMPAD8 = 0x48;
+ public static final int KEY_NUMPAD9 = 0x49;
+ public static final int KEY_SUBTRACT = 0x4A; /* - on numeric keypad */
+ public static final int KEY_NUMPAD4 = 0x4B;
+ public static final int KEY_NUMPAD5 = 0x4C;
+ public static final int KEY_NUMPAD6 = 0x4D;
+ public static final int KEY_ADD = 0x4E; /* + on numeric keypad */
+ public static final int KEY_NUMPAD1 = 0x4F;
+ public static final int KEY_NUMPAD2 = 0x50;
+ public static final int KEY_NUMPAD3 = 0x51;
+ public static final int KEY_NUMPAD0 = 0x52;
+ public static final int KEY_DECIMAL = 0x53; /* . on numeric keypad */
+ public static final int KEY_F11 = 0x57;
+ public static final int KEY_F12 = 0x58;
+ public static final int KEY_F13 = 0x64; /* (NEC PC98) */
+ public static final int KEY_F14 = 0x65; /* (NEC PC98) */
+ public static final int KEY_F15 = 0x66; /* (NEC PC98) */
+ public static final int KEY_KANA = 0x70; /* (Japanese keyboard) */
+ public static final int KEY_CONVERT = 0x79; /* (Japanese keyboard) */
+ public static final int KEY_NOCONVERT = 0x7B; /* (Japanese keyboard) */
+ public static final int KEY_YEN = 0x7D; /* (Japanese keyboard) */
+ public static final int KEY_NUMPADEQUALS = 0x8D; /* = on numeric keypad (NEC PC98) */
+ public static final int KEY_CIRCUMFLEX = 0x90; /* (Japanese keyboard) */
+ public static final int KEY_AT = 0x91; /* (NEC PC98) */
+ public static final int KEY_COLON = 0x92; /* (NEC PC98) */
+ public static final int KEY_UNDERLINE = 0x93; /* (NEC PC98) */
+ public static final int KEY_KANJI = 0x94; /* (Japanese keyboard) */
+ public static final int KEY_STOP = 0x95; /* (NEC PC98) */
+ public static final int KEY_AX = 0x96; /* (Japan AX) */
+ public static final int KEY_UNLABELED = 0x97; /* (J3100) */
+ public static final int KEY_NUMPADENTER = 0x9C; /* Enter on numeric keypad */
+ public static final int KEY_RCONTROL = 0x9D;
+ public static final int KEY_NUMPADCOMMA = 0xB3; /* , on numeric keypad (NEC PC98) */
+ public static final int KEY_DIVIDE = 0xB5; /* / on numeric keypad */
+ public static final int KEY_SYSRQ = 0xB7;
+ public static final int KEY_RMENU = 0xB8; /* right Alt */
+ public static final int KEY_PAUSE = 0xC5; /* Pause */
+ public static final int KEY_HOME = 0xC7; /* Home on arrow keypad */
+ public static final int KEY_UP = 0xC8; /* UpArrow on arrow keypad */
+ public static final int KEY_PRIOR = 0xC9; /* PgUp on arrow keypad */
+ public static final int KEY_LEFT = 0xCB; /* LeftArrow on arrow keypad */
+ public static final int KEY_RIGHT = 0xCD; /* RightArrow on arrow keypad */
+ public static final int KEY_END = 0xCF; /* End on arrow keypad */
+ public static final int KEY_DOWN = 0xD0; /* DownArrow on arrow keypad */
+ public static final int KEY_NEXT = 0xD1; /* PgDn on arrow keypad */
+ public static final int KEY_INSERT = 0xD2; /* Insert on arrow keypad */
+ public static final int KEY_DELETE = 0xD3; /* Delete on arrow keypad */
+ public static final int KEY_LMETA = 0xDB; /* Left Windows/Option key */
+ /**
+ * The left windows key, mapped to KEY_LMETA
+ *
+ * @deprecated Use KEY_LMETA instead
+ */
+ public static final int KEY_LWIN = KEY_LMETA; /* Left Windows key */
+ public static final int KEY_RMETA = 0xDC; /* Right Windows/Option key */
+ /**
+ * The right windows key, mapped to KEY_RMETA
+ *
+ * @deprecated Use KEY_RMETA instead
+ */
+ public static final int KEY_RWIN = KEY_RMETA; /* Right Windows key */
+ public static final int KEY_APPS = 0xDD; /* AppMenu key */
+ public static final int KEY_POWER = 0xDE;
+ public static final int KEY_SLEEP = 0xDF;
+
+/* public static final int STATE_ON = 0;
+ public static final int STATE_OFF = 1;
+ public static final int STATE_UNKNOWN = 2;
+*/
+ public static final int KEYBOARD_SIZE = 256;
+
+ /** Buffer size in events */
+ private static final int BUFFER_SIZE = 50;
+
+ /** Key names */
+ private static final String[] keyName = new String[255];
+ private static final Map keyMap = new HashMap(253);
+ private static int counter;
+
+ static {
+ // Use reflection to find out key names
+ Field[] field = Keyboard.class.getFields();
+ try {
+ for (int i = 0; i < field.length; i++) {
+ if (Modifier.isStatic(field[i].getModifiers())
+ && Modifier.isPublic(field[i].getModifiers())
+ && Modifier.isFinal(field[i].getModifiers())
+ && field[i].getType().equals(int.class)
+ && field[i].getName().startsWith("KEY_")) {
+
+ int key = field[i].getInt(null);
+ String name = field[i].getName().substring(4);
+ keyName[key] = name;
+ keyMap.put(name, new Integer(key));
+ counter ++;
+ }
+
+ }
+ } catch (Exception e) {
+ }
+
+ }
+
+ /** The number of keys supported */
+ private static final int keyCount = counter;
+
+ /** Has the keyboard been created? */
+ private static boolean created;
+
+ /** Are repeat events enabled? */
+ private static boolean repeat_enabled;
+
+ /** The keys status from the last poll */
+ private static final ByteBuffer keyDownBuffer = BufferUtils.createByteBuffer(KEYBOARD_SIZE);
+
+ /**
+ * The key events from the last read: a sequence of pairs of key number,
+ * followed by state. The state is followed by
+ * a 4 byte code point representing the translated character.
+ */
+ private static ByteBuffer readBuffer;
+
+ /** current event */
+ private static KeyEvent current_event = new KeyEvent();
+
+ /** scratch event */
+ private static KeyEvent tmp_event = new KeyEvent();
+
+ /** One time initialization */
+ private static boolean initialized;
+
+ private static InputImplementation implementation;
+
+ /**
+ * Keyboard cannot be constructed.
+ */
+ private Keyboard() {
+ }
+
+ /**
+ * Static initialization
+ */
+ private static void initialize() {
+ if (initialized)
+ return;
+ Sys.initialize();
+ initialized = true;
+ }
+
+ /**
+ * "Create" the keyboard with the given implementation. This is used
+ * reflectively from AWTInputAdapter.
+ *
+ * @throws LWJGLException if the keyboard could not be created for any reason
+ */
+ private static void create(InputImplementation impl) throws LWJGLException {
+ if (created)
+ return;
+ if (!initialized)
+ initialize();
+ implementation = impl;
+ implementation.createKeyboard();
+ created = true;
+ readBuffer = ByteBuffer.allocate(EVENT_SIZE*BUFFER_SIZE);
+ reset();
+ }
+
+ /**
+ * "Create" the keyboard. The display must first have been created. The
+ * reason for this is so the keyboard has a window to "focus" in.
+ *
+ * @throws LWJGLException if the keyboard could not be created for any reason
+ */
+ public static void create() throws LWJGLException {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if (!Display.isCreated()) throw new IllegalStateException("Display must be created.");
+
+ create(OpenGLPackageAccess.createImplementation());
+ }
+ }
+
+ private static void reset() {
+ readBuffer.limit(0);
+ for (int i = 0; i < keyDownBuffer.remaining(); i++)
+ keyDownBuffer.put(i, (byte)0);
+ current_event.reset();
+ }
+
+ /**
+ * @return true if the keyboard has been created
+ */
+ public static boolean isCreated() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return created;
+ }
+ }
+
+ /**
+ * "Destroy" the keyboard
+ */
+ public static void destroy() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if (!created)
+ return;
+ created = false;
+ implementation.destroyKeyboard();
+ reset();
+ }
+ }
+
+ /**
+ * Polls the keyboard for its current state. Access the polled values using the
+ * <code>isKeyDown</code> method.
+ * By using this method, it is possible to "miss" keyboard keys if you don't
+ * poll fast enough.
+ *
+ * To use buffered values, you have to call <code>next</code> for each event you
+ * want to read. You can query which key caused the event by using
+ * <code>getEventKey</code>. To get the state of that key, for that event, use
+ * <code>getEventKeyState</code> - finally use <code>getEventCharacter</code> to get the
+ * character for that event.
+ *
+ * NOTE: This method does not query the operating system for new events. To do that,
+ * Display.processMessages() (or Display.update()) must be called first.
+ *
+ * @see org.lwjgl.input.Keyboard#isKeyDown(int key)
+ * @see org.lwjgl.input.Keyboard#next()
+ * @see org.lwjgl.input.Keyboard#getEventKey()
+ * @see org.lwjgl.input.Keyboard#getEventKeyState()
+ * @see org.lwjgl.input.Keyboard#getEventCharacter()
+ */
+ public static void poll() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if (!created)
+ throw new IllegalStateException("Keyboard must be created before you can poll the device");
+ implementation.pollKeyboard(keyDownBuffer);
+ read();
+ }
+ }
+
+ private static void read() {
+ readBuffer.compact();
+ implementation.readKeyboard(readBuffer);
+ readBuffer.flip();
+ }
+
+ /**
+ * Checks to see if a key is down.
+ * @param key Keycode to check
+ * @return true if the key is down according to the last poll()
+ */
+ public static boolean isKeyDown(int key) {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if (!created)
+ throw new IllegalStateException("Keyboard must be created before you can query key state");
+ return keyDownBuffer.get(key) != 0;
+ }
+ }
+
+ /**
+ * Checks whether one of the state keys are "active"
+ *
+ * @param key State key to test (KEY_CAPITAL | KEY_NUMLOCK | KEY_SYSRQ)
+ * @return STATE_ON if on, STATE_OFF if off and STATE_UNKNOWN if the state is unknown
+ */
+/* public static int isStateKeySet(int key) {
+ if (!created)
+ throw new IllegalStateException("Keyboard must be created before you can query key state");
+ return implementation.isStateKeySet(key);
+ }
+*/
+ /**
+ * Gets a key's name
+ * @param key The key
+ * @return a String with the key's human readable name in it or null if the key is unnamed
+ */
+ public static synchronized String getKeyName(int key) {
+ return keyName[key];
+ }
+
+ /**
+ * Get's a key's index. If the key is unrecognised then KEY_NONE is returned.
+ * @param keyName The key name
+ */
+ public static synchronized int getKeyIndex(String keyName) {
+ Integer ret = (Integer) keyMap.get(keyName);
+ if (ret == null)
+ return KEY_NONE;
+ else
+ return ret.intValue();
+ }
+
+ /**
+ * Gets the number of keyboard events waiting after doing a buffer enabled poll().
+ * @return the number of keyboard events
+ */
+ public static int getNumKeyboardEvents() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if (!created)
+ throw new IllegalStateException("Keyboard must be created before you can read events");
+ int old_position = readBuffer.position();
+ int num_events = 0;
+ while (readNext(tmp_event) && (!tmp_event.repeat || repeat_enabled))
+ num_events++;
+ readBuffer.position(old_position);
+ return num_events;
+ }
+ }
+
+ /**
+ * Gets the next keyboard event. You can query which key caused the event by using
+ * <code>getEventKey</code>. To get the state of that key, for that event, use
+ * <code>getEventKeyState</code> - finally use <code>getEventCharacter</code> to get the
+ * character for that event.
+ *
+ * @see org.lwjgl.input.Keyboard#getEventKey()
+ * @see org.lwjgl.input.Keyboard#getEventKeyState()
+ * @see org.lwjgl.input.Keyboard#getEventCharacter()
+ * @return true if a keyboard event was read, false otherwise
+ */
+ public static boolean next() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if (!created)
+ throw new IllegalStateException("Keyboard must be created before you can read events");
+
+ boolean result;
+ while ((result = readNext(current_event)) && current_event.repeat && !repeat_enabled)
+ ;
+ return result;
+ }
+ }
+
+ /**
+ * Controls whether repeat events are reported or not. If repeat events
+ * are enabled, key down events are reported when a key is pressed and held for
+ * a OS dependent amount of time. To distinguish a repeat event from a normal event,
+ * use isRepeatEvent().
+ *
+ * @see org.lwjgl.input.Keyboard#getEventKey()
+ */
+ public static void enableRepeatEvents(boolean enable) {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ repeat_enabled = enable;
+ }
+ }
+
+ /**
+ * Check whether repeat events are currently reported or not.
+ *
+ * @return true is repeat events are reported, false if not.
+ * @see org.lwjgl.input.Keyboard#getEventKey()
+ */
+ public static boolean areRepeatEventsEnabled() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return repeat_enabled;
+ }
+ }
+
+ private static boolean readNext(KeyEvent event) {
+ if (readBuffer.hasRemaining()) {
+ event.key = readBuffer.getInt() & 0xFF;
+ event.state = readBuffer.get() != 0;
+ event.character = readBuffer.getInt();
+ event.nanos = readBuffer.getLong();
+ event.repeat = readBuffer.get() == 1;
+ return true;
+ } else
+ return false;
+ }
+
+ /**
+ * @return Number of keys on this keyboard
+ */
+ public static int getKeyCount() {
+ return keyCount;
+ }
+
+ /**
+ * @return The character from the current event
+ */
+ public static char getEventCharacter() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return (char)current_event.character;
+ }
+ }
+
+ /**
+ * Please note that the key code returned is NOT valid against the
+ * current keyboard layout. To get the actual character pressed call
+ * getEventCharacter
+ *
+ * @return The key from the current event
+ */
+ public static int getEventKey() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return current_event.key;
+ }
+ }
+
+ /**
+ * Gets the state of the tkey that generated the
+ * current event
+ *
+ * @return True if key was down, or false if released
+ */
+ public static boolean getEventKeyState() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return current_event.state;
+ }
+ }
+
+ /**
+ * Gets the time in nanoseconds of the current event.
+ * Only useful for relative comparisons with other
+ * Keyboard events, as the absolute time has no defined
+ * origin.
+ * @return The time in nanoseconds of the current event
+ */
+ public static long getEventNanoseconds() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return current_event.nanos;
+ }
+ }
+
+ /**
+ * @see org.lwjgl.input.Keyboard#enableRepeatEvents(boolean)
+ * @return true if the current event is a repeat event, false if
+ * the current event is not a repeat even or if repeat events are disabled.
+ */
+ public static boolean isRepeatEvent() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return current_event.repeat;
+ }
+ }
+
+ private final static class KeyEvent {
+ /** The current keyboard character being examined */
+ private int character;
+
+ /** The current keyboard event key being examined */
+ private int key;
+
+ /** The current state of the key being examined in the event queue */
+ private boolean state;
+
+ /** The current event time */
+ private long nanos;
+
+ /** Is the current event a repeated event? */
+ private boolean repeat;
+
+ private void reset() {
+ character = 0;
+ key = 0;
+ state = false;
+ repeat = false;
+ }
+ }
+}
diff --git a/src/java/org/lwjgl/input/Mouse.java b/src/java/org/lwjgl/input/Mouse.java
index 9195a2e..028d8e7 100644
--- a/src/java/org/lwjgl/input/Mouse.java
+++ b/src/java/org/lwjgl/input/Mouse.java
@@ -1,683 +1,683 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.input;
-
-import java.nio.ByteBuffer;
-import java.nio.IntBuffer;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.lwjgl.BufferUtils;
-import org.lwjgl.LWJGLException;
-import org.lwjgl.LWJGLUtil;
-import org.lwjgl.Sys;
-import org.lwjgl.opengl.Display;
-import org.lwjgl.opengl.InputImplementation;
-
-
-/**
- * <br>
- * A raw Mouse interface. This can be used to poll the current state of the
- * mouse buttons, and determine the mouse movement delta since the last poll.
- *
- * n buttons supported, n being a native limit. A scrolly wheel is also
- * supported, if one such is available. Movement is reported as delta from
- * last position or as an absolute position. If the window has been created
- * the absolute position will be clamped to 0 - width | height.
- *
- * @author cix_foo <cix_foo at users.sourceforge.net>
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 3297 $
- * $Id: Mouse.java 3297 2010-03-27 16:04:30Z kappa1 $
- */
-public class Mouse {
- /** Internal use - event size in bytes */
- public static final int EVENT_SIZE = 1 + 1 + 4 + 4 + 4 + 8;
-
- /** Has the mouse been created? */
- private static boolean created;
-
- /** The mouse buttons status from the last poll */
- private static ByteBuffer buttons;
-
- /** Mouse absolute X position in pixels */
- private static int x;
-
- /** Mouse absolute Y position in pixels */
- private static int y;
-
- /** Buffer to hold the deltas dx, dy and dwheel */
- private static IntBuffer coord_buffer;
-
- /** Delta X */
- private static int dx;
-
- /** Delta Y */
- private static int dy;
-
- /** Delta Z */
- private static int dwheel;
-
- /** Number of buttons supported by the mouse */
- private static int buttonCount = -1;
-
- /** Does this mouse support a scroll wheel */
- private static boolean hasWheel;
-
- /** The current native cursor, if any */
- private static Cursor currentCursor;
-
- /** Button names. These are set upon create(), to names like BUTTON0, BUTTON1, etc. */
- private static String[] buttonName;
-
- /** hashmap of button names, for fast lookup */
- private static final Map buttonMap = new HashMap(16);
-
- /** Lazy initialization */
- private static boolean initialized;
-
- /** The mouse button events from the last read */
- private static ByteBuffer readBuffer;
-
- /** The current mouse event button being examined */
- private static int eventButton;
-
- /** The current state of the button being examined in the event queue */
- private static boolean eventState;
-
- /** The current delta of the mouse in the event queue */
- private static int event_dx;
- private static int event_dy;
- private static int event_dwheel;
- /** The current absolute position of the mouse in the event queue */
- private static int event_x;
- private static int event_y;
- private static long event_nanos;
- /** The position of the mouse it was grabbed at */
- private static int grab_x;
- private static int grab_y;
-
- /** Buffer size in events */
- private static final int BUFFER_SIZE = 50;
-
- private static boolean isGrabbed;
-
- private static InputImplementation implementation;
-
- /** Whether we need cursor animation emulation */
- private static final boolean emulateCursorAnimation = LWJGLUtil.getPlatform() == LWJGLUtil.PLATFORM_WINDOWS ||
- LWJGLUtil.getPlatform() == LWJGLUtil.PLATFORM_MACOSX;
-
- private static final boolean allowNegativeMouseCoords = getPrivilegedBoolean("org.lwjgl.input.Mouse.allowNegativeMouseCoords");
-
- /**
- * Mouse cannot be constructed.
- */
- private Mouse() {
- }
-
- /**
- * Gets the currently bound native cursor, if any.
- *
- * @return the currently bound native cursor, if any.
- */
- public static Cursor getNativeCursor() {
- synchronized (OpenGLPackageAccess.global_lock) {
- return currentCursor;
- }
- }
-
- /**
- * Binds a native cursor. If the cursor argument is null, any
- * currently bound native cursor is disabled, and the cursor reverts
- * to the default operating system supplied cursor.
- *
- * NOTE: The native cursor is not constrained to the window, but
- * relative events will not be generated if the cursor is outside.
- *
- * @param cursor the native cursor object to bind. May be null.
- * @return The previous Cursor object set, or null.
- * @throws LWJGLException if the cursor could not be set for any reason
- */
- public static Cursor setNativeCursor(Cursor cursor) throws LWJGLException {
- synchronized (OpenGLPackageAccess.global_lock) {
- if ((Cursor.getCapabilities() & Cursor.CURSOR_ONE_BIT_TRANSPARENCY) == 0)
- throw new IllegalStateException("Mouse doesn't support native cursors");
- Cursor oldCursor = currentCursor;
- currentCursor = cursor;
- if (isCreated()) {
- if (currentCursor != null) {
- implementation.setNativeCursor(currentCursor.getHandle());
- currentCursor.setTimeout();
- } else {
- implementation.setNativeCursor(null);
- }
- }
- return oldCursor;
- }
- }
-
- /**
- * Set the position of the cursor. If the cursor is not grabbed,
- * the native cursor is moved to the new position.
- *
- * @param new_x The x coordinate of the new cursor position in OpenGL coordinates relative
- * to the window origin.
- * @param new_y The y coordinate of the new cursor position in OpenGL coordinates relative
- * to the window origin.
- */
- public static void setCursorPosition(int new_x, int new_y) {
- synchronized (OpenGLPackageAccess.global_lock) {
- if (!isCreated())
- throw new IllegalStateException("Mouse is not created");
- x = event_x = new_x;
- y = event_y = new_y;
- if (!isGrabbed() && (Cursor.getCapabilities() & Cursor.CURSOR_ONE_BIT_TRANSPARENCY) != 0) {
- implementation.setCursorPosition(x, y);
- }
- else {
- grab_x = new_x;
- grab_y = new_y;
- }
- }
- }
-
- /**
- * Static initialization
- */
- private static void initialize() {
- Sys.initialize();
-
- // Assign names to all the buttons
- buttonName = new String[16];
- for (int i = 0; i < 16; i++) {
- buttonName[i] = "BUTTON" + i;
- buttonMap.put(buttonName[i], new Integer(i));
- }
-
- initialized = true;
- }
-
- private static void resetMouse() {
- dx = dy = dwheel = 0;
- readBuffer.position(readBuffer.limit());
- }
-
- static InputImplementation getImplementation() {
- return implementation;
- }
-
- /**
- * "Create" the mouse with the given custom implementation. This is used
- * reflectively by AWTInputAdapter.
- *
- * @throws LWJGLException if the mouse could not be created for any reason
- */
- private static void create(InputImplementation impl) throws LWJGLException {
- if (created)
- return;
- if (!initialized)
- initialize();
- implementation = impl;
- implementation.createMouse();
- hasWheel = implementation.hasWheel();
- created = true;
-
- // set mouse buttons
- buttonCount = implementation.getButtonCount();
- buttons = BufferUtils.createByteBuffer(buttonCount);
- coord_buffer = BufferUtils.createIntBuffer(3);
- if (currentCursor != null && implementation.getNativeCursorCapabilities() != 0)
- setNativeCursor(currentCursor);
- readBuffer = ByteBuffer.allocate(EVENT_SIZE * BUFFER_SIZE);
- readBuffer.limit(0);
- setGrabbed(isGrabbed);
- }
-
- /**
- * "Create" the mouse. The display must first have been created.
- * Initially, the mouse is not grabbed and the delta values are reported
- * with respect to the center of the display.
- *
- * @throws LWJGLException if the mouse could not be created for any reason
- */
- public static void create() throws LWJGLException {
- synchronized (OpenGLPackageAccess.global_lock) {
- if (!Display.isCreated()) throw new IllegalStateException("Display must be created.");
-
- create(OpenGLPackageAccess.createImplementation());
- }
- }
-
- /**
- * @return true if the mouse has been created
- */
- public static boolean isCreated() {
- synchronized (OpenGLPackageAccess.global_lock) {
- return created;
- }
- }
-
- /**
- * "Destroy" the mouse.
- */
- public static void destroy() {
- synchronized (OpenGLPackageAccess.global_lock) {
- if (!created) return;
- created = false;
- buttons = null;
- coord_buffer = null;
-
- implementation.destroyMouse();
- }
- }
-
- /**
- * Polls the mouse for its current state. Access the polled values using the
- * get<value> methods.
- * By using this method, it is possible to "miss" mouse click events if you don't
- * poll fast enough.
- *
- * To use buffered values, you have to call <code>next</code> for each event you
- * want to read. You can query which button caused the event by using
- * <code>getEventButton</code>. To get the state of that button, for that event, use
- * <code>getEventButtonState</code>.
- *
- * NOTE: This method does not query the operating system for new events. To do that,
- * Display.processMessages() (or Display.update()) must be called first.
- *
- * @see org.lwjgl.input.Mouse#next()
- * @see org.lwjgl.input.Mouse#getEventButton()
- * @see org.lwjgl.input.Mouse#getEventButtonState()
- * @see org.lwjgl.input.Mouse#isButtonDown(int button)
- * @see org.lwjgl.input.Mouse#getX()
- * @see org.lwjgl.input.Mouse#getY()
- * @see org.lwjgl.input.Mouse#getDX()
- * @see org.lwjgl.input.Mouse#getDY()
- * @see org.lwjgl.input.Mouse#getDWheel()
- */
- public static void poll() {
- synchronized (OpenGLPackageAccess.global_lock) {
- if (!created) throw new IllegalStateException("Mouse must be created before you can poll it");
- implementation.pollMouse(coord_buffer, buttons);
-
- /* If we're grabbed, poll returns mouse deltas, if not it returns absolute coordinates */
- int poll_coord1 = coord_buffer.get(0);
- int poll_coord2 = coord_buffer.get(1);
- /* The wheel is always relative */
- int poll_dwheel = coord_buffer.get(2);
-
- if (isGrabbed()) {
- dx += poll_coord1;
- dy += poll_coord2;
- x += poll_coord1;
- y += poll_coord2;
- } else {
- dx = poll_coord1 - x;
- dy = poll_coord2 - y;
- x = poll_coord1;
- y = poll_coord2;
- }
- if(!allowNegativeMouseCoords) {
- x = Math.min(implementation.getWidth() - 1, Math.max(0, x));
- y = Math.min(implementation.getHeight() - 1, Math.max(0, y));
- }
- dwheel += poll_dwheel;
- read();
- }
- }
-
- private static void read() {
- readBuffer.compact();
- implementation.readMouse(readBuffer);
- readBuffer.flip();
- }
-
- /**
- * See if a particular mouse button is down.
- *
- * @param button The index of the button you wish to test (0..getButtonCount-1)
- * @return true if the specified button is down
- */
- public static boolean isButtonDown(int button) {
- synchronized (OpenGLPackageAccess.global_lock) {
- if (!created) throw new IllegalStateException("Mouse must be created before you can poll the button state");
- if (button >= buttonCount || button < 0)
- return false;
- else
- return buttons.get(button) == 1;
- }
- }
-
- /**
- * Gets a button's name
- * @param button The button
- * @return a String with the button's human readable name in it or null if the button is unnamed
- */
- public static String getButtonName(int button) {
- synchronized (OpenGLPackageAccess.global_lock) {
- if (button >= buttonName.length || button < 0)
- return null;
- else
- return buttonName[button];
- }
- }
-
- /**
- * Get's a button's index. If the button is unrecognised then -1 is returned.
- * @param buttonName The button name
- */
- public static int getButtonIndex(String buttonName) {
- synchronized (OpenGLPackageAccess.global_lock) {
- Integer ret = (Integer) buttonMap.get(buttonName);
- if (ret == null)
- return -1;
- else
- return ret.intValue();
- }
- }
-
- /**
- * Gets the next mouse event. You can query which button caused the event by using
- * <code>getEventButton()</code> (if any). To get the state of that key, for that event, use
- * <code>getEventButtonState</code>. To get the current mouse delta values use <code>getEventDX()</code>,
- * <code>getEventDY()</code> and <code>getEventDZ()</code>.
- * @see org.lwjgl.input.Mouse#getEventButton()
- * @see org.lwjgl.input.Mouse#getEventButtonState()
- * @return true if a mouse event was read, false otherwise
- */
- public static boolean next() {
- synchronized (OpenGLPackageAccess.global_lock) {
- if (!created) throw new IllegalStateException("Mouse must be created before you can read events");
- if (readBuffer.hasRemaining()) {
- eventButton = readBuffer.get();
- eventState = readBuffer.get() != 0;
- if (isGrabbed()) {
- event_dx = readBuffer.getInt();
- event_dy = readBuffer.getInt();
- event_x += event_dx;
- event_y += event_dy;
- } else {
- int new_event_x = readBuffer.getInt();
- int new_event_y = readBuffer.getInt();
- event_dx = new_event_x - event_x;
- event_dy = new_event_y - event_y;
- event_x = new_event_x;
- event_y = new_event_y;
- }
- event_x = Math.min(implementation.getWidth() - 1, Math.max(0, event_x));
- event_y = Math.min(implementation.getHeight() - 1, Math.max(0, event_y));
- event_dwheel = readBuffer.getInt();
- event_nanos = readBuffer.getLong();
- return true;
- } else
- return false;
- }
- }
-
- /**
- * @return Current events button. Returns -1 if no button state was changed
- */
- public static int getEventButton() {
- synchronized (OpenGLPackageAccess.global_lock) {
- return eventButton;
- }
- }
-
- /**
- * Get the current events button state.
- * @return Current events button state.
- */
- public static boolean getEventButtonState() {
- synchronized (OpenGLPackageAccess.global_lock) {
- return eventState;
- }
- }
-
- /**
- * @return Current events delta x. Only valid when the mouse is grabbed.
- */
- public static int getEventDX() {
- synchronized (OpenGLPackageAccess.global_lock) {
- return event_dx;
- }
- }
-
- /**
- * @return Current events delta y. Only valid when the mouse is grabbed.
- */
- public static int getEventDY() {
- synchronized (OpenGLPackageAccess.global_lock) {
- return event_dy;
- }
- }
-
- /**
- * @return Current events absolute x. Only valid when the mouse is not grabbed.
- */
- public static int getEventX() {
- synchronized (OpenGLPackageAccess.global_lock) {
- return event_x;
- }
- }
-
- /**
- * @return Current events absolute y. Only valid when the mouse is not grabbed.
- */
- public static int getEventY() {
- synchronized (OpenGLPackageAccess.global_lock) {
- return event_y;
- }
- }
-
- /**
- * @return Current events delta z
- */
- public static int getEventDWheel() {
- synchronized (OpenGLPackageAccess.global_lock) {
- return event_dwheel;
- }
- }
-
- /**
- * Gets the time in nanoseconds of the current event.
- * Only useful for relative comparisons with other
- * Mouse events, as the absolute time has no defined
- * origin.
- *
- * @return The time in nanoseconds of the current event
- */
- public static long getEventNanoseconds() {
- synchronized (OpenGLPackageAccess.global_lock) {
- return event_nanos;
- }
- }
-
- /**
- * Retrieves the absolute position. It will be clamped to
- * 0...width-1.
- *
- * @return Absolute x axis position of mouse
- */
- public static int getX() {
- synchronized (OpenGLPackageAccess.global_lock) {
- return x;
- }
- }
-
- /**
- * Retrieves the absolute position. It will be clamped to
- * 0...height-1.
- *
- * @return Absolute y axis position of mouse
- */
- public static int getY() {
- synchronized (OpenGLPackageAccess.global_lock) {
- return y;
- }
- }
-
- /**
- * @return Movement on the x axis since last time getDX() was called. Only valid when the mouse is grabbed.
- */
- public static int getDX() {
- synchronized (OpenGLPackageAccess.global_lock) {
- int result = dx;
- dx = 0;
- return result;
- }
- }
-
- /**
- * @return Movement on the y axis since last time getDY() was called. Only valid when the mouse is grabbed.
- */
- public static int getDY() {
- synchronized (OpenGLPackageAccess.global_lock) {
- int result = dy;
- dy = 0;
- return result;
- }
- }
-
- /**
- * @return Movement of the wheel since last time getDWheel() was called
- */
- public static int getDWheel() {
- synchronized (OpenGLPackageAccess.global_lock) {
- int result = dwheel;
- dwheel = 0;
- return result;
- }
- }
-
- /**
- * @return Number of buttons on this mouse
- */
- public static int getButtonCount() {
- synchronized (OpenGLPackageAccess.global_lock) {
- return buttonCount;
- }
- }
-
- /**
- * @return Whether or not this mouse has wheel support
- */
- public static boolean hasWheel() {
- synchronized (OpenGLPackageAccess.global_lock) {
- return hasWheel;
- }
- }
-
- /**
- * @return whether or not the mouse has grabbed the cursor
- */
- public static boolean isGrabbed() {
- synchronized (OpenGLPackageAccess.global_lock) {
- return isGrabbed;
- }
- }
-
- /**
- * Sets whether or not the mouse has grabbed the cursor
- * (and thus hidden). If grab is false, the getX() and getY()
- * will return delta movement in pixels clamped to the display
- * dimensions, from the center of the display.
- *
- * @param grab whether the mouse should be grabbed
- */
- public static void setGrabbed(boolean grab) {
- synchronized (OpenGLPackageAccess.global_lock) {
- boolean grabbed = isGrabbed;
- isGrabbed = grab;
- if (isCreated()) {
- if (grab && !grabbed) {
- // store location mouse was grabbed
- grab_x = x;
- grab_y = y;
- }
- else if (!grab && grabbed) {
- // move mouse back to location it was grabbed before ungrabbing
- if ((Cursor.getCapabilities() & Cursor.CURSOR_ONE_BIT_TRANSPARENCY) != 0)
- implementation.setCursorPosition(grab_x, grab_y);
- }
-
- implementation.grabMouse(grab);
- // Get latest values from native side
- poll();
- event_x = x;
- event_y = y;
- resetMouse();
- }
- }
- }
-
- /**
- * Updates the cursor, so that animation can be changed if needed.
- * This method is called automatically by the window on its update, and
- * shouldn't be called otherwise
- */
- public static void updateCursor() {
- synchronized (OpenGLPackageAccess.global_lock) {
- if (emulateCursorAnimation && currentCursor != null && currentCursor.hasTimedOut() && Mouse.isInsideWindow()) {
- currentCursor.nextCursor();
- try {
- setNativeCursor(currentCursor);
- } catch (LWJGLException e) {
- if (LWJGLUtil.DEBUG) e.printStackTrace();
- }
- }
- }
- }
-
- /** Gets a boolean property as a privileged action. */
- static boolean getPrivilegedBoolean(final String property_name) {
- Boolean value = (Boolean)AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return new Boolean(Boolean.getBoolean(property_name));
- }
- });
- return value.booleanValue();
- }
-
- /**
- * Retrieves whether or not the mouse cursor is within the bounds of the window.
- * If the mouse cursor was moved outside the display during a drag, then the result of calling
- * this method will be true until the button is released.
- * @return true if mouse is inside display, false otherwise.
- */
- public static boolean isInsideWindow() {
- return implementation.isInsideWindow();
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.input;
+
+import java.nio.ByteBuffer;
+import java.nio.IntBuffer;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.LWJGLException;
+import org.lwjgl.LWJGLUtil;
+import org.lwjgl.Sys;
+import org.lwjgl.opengl.Display;
+import org.lwjgl.opengl.InputImplementation;
+
+
+/**
+ * <br>
+ * A raw Mouse interface. This can be used to poll the current state of the
+ * mouse buttons, and determine the mouse movement delta since the last poll.
+ *
+ * n buttons supported, n being a native limit. A scrolly wheel is also
+ * supported, if one such is available. Movement is reported as delta from
+ * last position or as an absolute position. If the window has been created
+ * the absolute position will be clamped to 0 - width | height.
+ *
+ * @author cix_foo <cix_foo at users.sourceforge.net>
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 3297 $
+ * $Id: Mouse.java 3297 2010-03-27 16:04:30Z kappa1 $
+ */
+public class Mouse {
+ /** Internal use - event size in bytes */
+ public static final int EVENT_SIZE = 1 + 1 + 4 + 4 + 4 + 8;
+
+ /** Has the mouse been created? */
+ private static boolean created;
+
+ /** The mouse buttons status from the last poll */
+ private static ByteBuffer buttons;
+
+ /** Mouse absolute X position in pixels */
+ private static int x;
+
+ /** Mouse absolute Y position in pixels */
+ private static int y;
+
+ /** Buffer to hold the deltas dx, dy and dwheel */
+ private static IntBuffer coord_buffer;
+
+ /** Delta X */
+ private static int dx;
+
+ /** Delta Y */
+ private static int dy;
+
+ /** Delta Z */
+ private static int dwheel;
+
+ /** Number of buttons supported by the mouse */
+ private static int buttonCount = -1;
+
+ /** Does this mouse support a scroll wheel */
+ private static boolean hasWheel;
+
+ /** The current native cursor, if any */
+ private static Cursor currentCursor;
+
+ /** Button names. These are set upon create(), to names like BUTTON0, BUTTON1, etc. */
+ private static String[] buttonName;
+
+ /** hashmap of button names, for fast lookup */
+ private static final Map buttonMap = new HashMap(16);
+
+ /** Lazy initialization */
+ private static boolean initialized;
+
+ /** The mouse button events from the last read */
+ private static ByteBuffer readBuffer;
+
+ /** The current mouse event button being examined */
+ private static int eventButton;
+
+ /** The current state of the button being examined in the event queue */
+ private static boolean eventState;
+
+ /** The current delta of the mouse in the event queue */
+ private static int event_dx;
+ private static int event_dy;
+ private static int event_dwheel;
+ /** The current absolute position of the mouse in the event queue */
+ private static int event_x;
+ private static int event_y;
+ private static long event_nanos;
+ /** The position of the mouse it was grabbed at */
+ private static int grab_x;
+ private static int grab_y;
+
+ /** Buffer size in events */
+ private static final int BUFFER_SIZE = 50;
+
+ private static boolean isGrabbed;
+
+ private static InputImplementation implementation;
+
+ /** Whether we need cursor animation emulation */
+ private static final boolean emulateCursorAnimation = LWJGLUtil.getPlatform() == LWJGLUtil.PLATFORM_WINDOWS ||
+ LWJGLUtil.getPlatform() == LWJGLUtil.PLATFORM_MACOSX;
+
+ private static final boolean allowNegativeMouseCoords = getPrivilegedBoolean("org.lwjgl.input.Mouse.allowNegativeMouseCoords");
+
+ /**
+ * Mouse cannot be constructed.
+ */
+ private Mouse() {
+ }
+
+ /**
+ * Gets the currently bound native cursor, if any.
+ *
+ * @return the currently bound native cursor, if any.
+ */
+ public static Cursor getNativeCursor() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return currentCursor;
+ }
+ }
+
+ /**
+ * Binds a native cursor. If the cursor argument is null, any
+ * currently bound native cursor is disabled, and the cursor reverts
+ * to the default operating system supplied cursor.
+ *
+ * NOTE: The native cursor is not constrained to the window, but
+ * relative events will not be generated if the cursor is outside.
+ *
+ * @param cursor the native cursor object to bind. May be null.
+ * @return The previous Cursor object set, or null.
+ * @throws LWJGLException if the cursor could not be set for any reason
+ */
+ public static Cursor setNativeCursor(Cursor cursor) throws LWJGLException {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if ((Cursor.getCapabilities() & Cursor.CURSOR_ONE_BIT_TRANSPARENCY) == 0)
+ throw new IllegalStateException("Mouse doesn't support native cursors");
+ Cursor oldCursor = currentCursor;
+ currentCursor = cursor;
+ if (isCreated()) {
+ if (currentCursor != null) {
+ implementation.setNativeCursor(currentCursor.getHandle());
+ currentCursor.setTimeout();
+ } else {
+ implementation.setNativeCursor(null);
+ }
+ }
+ return oldCursor;
+ }
+ }
+
+ /**
+ * Set the position of the cursor. If the cursor is not grabbed,
+ * the native cursor is moved to the new position.
+ *
+ * @param new_x The x coordinate of the new cursor position in OpenGL coordinates relative
+ * to the window origin.
+ * @param new_y The y coordinate of the new cursor position in OpenGL coordinates relative
+ * to the window origin.
+ */
+ public static void setCursorPosition(int new_x, int new_y) {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if (!isCreated())
+ throw new IllegalStateException("Mouse is not created");
+ x = event_x = new_x;
+ y = event_y = new_y;
+ if (!isGrabbed() && (Cursor.getCapabilities() & Cursor.CURSOR_ONE_BIT_TRANSPARENCY) != 0) {
+ implementation.setCursorPosition(x, y);
+ }
+ else {
+ grab_x = new_x;
+ grab_y = new_y;
+ }
+ }
+ }
+
+ /**
+ * Static initialization
+ */
+ private static void initialize() {
+ Sys.initialize();
+
+ // Assign names to all the buttons
+ buttonName = new String[16];
+ for (int i = 0; i < 16; i++) {
+ buttonName[i] = "BUTTON" + i;
+ buttonMap.put(buttonName[i], new Integer(i));
+ }
+
+ initialized = true;
+ }
+
+ private static void resetMouse() {
+ dx = dy = dwheel = 0;
+ readBuffer.position(readBuffer.limit());
+ }
+
+ static InputImplementation getImplementation() {
+ return implementation;
+ }
+
+ /**
+ * "Create" the mouse with the given custom implementation. This is used
+ * reflectively by AWTInputAdapter.
+ *
+ * @throws LWJGLException if the mouse could not be created for any reason
+ */
+ private static void create(InputImplementation impl) throws LWJGLException {
+ if (created)
+ return;
+ if (!initialized)
+ initialize();
+ implementation = impl;
+ implementation.createMouse();
+ hasWheel = implementation.hasWheel();
+ created = true;
+
+ // set mouse buttons
+ buttonCount = implementation.getButtonCount();
+ buttons = BufferUtils.createByteBuffer(buttonCount);
+ coord_buffer = BufferUtils.createIntBuffer(3);
+ if (currentCursor != null && implementation.getNativeCursorCapabilities() != 0)
+ setNativeCursor(currentCursor);
+ readBuffer = ByteBuffer.allocate(EVENT_SIZE * BUFFER_SIZE);
+ readBuffer.limit(0);
+ setGrabbed(isGrabbed);
+ }
+
+ /**
+ * "Create" the mouse. The display must first have been created.
+ * Initially, the mouse is not grabbed and the delta values are reported
+ * with respect to the center of the display.
+ *
+ * @throws LWJGLException if the mouse could not be created for any reason
+ */
+ public static void create() throws LWJGLException {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if (!Display.isCreated()) throw new IllegalStateException("Display must be created.");
+
+ create(OpenGLPackageAccess.createImplementation());
+ }
+ }
+
+ /**
+ * @return true if the mouse has been created
+ */
+ public static boolean isCreated() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return created;
+ }
+ }
+
+ /**
+ * "Destroy" the mouse.
+ */
+ public static void destroy() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if (!created) return;
+ created = false;
+ buttons = null;
+ coord_buffer = null;
+
+ implementation.destroyMouse();
+ }
+ }
+
+ /**
+ * Polls the mouse for its current state. Access the polled values using the
+ * get<value> methods.
+ * By using this method, it is possible to "miss" mouse click events if you don't
+ * poll fast enough.
+ *
+ * To use buffered values, you have to call <code>next</code> for each event you
+ * want to read. You can query which button caused the event by using
+ * <code>getEventButton</code>. To get the state of that button, for that event, use
+ * <code>getEventButtonState</code>.
+ *
+ * NOTE: This method does not query the operating system for new events. To do that,
+ * Display.processMessages() (or Display.update()) must be called first.
+ *
+ * @see org.lwjgl.input.Mouse#next()
+ * @see org.lwjgl.input.Mouse#getEventButton()
+ * @see org.lwjgl.input.Mouse#getEventButtonState()
+ * @see org.lwjgl.input.Mouse#isButtonDown(int button)
+ * @see org.lwjgl.input.Mouse#getX()
+ * @see org.lwjgl.input.Mouse#getY()
+ * @see org.lwjgl.input.Mouse#getDX()
+ * @see org.lwjgl.input.Mouse#getDY()
+ * @see org.lwjgl.input.Mouse#getDWheel()
+ */
+ public static void poll() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if (!created) throw new IllegalStateException("Mouse must be created before you can poll it");
+ implementation.pollMouse(coord_buffer, buttons);
+
+ /* If we're grabbed, poll returns mouse deltas, if not it returns absolute coordinates */
+ int poll_coord1 = coord_buffer.get(0);
+ int poll_coord2 = coord_buffer.get(1);
+ /* The wheel is always relative */
+ int poll_dwheel = coord_buffer.get(2);
+
+ if (isGrabbed()) {
+ dx += poll_coord1;
+ dy += poll_coord2;
+ x += poll_coord1;
+ y += poll_coord2;
+ } else {
+ dx = poll_coord1 - x;
+ dy = poll_coord2 - y;
+ x = poll_coord1;
+ y = poll_coord2;
+ }
+ if(!allowNegativeMouseCoords) {
+ x = Math.min(implementation.getWidth() - 1, Math.max(0, x));
+ y = Math.min(implementation.getHeight() - 1, Math.max(0, y));
+ }
+ dwheel += poll_dwheel;
+ read();
+ }
+ }
+
+ private static void read() {
+ readBuffer.compact();
+ implementation.readMouse(readBuffer);
+ readBuffer.flip();
+ }
+
+ /**
+ * See if a particular mouse button is down.
+ *
+ * @param button The index of the button you wish to test (0..getButtonCount-1)
+ * @return true if the specified button is down
+ */
+ public static boolean isButtonDown(int button) {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if (!created) throw new IllegalStateException("Mouse must be created before you can poll the button state");
+ if (button >= buttonCount || button < 0)
+ return false;
+ else
+ return buttons.get(button) == 1;
+ }
+ }
+
+ /**
+ * Gets a button's name
+ * @param button The button
+ * @return a String with the button's human readable name in it or null if the button is unnamed
+ */
+ public static String getButtonName(int button) {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if (button >= buttonName.length || button < 0)
+ return null;
+ else
+ return buttonName[button];
+ }
+ }
+
+ /**
+ * Get's a button's index. If the button is unrecognised then -1 is returned.
+ * @param buttonName The button name
+ */
+ public static int getButtonIndex(String buttonName) {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ Integer ret = (Integer) buttonMap.get(buttonName);
+ if (ret == null)
+ return -1;
+ else
+ return ret.intValue();
+ }
+ }
+
+ /**
+ * Gets the next mouse event. You can query which button caused the event by using
+ * <code>getEventButton()</code> (if any). To get the state of that key, for that event, use
+ * <code>getEventButtonState</code>. To get the current mouse delta values use <code>getEventDX()</code>,
+ * <code>getEventDY()</code> and <code>getEventDZ()</code>.
+ * @see org.lwjgl.input.Mouse#getEventButton()
+ * @see org.lwjgl.input.Mouse#getEventButtonState()
+ * @return true if a mouse event was read, false otherwise
+ */
+ public static boolean next() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if (!created) throw new IllegalStateException("Mouse must be created before you can read events");
+ if (readBuffer.hasRemaining()) {
+ eventButton = readBuffer.get();
+ eventState = readBuffer.get() != 0;
+ if (isGrabbed()) {
+ event_dx = readBuffer.getInt();
+ event_dy = readBuffer.getInt();
+ event_x += event_dx;
+ event_y += event_dy;
+ } else {
+ int new_event_x = readBuffer.getInt();
+ int new_event_y = readBuffer.getInt();
+ event_dx = new_event_x - event_x;
+ event_dy = new_event_y - event_y;
+ event_x = new_event_x;
+ event_y = new_event_y;
+ }
+ event_x = Math.min(implementation.getWidth() - 1, Math.max(0, event_x));
+ event_y = Math.min(implementation.getHeight() - 1, Math.max(0, event_y));
+ event_dwheel = readBuffer.getInt();
+ event_nanos = readBuffer.getLong();
+ return true;
+ } else
+ return false;
+ }
+ }
+
+ /**
+ * @return Current events button. Returns -1 if no button state was changed
+ */
+ public static int getEventButton() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return eventButton;
+ }
+ }
+
+ /**
+ * Get the current events button state.
+ * @return Current events button state.
+ */
+ public static boolean getEventButtonState() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return eventState;
+ }
+ }
+
+ /**
+ * @return Current events delta x. Only valid when the mouse is grabbed.
+ */
+ public static int getEventDX() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return event_dx;
+ }
+ }
+
+ /**
+ * @return Current events delta y. Only valid when the mouse is grabbed.
+ */
+ public static int getEventDY() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return event_dy;
+ }
+ }
+
+ /**
+ * @return Current events absolute x. Only valid when the mouse is not grabbed.
+ */
+ public static int getEventX() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return event_x;
+ }
+ }
+
+ /**
+ * @return Current events absolute y. Only valid when the mouse is not grabbed.
+ */
+ public static int getEventY() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return event_y;
+ }
+ }
+
+ /**
+ * @return Current events delta z
+ */
+ public static int getEventDWheel() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return event_dwheel;
+ }
+ }
+
+ /**
+ * Gets the time in nanoseconds of the current event.
+ * Only useful for relative comparisons with other
+ * Mouse events, as the absolute time has no defined
+ * origin.
+ *
+ * @return The time in nanoseconds of the current event
+ */
+ public static long getEventNanoseconds() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return event_nanos;
+ }
+ }
+
+ /**
+ * Retrieves the absolute position. It will be clamped to
+ * 0...width-1.
+ *
+ * @return Absolute x axis position of mouse
+ */
+ public static int getX() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return x;
+ }
+ }
+
+ /**
+ * Retrieves the absolute position. It will be clamped to
+ * 0...height-1.
+ *
+ * @return Absolute y axis position of mouse
+ */
+ public static int getY() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return y;
+ }
+ }
+
+ /**
+ * @return Movement on the x axis since last time getDX() was called. Only valid when the mouse is grabbed.
+ */
+ public static int getDX() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ int result = dx;
+ dx = 0;
+ return result;
+ }
+ }
+
+ /**
+ * @return Movement on the y axis since last time getDY() was called. Only valid when the mouse is grabbed.
+ */
+ public static int getDY() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ int result = dy;
+ dy = 0;
+ return result;
+ }
+ }
+
+ /**
+ * @return Movement of the wheel since last time getDWheel() was called
+ */
+ public static int getDWheel() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ int result = dwheel;
+ dwheel = 0;
+ return result;
+ }
+ }
+
+ /**
+ * @return Number of buttons on this mouse
+ */
+ public static int getButtonCount() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return buttonCount;
+ }
+ }
+
+ /**
+ * @return Whether or not this mouse has wheel support
+ */
+ public static boolean hasWheel() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return hasWheel;
+ }
+ }
+
+ /**
+ * @return whether or not the mouse has grabbed the cursor
+ */
+ public static boolean isGrabbed() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return isGrabbed;
+ }
+ }
+
+ /**
+ * Sets whether or not the mouse has grabbed the cursor
+ * (and thus hidden). If grab is false, the getX() and getY()
+ * will return delta movement in pixels clamped to the display
+ * dimensions, from the center of the display.
+ *
+ * @param grab whether the mouse should be grabbed
+ */
+ public static void setGrabbed(boolean grab) {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ boolean grabbed = isGrabbed;
+ isGrabbed = grab;
+ if (isCreated()) {
+ if (grab && !grabbed) {
+ // store location mouse was grabbed
+ grab_x = x;
+ grab_y = y;
+ }
+ else if (!grab && grabbed) {
+ // move mouse back to location it was grabbed before ungrabbing
+ if ((Cursor.getCapabilities() & Cursor.CURSOR_ONE_BIT_TRANSPARENCY) != 0)
+ implementation.setCursorPosition(grab_x, grab_y);
+ }
+
+ implementation.grabMouse(grab);
+ // Get latest values from native side
+ poll();
+ event_x = x;
+ event_y = y;
+ resetMouse();
+ }
+ }
+ }
+
+ /**
+ * Updates the cursor, so that animation can be changed if needed.
+ * This method is called automatically by the window on its update, and
+ * shouldn't be called otherwise
+ */
+ public static void updateCursor() {
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if (emulateCursorAnimation && currentCursor != null && currentCursor.hasTimedOut() && Mouse.isInsideWindow()) {
+ currentCursor.nextCursor();
+ try {
+ setNativeCursor(currentCursor);
+ } catch (LWJGLException e) {
+ if (LWJGLUtil.DEBUG) e.printStackTrace();
+ }
+ }
+ }
+ }
+
+ /** Gets a boolean property as a privileged action. */
+ static boolean getPrivilegedBoolean(final String property_name) {
+ Boolean value = (Boolean)AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ return new Boolean(Boolean.getBoolean(property_name));
+ }
+ });
+ return value.booleanValue();
+ }
+
+ /**
+ * Retrieves whether or not the mouse cursor is within the bounds of the window.
+ * If the mouse cursor was moved outside the display during a drag, then the result of calling
+ * this method will be true until the button is released.
+ * @return true if mouse is inside display, false otherwise.
+ */
+ public static boolean isInsideWindow() {
+ return implementation.isInsideWindow();
+ }
+}
diff --git a/src/java/org/lwjgl/openal/AL.java b/src/java/org/lwjgl/openal/AL.java
index a25a080..a689880 100644
--- a/src/java/org/lwjgl/openal/AL.java
+++ b/src/java/org/lwjgl/openal/AL.java
@@ -1,231 +1,231 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.openal;
-
-import org.lwjgl.LWJGLException;
-import org.lwjgl.LWJGLUtil;
-import org.lwjgl.Sys;
-
-/**
- * <p>
- * The AL class implements the actual creation code for linking to the native library
- * OpenAL.
- * </p>
- *
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 3182 $
- * $Id: AL.java 3182 2009-03-17 21:36:18Z matzon $
- */
-public final class AL {
- /** ALCdevice instance. */
- protected static ALCdevice device;
-
- /** Current ALCcontext. */
- protected static ALCcontext context;
-
- /** Have we been created? */
- private static boolean created;
-
- static {
- Sys.initialize();
- }
-
- private AL() {
- }
-
- /**
- * Native method to create AL instance
- *
- * @param oalPaths Array of strings containing paths to search for OpenAL library
- */
- private static native void nCreate(String oalPath) throws LWJGLException;
-
- /**
- * Native method to create AL instance from the Mac OS X 10.4 OpenAL framework.
- * It is only defined in the Mac OS X native library.
- *
- * @param oalPaths Array of strings containing paths to search for OpenAL library
- */
- private static native void nCreateDefault() throws LWJGLException;
-
- /**
- * Native method the destroy the AL
- */
- private static native void nDestroy();
-
- /**
- * @return true if AL has been created
- */
- public static boolean isCreated() {
- return created;
- }
-
- /**
- * Creates an OpenAL instance. Using this constructor will cause OpenAL to
- * open the device using supplied device argument, and create a context using the context values
- * supplied.
- *
- * @param deviceArguments Arguments supplied to native device
- * @param contextFrequency Frequency for mixing output buffer, in units of Hz (Common values include 11025, 22050, and 44100).
- * @param contextRefresh Refresh intervalls, in units of Hz.
- * @param contextSynchronized Flag, indicating a synchronous context.*
- */
- public static void create(String deviceArguments, int contextFrequency, int contextRefresh, boolean contextSynchronized)
- throws LWJGLException {
- create(deviceArguments, contextFrequency, contextRefresh, contextSynchronized, true);
- }
-
- /**
- * @param openDevice Whether to automatically open the device
- * @see #create(String, int, int, boolean)
- */
- public static void create(String deviceArguments, int contextFrequency, int contextRefresh, boolean contextSynchronized, boolean openDevice)
- throws LWJGLException {
-
- if (created)
- throw new IllegalStateException("Only one OpenAL context may be instantiated at any one time.");
- String libname;
- String[] library_names;
- switch (LWJGLUtil.getPlatform()) {
- case LWJGLUtil.PLATFORM_WINDOWS:
- libname = "OpenAL32";
- library_names = new String[]{"OpenAL64.dll", "OpenAL32.dll"};
- break;
- case LWJGLUtil.PLATFORM_LINUX:
- libname = "openal";
- library_names = new String[]{"libopenal64.so", "libopenal.so", "libopenal.so.0"};
- break;
- case LWJGLUtil.PLATFORM_MACOSX:
- libname = "openal";
- library_names = new String[]{"openal.dylib"};
- break;
- default:
- throw new LWJGLException("Unknown platform: " + LWJGLUtil.getPlatform());
- }
- String[] oalPaths = LWJGLUtil.getLibraryPaths(libname, library_names, AL.class.getClassLoader());
- LWJGLUtil.log("Found " + oalPaths.length + " OpenAL paths");
- for (int i = 0; i < oalPaths.length; i++) {
- try {
- nCreate(oalPaths[i]);
- created = true;
- init(deviceArguments, contextFrequency, contextRefresh, contextSynchronized, openDevice);
- break;
- } catch (LWJGLException e) {
- LWJGLUtil.log("Failed to load " + oalPaths[i] + ": " + e.getMessage());
- }
- }
- if (!created && LWJGLUtil.getPlatform() == LWJGLUtil.PLATFORM_MACOSX) {
- // Try to load OpenAL from the framework instead
- nCreateDefault();
- created = true;
- init(deviceArguments, contextFrequency, contextRefresh, contextSynchronized, openDevice);
- }
- if (!created)
- throw new LWJGLException("Could not locate OpenAL library.");
- }
-
- private static void init(String deviceArguments, int contextFrequency, int contextRefresh, boolean contextSynchronized, boolean openDevice) throws LWJGLException {
- try {
- AL10.initNativeStubs();
- ALC10.initNativeStubs();
-
- if(openDevice) {
- device = ALC10.alcOpenDevice(deviceArguments);
- if (device == null)
- throw new LWJGLException("Could not open ALC device");
-
- if (contextFrequency == -1) {
- context = ALC10.alcCreateContext(device, null);
- } else {
- context = ALC10.alcCreateContext(device,
- ALCcontext.createAttributeList(contextFrequency, contextRefresh,
- contextSynchronized ? ALC10.ALC_TRUE : ALC10.ALC_FALSE));
- }
- ALC10.alcMakeContextCurrent(context);
- }
- } catch (LWJGLException e) {
- destroy();
- throw e;
- }
-
- ALC11.initialize();
- }
-
- /**
- * Creates an OpenAL instance. The empty create will cause OpenAL to
- * open the default device, and create a context using default values.
- * This method used to use default values that the OpenAL implementation
- * chose but this produces unexpected results on some systems; so now
- * it defaults to 44100Hz mixing @ 60Hz refresh.
- */
- public static void create() throws LWJGLException {
- create(null, 44100, 60, false);
- }
-
- /**
- * Exit cleanly by calling destroy.
- */
- public static void destroy() {
- if (context != null) {
- ALC10.alcMakeContextCurrent(null);
- ALC10.alcDestroyContext(context);
- context = null;
- }
- if (device != null) {
- boolean result = ALC10.alcCloseDevice(device);
- device = null;
- }
- resetNativeStubs(AL10.class);
- resetNativeStubs(ALC10.class);
- resetNativeStubs(ALC11.class);
-
- if (created)
- nDestroy();
- created = false;
- }
-
- private static native void resetNativeStubs(Class clazz);
-
- /**
- * @return handle to the default AL context.
- */
- public static ALCcontext getContext() {
- return context;
- }
-
- /**
- * @return handle to the default AL device.
- */
- public static ALCdevice getDevice() {
- return device;
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.openal;
+
+import org.lwjgl.LWJGLException;
+import org.lwjgl.LWJGLUtil;
+import org.lwjgl.Sys;
+
+/**
+ * <p>
+ * The AL class implements the actual creation code for linking to the native library
+ * OpenAL.
+ * </p>
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 3182 $
+ * $Id: AL.java 3182 2009-03-17 21:36:18Z matzon $
+ */
+public final class AL {
+ /** ALCdevice instance. */
+ protected static ALCdevice device;
+
+ /** Current ALCcontext. */
+ protected static ALCcontext context;
+
+ /** Have we been created? */
+ private static boolean created;
+
+ static {
+ Sys.initialize();
+ }
+
+ private AL() {
+ }
+
+ /**
+ * Native method to create AL instance
+ *
+ * @param oalPaths Array of strings containing paths to search for OpenAL library
+ */
+ private static native void nCreate(String oalPath) throws LWJGLException;
+
+ /**
+ * Native method to create AL instance from the Mac OS X 10.4 OpenAL framework.
+ * It is only defined in the Mac OS X native library.
+ *
+ * @param oalPaths Array of strings containing paths to search for OpenAL library
+ */
+ private static native void nCreateDefault() throws LWJGLException;
+
+ /**
+ * Native method the destroy the AL
+ */
+ private static native void nDestroy();
+
+ /**
+ * @return true if AL has been created
+ */
+ public static boolean isCreated() {
+ return created;
+ }
+
+ /**
+ * Creates an OpenAL instance. Using this constructor will cause OpenAL to
+ * open the device using supplied device argument, and create a context using the context values
+ * supplied.
+ *
+ * @param deviceArguments Arguments supplied to native device
+ * @param contextFrequency Frequency for mixing output buffer, in units of Hz (Common values include 11025, 22050, and 44100).
+ * @param contextRefresh Refresh intervalls, in units of Hz.
+ * @param contextSynchronized Flag, indicating a synchronous context.*
+ */
+ public static void create(String deviceArguments, int contextFrequency, int contextRefresh, boolean contextSynchronized)
+ throws LWJGLException {
+ create(deviceArguments, contextFrequency, contextRefresh, contextSynchronized, true);
+ }
+
+ /**
+ * @param openDevice Whether to automatically open the device
+ * @see #create(String, int, int, boolean)
+ */
+ public static void create(String deviceArguments, int contextFrequency, int contextRefresh, boolean contextSynchronized, boolean openDevice)
+ throws LWJGLException {
+
+ if (created)
+ throw new IllegalStateException("Only one OpenAL context may be instantiated at any one time.");
+ String libname;
+ String[] library_names;
+ switch (LWJGLUtil.getPlatform()) {
+ case LWJGLUtil.PLATFORM_WINDOWS:
+ libname = "OpenAL32";
+ library_names = new String[]{"OpenAL64.dll", "OpenAL32.dll"};
+ break;
+ case LWJGLUtil.PLATFORM_LINUX:
+ libname = "openal";
+ library_names = new String[]{"libopenal64.so", "libopenal.so", "libopenal.so.0"};
+ break;
+ case LWJGLUtil.PLATFORM_MACOSX:
+ libname = "openal";
+ library_names = new String[]{"openal.dylib"};
+ break;
+ default:
+ throw new LWJGLException("Unknown platform: " + LWJGLUtil.getPlatform());
+ }
+ String[] oalPaths = LWJGLUtil.getLibraryPaths(libname, library_names, AL.class.getClassLoader());
+ LWJGLUtil.log("Found " + oalPaths.length + " OpenAL paths");
+ for (int i = 0; i < oalPaths.length; i++) {
+ try {
+ nCreate(oalPaths[i]);
+ created = true;
+ init(deviceArguments, contextFrequency, contextRefresh, contextSynchronized, openDevice);
+ break;
+ } catch (LWJGLException e) {
+ LWJGLUtil.log("Failed to load " + oalPaths[i] + ": " + e.getMessage());
+ }
+ }
+ if (!created && LWJGLUtil.getPlatform() == LWJGLUtil.PLATFORM_MACOSX) {
+ // Try to load OpenAL from the framework instead
+ nCreateDefault();
+ created = true;
+ init(deviceArguments, contextFrequency, contextRefresh, contextSynchronized, openDevice);
+ }
+ if (!created)
+ throw new LWJGLException("Could not locate OpenAL library.");
+ }
+
+ private static void init(String deviceArguments, int contextFrequency, int contextRefresh, boolean contextSynchronized, boolean openDevice) throws LWJGLException {
+ try {
+ AL10.initNativeStubs();
+ ALC10.initNativeStubs();
+
+ if(openDevice) {
+ device = ALC10.alcOpenDevice(deviceArguments);
+ if (device == null)
+ throw new LWJGLException("Could not open ALC device");
+
+ if (contextFrequency == -1) {
+ context = ALC10.alcCreateContext(device, null);
+ } else {
+ context = ALC10.alcCreateContext(device,
+ ALCcontext.createAttributeList(contextFrequency, contextRefresh,
+ contextSynchronized ? ALC10.ALC_TRUE : ALC10.ALC_FALSE));
+ }
+ ALC10.alcMakeContextCurrent(context);
+ }
+ } catch (LWJGLException e) {
+ destroy();
+ throw e;
+ }
+
+ ALC11.initialize();
+ }
+
+ /**
+ * Creates an OpenAL instance. The empty create will cause OpenAL to
+ * open the default device, and create a context using default values.
+ * This method used to use default values that the OpenAL implementation
+ * chose but this produces unexpected results on some systems; so now
+ * it defaults to 44100Hz mixing @ 60Hz refresh.
+ */
+ public static void create() throws LWJGLException {
+ create(null, 44100, 60, false);
+ }
+
+ /**
+ * Exit cleanly by calling destroy.
+ */
+ public static void destroy() {
+ if (context != null) {
+ ALC10.alcMakeContextCurrent(null);
+ ALC10.alcDestroyContext(context);
+ context = null;
+ }
+ if (device != null) {
+ boolean result = ALC10.alcCloseDevice(device);
+ device = null;
+ }
+ resetNativeStubs(AL10.class);
+ resetNativeStubs(ALC10.class);
+ resetNativeStubs(ALC11.class);
+
+ if (created)
+ nDestroy();
+ created = false;
+ }
+
+ private static native void resetNativeStubs(Class clazz);
+
+ /**
+ * @return handle to the default AL context.
+ */
+ public static ALCcontext getContext() {
+ return context;
+ }
+
+ /**
+ * @return handle to the default AL device.
+ */
+ public static ALCdevice getDevice() {
+ return device;
+ }
+}
diff --git a/src/java/org/lwjgl/openal/ALC10.java b/src/java/org/lwjgl/openal/ALC10.java
index 45f81b8..1125060 100644
--- a/src/java/org/lwjgl/openal/ALC10.java
+++ b/src/java/org/lwjgl/openal/ALC10.java
@@ -1,436 +1,436 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.openal;
-
-import java.nio.Buffer;
-import java.nio.IntBuffer;
-import java.util.HashMap;
-
-import org.lwjgl.BufferChecks;
-import org.lwjgl.LWJGLException;
-
-/**
- *
- * <p>
- * ALC introduces the notion of a Device. A Device can be, depending on the
- * implementation, a hardware device, or a daemon/OS service/actual server. This
- * mechanism also permits different drivers (and hardware) to coexist within the same
- * system, as well as allowing several applications to share system resources for audio,
- * including a single hardware output device. The details are left to the
- * implementation, which has to map the available backends to unique device
- * specifiers (represented as strings).
- * </p>
- *
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 2286 $
- * $Id: ALC.java 2286 2006-03-23 19:32:21 +0000 (to, 23 mar 2006) matzon $
- */
-public final class ALC10 {
-
- /** List of active contexts */
- static HashMap contexts = new HashMap();
-
- /** List of active devices */
- static HashMap devices = new HashMap();
-
- /** Bad value */
- public static final int ALC_INVALID = 0;
-
- /** Boolean False */
- public static final int ALC_FALSE = 0;
-
- /** Boolean True */
- public static final int ALC_TRUE = 1;
-
- /** Errors: No Error */
- public static final int ALC_NO_ERROR = ALC_FALSE;
-
- /** Major version query. */
- public static final int ALC_MAJOR_VERSION = 0x1000;
-
- /** Minor version query. */
- public static final int ALC_MINOR_VERSION = 0x1001;
-
- /**
- * The size required for the zero-terminated attributes list, for the current context.
- **/
- public static final int ALC_ATTRIBUTES_SIZE = 0x1002;
-
- /**
- * Expects a destination of ALC_CURRENT_ATTRIBUTES_SIZE,
- * and provides the attribute list for the current context of the specified device.
- */
- public static final int ALC_ALL_ATTRIBUTES = 0x1003;
-
- /** The specifier string for the default device */
- public static final int ALC_DEFAULT_DEVICE_SPECIFIER = 0x1004;
-
- /** The specifier string for the device */
- public static final int ALC_DEVICE_SPECIFIER = 0x1005;
-
- /** The extensions string for diagnostics and printing */
- public static final int ALC_EXTENSIONS = 0x1006;
-
- /** Frequency for mixing output buffer, in units of Hz. */
- public static final int ALC_FREQUENCY = 0x1007;
-
- /** Refresh intervalls, in units of Hz. */
- public static final int ALC_REFRESH = 0x1008;
-
- /** Flag, indicating a synchronous context. */
- public static final int ALC_SYNC = 0x1009;
-
- /** The device argument does not name a valid device */
- public static final int ALC_INVALID_DEVICE = 0xA001;
-
- /** The context argument does not name a valid context */
- public static final int ALC_INVALID_CONTEXT = 0xA002;
-
- /**
- * A function was called at inappropriate time, or in an inappropriate way,
- * causing an illegal state. This can be an incompatible ALenum, object ID,
- * and/or function.
- */
- public static final int ALC_INVALID_ENUM = 0xA003;
-
- /**
- * Illegal value passed as an argument to an AL call.
- * Applies to parameter values, but not to enumerations.
- */
- public static final int ALC_INVALID_VALUE = 0xA004;
-
- /**
- * A function could not be completed, because there is not enough
- * memory available.
- */
- public static final int ALC_OUT_OF_MEMORY = 0xA005;
-
- static native void initNativeStubs() throws LWJGLException;
-
- /**
- * The application can obtain certain strings from ALC.
- *
- * <code>ALC_DEFAULT_DEVICE_SPECIFIER</code> - The specifer string for the default device
- * <code>ALC_DEVICE_SPECIFIER</code> - The specifer string for the device
- * <code>ALC_EXTENSIONS</code> - The extensions string for diagnostics and printing.
- *
- * In addition, printable error message strings are provided for all valid error tokens,
- * including <code>ALC_NO_ERROR</code>,<code>ALC_INVALID_DEVICE</code>, <code>ALC_INVALID_CONTEXT</code>,
- * <code>ALC_INVALID_ENUM</code>, <code>ALC_INVALID_VALUE</code>.
- *
- * @param pname Property to get
- * @return String property from device
- */
- public static String alcGetString(ALCdevice device, int pname) {
- String result;
- result = nalcGetString(getDevice(device), pname);
- Util.checkALCError(device);
- return result;
- }
- native static String nalcGetString(long device, int pname);
-
- /**
- * The application can query ALC for information using an integer query function.
- * For some tokens, <code>null</code> is a legal deviceHandle. In other cases, specifying a <code>null</code>
- * device will generate an <code>ALC_INVALID_DEVICE</code> error. The application has to
- * specify the size of the destination buffer provided. A <code>null</code> destination or a zero
- * size parameter will cause ALC to ignore the query.
- *
- * <code>ALC_MAJOR_VERSION</code> - Major version query.
- * <code>ALC_MINOR_VERSION</code> - Minor version query.
- * <code>ALC_ATTRIBUTES_SIZE</code> - The size required for the zero-terminated attributes list,
- * for the current context. <code>null</code> is an invalid device. <code>null</code> (no current context
- * for the specified device) is legal.
- * <code>ALC_ALL_ATTRIBUTES</code> - Expects a destination of <code>ALC_CURRENT_ATTRIBUTES_SIZE</code>,
- * and provides the attribute list for the current context of the specified device.
- * <code>null</code> is an invalid device. <code>null</code> (no current context for the specified device)
- * will return the default attributes defined by the specified device.
- *
- * @param pname Property to get
- * @param integerdata ByteBuffer to write integers to
- */
- public static void alcGetInteger(ALCdevice device, int pname, IntBuffer integerdata) {
- BufferChecks.checkDirect(integerdata);
- nalcGetIntegerv(getDevice(device), pname, integerdata.remaining(), integerdata, integerdata.position());
- Util.checkALCError(device);
- }
- native static void nalcGetIntegerv(long device, int pname, int size, Buffer integerdata, int offset);
-
- /**
- * The <code>alcOpenDevice</code> function allows the application (i.e. the client program) to
- * connect to a device (i.e. the server).
- *
- * If the function returns <code>null</code>, then no sound driver/device has been found. The
- * argument is a null terminated string that requests a certain device or device
- * configuration. If <code>null</code> is specified, the implementation will provide an
- * implementation specific default.
- *
- * @param devicename name of device to open
- * @return opened device, or null
- */
- public static ALCdevice alcOpenDevice(String devicename) {
- long device_address = nalcOpenDevice(devicename);
- if(device_address != 0) {
- ALCdevice device = new ALCdevice(device_address);
- synchronized (ALC10.devices) {
- devices.put(new Long(device_address), device);
- }
- return device;
- }
- return null;
- }
- native static long nalcOpenDevice(String devicename);
-
- /**
- * The <code>alcCloseDevice</code> function allows the application (i.e. the client program) to
- * disconnect from a device (i.e. the server).
- *
- * If deviceHandle is <code>null</code> or invalid, an <code>ALC_INVALID_DEVICE</code> error will be
- * generated. Once closed, a deviceHandle is invalid.
- *
- * @param device address of native device to close
- */
- public static boolean alcCloseDevice(ALCdevice device) {
- boolean result = nalcCloseDevice(getDevice(device));
- synchronized (devices) {
- device.setInvalid();
- devices.remove(new Long(device.device));
- }
- return result;
-
- }
- native static boolean nalcCloseDevice(long device);
-
- /**
- * A context is created using <code>alcCreateContext</code>. The device parameter has to be a valid
- * device. The attribute list can be <code>null</code>, or a zero terminated list of integer pairs
- * composed of valid ALC attribute tokens and requested values.
- *
- * Context creation will fail if the application requests attributes that, by themselves,
- * can not be provided. Context creation will fail if the combination of specified
- * attributes can not be provided. Context creation will fail if a specified attribute, or
- * the combination of attributes, does not match the default values for unspecified
- * attributes.
- *
- * @param device address of device to associate context to
- * @param attrList Buffer to read attributes from
- * @return New context, or null if creation failed
- */
- public static ALCcontext alcCreateContext(ALCdevice device, IntBuffer attrList) {
- long context_address = nalcCreateContext(getDevice(device), attrList);
- Util.checkALCError(device);
-
- if(context_address != 0) {
- ALCcontext context = new ALCcontext(context_address);
- synchronized (ALC10.contexts) {
- contexts.put(new Long(context_address), context);
- device.addContext(context);
- }
- return context;
- }
- return null;
- }
- native static long nalcCreateContext(long device, IntBuffer attrList);
-
- /**
- * To make a Context current with respect to AL Operation (state changes by issueing
- * commands), <code>alcMakeContextCurrent</code> is used. The context parameter can be <code>null</code>
- * or a valid context pointer. The operation will apply to the device that the context
- * was created for.
- *
- * For each OS process (usually this means for each application), only one context can
- * be current at any given time. All AL commands apply to the current context.
- * Commands that affect objects shared among contexts (e.g. buffers) have side effects
- * on other contexts.
- *
- * @param context address of context to make current
- * @return true if successfull, false if not
- */
- public static int alcMakeContextCurrent(ALCcontext context) {
- return nalcMakeContextCurrent(getContext(context));
- }
- native static int nalcMakeContextCurrent(long context);
-
- /**
- * The current context is the only context accessible to state changes by AL commands
- * (aside from state changes affecting shared objects). However, multiple contexts can
- * be processed at the same time. To indicate that a context should be processed (i.e.
- * that internal execution state like offset increments are supposed to be performed),
- * the application has to use <code>alcProcessContext</code>.
- *
- * Repeated calls to <code>alcProcessContext</code> are legal, and do not affect a context that is
- * already marked as processing. The default state of a context created by
- * alcCreateContext is that it is not marked as processing.
- */
- public static void alcProcessContext(ALCcontext context) {
- nalcProcessContext(getContext(context));
- }
- native static void nalcProcessContext(long context);
-
- /**
- * The application can query for, and obtain an handle to, the current context for the
- * application. If there is no current context, <code>null</code> is returned.
- *
- * @return Current ALCcontext
- */
- public static ALCcontext alcGetCurrentContext() {
- ALCcontext context = null;
- long context_address = nalcGetCurrentContext();
- if(context_address != 0) {
- synchronized (ALC10.contexts) {
- context = (ALCcontext) ALC10.contexts.get(new Long(context_address));
- }
- }
- return context;
- }
- native static long nalcGetCurrentContext();
-
- /**
- * The application can query for, and obtain an handle to, the device of a given context.
- *
- * @param context address of context to get device for
- */
- public static ALCdevice alcGetContextsDevice(ALCcontext context) {
- ALCdevice device = null;
- long device_address = nalcGetContextsDevice(getContext(context));
- if (device_address != 0) {
- synchronized (ALC10.devices) {
- device = (ALCdevice) ALC10.devices.get(new Long(device_address));
- }
- }
- return device;
- }
- native static long nalcGetContextsDevice(long context);
-
- /**
- * The application can suspend any context from processing (including the current
- * one). To indicate that a context should be suspended from processing (i.e. that
- * internal execution state like offset increments is not supposed to be changed), the
- * application has to use <code>alcSuspendContext</code>.
- *
- * Repeated calls to <code>alcSuspendContext</code> are legal, and do not affect a context that is
- * already marked as suspended. The default state of a context created by
- * <code>alcCreateContext</code> is that it is marked as suspended.
- *
- * @param context address of context to suspend
- */
- public static void alcSuspendContext(ALCcontext context) {
- nalcSuspendContext(getContext(context));
- }
- native static void nalcSuspendContext(long context);
-
- /**
- * The correct way to destroy a context is to first release it using <code>alcMakeCurrent</code> and
- * <code>null</code>. Applications should not attempt to destroy a current context.
- *
- * @param context address of context to Destroy
- */
- public static void alcDestroyContext(ALCcontext context) {
- synchronized(ALC10.contexts) {
- ALCdevice device = alcGetContextsDevice(context);
- nalcDestroyContext(getContext(context));
- device.removeContext(context);
- context.setInvalid();
- }
- }
- native static void nalcDestroyContext(long context);
-
- /**
- * ALC uses the same conventions and mechanisms as AL for error handling. In
- * particular, ALC does not use conventions derived from X11 (GLX) or Windows
- * (WGL). The <code>alcGetError</code> function can be used to query ALC errors.
- *
- * Error conditions are specific to the device.
- *
- * ALC_NO_ERROR - The device handle or specifier does name an accessible driver/server.
- * <code>ALC_INVALID_DEVICE</code> - The Context argument does not name a valid context.
- * <code>ALC_INVALID_CONTEXT</code> - The Context argument does not name a valid context.
- * <code>ALC_INVALID_ENUM</code> - A token used is not valid, or not applicable.
- * <code>ALC_INVALID_VALUE</code> - An value (e.g. attribute) is not valid, or not applicable.
- *
- * @return Errorcode from ALC statemachine
- */
- public static int alcGetError(ALCdevice device) {
- return nalcGetError(getDevice(device));
- }
- native static int nalcGetError(long device);
-
- /**
- * Verify that a given extension is available for the current context and the device it
- * is associated with.
- * A <code>null</code> name argument returns <code>ALC_FALSE</code>, as do invalid and unsupported string
- * tokens.
- *
- * @param extName name of extension to find
- * @return true if extension is available, false if not
- */
- public static boolean alcIsExtensionPresent(ALCdevice device, String extName) {
- boolean result = nalcIsExtensionPresent(getDevice(device), extName);
- Util.checkALCError(device);
- return result;
- }
- native static boolean nalcIsExtensionPresent(long device, String extName);
-
- /**
- * Enumeration/token values are device independend, but tokens defined for
- * extensions might not be present for a given device. But only the tokens defined
- * by the AL core are guaranteed. Availability of extension tokens dependends on the ALC extension.
- *
- * Specifying a <code>null</code> name parameter will cause an <code>ALC_INVALID_VALUE</code> error.
- *
- * @param enumName name of enum to find
- * @return value of enumeration
- */
- public static int alcGetEnumValue(ALCdevice device, String enumName) {
- int result = nalcGetEnumValue(getDevice(device), enumName);
- Util.checkALCError(device);
- return result;
- }
- native static int nalcGetEnumValue(long device, String enumName);
-
- static long getDevice(ALCdevice device) {
- if(device != null) {
- Util.checkALCValidDevice(device);
- return device.device;
- }
- return 0L;
- }
-
- static long getContext(ALCcontext context) {
- if(context != null) {
- Util.checkALCValidContext(context);
- return context.context;
- }
- return 0L;
- }
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.openal;
+
+import java.nio.Buffer;
+import java.nio.IntBuffer;
+import java.util.HashMap;
+
+import org.lwjgl.BufferChecks;
+import org.lwjgl.LWJGLException;
+
+/**
+ *
+ * <p>
+ * ALC introduces the notion of a Device. A Device can be, depending on the
+ * implementation, a hardware device, or a daemon/OS service/actual server. This
+ * mechanism also permits different drivers (and hardware) to coexist within the same
+ * system, as well as allowing several applications to share system resources for audio,
+ * including a single hardware output device. The details are left to the
+ * implementation, which has to map the available backends to unique device
+ * specifiers (represented as strings).
+ * </p>
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 2286 $
+ * $Id: ALC.java 2286 2006-03-23 19:32:21 +0000 (to, 23 mar 2006) matzon $
+ */
+public final class ALC10 {
+
+ /** List of active contexts */
+ static HashMap contexts = new HashMap();
+
+ /** List of active devices */
+ static HashMap devices = new HashMap();
+
+ /** Bad value */
+ public static final int ALC_INVALID = 0;
+
+ /** Boolean False */
+ public static final int ALC_FALSE = 0;
+
+ /** Boolean True */
+ public static final int ALC_TRUE = 1;
+
+ /** Errors: No Error */
+ public static final int ALC_NO_ERROR = ALC_FALSE;
+
+ /** Major version query. */
+ public static final int ALC_MAJOR_VERSION = 0x1000;
+
+ /** Minor version query. */
+ public static final int ALC_MINOR_VERSION = 0x1001;
+
+ /**
+ * The size required for the zero-terminated attributes list, for the current context.
+ **/
+ public static final int ALC_ATTRIBUTES_SIZE = 0x1002;
+
+ /**
+ * Expects a destination of ALC_CURRENT_ATTRIBUTES_SIZE,
+ * and provides the attribute list for the current context of the specified device.
+ */
+ public static final int ALC_ALL_ATTRIBUTES = 0x1003;
+
+ /** The specifier string for the default device */
+ public static final int ALC_DEFAULT_DEVICE_SPECIFIER = 0x1004;
+
+ /** The specifier string for the device */
+ public static final int ALC_DEVICE_SPECIFIER = 0x1005;
+
+ /** The extensions string for diagnostics and printing */
+ public static final int ALC_EXTENSIONS = 0x1006;
+
+ /** Frequency for mixing output buffer, in units of Hz. */
+ public static final int ALC_FREQUENCY = 0x1007;
+
+ /** Refresh intervalls, in units of Hz. */
+ public static final int ALC_REFRESH = 0x1008;
+
+ /** Flag, indicating a synchronous context. */
+ public static final int ALC_SYNC = 0x1009;
+
+ /** The device argument does not name a valid device */
+ public static final int ALC_INVALID_DEVICE = 0xA001;
+
+ /** The context argument does not name a valid context */
+ public static final int ALC_INVALID_CONTEXT = 0xA002;
+
+ /**
+ * A function was called at inappropriate time, or in an inappropriate way,
+ * causing an illegal state. This can be an incompatible ALenum, object ID,
+ * and/or function.
+ */
+ public static final int ALC_INVALID_ENUM = 0xA003;
+
+ /**
+ * Illegal value passed as an argument to an AL call.
+ * Applies to parameter values, but not to enumerations.
+ */
+ public static final int ALC_INVALID_VALUE = 0xA004;
+
+ /**
+ * A function could not be completed, because there is not enough
+ * memory available.
+ */
+ public static final int ALC_OUT_OF_MEMORY = 0xA005;
+
+ static native void initNativeStubs() throws LWJGLException;
+
+ /**
+ * The application can obtain certain strings from ALC.
+ *
+ * <code>ALC_DEFAULT_DEVICE_SPECIFIER</code> - The specifer string for the default device
+ * <code>ALC_DEVICE_SPECIFIER</code> - The specifer string for the device
+ * <code>ALC_EXTENSIONS</code> - The extensions string for diagnostics and printing.
+ *
+ * In addition, printable error message strings are provided for all valid error tokens,
+ * including <code>ALC_NO_ERROR</code>,<code>ALC_INVALID_DEVICE</code>, <code>ALC_INVALID_CONTEXT</code>,
+ * <code>ALC_INVALID_ENUM</code>, <code>ALC_INVALID_VALUE</code>.
+ *
+ * @param pname Property to get
+ * @return String property from device
+ */
+ public static String alcGetString(ALCdevice device, int pname) {
+ String result;
+ result = nalcGetString(getDevice(device), pname);
+ Util.checkALCError(device);
+ return result;
+ }
+ native static String nalcGetString(long device, int pname);
+
+ /**
+ * The application can query ALC for information using an integer query function.
+ * For some tokens, <code>null</code> is a legal deviceHandle. In other cases, specifying a <code>null</code>
+ * device will generate an <code>ALC_INVALID_DEVICE</code> error. The application has to
+ * specify the size of the destination buffer provided. A <code>null</code> destination or a zero
+ * size parameter will cause ALC to ignore the query.
+ *
+ * <code>ALC_MAJOR_VERSION</code> - Major version query.
+ * <code>ALC_MINOR_VERSION</code> - Minor version query.
+ * <code>ALC_ATTRIBUTES_SIZE</code> - The size required for the zero-terminated attributes list,
+ * for the current context. <code>null</code> is an invalid device. <code>null</code> (no current context
+ * for the specified device) is legal.
+ * <code>ALC_ALL_ATTRIBUTES</code> - Expects a destination of <code>ALC_CURRENT_ATTRIBUTES_SIZE</code>,
+ * and provides the attribute list for the current context of the specified device.
+ * <code>null</code> is an invalid device. <code>null</code> (no current context for the specified device)
+ * will return the default attributes defined by the specified device.
+ *
+ * @param pname Property to get
+ * @param integerdata ByteBuffer to write integers to
+ */
+ public static void alcGetInteger(ALCdevice device, int pname, IntBuffer integerdata) {
+ BufferChecks.checkDirect(integerdata);
+ nalcGetIntegerv(getDevice(device), pname, integerdata.remaining(), integerdata, integerdata.position());
+ Util.checkALCError(device);
+ }
+ native static void nalcGetIntegerv(long device, int pname, int size, Buffer integerdata, int offset);
+
+ /**
+ * The <code>alcOpenDevice</code> function allows the application (i.e. the client program) to
+ * connect to a device (i.e. the server).
+ *
+ * If the function returns <code>null</code>, then no sound driver/device has been found. The
+ * argument is a null terminated string that requests a certain device or device
+ * configuration. If <code>null</code> is specified, the implementation will provide an
+ * implementation specific default.
+ *
+ * @param devicename name of device to open
+ * @return opened device, or null
+ */
+ public static ALCdevice alcOpenDevice(String devicename) {
+ long device_address = nalcOpenDevice(devicename);
+ if(device_address != 0) {
+ ALCdevice device = new ALCdevice(device_address);
+ synchronized (ALC10.devices) {
+ devices.put(new Long(device_address), device);
+ }
+ return device;
+ }
+ return null;
+ }
+ native static long nalcOpenDevice(String devicename);
+
+ /**
+ * The <code>alcCloseDevice</code> function allows the application (i.e. the client program) to
+ * disconnect from a device (i.e. the server).
+ *
+ * If deviceHandle is <code>null</code> or invalid, an <code>ALC_INVALID_DEVICE</code> error will be
+ * generated. Once closed, a deviceHandle is invalid.
+ *
+ * @param device address of native device to close
+ */
+ public static boolean alcCloseDevice(ALCdevice device) {
+ boolean result = nalcCloseDevice(getDevice(device));
+ synchronized (devices) {
+ device.setInvalid();
+ devices.remove(new Long(device.device));
+ }
+ return result;
+
+ }
+ native static boolean nalcCloseDevice(long device);
+
+ /**
+ * A context is created using <code>alcCreateContext</code>. The device parameter has to be a valid
+ * device. The attribute list can be <code>null</code>, or a zero terminated list of integer pairs
+ * composed of valid ALC attribute tokens and requested values.
+ *
+ * Context creation will fail if the application requests attributes that, by themselves,
+ * can not be provided. Context creation will fail if the combination of specified
+ * attributes can not be provided. Context creation will fail if a specified attribute, or
+ * the combination of attributes, does not match the default values for unspecified
+ * attributes.
+ *
+ * @param device address of device to associate context to
+ * @param attrList Buffer to read attributes from
+ * @return New context, or null if creation failed
+ */
+ public static ALCcontext alcCreateContext(ALCdevice device, IntBuffer attrList) {
+ long context_address = nalcCreateContext(getDevice(device), attrList);
+ Util.checkALCError(device);
+
+ if(context_address != 0) {
+ ALCcontext context = new ALCcontext(context_address);
+ synchronized (ALC10.contexts) {
+ contexts.put(new Long(context_address), context);
+ device.addContext(context);
+ }
+ return context;
+ }
+ return null;
+ }
+ native static long nalcCreateContext(long device, IntBuffer attrList);
+
+ /**
+ * To make a Context current with respect to AL Operation (state changes by issueing
+ * commands), <code>alcMakeContextCurrent</code> is used. The context parameter can be <code>null</code>
+ * or a valid context pointer. The operation will apply to the device that the context
+ * was created for.
+ *
+ * For each OS process (usually this means for each application), only one context can
+ * be current at any given time. All AL commands apply to the current context.
+ * Commands that affect objects shared among contexts (e.g. buffers) have side effects
+ * on other contexts.
+ *
+ * @param context address of context to make current
+ * @return true if successfull, false if not
+ */
+ public static int alcMakeContextCurrent(ALCcontext context) {
+ return nalcMakeContextCurrent(getContext(context));
+ }
+ native static int nalcMakeContextCurrent(long context);
+
+ /**
+ * The current context is the only context accessible to state changes by AL commands
+ * (aside from state changes affecting shared objects). However, multiple contexts can
+ * be processed at the same time. To indicate that a context should be processed (i.e.
+ * that internal execution state like offset increments are supposed to be performed),
+ * the application has to use <code>alcProcessContext</code>.
+ *
+ * Repeated calls to <code>alcProcessContext</code> are legal, and do not affect a context that is
+ * already marked as processing. The default state of a context created by
+ * alcCreateContext is that it is not marked as processing.
+ */
+ public static void alcProcessContext(ALCcontext context) {
+ nalcProcessContext(getContext(context));
+ }
+ native static void nalcProcessContext(long context);
+
+ /**
+ * The application can query for, and obtain an handle to, the current context for the
+ * application. If there is no current context, <code>null</code> is returned.
+ *
+ * @return Current ALCcontext
+ */
+ public static ALCcontext alcGetCurrentContext() {
+ ALCcontext context = null;
+ long context_address = nalcGetCurrentContext();
+ if(context_address != 0) {
+ synchronized (ALC10.contexts) {
+ context = (ALCcontext) ALC10.contexts.get(new Long(context_address));
+ }
+ }
+ return context;
+ }
+ native static long nalcGetCurrentContext();
+
+ /**
+ * The application can query for, and obtain an handle to, the device of a given context.
+ *
+ * @param context address of context to get device for
+ */
+ public static ALCdevice alcGetContextsDevice(ALCcontext context) {
+ ALCdevice device = null;
+ long device_address = nalcGetContextsDevice(getContext(context));
+ if (device_address != 0) {
+ synchronized (ALC10.devices) {
+ device = (ALCdevice) ALC10.devices.get(new Long(device_address));
+ }
+ }
+ return device;
+ }
+ native static long nalcGetContextsDevice(long context);
+
+ /**
+ * The application can suspend any context from processing (including the current
+ * one). To indicate that a context should be suspended from processing (i.e. that
+ * internal execution state like offset increments is not supposed to be changed), the
+ * application has to use <code>alcSuspendContext</code>.
+ *
+ * Repeated calls to <code>alcSuspendContext</code> are legal, and do not affect a context that is
+ * already marked as suspended. The default state of a context created by
+ * <code>alcCreateContext</code> is that it is marked as suspended.
+ *
+ * @param context address of context to suspend
+ */
+ public static void alcSuspendContext(ALCcontext context) {
+ nalcSuspendContext(getContext(context));
+ }
+ native static void nalcSuspendContext(long context);
+
+ /**
+ * The correct way to destroy a context is to first release it using <code>alcMakeCurrent</code> and
+ * <code>null</code>. Applications should not attempt to destroy a current context.
+ *
+ * @param context address of context to Destroy
+ */
+ public static void alcDestroyContext(ALCcontext context) {
+ synchronized(ALC10.contexts) {
+ ALCdevice device = alcGetContextsDevice(context);
+ nalcDestroyContext(getContext(context));
+ device.removeContext(context);
+ context.setInvalid();
+ }
+ }
+ native static void nalcDestroyContext(long context);
+
+ /**
+ * ALC uses the same conventions and mechanisms as AL for error handling. In
+ * particular, ALC does not use conventions derived from X11 (GLX) or Windows
+ * (WGL). The <code>alcGetError</code> function can be used to query ALC errors.
+ *
+ * Error conditions are specific to the device.
+ *
+ * ALC_NO_ERROR - The device handle or specifier does name an accessible driver/server.
+ * <code>ALC_INVALID_DEVICE</code> - The Context argument does not name a valid context.
+ * <code>ALC_INVALID_CONTEXT</code> - The Context argument does not name a valid context.
+ * <code>ALC_INVALID_ENUM</code> - A token used is not valid, or not applicable.
+ * <code>ALC_INVALID_VALUE</code> - An value (e.g. attribute) is not valid, or not applicable.
+ *
+ * @return Errorcode from ALC statemachine
+ */
+ public static int alcGetError(ALCdevice device) {
+ return nalcGetError(getDevice(device));
+ }
+ native static int nalcGetError(long device);
+
+ /**
+ * Verify that a given extension is available for the current context and the device it
+ * is associated with.
+ * A <code>null</code> name argument returns <code>ALC_FALSE</code>, as do invalid and unsupported string
+ * tokens.
+ *
+ * @param extName name of extension to find
+ * @return true if extension is available, false if not
+ */
+ public static boolean alcIsExtensionPresent(ALCdevice device, String extName) {
+ boolean result = nalcIsExtensionPresent(getDevice(device), extName);
+ Util.checkALCError(device);
+ return result;
+ }
+ native static boolean nalcIsExtensionPresent(long device, String extName);
+
+ /**
+ * Enumeration/token values are device independend, but tokens defined for
+ * extensions might not be present for a given device. But only the tokens defined
+ * by the AL core are guaranteed. Availability of extension tokens dependends on the ALC extension.
+ *
+ * Specifying a <code>null</code> name parameter will cause an <code>ALC_INVALID_VALUE</code> error.
+ *
+ * @param enumName name of enum to find
+ * @return value of enumeration
+ */
+ public static int alcGetEnumValue(ALCdevice device, String enumName) {
+ int result = nalcGetEnumValue(getDevice(device), enumName);
+ Util.checkALCError(device);
+ return result;
+ }
+ native static int nalcGetEnumValue(long device, String enumName);
+
+ static long getDevice(ALCdevice device) {
+ if(device != null) {
+ Util.checkALCValidDevice(device);
+ return device.device;
+ }
+ return 0L;
+ }
+
+ static long getContext(ALCcontext context) {
+ if(context != null) {
+ Util.checkALCValidContext(context);
+ return context.context;
+ }
+ return 0L;
+ }
+
+}
diff --git a/src/java/org/lwjgl/openal/ALC11.java b/src/java/org/lwjgl/openal/ALC11.java
index 9b0bf09..b470440 100644
--- a/src/java/org/lwjgl/openal/ALC11.java
+++ b/src/java/org/lwjgl/openal/ALC11.java
@@ -1,197 +1,197 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.openal;
-
-import java.nio.ByteBuffer;
-import java.nio.IntBuffer;
-
-import org.lwjgl.BufferUtils;
-import org.lwjgl.LWJGLException;
-import org.lwjgl.LWJGLUtil;
-
-
-/**
- * <p>
- * The ALC11 class implements features in OpenAL 1.1, specifically
- * ALC methods and properties.
- * </p>
- *
- * @author Brian Matzon <brian at matzon.dk>
- * @see ALC10
- * @version $Revision: 2286 $
- * $Id: ALC.java 2286 2006-03-23 19:32:21 +0000 (to, 23 mar 2006) matzon $
- */
-public final class ALC11 {
-
- public static final int ALC_DEFAULT_ALL_DEVICES_SPECIFIER = 0x1012;
- public static final int ALC_ALL_DEVICES_SPECIFIER = 0x1013;
-
- public static final int ALC_CAPTURE_DEVICE_SPECIFIER = 0x310;
- public static final int ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER = 0x311;
- public static final int ALC_CAPTURE_SAMPLES = 0x312;
-
- /**
- * The alcCaptureOpenDevice function allows the application to connect to a capture
- * device. To obtain a list of all available capture devices, use getCaptureDevices a list of all
- * capture devices will be returned. Retrieving ALC_CAPTURE_DEVICE_SPECIFIER with a valid capture device specified will result
- * in the name of that device being returned as a single string.
- *
- * If the function returns null, then no sound driver/device has been found, or the
- * requested format could not be fulfilled.
- * The "deviceName" argument is a string that requests a certain device or
- * device configuration. If null is specified, the implementation will provide an
- * implementation specific default. The "frequency" and "format" arguments specify the format that
- * audio data will be presented to the application, and match the values that can be passed to
- * alBufferData. The implementation is expected to convert and resample to this format on
- * behalf of the application. The "buffersize" argument specifies the number of sample frames
- * to buffer in the AL, for example, requesting a format of AL_FORMAT_STEREO16 and
- * a buffer size of 1024 would require the AL to store up to 1024 * 4 bytes of audio data.
- * Note that the implementation may use a larger buffer than requested if it needs to, but the
- * implementation will set up a buffer of at least the requested size.
- * Specifying a compressed or extension-supplied format may result in failure, even if the
- * extension is supplied for rendering.
- *
- * <i>LWJGL SPECIFIC: the actual created device is managed internally in lwjgl</i>
- *
- * @param devicename Name of device to open for capture
- * @param frequency Frequency of samples to capture
- * @param format Format of samples to capture
- * @param buffersize Size of buffer to capture to
- * @return ALCdevice if it was possible to open a device
- */
- public static ALCdevice alcCaptureOpenDevice(String devicename, int frequency, int format, int buffersize) {
- long device_address = nalcCaptureOpenDevice(devicename, frequency, format, buffersize);
- if(device_address != 0) {
- ALCdevice device = new ALCdevice(device_address);
- synchronized (ALC10.devices) {
- ALC10.devices.put(new Long(device_address), device);
- }
- return device;
- }
- return null;
- }
- static native long nalcCaptureOpenDevice( String devicename, int frequency, int format, int buffersize);
-
- /**
- * The alcCaptureCloseDevice function allows the application to disconnect from a capture
- * device.
- *
- * The return code will be true or false, indicating success or failure. If
- * the device is null or invalid, an ALC_INVALID_DEVICE error will be generated.
- * Once closed, a capture device is invalid.
- * @return true if device was successfully closed
- */
- public static boolean alcCaptureCloseDevice(ALCdevice device) {
- boolean result = nalcCaptureCloseDevice(ALC10.getDevice(device));
- synchronized (ALC10.devices) {
- device.setInvalid();
- ALC10.devices.remove(new Long(device.device));
- }
- return result;
- }
- static native boolean nalcCaptureCloseDevice(long device);
-
- /**
- * Once a capture device has been opened via alcCaptureOpenDevice, it is made to start
- * recording audio via the alcCaptureStart entry point:
- *
- * Once started, the device will record audio to an internal ring buffer, the size of which was
- * specified when opening the device.
- * The application may query the capture device to discover how much data is currently
- * available via the alcGetInteger with the ALC_CAPTURE_SAMPLES token. This will
- * report the number of sample frames currently available.
- */
- public static void alcCaptureStart(ALCdevice device) {
- nalcCaptureStart(ALC10.getDevice(device));
- }
- static native void nalcCaptureStart(long device);
-
- /**
- * If the application doesn't need to capture more audio for an amount of time, they can halt
- * the device without closing it via the alcCaptureStop entry point.
- * The implementation is encouraged to optimize for this case. The amount of audio
- * samples available after restarting a stopped capture device is reset to zero. The
- * application does not need to stop the capture device to read from it.
- */
- public static void alcCaptureStop(ALCdevice device) {
- nalcCaptureStop(ALC10.getDevice(device));
- }
- static native void nalcCaptureStop(long device);
-
- /**
- * When the application feels there are enough samples available to process, it can obtain
- * them from the AL via the alcCaptureSamples entry point.
- *
- * The "buffer" argument specifies an application-allocated buffer that can contain at least
- * "samples" sample frames. The implementation may defer conversion and resampling until
- * this point. Requesting more sample frames than are currently available is an error.
- *
- * @param buffer Buffer to store samples in
- * @param samples Number of samples to request
- */
- public static void alcCaptureSamples(ALCdevice device, ByteBuffer buffer, int samples ) {
- nalcCaptureSamples(ALC10.getDevice(device), buffer, buffer.position(), samples);
- }
- static native void nalcCaptureSamples(long device, ByteBuffer buffer, int position, int samples );
-
- static native void initNativeStubs() throws LWJGLException;
-
- /**
- * Initializes ALC11, including any extensions
- * @return true if initialization was successfull
- */
- static boolean initialize() {
- try {
- IntBuffer ib = BufferUtils.createIntBuffer(2);
- ALC10.alcGetInteger(AL.getDevice(), ALC10.ALC_MAJOR_VERSION, ib);
- ib.position(1);
- ALC10.alcGetInteger(AL.getDevice(), ALC10.ALC_MINOR_VERSION, ib);
-
- int major = ib.get(0);
- int minor = ib.get(1);
-
- // checking for version 1.x+
- if(major >= 1) {
-
- // checking for version 1.1+
- if(major > 1 || minor >= 1) {
- ALC11.initNativeStubs();
- AL11.initNativeStubs();
- }
- }
- } catch (LWJGLException le) {
- LWJGLUtil.log("failed to initialize ALC11: " + le);
- return false;
- }
- return true;
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.openal;
+
+import java.nio.ByteBuffer;
+import java.nio.IntBuffer;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.LWJGLException;
+import org.lwjgl.LWJGLUtil;
+
+
+/**
+ * <p>
+ * The ALC11 class implements features in OpenAL 1.1, specifically
+ * ALC methods and properties.
+ * </p>
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ * @see ALC10
+ * @version $Revision: 2286 $
+ * $Id: ALC.java 2286 2006-03-23 19:32:21 +0000 (to, 23 mar 2006) matzon $
+ */
+public final class ALC11 {
+
+ public static final int ALC_DEFAULT_ALL_DEVICES_SPECIFIER = 0x1012;
+ public static final int ALC_ALL_DEVICES_SPECIFIER = 0x1013;
+
+ public static final int ALC_CAPTURE_DEVICE_SPECIFIER = 0x310;
+ public static final int ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER = 0x311;
+ public static final int ALC_CAPTURE_SAMPLES = 0x312;
+
+ /**
+ * The alcCaptureOpenDevice function allows the application to connect to a capture
+ * device. To obtain a list of all available capture devices, use getCaptureDevices a list of all
+ * capture devices will be returned. Retrieving ALC_CAPTURE_DEVICE_SPECIFIER with a valid capture device specified will result
+ * in the name of that device being returned as a single string.
+ *
+ * If the function returns null, then no sound driver/device has been found, or the
+ * requested format could not be fulfilled.
+ * The "deviceName" argument is a string that requests a certain device or
+ * device configuration. If null is specified, the implementation will provide an
+ * implementation specific default. The "frequency" and "format" arguments specify the format that
+ * audio data will be presented to the application, and match the values that can be passed to
+ * alBufferData. The implementation is expected to convert and resample to this format on
+ * behalf of the application. The "buffersize" argument specifies the number of sample frames
+ * to buffer in the AL, for example, requesting a format of AL_FORMAT_STEREO16 and
+ * a buffer size of 1024 would require the AL to store up to 1024 * 4 bytes of audio data.
+ * Note that the implementation may use a larger buffer than requested if it needs to, but the
+ * implementation will set up a buffer of at least the requested size.
+ * Specifying a compressed or extension-supplied format may result in failure, even if the
+ * extension is supplied for rendering.
+ *
+ * <i>LWJGL SPECIFIC: the actual created device is managed internally in lwjgl</i>
+ *
+ * @param devicename Name of device to open for capture
+ * @param frequency Frequency of samples to capture
+ * @param format Format of samples to capture
+ * @param buffersize Size of buffer to capture to
+ * @return ALCdevice if it was possible to open a device
+ */
+ public static ALCdevice alcCaptureOpenDevice(String devicename, int frequency, int format, int buffersize) {
+ long device_address = nalcCaptureOpenDevice(devicename, frequency, format, buffersize);
+ if(device_address != 0) {
+ ALCdevice device = new ALCdevice(device_address);
+ synchronized (ALC10.devices) {
+ ALC10.devices.put(new Long(device_address), device);
+ }
+ return device;
+ }
+ return null;
+ }
+ static native long nalcCaptureOpenDevice( String devicename, int frequency, int format, int buffersize);
+
+ /**
+ * The alcCaptureCloseDevice function allows the application to disconnect from a capture
+ * device.
+ *
+ * The return code will be true or false, indicating success or failure. If
+ * the device is null or invalid, an ALC_INVALID_DEVICE error will be generated.
+ * Once closed, a capture device is invalid.
+ * @return true if device was successfully closed
+ */
+ public static boolean alcCaptureCloseDevice(ALCdevice device) {
+ boolean result = nalcCaptureCloseDevice(ALC10.getDevice(device));
+ synchronized (ALC10.devices) {
+ device.setInvalid();
+ ALC10.devices.remove(new Long(device.device));
+ }
+ return result;
+ }
+ static native boolean nalcCaptureCloseDevice(long device);
+
+ /**
+ * Once a capture device has been opened via alcCaptureOpenDevice, it is made to start
+ * recording audio via the alcCaptureStart entry point:
+ *
+ * Once started, the device will record audio to an internal ring buffer, the size of which was
+ * specified when opening the device.
+ * The application may query the capture device to discover how much data is currently
+ * available via the alcGetInteger with the ALC_CAPTURE_SAMPLES token. This will
+ * report the number of sample frames currently available.
+ */
+ public static void alcCaptureStart(ALCdevice device) {
+ nalcCaptureStart(ALC10.getDevice(device));
+ }
+ static native void nalcCaptureStart(long device);
+
+ /**
+ * If the application doesn't need to capture more audio for an amount of time, they can halt
+ * the device without closing it via the alcCaptureStop entry point.
+ * The implementation is encouraged to optimize for this case. The amount of audio
+ * samples available after restarting a stopped capture device is reset to zero. The
+ * application does not need to stop the capture device to read from it.
+ */
+ public static void alcCaptureStop(ALCdevice device) {
+ nalcCaptureStop(ALC10.getDevice(device));
+ }
+ static native void nalcCaptureStop(long device);
+
+ /**
+ * When the application feels there are enough samples available to process, it can obtain
+ * them from the AL via the alcCaptureSamples entry point.
+ *
+ * The "buffer" argument specifies an application-allocated buffer that can contain at least
+ * "samples" sample frames. The implementation may defer conversion and resampling until
+ * this point. Requesting more sample frames than are currently available is an error.
+ *
+ * @param buffer Buffer to store samples in
+ * @param samples Number of samples to request
+ */
+ public static void alcCaptureSamples(ALCdevice device, ByteBuffer buffer, int samples ) {
+ nalcCaptureSamples(ALC10.getDevice(device), buffer, buffer.position(), samples);
+ }
+ static native void nalcCaptureSamples(long device, ByteBuffer buffer, int position, int samples );
+
+ static native void initNativeStubs() throws LWJGLException;
+
+ /**
+ * Initializes ALC11, including any extensions
+ * @return true if initialization was successfull
+ */
+ static boolean initialize() {
+ try {
+ IntBuffer ib = BufferUtils.createIntBuffer(2);
+ ALC10.alcGetInteger(AL.getDevice(), ALC10.ALC_MAJOR_VERSION, ib);
+ ib.position(1);
+ ALC10.alcGetInteger(AL.getDevice(), ALC10.ALC_MINOR_VERSION, ib);
+
+ int major = ib.get(0);
+ int minor = ib.get(1);
+
+ // checking for version 1.x+
+ if(major >= 1) {
+
+ // checking for version 1.1+
+ if(major > 1 || minor >= 1) {
+ ALC11.initNativeStubs();
+ AL11.initNativeStubs();
+ }
+ }
+ } catch (LWJGLException le) {
+ LWJGLUtil.log("failed to initialize ALC11: " + le);
+ return false;
+ }
+ return true;
+ }
+}
diff --git a/src/java/org/lwjgl/openal/ALCcontext.java b/src/java/org/lwjgl/openal/ALCcontext.java
index b587f8c..c7c8d39 100644
--- a/src/java/org/lwjgl/openal/ALCcontext.java
+++ b/src/java/org/lwjgl/openal/ALCcontext.java
@@ -1,115 +1,115 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.openal;
-
-import java.nio.IntBuffer;
-
-import org.lwjgl.BufferUtils;
-
-/**
- * The ALCcontext class represents a context opened in OpenAL space.
- *
- * All operations of the AL core API affect a current AL context. Within the scope of AL,
- * the ALC is implied - it is not visible as a handle or function parameter. Only one AL
- * Context per process can be current at a time. Applications maintaining multiple AL
- * Contexts, whether threaded or not, have to set the current context accordingly.
- * Applications can have multiple threads that share one more or contexts. In other words,
- * AL and ALC are threadsafe.
- *
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 2983 $
- * $Id: ALCcontext.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public final class ALCcontext {
-
- /** Address of actual context */
- final long context;
-
- /** Whether this context is valid */
- private boolean valid = false;
-
- /**
- * Creates a new instance of ALCcontext
- *
- * @param context address of actual context
- */
- ALCcontext(long context) {
- this.context = context;
- this.valid = true;
- }
-
- /*
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object context) {
- if(context instanceof ALCcontext) {
- return ((ALCcontext)context).context == this.context;
- }
- return super.equals(context);
- }
-
- /**
- * Creates an attribute list in a ByteBuffer
- * @param contextFrequency Frequency to add
- * @param contextRefresh Refresh rate to add
- * @param contextSynchronized Whether to synchronize the context
- * @return
- */
- static IntBuffer createAttributeList(int contextFrequency, int contextRefresh, int contextSynchronized) {
- IntBuffer attribList = BufferUtils.createIntBuffer(7);
-
- attribList.put(ALC10.ALC_FREQUENCY);
- attribList.put(contextFrequency);
- attribList.put(ALC10.ALC_REFRESH);
- attribList.put(contextRefresh);
- attribList.put(ALC10.ALC_SYNC);
- attribList.put(contextSynchronized);
- attribList.put(0); //terminating int
-
- return attribList;
- }
-
- /**
- * Marks this context as invalid
- *
- */
- void setInvalid() {
- valid = false;
- }
-
- /**
- * @return true if this context is still valid
- */
- public boolean isValid() {
- return valid;
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.openal;
+
+import java.nio.IntBuffer;
+
+import org.lwjgl.BufferUtils;
+
+/**
+ * The ALCcontext class represents a context opened in OpenAL space.
+ *
+ * All operations of the AL core API affect a current AL context. Within the scope of AL,
+ * the ALC is implied - it is not visible as a handle or function parameter. Only one AL
+ * Context per process can be current at a time. Applications maintaining multiple AL
+ * Contexts, whether threaded or not, have to set the current context accordingly.
+ * Applications can have multiple threads that share one more or contexts. In other words,
+ * AL and ALC are threadsafe.
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 2983 $
+ * $Id: ALCcontext.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public final class ALCcontext {
+
+ /** Address of actual context */
+ final long context;
+
+ /** Whether this context is valid */
+ private boolean valid = false;
+
+ /**
+ * Creates a new instance of ALCcontext
+ *
+ * @param context address of actual context
+ */
+ ALCcontext(long context) {
+ this.context = context;
+ this.valid = true;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ public boolean equals(Object context) {
+ if(context instanceof ALCcontext) {
+ return ((ALCcontext)context).context == this.context;
+ }
+ return super.equals(context);
+ }
+
+ /**
+ * Creates an attribute list in a ByteBuffer
+ * @param contextFrequency Frequency to add
+ * @param contextRefresh Refresh rate to add
+ * @param contextSynchronized Whether to synchronize the context
+ * @return
+ */
+ static IntBuffer createAttributeList(int contextFrequency, int contextRefresh, int contextSynchronized) {
+ IntBuffer attribList = BufferUtils.createIntBuffer(7);
+
+ attribList.put(ALC10.ALC_FREQUENCY);
+ attribList.put(contextFrequency);
+ attribList.put(ALC10.ALC_REFRESH);
+ attribList.put(contextRefresh);
+ attribList.put(ALC10.ALC_SYNC);
+ attribList.put(contextSynchronized);
+ attribList.put(0); //terminating int
+
+ return attribList;
+ }
+
+ /**
+ * Marks this context as invalid
+ *
+ */
+ void setInvalid() {
+ valid = false;
+ }
+
+ /**
+ * @return true if this context is still valid
+ */
+ public boolean isValid() {
+ return valid;
+ }
+}
diff --git a/src/java/org/lwjgl/openal/ALCdevice.java b/src/java/org/lwjgl/openal/ALCdevice.java
index 4a6b535..887839f 100644
--- a/src/java/org/lwjgl/openal/ALCdevice.java
+++ b/src/java/org/lwjgl/openal/ALCdevice.java
@@ -1,124 +1,124 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.openal;
-
-import java.util.HashMap;
-import java.util.Iterator;
-
-/**
- * The ALCdevice class represents a device opened in OpenAL space.
- *
- * ALC introduces the notion of a Device. A Device can be, depending on the
- * implementation, a hardware device, or a daemon/OS service/actual server. This
- * mechanism also permits different drivers (and hardware) to coexist within the same
- * system, as well as allowing several applications to share system resources for audio,
- * including a single hardware output device. The details are left to the implementation,
- * which has to map the available backends to unique device specifiers.
- *
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 2983 $
- * $Id: ALCdevice.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public final class ALCdevice {
-
- /** Address of actual device */
- final long device;
-
- /** Whether this device is valid */
- private boolean valid = false;
-
- /** List of contexts belonging to the device */
- private HashMap contexts = new HashMap();
-
- /**
- * Creates a new instance of ALCdevice
- *
- * @param device address of actual device
- */
- ALCdevice(long device) {
- this.device = device;
- this.valid = true;
- }
-
- /*
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object device) {
- if(device instanceof ALCdevice) {
- return ((ALCdevice)device).device == this.device;
- }
- return super.equals(device);
- }
-
- /**
- * Adds a context to the device
- *
- * @param context context to add to the list of contexts for this device
- */
- void addContext(ALCcontext context) {
- synchronized (contexts) {
- contexts.put(new Long(context.context), context);
- }
- }
-
- /**
- * Remove context associated with device
- *
- * @param context Context to disassociate with device
- */
- void removeContext(ALCcontext context) {
- synchronized (contexts) {
- contexts.remove(new Long(context.context));
- }
- }
-
- /**
- * Marks this device and all of its contexts invalid
- */
- void setInvalid() {
- valid = false;
- synchronized (contexts) {
- for(Iterator i = contexts.values().iterator(); i.hasNext();) {
- ALCcontext context = (ALCcontext) i.next();
- context.setInvalid();
- }
- }
- contexts.clear();
- }
-
- /**
- * @return true if this device is still valid
- */
- public boolean isValid() {
- return valid;
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.openal;
+
+import java.util.HashMap;
+import java.util.Iterator;
+
+/**
+ * The ALCdevice class represents a device opened in OpenAL space.
+ *
+ * ALC introduces the notion of a Device. A Device can be, depending on the
+ * implementation, a hardware device, or a daemon/OS service/actual server. This
+ * mechanism also permits different drivers (and hardware) to coexist within the same
+ * system, as well as allowing several applications to share system resources for audio,
+ * including a single hardware output device. The details are left to the implementation,
+ * which has to map the available backends to unique device specifiers.
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 2983 $
+ * $Id: ALCdevice.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public final class ALCdevice {
+
+ /** Address of actual device */
+ final long device;
+
+ /** Whether this device is valid */
+ private boolean valid = false;
+
+ /** List of contexts belonging to the device */
+ private HashMap contexts = new HashMap();
+
+ /**
+ * Creates a new instance of ALCdevice
+ *
+ * @param device address of actual device
+ */
+ ALCdevice(long device) {
+ this.device = device;
+ this.valid = true;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ public boolean equals(Object device) {
+ if(device instanceof ALCdevice) {
+ return ((ALCdevice)device).device == this.device;
+ }
+ return super.equals(device);
+ }
+
+ /**
+ * Adds a context to the device
+ *
+ * @param context context to add to the list of contexts for this device
+ */
+ void addContext(ALCcontext context) {
+ synchronized (contexts) {
+ contexts.put(new Long(context.context), context);
+ }
+ }
+
+ /**
+ * Remove context associated with device
+ *
+ * @param context Context to disassociate with device
+ */
+ void removeContext(ALCcontext context) {
+ synchronized (contexts) {
+ contexts.remove(new Long(context.context));
+ }
+ }
+
+ /**
+ * Marks this device and all of its contexts invalid
+ */
+ void setInvalid() {
+ valid = false;
+ synchronized (contexts) {
+ for(Iterator i = contexts.values().iterator(); i.hasNext();) {
+ ALCcontext context = (ALCcontext) i.next();
+ context.setInvalid();
+ }
+ }
+ contexts.clear();
+ }
+
+ /**
+ * @return true if this device is still valid
+ */
+ public boolean isValid() {
+ return valid;
+ }
+}
diff --git a/src/java/org/lwjgl/openal/OpenALException.java b/src/java/org/lwjgl/openal/OpenALException.java
index dcbcf1e..830ed49 100644
--- a/src/java/org/lwjgl/openal/OpenALException.java
+++ b/src/java/org/lwjgl/openal/OpenALException.java
@@ -1,85 +1,85 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.openal;
-
-/**
- * <br>
- * Thrown by the debug build library of the LWJGL if any OpenAL operation
- * causes an error.
- *
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 2983 $
- * $Id: OpenALException.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public class OpenALException extends RuntimeException {
-
- private static final long serialVersionUID = 1L;
-
- /**
- * Constructor for OpenALException.
- */
- public OpenALException() {
- super();
- }
-
- /**
- * Constructor that takes an AL error number
- */
- public OpenALException(int error_code) {
- super("OpenAL error: " + AL10.alGetString(error_code) + " (" + error_code + ")");
- }
-
- /**
- * Constructor for OpenALException.
- * @param message
- */
- public OpenALException(String message) {
- super(message);
- }
-
- /**
- * Constructor for OpenALException.
- * @param message
- * @param cause
- */
- public OpenALException(String message, Throwable cause) {
- super(message, cause);
- }
-
- /**
- * Constructor for OpenALException.
- * @param cause
- */
- public OpenALException(Throwable cause) {
- super(cause);
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.openal;
+
+/**
+ * <br>
+ * Thrown by the debug build library of the LWJGL if any OpenAL operation
+ * causes an error.
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 2983 $
+ * $Id: OpenALException.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public class OpenALException extends RuntimeException {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Constructor for OpenALException.
+ */
+ public OpenALException() {
+ super();
+ }
+
+ /**
+ * Constructor that takes an AL error number
+ */
+ public OpenALException(int error_code) {
+ super("OpenAL error: " + AL10.alGetString(error_code) + " (" + error_code + ")");
+ }
+
+ /**
+ * Constructor for OpenALException.
+ * @param message
+ */
+ public OpenALException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructor for OpenALException.
+ * @param message
+ * @param cause
+ */
+ public OpenALException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * Constructor for OpenALException.
+ * @param cause
+ */
+ public OpenALException(Throwable cause) {
+ super(cause);
+ }
+}
diff --git a/src/java/org/lwjgl/openal/Util.java b/src/java/org/lwjgl/openal/Util.java
index 3d8bf9a..43b9b0d 100644
--- a/src/java/org/lwjgl/openal/Util.java
+++ b/src/java/org/lwjgl/openal/Util.java
@@ -1,86 +1,86 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.openal;
-
-
-/**
- * Simple utility class for checking AL/ALC errors
- *
- * @author cix_foo <cix_foo at users.sourceforge.net>
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 2983 $
- */
-
-public final class Util {
- /** No c'tor */
- private Util() {
- }
-
- /**
- * Checks for any ALC errors and throws an unchecked exception on errors
- * @param device Device for which to check ALC errors
- */
- public static void checkALCError(ALCdevice device) {
- int err = ALC10.alcGetError(device);
- if (err != ALC10.ALC_NO_ERROR)
- throw new OpenALException(ALC10.alcGetString(AL.getDevice(), err));
- }
-
- /**
- * Checks for any AL errors and throws an unchecked exception on errors
- */
- public static void checkALError() {
- int err = AL10.alGetError();
- if (err != AL10.AL_NO_ERROR)
- throw new OpenALException(err);
- }
-
- /**
- * Checks for a valid device
- * @param device ALCdevice to check the validity of
- */
- public static void checkALCValidDevice(ALCdevice device) {
- if(!device.isValid()) {
- throw new OpenALException("Invalid device: " + device);
- }
- }
-
- /**
- * Checks for a valid context
- * @param context ALCcontext to check the validity of
- */
- public static void checkALCValidContext(ALCcontext context) {
- if(!context.isValid()) {
- throw new OpenALException("Invalid context: " + context);
- }
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.openal;
+
+
+/**
+ * Simple utility class for checking AL/ALC errors
+ *
+ * @author cix_foo <cix_foo at users.sourceforge.net>
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 2983 $
+ */
+
+public final class Util {
+ /** No c'tor */
+ private Util() {
+ }
+
+ /**
+ * Checks for any ALC errors and throws an unchecked exception on errors
+ * @param device Device for which to check ALC errors
+ */
+ public static void checkALCError(ALCdevice device) {
+ int err = ALC10.alcGetError(device);
+ if (err != ALC10.ALC_NO_ERROR)
+ throw new OpenALException(ALC10.alcGetString(AL.getDevice(), err));
+ }
+
+ /**
+ * Checks for any AL errors and throws an unchecked exception on errors
+ */
+ public static void checkALError() {
+ int err = AL10.alGetError();
+ if (err != AL10.AL_NO_ERROR)
+ throw new OpenALException(err);
+ }
+
+ /**
+ * Checks for a valid device
+ * @param device ALCdevice to check the validity of
+ */
+ public static void checkALCValidDevice(ALCdevice device) {
+ if(!device.isValid()) {
+ throw new OpenALException("Invalid device: " + device);
+ }
+ }
+
+ /**
+ * Checks for a valid context
+ * @param context ALCcontext to check the validity of
+ */
+ public static void checkALCValidContext(ALCcontext context) {
+ if(!context.isValid()) {
+ throw new OpenALException("Invalid context: " + context);
+ }
+ }
+}
diff --git a/src/java/org/lwjgl/opengl/AWTCanvasImplementation.java b/src/java/org/lwjgl/opengl/AWTCanvasImplementation.java
index b51b811..5b2a8eb 100644
--- a/src/java/org/lwjgl/opengl/AWTCanvasImplementation.java
+++ b/src/java/org/lwjgl/opengl/AWTCanvasImplementation.java
@@ -1,59 +1,59 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import java.awt.GraphicsConfiguration;
-import java.awt.GraphicsDevice;
-import java.awt.Canvas;
-
-import org.lwjgl.LWJGLException;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3002 $
- * $Id: AWTCanvasImplementation.java 3002 2008-04-10 20:25:54Z elias_naur $
- */
-interface AWTCanvasImplementation {
- /**
- * Return an opaque handle to the canvas peer information required to create a context from it.
- */
- PeerInfo createPeerInfo(Canvas component, PixelFormat pixel_format) throws LWJGLException;
-
- /**
- * Find a proper GraphicsConfiguration from the given GraphicsDevice and PixelFormat.
- *
- * @return A GraphicsConfiguration matching the given GraphicsConfiguration and PixelFormat.
- * @throws LWJGLException if no suitable configuration could be found.
- */
- GraphicsConfiguration findConfiguration(GraphicsDevice device, PixelFormat pixel_format) throws LWJGLException;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+import java.awt.Canvas;
+
+import org.lwjgl.LWJGLException;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3002 $
+ * $Id: AWTCanvasImplementation.java 3002 2008-04-10 20:25:54Z elias_naur $
+ */
+interface AWTCanvasImplementation {
+ /**
+ * Return an opaque handle to the canvas peer information required to create a context from it.
+ */
+ PeerInfo createPeerInfo(Canvas component, PixelFormat pixel_format) throws LWJGLException;
+
+ /**
+ * Find a proper GraphicsConfiguration from the given GraphicsDevice and PixelFormat.
+ *
+ * @return A GraphicsConfiguration matching the given GraphicsConfiguration and PixelFormat.
+ * @throws LWJGLException if no suitable configuration could be found.
+ */
+ GraphicsConfiguration findConfiguration(GraphicsDevice device, PixelFormat pixel_format) throws LWJGLException;
+}
diff --git a/src/java/org/lwjgl/opengl/AWTGLCanvas.java b/src/java/org/lwjgl/opengl/AWTGLCanvas.java
index 2121247..466b41b 100644
--- a/src/java/org/lwjgl/opengl/AWTGLCanvas.java
+++ b/src/java/org/lwjgl/opengl/AWTGLCanvas.java
@@ -1,363 +1,363 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.LWJGLException;
-import org.lwjgl.LWJGLUtil;
-import org.lwjgl.Sys;
-
-import java.awt.*;
-import java.awt.event.ComponentEvent;
-import java.awt.event.ComponentListener;
-import java.awt.event.HierarchyEvent;
-import java.awt.event.HierarchyListener;
-
-/**
- * <p/>
- * An AWT rendering context.
- * <p/>
- *
- * @author $Author: spasi $
- * $Id: AWTGLCanvas.java 3116 2008-08-19 16:46:03Z spasi $
- * @version $Revision: 3116 $
- */
-public class AWTGLCanvas extends Canvas implements Drawable, ComponentListener, HierarchyListener {
-
- private static final long serialVersionUID = 1L;
-
- private final static AWTCanvasImplementation implementation;
- private boolean update_context;
- private Object SYNC_LOCK = new Object();
-
- /** The requested pixel format */
- private final PixelFormat pixel_format;
-
- /** The drawable to share context with */
- private final Drawable drawable;
-
- /** The ContextAttribs to use when creating the context */
- private final ContextAttribs attribs;
-
- /** Context handle */
- private PeerInfo peer_info;
- private Context context;
-
- /**
- * re-entry counter for support for re-entrant
- * redrawing in paint(). It happens when using dialog boxes.
- */
- private int reentry_count;
-
- /** Tracks whether initGL() needs to be called */
- private boolean first_run;
-
- static {
- Sys.initialize();
- implementation = createImplementation();
- }
-
- static AWTCanvasImplementation createImplementation() {
- switch ( LWJGLUtil.getPlatform() ) {
- case LWJGLUtil.PLATFORM_LINUX:
- return new LinuxCanvasImplementation();
- case LWJGLUtil.PLATFORM_WINDOWS:
- return new WindowsCanvasImplementation();
- case LWJGLUtil.PLATFORM_MACOSX:
- return new MacOSXCanvasImplementation();
- default:
- throw new IllegalStateException("Unsupported platform");
- }
- }
-
- private void setUpdate() {
- synchronized ( SYNC_LOCK ) {
- update_context = true;
- }
- }
-
- /** This method should only be called internally. */
- public Context getContext() {
- return context;
- }
-
- /** Constructor using the default PixelFormat. */
- public AWTGLCanvas() throws LWJGLException {
- this(new PixelFormat());
- }
-
- /**
- * Create an AWTGLCanvas with the requested PixelFormat on the default GraphicsDevice.
- *
- * @param pixel_format The desired pixel format. May not be null
- */
- public AWTGLCanvas(PixelFormat pixel_format) throws LWJGLException {
- this(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(), pixel_format);
- }
-
- /**
- * Create an AWTGLCanvas with the requested PixelFormat on the default GraphicsDevice.
- *
- * @param device the device to create the canvas on.
- * @param pixel_format The desired pixel format. May not be null
- */
- public AWTGLCanvas(GraphicsDevice device, PixelFormat pixel_format) throws LWJGLException {
- this(device, pixel_format, null);
- }
-
- /**
- * Create an AWTGLCanvas with the requested PixelFormat on the specified GraphicsDevice.
- *
- * @param device the device to create the canvas on.
- * @param pixel_format The desired pixel format. May not be null
- * @param drawable The Drawable to share context with
- */
- public AWTGLCanvas(GraphicsDevice device, PixelFormat pixel_format, Drawable drawable) throws LWJGLException {
- this(device, pixel_format, drawable, null);
- }
-
- /**
- * Create an AWTGLCanvas with the requested PixelFormat on the specified GraphicsDevice.
- *
- * @param device the device to create the canvas on.
- * @param pixel_format The desired pixel format. May not be null
- * @param drawable The Drawable to share context with
- * @param attribs The ContextAttribs to use when creating the context. (optional, may be null)
- */
- public AWTGLCanvas(GraphicsDevice device, PixelFormat pixel_format, Drawable drawable, ContextAttribs attribs) throws LWJGLException {
- super(implementation.findConfiguration(device, pixel_format));
- if ( pixel_format == null )
- throw new NullPointerException("Pixel format must be non-null");
- addHierarchyListener(this);
- addComponentListener(this);
- this.drawable = drawable;
- this.pixel_format = pixel_format;
- this.attribs = attribs;
- }
-
- /* (non-Javadoc)
- * @see java.awt.Canvas#addNotify()
- */
- public void addNotify() {
- super.addNotify();
- }
-
- /* (non-Javadoc)
- * @see java.awt.Component#removeNotify()
- */
- public void removeNotify() {
- synchronized ( SYNC_LOCK ) {
- destroyContext();
- super.removeNotify();
- }
- }
-
- /** Set swap interval. */
- public void setSwapInterval(int swap_interval) {
- synchronized ( SYNC_LOCK ) {
- if ( context == null )
- throw new IllegalStateException("Canvas not yet displayable");
- Context.setSwapInterval(swap_interval);
- }
- }
-
- /** Enable vsync */
- public void setVSyncEnabled(boolean enabled) {
- setSwapInterval(enabled ? 1 : 0);
- }
-
- /** Swap the canvas' buffer */
- public void swapBuffers() throws LWJGLException {
- synchronized ( SYNC_LOCK ) {
- if ( context == null )
- throw new IllegalStateException("Canvas not yet displayable");
- Context.swapBuffers();
- }
- }
-
- public void releaseContext() throws LWJGLException {
- synchronized ( SYNC_LOCK ) {
- if ( context == null )
- throw new IllegalStateException("Canvas not yet displayable");
- if ( context.isCurrent() )
- Context.releaseCurrentContext();
- }
- }
-
- /**
- * Make the canvas' context current. It is highly recommended that the context
- * is only made current inside the AWT thread (for example in an overridden paintGL()).
- */
- public void makeCurrent() throws LWJGLException {
- synchronized ( SYNC_LOCK ) {
- if ( context == null )
- throw new IllegalStateException("Canvas not yet displayable");
- context.makeCurrent();
- }
- }
-
- /** Destroy the OpenGL context. This happens when the component becomes undisplayable */
- private void destroyContext() {
- synchronized ( SYNC_LOCK ) {
- try {
- if ( context != null ) {
- context.forceDestroy();
- context = null;
- reentry_count = 0;
- peer_info.destroy();
- peer_info = null;
- }
- } catch (LWJGLException e) {
- throw new RuntimeException(e);
- }
- }
- }
-
- /**
- * Override this to do initialising of the context.
- * It will be called once from paint(), immediately after
- * the context is created and made current.
- */
- protected void initGL() {
- }
-
- /** Override this to do painting */
- protected void paintGL() {
- }
-
- /**
- * The default paint() operation makes the context current and calls paintGL() which should
- * be overridden to do GL operations.
- */
- public final void paint(Graphics g) {
- LWJGLException exception = null;
- synchronized ( SYNC_LOCK ) {
- if ( !isDisplayable() )
- return;
- try {
- if ( peer_info == null ) {
- this.peer_info = implementation.createPeerInfo(this, pixel_format);
- }
- peer_info.lockAndGetHandle();
- try {
- if ( context == null ) {
- this.context = new Context(peer_info, attribs, drawable != null ? drawable.getContext() : null);
- first_run = true;
- }
-
- if ( reentry_count == 0 )
- context.makeCurrent();
- reentry_count++;
- try {
- if ( update_context ) {
- context.update();
- update_context = false;
- }
- if ( first_run ) {
- first_run = false;
- initGL();
- }
- paintGL();
- } finally {
- reentry_count--;
- if ( reentry_count == 0 )
- Context.releaseCurrentContext();
- }
- } finally {
- peer_info.unlock();
- }
- } catch (LWJGLException e) {
- exception = e;
- }
- }
- if ( exception != null )
- exceptionOccurred(exception);
- }
-
- /**
- * This method will be called if an unhandled LWJGLException occurs in paint().
- * Override this method to be notified of this.
- *
- * @param exception The exception that occurred.
- */
- protected void exceptionOccurred(LWJGLException exception) {
- LWJGLUtil.log("Unhandled exception occurred, skipping paint(): " + exception);
- }
-
- /** override update to avoid clearing */
- public void update(Graphics g) {
- paint(g);
- }
-
- public void componentShown(ComponentEvent e) {
- }
-
- public void componentHidden(ComponentEvent e) {
- }
-
- public void componentResized(ComponentEvent e) {
- setUpdate();
- }
-
- public void componentMoved(ComponentEvent e) {
- setUpdate();
- }
-
- public void setLocation(int x, int y) {
- super.setLocation(x, y);
- setUpdate();
- }
-
- public void setLocation(Point p) {
- super.setLocation(p);
- setUpdate();
- }
-
- public void setSize(Dimension d) {
- super.setSize(d);
- setUpdate();
- }
-
- public void setSize(int width, int height) {
- super.setSize(width, height);
- setUpdate();
- }
-
- public void setBounds(int x, int y, int width, int height) {
- super.setBounds(x, y, width, height);
- setUpdate();
- }
-
- public void hierarchyChanged(HierarchyEvent e) {
- setUpdate();
- }
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.LWJGLException;
+import org.lwjgl.LWJGLUtil;
+import org.lwjgl.Sys;
+
+import java.awt.*;
+import java.awt.event.ComponentEvent;
+import java.awt.event.ComponentListener;
+import java.awt.event.HierarchyEvent;
+import java.awt.event.HierarchyListener;
+
+/**
+ * <p/>
+ * An AWT rendering context.
+ * <p/>
+ *
+ * @author $Author: spasi $
+ * $Id: AWTGLCanvas.java 3116 2008-08-19 16:46:03Z spasi $
+ * @version $Revision: 3116 $
+ */
+public class AWTGLCanvas extends Canvas implements Drawable, ComponentListener, HierarchyListener {
+
+ private static final long serialVersionUID = 1L;
+
+ private final static AWTCanvasImplementation implementation;
+ private boolean update_context;
+ private Object SYNC_LOCK = new Object();
+
+ /** The requested pixel format */
+ private final PixelFormat pixel_format;
+
+ /** The drawable to share context with */
+ private final Drawable drawable;
+
+ /** The ContextAttribs to use when creating the context */
+ private final ContextAttribs attribs;
+
+ /** Context handle */
+ private PeerInfo peer_info;
+ private Context context;
+
+ /**
+ * re-entry counter for support for re-entrant
+ * redrawing in paint(). It happens when using dialog boxes.
+ */
+ private int reentry_count;
+
+ /** Tracks whether initGL() needs to be called */
+ private boolean first_run;
+
+ static {
+ Sys.initialize();
+ implementation = createImplementation();
+ }
+
+ static AWTCanvasImplementation createImplementation() {
+ switch ( LWJGLUtil.getPlatform() ) {
+ case LWJGLUtil.PLATFORM_LINUX:
+ return new LinuxCanvasImplementation();
+ case LWJGLUtil.PLATFORM_WINDOWS:
+ return new WindowsCanvasImplementation();
+ case LWJGLUtil.PLATFORM_MACOSX:
+ return new MacOSXCanvasImplementation();
+ default:
+ throw new IllegalStateException("Unsupported platform");
+ }
+ }
+
+ private void setUpdate() {
+ synchronized ( SYNC_LOCK ) {
+ update_context = true;
+ }
+ }
+
+ /** This method should only be called internally. */
+ public Context getContext() {
+ return context;
+ }
+
+ /** Constructor using the default PixelFormat. */
+ public AWTGLCanvas() throws LWJGLException {
+ this(new PixelFormat());
+ }
+
+ /**
+ * Create an AWTGLCanvas with the requested PixelFormat on the default GraphicsDevice.
+ *
+ * @param pixel_format The desired pixel format. May not be null
+ */
+ public AWTGLCanvas(PixelFormat pixel_format) throws LWJGLException {
+ this(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(), pixel_format);
+ }
+
+ /**
+ * Create an AWTGLCanvas with the requested PixelFormat on the default GraphicsDevice.
+ *
+ * @param device the device to create the canvas on.
+ * @param pixel_format The desired pixel format. May not be null
+ */
+ public AWTGLCanvas(GraphicsDevice device, PixelFormat pixel_format) throws LWJGLException {
+ this(device, pixel_format, null);
+ }
+
+ /**
+ * Create an AWTGLCanvas with the requested PixelFormat on the specified GraphicsDevice.
+ *
+ * @param device the device to create the canvas on.
+ * @param pixel_format The desired pixel format. May not be null
+ * @param drawable The Drawable to share context with
+ */
+ public AWTGLCanvas(GraphicsDevice device, PixelFormat pixel_format, Drawable drawable) throws LWJGLException {
+ this(device, pixel_format, drawable, null);
+ }
+
+ /**
+ * Create an AWTGLCanvas with the requested PixelFormat on the specified GraphicsDevice.
+ *
+ * @param device the device to create the canvas on.
+ * @param pixel_format The desired pixel format. May not be null
+ * @param drawable The Drawable to share context with
+ * @param attribs The ContextAttribs to use when creating the context. (optional, may be null)
+ */
+ public AWTGLCanvas(GraphicsDevice device, PixelFormat pixel_format, Drawable drawable, ContextAttribs attribs) throws LWJGLException {
+ super(implementation.findConfiguration(device, pixel_format));
+ if ( pixel_format == null )
+ throw new NullPointerException("Pixel format must be non-null");
+ addHierarchyListener(this);
+ addComponentListener(this);
+ this.drawable = drawable;
+ this.pixel_format = pixel_format;
+ this.attribs = attribs;
+ }
+
+ /* (non-Javadoc)
+ * @see java.awt.Canvas#addNotify()
+ */
+ public void addNotify() {
+ super.addNotify();
+ }
+
+ /* (non-Javadoc)
+ * @see java.awt.Component#removeNotify()
+ */
+ public void removeNotify() {
+ synchronized ( SYNC_LOCK ) {
+ destroyContext();
+ super.removeNotify();
+ }
+ }
+
+ /** Set swap interval. */
+ public void setSwapInterval(int swap_interval) {
+ synchronized ( SYNC_LOCK ) {
+ if ( context == null )
+ throw new IllegalStateException("Canvas not yet displayable");
+ Context.setSwapInterval(swap_interval);
+ }
+ }
+
+ /** Enable vsync */
+ public void setVSyncEnabled(boolean enabled) {
+ setSwapInterval(enabled ? 1 : 0);
+ }
+
+ /** Swap the canvas' buffer */
+ public void swapBuffers() throws LWJGLException {
+ synchronized ( SYNC_LOCK ) {
+ if ( context == null )
+ throw new IllegalStateException("Canvas not yet displayable");
+ Context.swapBuffers();
+ }
+ }
+
+ public void releaseContext() throws LWJGLException {
+ synchronized ( SYNC_LOCK ) {
+ if ( context == null )
+ throw new IllegalStateException("Canvas not yet displayable");
+ if ( context.isCurrent() )
+ Context.releaseCurrentContext();
+ }
+ }
+
+ /**
+ * Make the canvas' context current. It is highly recommended that the context
+ * is only made current inside the AWT thread (for example in an overridden paintGL()).
+ */
+ public void makeCurrent() throws LWJGLException {
+ synchronized ( SYNC_LOCK ) {
+ if ( context == null )
+ throw new IllegalStateException("Canvas not yet displayable");
+ context.makeCurrent();
+ }
+ }
+
+ /** Destroy the OpenGL context. This happens when the component becomes undisplayable */
+ private void destroyContext() {
+ synchronized ( SYNC_LOCK ) {
+ try {
+ if ( context != null ) {
+ context.forceDestroy();
+ context = null;
+ reentry_count = 0;
+ peer_info.destroy();
+ peer_info = null;
+ }
+ } catch (LWJGLException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+ /**
+ * Override this to do initialising of the context.
+ * It will be called once from paint(), immediately after
+ * the context is created and made current.
+ */
+ protected void initGL() {
+ }
+
+ /** Override this to do painting */
+ protected void paintGL() {
+ }
+
+ /**
+ * The default paint() operation makes the context current and calls paintGL() which should
+ * be overridden to do GL operations.
+ */
+ public final void paint(Graphics g) {
+ LWJGLException exception = null;
+ synchronized ( SYNC_LOCK ) {
+ if ( !isDisplayable() )
+ return;
+ try {
+ if ( peer_info == null ) {
+ this.peer_info = implementation.createPeerInfo(this, pixel_format);
+ }
+ peer_info.lockAndGetHandle();
+ try {
+ if ( context == null ) {
+ this.context = new Context(peer_info, attribs, drawable != null ? drawable.getContext() : null);
+ first_run = true;
+ }
+
+ if ( reentry_count == 0 )
+ context.makeCurrent();
+ reentry_count++;
+ try {
+ if ( update_context ) {
+ context.update();
+ update_context = false;
+ }
+ if ( first_run ) {
+ first_run = false;
+ initGL();
+ }
+ paintGL();
+ } finally {
+ reentry_count--;
+ if ( reentry_count == 0 )
+ Context.releaseCurrentContext();
+ }
+ } finally {
+ peer_info.unlock();
+ }
+ } catch (LWJGLException e) {
+ exception = e;
+ }
+ }
+ if ( exception != null )
+ exceptionOccurred(exception);
+ }
+
+ /**
+ * This method will be called if an unhandled LWJGLException occurs in paint().
+ * Override this method to be notified of this.
+ *
+ * @param exception The exception that occurred.
+ */
+ protected void exceptionOccurred(LWJGLException exception) {
+ LWJGLUtil.log("Unhandled exception occurred, skipping paint(): " + exception);
+ }
+
+ /** override update to avoid clearing */
+ public void update(Graphics g) {
+ paint(g);
+ }
+
+ public void componentShown(ComponentEvent e) {
+ }
+
+ public void componentHidden(ComponentEvent e) {
+ }
+
+ public void componentResized(ComponentEvent e) {
+ setUpdate();
+ }
+
+ public void componentMoved(ComponentEvent e) {
+ setUpdate();
+ }
+
+ public void setLocation(int x, int y) {
+ super.setLocation(x, y);
+ setUpdate();
+ }
+
+ public void setLocation(Point p) {
+ super.setLocation(p);
+ setUpdate();
+ }
+
+ public void setSize(Dimension d) {
+ super.setSize(d);
+ setUpdate();
+ }
+
+ public void setSize(int width, int height) {
+ super.setSize(width, height);
+ setUpdate();
+ }
+
+ public void setBounds(int x, int y, int width, int height) {
+ super.setBounds(x, y, width, height);
+ setUpdate();
+ }
+
+ public void hierarchyChanged(HierarchyEvent e) {
+ setUpdate();
+ }
+
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/opengl/AWTSurfaceLock.java b/src/java/org/lwjgl/opengl/AWTSurfaceLock.java
index 64f02c6..5ff0ad2 100644
--- a/src/java/org/lwjgl/opengl/AWTSurfaceLock.java
+++ b/src/java/org/lwjgl/opengl/AWTSurfaceLock.java
@@ -1,106 +1,106 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import java.awt.Canvas;
-import java.nio.ByteBuffer;
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-
-import org.lwjgl.LWJGLException;
-import org.lwjgl.LWJGLUtil;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3116 $
- * $Id: AWTSurfaceLock.java 3116 2008-08-19 16:46:03Z spasi $
- */
-final class AWTSurfaceLock {
-
- private final static int WAIT_DELAY_MILLIS = 100;
-
- private final ByteBuffer lock_buffer;
-
- private boolean firstLockSucceeded = false;
-
- AWTSurfaceLock() {
- lock_buffer = createHandle();
- }
-
- private static native ByteBuffer createHandle();
-
- public ByteBuffer lockAndGetHandle(Canvas component) throws LWJGLException {
- while (!privilegedLockAndInitHandle(component)) {
- LWJGLUtil.log("Could not get drawing surface info, retrying...");
- try {
- Thread.sleep(WAIT_DELAY_MILLIS);
- } catch (InterruptedException e) {
- LWJGLUtil.log("Interrupted while retrying: " + e);
- }
- }
-
- return lock_buffer;
- }
-
- private boolean privilegedLockAndInitHandle(final Canvas component) throws LWJGLException {
- // Workaround for Sun JDK bug 4796548 which still exists in java for OS X
- // We need to elevate privileges because of an AWT bug. Please see
- // http://192.18.37.44/forums/index.php?topic=10572 for a discussion.
- // It is only needed on first call, so we avoid it on all subsequent calls
- // due to performance.
- if (firstLockSucceeded)
- return lockAndInitHandle(lock_buffer, component);
- else
- try {
- final Object result = AccessController.doPrivileged(new PrivilegedExceptionAction() {
-
- public Object run() throws LWJGLException {
- return Boolean.valueOf(lockAndInitHandle(lock_buffer, component));
- }
- });
- firstLockSucceeded = ((Boolean) result).booleanValue();
- return firstLockSucceeded;
- } catch (PrivilegedActionException e) {
- throw (LWJGLException) e.getException();
- }
- }
-
- private static native boolean lockAndInitHandle(ByteBuffer lock_buffer, Canvas component) throws LWJGLException;
-
- void unlock() throws LWJGLException {
- nUnlock(lock_buffer);
- }
-
- private static native void nUnlock(ByteBuffer lock_buffer) throws LWJGLException;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import java.awt.Canvas;
+import java.nio.ByteBuffer;
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+
+import org.lwjgl.LWJGLException;
+import org.lwjgl.LWJGLUtil;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3116 $
+ * $Id: AWTSurfaceLock.java 3116 2008-08-19 16:46:03Z spasi $
+ */
+final class AWTSurfaceLock {
+
+ private final static int WAIT_DELAY_MILLIS = 100;
+
+ private final ByteBuffer lock_buffer;
+
+ private boolean firstLockSucceeded = false;
+
+ AWTSurfaceLock() {
+ lock_buffer = createHandle();
+ }
+
+ private static native ByteBuffer createHandle();
+
+ public ByteBuffer lockAndGetHandle(Canvas component) throws LWJGLException {
+ while (!privilegedLockAndInitHandle(component)) {
+ LWJGLUtil.log("Could not get drawing surface info, retrying...");
+ try {
+ Thread.sleep(WAIT_DELAY_MILLIS);
+ } catch (InterruptedException e) {
+ LWJGLUtil.log("Interrupted while retrying: " + e);
+ }
+ }
+
+ return lock_buffer;
+ }
+
+ private boolean privilegedLockAndInitHandle(final Canvas component) throws LWJGLException {
+ // Workaround for Sun JDK bug 4796548 which still exists in java for OS X
+ // We need to elevate privileges because of an AWT bug. Please see
+ // http://192.18.37.44/forums/index.php?topic=10572 for a discussion.
+ // It is only needed on first call, so we avoid it on all subsequent calls
+ // due to performance.
+ if (firstLockSucceeded)
+ return lockAndInitHandle(lock_buffer, component);
+ else
+ try {
+ final Object result = AccessController.doPrivileged(new PrivilegedExceptionAction() {
+
+ public Object run() throws LWJGLException {
+ return Boolean.valueOf(lockAndInitHandle(lock_buffer, component));
+ }
+ });
+ firstLockSucceeded = ((Boolean) result).booleanValue();
+ return firstLockSucceeded;
+ } catch (PrivilegedActionException e) {
+ throw (LWJGLException) e.getException();
+ }
+ }
+
+ private static native boolean lockAndInitHandle(ByteBuffer lock_buffer, Canvas component) throws LWJGLException;
+
+ void unlock() throws LWJGLException {
+ nUnlock(lock_buffer);
+ }
+
+ private static native void nUnlock(ByteBuffer lock_buffer) throws LWJGLException;
+}
diff --git a/src/java/org/lwjgl/opengl/Context.java b/src/java/org/lwjgl/opengl/Context.java
index 36119ab..c07c966 100644
--- a/src/java/org/lwjgl/opengl/Context.java
+++ b/src/java/org/lwjgl/opengl/Context.java
@@ -1,252 +1,252 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.LWJGLException;
-import org.lwjgl.LWJGLUtil;
-import org.lwjgl.Sys;
-
-import java.nio.ByteBuffer;
-import java.nio.IntBuffer;
-
-/**
- * <p/>
- * Context encapsulates an OpenGL context.
- * <p/>
- * <p/>
- * This class is thread-safe.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3117 $
- * $Id: Context.java 3117 2008-08-19 17:47:24Z spasi $
- */
-final class Context {
-
- /** The platform specific implementation of context methods */
- private final static ContextImplementation implementation;
-
- /** The current Context */
- private final static ThreadLocal current_context_local = new ThreadLocal();
-
- /** Handle to the native GL rendering context */
- private final ByteBuffer handle;
- private final PeerInfo peer_info;
-
- private final IntBuffer attribList;
- private final boolean forwardCompatible;
-
- /** Whether the context has been destroyed */
- private boolean destroyed;
-
- private boolean destroy_requested;
-
- /** The thread that has this context current, or null. */
- private Thread thread;
-
- static {
- Sys.initialize();
- implementation = createImplementation();
- }
-
- private static ContextImplementation createImplementation() {
- switch ( LWJGLUtil.getPlatform() ) {
- case LWJGLUtil.PLATFORM_LINUX:
- return new LinuxContextImplementation();
- case LWJGLUtil.PLATFORM_WINDOWS:
- return new WindowsContextImplementation();
- case LWJGLUtil.PLATFORM_MACOSX:
- return new MacOSXContextImplementation();
- default:
- throw new IllegalStateException("Unsupported platform");
- }
- }
-
- PeerInfo getPeerInfo() {
- return peer_info;
- }
-
- static Context getCurrentContext() {
- return (Context)current_context_local.get();
- }
-
- /** Create a context with the specified peer info and shared context */
- Context(PeerInfo peer_info, ContextAttribs attribs, Context shared_context) throws LWJGLException {
- Context context_lock = shared_context != null ? shared_context : this;
- // If shared_context is not null, synchronize on it to make sure it is not deleted
- // while this context is created. Otherwise, simply synchronize on ourself to avoid NPE
- synchronized ( context_lock ) {
- if ( shared_context != null && shared_context.destroyed )
- throw new IllegalArgumentException("Shared context is destroyed");
- GLContext.loadOpenGLLibrary();
- try {
- this.peer_info = peer_info;
- if ( attribs != null ) {
- attribList = attribs.getAttribList();
- forwardCompatible = attribs.isForwardCompatible();
- } else {
- attribList = null;
- forwardCompatible = false;
- }
-
- this.handle = implementation.create(peer_info, attribList, shared_context != null ? shared_context.handle : null);
- } catch (LWJGLException e) {
- GLContext.unloadOpenGLLibrary();
- throw e;
- }
- }
- }
-
- /** Release the current context (if any). After this call, no context is current. */
- public static void releaseCurrentContext() throws LWJGLException {
- Context current_context = getCurrentContext();
- if ( current_context != null ) {
- implementation.releaseCurrentContext();
- GLContext.useContext(null);
- current_context_local.set(null);
- synchronized ( current_context ) {
- current_context.thread = null;
- current_context.checkDestroy();
- }
- }
- }
-
- /**
- * Release the context from its drawable. This is necessary on some platforms,
- * like Mac OS X, where binding the context to a drawable and binding the context
- * for rendering are two distinct actions and where calling releaseDrawable
- * on every releaseCurrentContext results in artifacts.
- */
- public synchronized void releaseDrawable() throws LWJGLException {
- if ( destroyed )
- throw new IllegalStateException("Context is destroyed");
- implementation.releaseDrawable(getHandle());
- }
-
- /** Update the context. Should be called whenever it's drawable is moved or resized */
- public synchronized void update() {
- if ( destroyed )
- throw new IllegalStateException("Context is destroyed");
- implementation.update(getHandle());
- }
-
- /** Swap the buffers on the current context. Only valid for double-buffered contexts */
- public static void swapBuffers() throws LWJGLException {
- implementation.swapBuffers();
- }
-
- private boolean canAccess() {
- return thread == null || Thread.currentThread() == thread;
- }
-
- private void checkAccess() {
- if ( !canAccess() )
- throw new IllegalStateException("From thread " + Thread.currentThread() + ": " + thread + " already has the context current");
- }
-
- /** Make the context current */
- public synchronized void makeCurrent() throws LWJGLException {
- checkAccess();
- if ( destroyed )
- throw new IllegalStateException("Context is destroyed");
- thread = Thread.currentThread();
- current_context_local.set(this);
- implementation.makeCurrent(peer_info, handle);
- GLContext.useContext(this, forwardCompatible);
- }
-
- ByteBuffer getHandle() {
- return handle;
- }
-
- /** Query whether the context is current */
- public synchronized boolean isCurrent() throws LWJGLException {
- if ( destroyed )
- throw new IllegalStateException("Context is destroyed");
- return implementation.isCurrent(handle);
- }
-
- private void checkDestroy() {
- if ( !destroyed && destroy_requested ) {
- try {
- releaseDrawable();
- implementation.destroy(peer_info, handle);
- destroyed = true;
- thread = null;
- GLContext.unloadOpenGLLibrary();
- } catch (LWJGLException e) {
- LWJGLUtil.log("Exception occurred while destroying context: " + e);
- }
- }
- }
-
- /**
- * Set the buffer swap interval. This call is a best-attempt at changing
- * the monitor swap interval, which is the minimum periodicity of color buffer swaps,
- * measured in video frame periods, and is not guaranteed to be successful.
- * <p/>
- * A video frame period is the time required to display a full frame of video data.
- */
- public static void setSwapInterval(int value) {
- implementation.setSwapInterval(value);
- }
-
- /**
- * Destroy the context. This method behaves the same as destroy() with the extra
- * requirement that the context must be either current to the current thread or not
- * current at all.
- */
- public synchronized void forceDestroy() throws LWJGLException {
- checkAccess();
- destroy();
- }
-
- /**
- * Request destruction of the Context. If the context is current, no context will be current after this call.
- * The context is destroyed when no thread has it current.
- */
- public synchronized void destroy() throws LWJGLException {
- if ( destroyed )
- return;
- destroy_requested = true;
- boolean was_current = isCurrent();
- int error = GL11.GL_NO_ERROR;
- if ( was_current ) {
- if ( GLContext.getCapabilities() != null && GLContext.getCapabilities().OpenGL11 )
- error = GL11.glGetError();
- releaseCurrentContext();
- }
- checkDestroy();
- if ( was_current && error != GL11.GL_NO_ERROR )
- throw new OpenGLException(error);
- }
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.LWJGLException;
+import org.lwjgl.LWJGLUtil;
+import org.lwjgl.Sys;
+
+import java.nio.ByteBuffer;
+import java.nio.IntBuffer;
+
+/**
+ * <p/>
+ * Context encapsulates an OpenGL context.
+ * <p/>
+ * <p/>
+ * This class is thread-safe.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3117 $
+ * $Id: Context.java 3117 2008-08-19 17:47:24Z spasi $
+ */
+final class Context {
+
+ /** The platform specific implementation of context methods */
+ private final static ContextImplementation implementation;
+
+ /** The current Context */
+ private final static ThreadLocal current_context_local = new ThreadLocal();
+
+ /** Handle to the native GL rendering context */
+ private final ByteBuffer handle;
+ private final PeerInfo peer_info;
+
+ private final IntBuffer attribList;
+ private final boolean forwardCompatible;
+
+ /** Whether the context has been destroyed */
+ private boolean destroyed;
+
+ private boolean destroy_requested;
+
+ /** The thread that has this context current, or null. */
+ private Thread thread;
+
+ static {
+ Sys.initialize();
+ implementation = createImplementation();
+ }
+
+ private static ContextImplementation createImplementation() {
+ switch ( LWJGLUtil.getPlatform() ) {
+ case LWJGLUtil.PLATFORM_LINUX:
+ return new LinuxContextImplementation();
+ case LWJGLUtil.PLATFORM_WINDOWS:
+ return new WindowsContextImplementation();
+ case LWJGLUtil.PLATFORM_MACOSX:
+ return new MacOSXContextImplementation();
+ default:
+ throw new IllegalStateException("Unsupported platform");
+ }
+ }
+
+ PeerInfo getPeerInfo() {
+ return peer_info;
+ }
+
+ static Context getCurrentContext() {
+ return (Context)current_context_local.get();
+ }
+
+ /** Create a context with the specified peer info and shared context */
+ Context(PeerInfo peer_info, ContextAttribs attribs, Context shared_context) throws LWJGLException {
+ Context context_lock = shared_context != null ? shared_context : this;
+ // If shared_context is not null, synchronize on it to make sure it is not deleted
+ // while this context is created. Otherwise, simply synchronize on ourself to avoid NPE
+ synchronized ( context_lock ) {
+ if ( shared_context != null && shared_context.destroyed )
+ throw new IllegalArgumentException("Shared context is destroyed");
+ GLContext.loadOpenGLLibrary();
+ try {
+ this.peer_info = peer_info;
+ if ( attribs != null ) {
+ attribList = attribs.getAttribList();
+ forwardCompatible = attribs.isForwardCompatible();
+ } else {
+ attribList = null;
+ forwardCompatible = false;
+ }
+
+ this.handle = implementation.create(peer_info, attribList, shared_context != null ? shared_context.handle : null);
+ } catch (LWJGLException e) {
+ GLContext.unloadOpenGLLibrary();
+ throw e;
+ }
+ }
+ }
+
+ /** Release the current context (if any). After this call, no context is current. */
+ public static void releaseCurrentContext() throws LWJGLException {
+ Context current_context = getCurrentContext();
+ if ( current_context != null ) {
+ implementation.releaseCurrentContext();
+ GLContext.useContext(null);
+ current_context_local.set(null);
+ synchronized ( current_context ) {
+ current_context.thread = null;
+ current_context.checkDestroy();
+ }
+ }
+ }
+
+ /**
+ * Release the context from its drawable. This is necessary on some platforms,
+ * like Mac OS X, where binding the context to a drawable and binding the context
+ * for rendering are two distinct actions and where calling releaseDrawable
+ * on every releaseCurrentContext results in artifacts.
+ */
+ public synchronized void releaseDrawable() throws LWJGLException {
+ if ( destroyed )
+ throw new IllegalStateException("Context is destroyed");
+ implementation.releaseDrawable(getHandle());
+ }
+
+ /** Update the context. Should be called whenever it's drawable is moved or resized */
+ public synchronized void update() {
+ if ( destroyed )
+ throw new IllegalStateException("Context is destroyed");
+ implementation.update(getHandle());
+ }
+
+ /** Swap the buffers on the current context. Only valid for double-buffered contexts */
+ public static void swapBuffers() throws LWJGLException {
+ implementation.swapBuffers();
+ }
+
+ private boolean canAccess() {
+ return thread == null || Thread.currentThread() == thread;
+ }
+
+ private void checkAccess() {
+ if ( !canAccess() )
+ throw new IllegalStateException("From thread " + Thread.currentThread() + ": " + thread + " already has the context current");
+ }
+
+ /** Make the context current */
+ public synchronized void makeCurrent() throws LWJGLException {
+ checkAccess();
+ if ( destroyed )
+ throw new IllegalStateException("Context is destroyed");
+ thread = Thread.currentThread();
+ current_context_local.set(this);
+ implementation.makeCurrent(peer_info, handle);
+ GLContext.useContext(this, forwardCompatible);
+ }
+
+ ByteBuffer getHandle() {
+ return handle;
+ }
+
+ /** Query whether the context is current */
+ public synchronized boolean isCurrent() throws LWJGLException {
+ if ( destroyed )
+ throw new IllegalStateException("Context is destroyed");
+ return implementation.isCurrent(handle);
+ }
+
+ private void checkDestroy() {
+ if ( !destroyed && destroy_requested ) {
+ try {
+ releaseDrawable();
+ implementation.destroy(peer_info, handle);
+ destroyed = true;
+ thread = null;
+ GLContext.unloadOpenGLLibrary();
+ } catch (LWJGLException e) {
+ LWJGLUtil.log("Exception occurred while destroying context: " + e);
+ }
+ }
+ }
+
+ /**
+ * Set the buffer swap interval. This call is a best-attempt at changing
+ * the monitor swap interval, which is the minimum periodicity of color buffer swaps,
+ * measured in video frame periods, and is not guaranteed to be successful.
+ * <p/>
+ * A video frame period is the time required to display a full frame of video data.
+ */
+ public static void setSwapInterval(int value) {
+ implementation.setSwapInterval(value);
+ }
+
+ /**
+ * Destroy the context. This method behaves the same as destroy() with the extra
+ * requirement that the context must be either current to the current thread or not
+ * current at all.
+ */
+ public synchronized void forceDestroy() throws LWJGLException {
+ checkAccess();
+ destroy();
+ }
+
+ /**
+ * Request destruction of the Context. If the context is current, no context will be current after this call.
+ * The context is destroyed when no thread has it current.
+ */
+ public synchronized void destroy() throws LWJGLException {
+ if ( destroyed )
+ return;
+ destroy_requested = true;
+ boolean was_current = isCurrent();
+ int error = GL11.GL_NO_ERROR;
+ if ( was_current ) {
+ if ( GLContext.getCapabilities() != null && GLContext.getCapabilities().OpenGL11 )
+ error = GL11.glGetError();
+ releaseCurrentContext();
+ }
+ checkDestroy();
+ if ( was_current && error != GL11.GL_NO_ERROR )
+ throw new OpenGLException(error);
+ }
+
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/opengl/ContextImplementation.java b/src/java/org/lwjgl/opengl/ContextImplementation.java
index 2e98fbf..c0234e0 100644
--- a/src/java/org/lwjgl/opengl/ContextImplementation.java
+++ b/src/java/org/lwjgl/opengl/ContextImplementation.java
@@ -1,90 +1,90 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import java.nio.ByteBuffer;
-import java.nio.IntBuffer;
-
-import org.lwjgl.LWJGLException;
-
-/**
- * <p/>
- * Context implementation interface.
- * <p/>
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3116 $
- * $Id: ContextImplementation.java 3116 2008-08-19 16:46:03Z spasi $
- */
-interface ContextImplementation {
- /**
- * Create a context.
- */
- ByteBuffer create(PeerInfo peer_info, IntBuffer attribs, ByteBuffer shared_context_handle) throws LWJGLException;
-
- /**
- * Swap the buffers of the current context. Only valid for double-buffered contexts.
- */
- void swapBuffers() throws LWJGLException;
-
- /**
- * Release the context from its drawable, if any.
- */
- void releaseDrawable(ByteBuffer context_handle) throws LWJGLException;
-
- /**
- * Release the current context (if any). After this call, no context is current.
- */
- void releaseCurrentContext() throws LWJGLException;
-
- /**
- * Update the context. Should be called whenever it's drawable is moved or resized
- */
- void update(ByteBuffer context_handle);
-
- /**
- * Query whether the context is current
- */
- void makeCurrent(PeerInfo peer_info, ByteBuffer handle) throws LWJGLException;
-
- /**
- * Query whether the context is current
- */
- boolean isCurrent(ByteBuffer handle) throws LWJGLException;
-
- void setSwapInterval(int value);
-
- /**
- * Destroys the Context.
- */
- void destroy(PeerInfo peer_info, ByteBuffer handle) throws LWJGLException;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import java.nio.ByteBuffer;
+import java.nio.IntBuffer;
+
+import org.lwjgl.LWJGLException;
+
+/**
+ * <p/>
+ * Context implementation interface.
+ * <p/>
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3116 $
+ * $Id: ContextImplementation.java 3116 2008-08-19 16:46:03Z spasi $
+ */
+interface ContextImplementation {
+ /**
+ * Create a context.
+ */
+ ByteBuffer create(PeerInfo peer_info, IntBuffer attribs, ByteBuffer shared_context_handle) throws LWJGLException;
+
+ /**
+ * Swap the buffers of the current context. Only valid for double-buffered contexts.
+ */
+ void swapBuffers() throws LWJGLException;
+
+ /**
+ * Release the context from its drawable, if any.
+ */
+ void releaseDrawable(ByteBuffer context_handle) throws LWJGLException;
+
+ /**
+ * Release the current context (if any). After this call, no context is current.
+ */
+ void releaseCurrentContext() throws LWJGLException;
+
+ /**
+ * Update the context. Should be called whenever it's drawable is moved or resized
+ */
+ void update(ByteBuffer context_handle);
+
+ /**
+ * Query whether the context is current
+ */
+ void makeCurrent(PeerInfo peer_info, ByteBuffer handle) throws LWJGLException;
+
+ /**
+ * Query whether the context is current
+ */
+ boolean isCurrent(ByteBuffer handle) throws LWJGLException;
+
+ void setSwapInterval(int value);
+
+ /**
+ * Destroys the Context.
+ */
+ void destroy(PeerInfo peer_info, ByteBuffer handle) throws LWJGLException;
+}
diff --git a/src/java/org/lwjgl/opengl/Display.java b/src/java/org/lwjgl/opengl/Display.java
index c9b960e..b344ef1 100644
--- a/src/java/org/lwjgl/opengl/Display.java
+++ b/src/java/org/lwjgl/opengl/Display.java
@@ -1,1127 +1,1127 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-/**
- * This is the abstract class for a Display in LWJGL. LWJGL displays have some
- * peculiar characteristics:
- *
- * - the display may be closeable by the user or operating system, and may be minimized
- * by the user or operating system
- * - only one display may ever be open at once
- * - the operating system may or may not be able to do fullscreen or windowed displays.
- *
- * @author foo
- */
-
-import org.lwjgl.BufferUtils;
-import org.lwjgl.LWJGLException;
-import org.lwjgl.LWJGLUtil;
-import org.lwjgl.Sys;
-import org.lwjgl.input.Controllers;
-import org.lwjgl.input.Keyboard;
-import org.lwjgl.input.Mouse;
-
-import java.awt.*;
-import java.awt.event.ComponentAdapter;
-import java.awt.event.ComponentEvent;
-import java.awt.event.ComponentListener;
-import java.nio.ByteBuffer;
-import java.nio.FloatBuffer;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Arrays;
-import java.util.HashSet;
-
-public final class Display {
-
- private static final Thread shutdown_hook = new Thread() {
- public void run() {
- reset();
- }
- };
-
- /** The display implementor */
- private static final DisplayImplementation display_impl;
-
- /** The initial display mode */
- private static final DisplayMode initial_mode;
-
- /** The parent, if any */
- private static Canvas parent;
-
- /** The current display mode, if created */
- private static DisplayMode current_mode;
-
- /** Timer for sync() */
- private static long timeThen;
-
- /** X coordinate of the window */
- private static int x = -1;
-
- /** Cached window icons, for when Display is recreated */
- private static ByteBuffer[] cached_icons;
-
- /**
- * Y coordinate of the window. Y in window coordinates is from the top of the display down,
- * unlike GL, where it is typically at the bottom of the display.
- */
- private static int y = -1;
-
- /** Title of the window (never null) */
- private static String title = "Game";
-
- /** Fullscreen */
- private static boolean fullscreen;
-
- /** Swap interval */
- private static int swap_interval;
-
- /** A unique context object, so we can track different contexts between creates() and destroys() */
- private static PeerInfo peer_info;
- private static Context context;
-
- /** The Drawable instance that tracks the current Display context */
- private final static Drawable drawable;
-
- private static boolean window_created = false;
-
- private static boolean parent_resized;
-
- /** Initial Background Color of Display */
- private static float r = 0, g = 0, b = 0;
-
- private static ComponentListener component_listener = new ComponentAdapter() {
- public void componentResized(ComponentEvent e) {
- synchronized ( GlobalLock.lock ) {
- parent_resized = true;
- }
- }
- };
-
- static {
- Sys.initialize();
- display_impl = createDisplayImplementation();
- try {
- current_mode = initial_mode = display_impl.init();
- LWJGLUtil.log("Initial mode: " + initial_mode);
- } catch (LWJGLException e) {
- throw new RuntimeException(e);
- }
- drawable = new Drawable() {
- public Context getContext() {
- synchronized ( GlobalLock.lock ) {
- return isCreated() ? context : null;
- }
- }
- };
- }
-
- /**
- * Fetch the Drawable from the Display.
- *
- * @return the Drawable corresponding to the Display context
- */
- public static Drawable getDrawable() {
- return drawable;
- }
-
- private static DisplayImplementation createDisplayImplementation() {
- switch ( LWJGLUtil.getPlatform() ) {
- case LWJGLUtil.PLATFORM_LINUX:
- return new LinuxDisplay();
- case LWJGLUtil.PLATFORM_WINDOWS:
- return new WindowsDisplay();
- case LWJGLUtil.PLATFORM_MACOSX:
- return new MacOSXDisplay();
- default:
- throw new IllegalStateException("Unsupported platform");
- }
- }
-
- /** Only constructed by ourselves */
- private Display() {
- }
-
- /**
- * Returns the entire list of possible fullscreen display modes as an array, in no
- * particular order. Although best attempts to filter out invalid modes are done, any
- * given mode is not guaranteed to be available nor is it guaranteed to be within the
- * current monitor specs (this is especially a problem with the frequency parameter).
- * Furthermore, it is not guaranteed that create() will detect an illegal display mode.
- * <p/>
- * The only certain way to check
- * is to call create() and make sure it works.
- * Only non-palette-indexed modes are returned (ie. bpp will be 16, 24, or 32).
- * Only DisplayModes from this call can be used when the Display is in fullscreen
- * mode.
- *
- * @return an array of all display modes the system reckons it can handle.
- */
- public static DisplayMode[] getAvailableDisplayModes() throws LWJGLException {
- synchronized ( GlobalLock.lock ) {
- DisplayMode[] unfilteredModes = display_impl.getAvailableDisplayModes();
-
- if ( unfilteredModes == null ) {
- return new DisplayMode[0];
- }
-
- // We'll use a HashSet to filter out the duplicated modes
- HashSet modes = new HashSet(unfilteredModes.length);
-
- modes.addAll(Arrays.asList(unfilteredModes));
- DisplayMode[] filteredModes = new DisplayMode[modes.size()];
- modes.toArray(filteredModes);
-
- LWJGLUtil.log("Removed " + (unfilteredModes.length - filteredModes.length) + " duplicate displaymodes");
-
- return filteredModes;
- }
- }
-
- /**
- * Return the initial desktop display mode.
- *
- * @return The desktop display mode
- */
- public static DisplayMode getDesktopDisplayMode() {
- return initial_mode;
- }
-
- /**
- * Return the current display mode, as set by setDisplayMode().
- *
- * @return The current display mode
- */
- public static DisplayMode getDisplayMode() {
- return current_mode;
- }
-
- /**
- * Set the current display mode. If no OpenGL context has been created, the given mode will apply to
- * the context when create() is called, and no immediate mode switching will happen. If there is a
- * context already, it will be resized according to the given mode. If the context is also a
- * fullscreen context, the mode will also be switched immediately. The native cursor position
- * is also reset.
- *
- * @param mode The new display mode to set
- *
- * @throws LWJGLException if the display mode could not be set
- */
- public static void setDisplayMode(DisplayMode mode) throws LWJGLException {
- synchronized (GlobalLock.lock) {
- if (mode == null)
- throw new NullPointerException("mode must be non-null");
- boolean was_fullscreen = isFullscreen();
- current_mode = mode;
- if (isCreated()) {
- destroyWindow();
- // If mode is not fullscreen capable, make sure we are in windowed mode
- try {
- if (was_fullscreen && !isFullscreen())
- display_impl.resetDisplayMode();
- else if (isFullscreen())
- switchDisplayMode();
- createWindow();
- makeCurrentAndSetSwapInterval();
- } catch (LWJGLException e) {
- destroyContext();
- destroyPeerInfo();
- display_impl.resetDisplayMode();
- throw e;
- }
- }
- }
- }
-
- private static DisplayMode getEffectiveMode() {
- return !isFullscreen() && parent != null ? new DisplayMode(parent.getWidth(), parent.getHeight()) : current_mode;
- }
-
- private static int getWindowX() {
- if (!isFullscreen() && parent == null) {
- // if no display location set, center window
- if (x == -1) {
- return Math.max(0, (initial_mode.getWidth() - current_mode.getWidth()) / 2);
- } else {
- return x;
- }
- } else {
- return 0;
- }
- }
-
- private static int getWindowY() {
- if (!isFullscreen() && parent == null) {
- // if no display location set, center window
- if ( y == -1 ) {
- return Math.max(0, (initial_mode.getHeight() - current_mode.getHeight()) / 2);
- } else {
- return y;
- }
- } else {
- return 0;
- }
- }
-
- /**
- * Create the native window peer from the given mode and fullscreen flag.
- * A native context must exist, and it will be attached to the window.
- */
- private static void createWindow() throws LWJGLException {
- if ( window_created ) {
- return;
- }
- Canvas tmp_parent = isFullscreen() ? null : parent;
- if ( tmp_parent != null && !tmp_parent.isDisplayable() ) // Only a best effort check, since the parent can turn undisplayable hereafter
- throw new LWJGLException("Parent.isDisplayable() must be true");
- if ( tmp_parent != null ) {
- tmp_parent.addComponentListener(component_listener);
- }
- DisplayMode mode = getEffectiveMode();
- display_impl.createWindow(mode, tmp_parent, getWindowX(), getWindowY());
- window_created = true;
-
- setTitle(title);
- initControls();
-
- // set cached window icon if exists
- if ( cached_icons != null ) {
- setIcon(cached_icons);
- } else {
- setIcon(new ByteBuffer[] { LWJGLUtil.LWJGLIcon32x32, LWJGLUtil.LWJGLIcon16x16 });
- }
- }
-
- private static void releaseDrawable() {
- try {
- if ( context != null && context.isCurrent() ) {
- Context.releaseCurrentContext();
- context.releaseDrawable();
- }
- } catch (LWJGLException e) {
- LWJGLUtil.log("Exception occurred while trying to release context: " + e);
- }
- }
-
- private static void destroyWindow() {
- if ( !window_created ) {
- return;
- }
- if ( parent != null ) {
- parent.removeComponentListener(component_listener);
- }
- releaseDrawable();
-
- // Automatically destroy keyboard & mouse
- if ( Mouse.isCreated() ) {
- Mouse.destroy();
- }
- if ( Keyboard.isCreated() ) {
- Keyboard.destroy();
- }
- display_impl.destroyWindow();
- window_created = false;
- }
-
- private static void switchDisplayMode() throws LWJGLException {
- if ( !current_mode.isFullscreenCapable() ) {
- throw new IllegalStateException("Only modes acquired from getAvailableDisplayModes() can be used for fullscreen display");
- }
- display_impl.switchDisplayMode(current_mode);
- }
-
- /**
- * Set the display configuration to the specified gamma, brightness and contrast.
- * The configuration changes will be reset when destroy() is called.
- *
- * @param gamma The gamma value
- * @param brightness The brightness value between -1.0 and 1.0, inclusive
- * @param contrast The contrast, larger than 0.0.
- */
- public static void setDisplayConfiguration(float gamma, float brightness, float contrast) throws LWJGLException {
- synchronized ( GlobalLock.lock ) {
- if ( !isCreated() ) {
- throw new LWJGLException("Display not yet created.");
- }
- if ( brightness < -1.0f || brightness > 1.0f )
- throw new IllegalArgumentException("Invalid brightness value");
- if ( contrast < 0.0f )
- throw new IllegalArgumentException("Invalid contrast value");
- int rampSize = display_impl.getGammaRampLength();
- if ( rampSize == 0 ) {
- throw new LWJGLException("Display configuration not supported");
- }
- FloatBuffer gammaRamp = BufferUtils.createFloatBuffer(rampSize);
- for ( int i = 0; i < rampSize; i++ ) {
- float intensity = (float)i / (rampSize - 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.put(i, rampEntry);
- }
- display_impl.setGammaRamp(gammaRamp);
- LWJGLUtil.log("Gamma set, gamma = " + gamma + ", brightness = " + brightness + ", contrast = " + contrast);
- }
- }
-
- private static long timeLate;
-
- /**
- * Best sync method that works reliably.
- *
- * @param fps The desired frame rate, in frames per second
- */
- public static void sync(int fps) {
- long timeNow;
- long gapTo;
- long savedTimeLate;
- synchronized ( GlobalLock.lock ) {
- gapTo = Sys.getTimerResolution() / fps + timeThen;
- timeNow = Sys.getTime();
- savedTimeLate = timeLate;
- }
-
- while ( gapTo > timeNow + savedTimeLate ) {
- try {
- Thread.sleep(1);
- } catch (InterruptedException e) {
- }
- timeNow = Sys.getTime();
- }
-
- synchronized ( GlobalLock.lock ) {
- if ( gapTo < timeNow )
- timeLate = timeNow - gapTo;
- else
- timeLate = 0;
-
- timeThen = timeNow;
- }
- }
-
- /** @return the title of the window */
- public static String getTitle() {
- synchronized ( GlobalLock.lock ) {
- return title;
- }
- }
-
- /** Return the last parent set with setParent(). */
- public static Canvas getParent() {
- synchronized ( GlobalLock.lock ) {
- return parent;
- }
- }
-
- /**
- * Set the parent of the Display. If parent is null, the Display will appear as a top level window.
- * If parent is not null, the Display is made a child of the parent. A parent's isDisplayable() must be true when
- * setParent() is called and remain true until setParent() is called again with
- * null or a different parent. This generally means that the parent component must remain added to it's parent container.<p>
- * It is not advisable to call this method from an AWT thread, since the context will be made current on the thread
- * and it is difficult to predict which AWT thread will process any given AWT event.<p>
- * While the Display is in fullscreen mode, the current parent will be ignored. Additionally, when a non null parent is specified,
- * the Dispaly will inherit the size of the parent, disregarding the currently set display mode.<p>
- */
- public static void setParent(Canvas parent) throws LWJGLException {
- synchronized ( GlobalLock.lock ) {
- if (Display.parent != parent) {
- Display.parent = parent;
- if ( !isCreated() )
- return;
- destroyWindow();
- try {
- if (isFullscreen()) {
- switchDisplayMode();
- } else {
- display_impl.resetDisplayMode();
- }
- createWindow();
- makeCurrentAndSetSwapInterval();
- } catch (LWJGLException e) {
- destroyContext();
- destroyPeerInfo();
- display_impl.resetDisplayMode();
- throw e;
- }
- }
- }
- }
-
- /**
- * Set the fullscreen mode of the context. If no context has been created through create(),
- * the mode will apply when create() is called. If fullscreen is true, the context will become
- * a fullscreen context and the display mode is switched to the mode given by getDisplayMode(). If
- * fullscreen is false, the context will become a windowed context with the dimensions given in the
- * mode returned by getDisplayMode(). The native cursor position is also reset.
- *
- * @param fullscreen Specify the fullscreen mode of the context.
- *
- * @throws LWJGLException If fullscreen is true, and the current DisplayMode instance is not
- * from getAvailableDisplayModes() or if the mode switch fails.
- */
- public static void setFullscreen(boolean fullscreen) throws LWJGLException {
- setDisplayModeAndFullscreenInternal(fullscreen, current_mode);
- }
-
- /**
- * Set the mode of the context. If no context has been created through create(),
- * the mode will apply when create() is called. If mode.isFullscreenCapable() is true, the context will become
- * a fullscreen context and the display mode is switched to the mode given by getDisplayMode(). If
- * mode.isFullscreenCapable() is false, the context will become a windowed context with the dimensions given in the
- * mode returned by getDisplayMode(). The native cursor position is also reset.
- *
- * @param mode The new display mode to set. Must be non-null.
- *
- * @throws LWJGLException If the mode switch fails.
- */
- public static void setDisplayModeAndFullscreen(DisplayMode mode) throws LWJGLException {
- setDisplayModeAndFullscreenInternal(mode.isFullscreenCapable(), mode);
- }
-
- private static void setDisplayModeAndFullscreenInternal(boolean fullscreen, DisplayMode mode) throws LWJGLException {
- synchronized ( GlobalLock.lock ) {
- if (mode == null)
- throw new NullPointerException("mode must be non-null");
- DisplayMode old_mode = current_mode;
- current_mode = mode;
- boolean was_fullscreen = isFullscreen();
- Display.fullscreen = fullscreen;
- if (was_fullscreen != isFullscreen() || !mode.equals(old_mode)) {
- if (!isCreated())
- return;
- destroyWindow();
- try {
- if (isFullscreen()) {
- switchDisplayMode();
- } else {
- display_impl.resetDisplayMode();
- }
- createWindow();
- makeCurrentAndSetSwapInterval();
- } catch (LWJGLException e) {
- destroyContext();
- destroyPeerInfo();
- display_impl.resetDisplayMode();
- throw e;
- }
- }
- }
- }
-
- /** @return whether the Display is in fullscreen mode */
- public static boolean isFullscreen() {
- synchronized (GlobalLock.lock) {
- return fullscreen && current_mode.isFullscreenCapable();
- }
- }
-
- /**
- * Set the title of the window. This may be ignored by the underlying OS.
- *
- * @param newTitle The new window title
- */
- public static void setTitle(String newTitle) {
- synchronized ( GlobalLock.lock ) {
- if ( newTitle == null ) {
- newTitle = "";
- }
- title = newTitle;
- if ( isCreated() )
- display_impl.setTitle(title);
- }
- }
-
- /** @return true if the user or operating system has asked the window to close */
- public static boolean isCloseRequested() {
- synchronized ( GlobalLock.lock ) {
- if ( !isCreated() )
- throw new IllegalStateException("Cannot determine close requested state of uncreated window");
- return display_impl.isCloseRequested();
- }
- }
-
- /** @return true if the window is visible, false if not */
- public static boolean isVisible() {
- synchronized ( GlobalLock.lock ) {
- if ( !isCreated() )
- throw new IllegalStateException("Cannot determine minimized state of uncreated window");
- return display_impl.isVisible();
- }
- }
-
- /** @return true if window is active, that is, the foreground display of the operating system. */
- public static boolean isActive() {
- synchronized ( GlobalLock.lock ) {
- if ( !isCreated() )
- throw new IllegalStateException("Cannot determine focused state of uncreated window");
- return display_impl.isActive();
- }
- }
-
- /**
- * Determine if the window's contents have been damaged by external events.
- * If you are writing a straightforward game rendering loop and simply paint
- * every frame regardless, you can ignore this flag altogether. If you are
- * trying to be kind to other processes you can check this flag and only
- * redraw when it returns true. The flag is cleared when update() or isDirty() is called.
- *
- * @return true if the window has been damaged by external changes
- * and needs to repaint itself
- */
- public static boolean isDirty() {
- synchronized ( GlobalLock.lock ) {
- if ( !isCreated() )
- throw new IllegalStateException("Cannot determine dirty state of uncreated window");
- return display_impl.isDirty();
- }
- }
-
- /**
- * Process operating system events. Call this to update the Display's state and to receive new
- * input device events. This method is called from update(), so it is not necessary to call
- * this method if update() is called periodically.
- */
- public static void processMessages() {
- synchronized ( GlobalLock.lock ) {
- if ( !isCreated() )
- throw new IllegalStateException("Display not created");
-
- display_impl.update();
- }
- pollDevices();
- }
-
- /**
- * Swap the display buffers. This method is called from update(), and should normally not be called by
- * the application.
- *
- * @throws OpenGLException if an OpenGL error has occured since the last call to GL11.glGetError()
- */
- public static void swapBuffers() throws LWJGLException {
- synchronized ( GlobalLock.lock ) {
- if ( !isCreated() )
- throw new IllegalStateException("Display not created");
-
- if ( LWJGLUtil.DEBUG )
- Util.checkGLError();
- Context.swapBuffers();
- }
- }
-
- /**
- * Update the window. If the window is visible clears
- * the dirty flag and calls swapBuffers() and finally
- * polls the input devices.
- *
- */
- public static void update() {
- update(true);
- }
-
- /**
- * Update the window. If the window is visible clears
- * the dirty flag and calls swapBuffers() and finally
- * polls the input devices if processMessages is true.
- *
- * @param processMessages Poll input devices if true
- */
- public static void update(boolean processMessages) {
- synchronized ( GlobalLock.lock ) {
- if ( !isCreated() )
- throw new IllegalStateException("Display not created");
-
- // We paint only when the window is visible or dirty
- if ( display_impl.isVisible() || display_impl.isDirty() ) {
- try {
- swapBuffers();
- } catch (LWJGLException e) {
- throw new RuntimeException(e);
- }
- }
-
- if ( parent_resized ) {
- reshape();
- parent_resized = false;
- }
-
- if ( processMessages )
- processMessages();
- }
- }
-
- static void pollDevices() {
- // Poll the input devices while we're here
- if ( Mouse.isCreated() ) {
- Mouse.poll();
- Mouse.updateCursor();
- }
-
- if ( Keyboard.isCreated() ) {
- Keyboard.poll();
- }
-
- if ( Controllers.isCreated() ) {
- Controllers.poll();
- }
- }
-
- /**
- * Release the Display context.
- *
- * @throws LWJGLException If the context could not be released
- */
- public static void releaseContext() throws LWJGLException {
- synchronized ( GlobalLock.lock ) {
- if ( !isCreated() )
- throw new IllegalStateException("Display is not created");
- if ( context.isCurrent() )
- Context.releaseCurrentContext();
- }
- }
-
- /**
- * Make the Display the current rendering context for GL calls.
- *
- * @throws LWJGLException If the context could not be made current
- */
- public static void makeCurrent() throws LWJGLException {
- synchronized ( GlobalLock.lock ) {
- if ( !isCreated() )
- throw new IllegalStateException("Display is not created");
- context.makeCurrent();
- }
- }
-
- private static void removeShutdownHook() {
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- Runtime.getRuntime().removeShutdownHook(shutdown_hook);
- return null;
- }
- });
- }
-
- private static void registerShutdownHook() {
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- Runtime.getRuntime().addShutdownHook(shutdown_hook);
- return null;
- }
- });
- }
-
- /**
- * Create the OpenGL context. If isFullscreen() is true or if windowed
- * context are not supported on the platform, the display mode will be switched to the mode returned by
- * getDisplayMode(), and a fullscreen context will be created. If isFullscreen() is false, a windowed context
- * will be created with the dimensions given in the mode returned by getDisplayMode(). If a context can't be
- * created with the given parameters, a LWJGLException will be thrown.
- * <p/>
- * <p>The window created will be set up in orthographic 2D projection, with 1:1 pixel ratio with GL coordinates.
- *
- * @throws LWJGLException
- */
- public static void create() throws LWJGLException {
- synchronized ( GlobalLock.lock ) {
- create(new PixelFormat());
- }
- }
-
- /**
- * Create the OpenGL context with the given minimum parameters. If isFullscreen() is true or if windowed
- * context are not supported on the platform, the display mode will be switched to the mode returned by
- * getDisplayMode(), and a fullscreen context will be created. If isFullscreen() is false, a windowed context
- * will be created with the dimensions given in the mode returned by getDisplayMode(). If a context can't be
- * created with the given parameters, a LWJGLException will be thrown.
- * <p/>
- * <p>The window created will be set up in orthographic 2D projection, with 1:1 pixel ratio with GL coordinates.
- *
- * @param pixel_format Describes the minimum specifications the context must fulfill.
- *
- * @throws LWJGLException
- */
- public static void create(PixelFormat pixel_format) throws LWJGLException {
- synchronized ( GlobalLock.lock ) {
- create(pixel_format, null, null);
- }
- }
-
- /**
- * Create the OpenGL context with the given minimum parameters. If isFullscreen() is true or if windowed
- * context are not supported on the platform, the display mode will be switched to the mode returned by
- * getDisplayMode(), and a fullscreen context will be created. If isFullscreen() is false, a windowed context
- * will be created with the dimensions given in the mode returned by getDisplayMode(). If a context can't be
- * created with the given parameters, a LWJGLException will be thrown.
- * <p/>
- * <p>The window created will be set up in orthographic 2D projection, with 1:1 pixel ratio with GL coordinates.
- *
- * @param pixel_format Describes the minimum specifications the context must fulfill.
- * @param shared_drawable The Drawable to share context with. (optional, may be null)
- *
- * @throws LWJGLException
- */
- public static void create(PixelFormat pixel_format, Drawable shared_drawable) throws LWJGLException {
- synchronized ( GlobalLock.lock ) {
- create(pixel_format, shared_drawable, null);
- }
- }
-
- /**
- * Create the OpenGL context with the given minimum parameters. If isFullscreen() is true or if windowed
- * context are not supported on the platform, the display mode will be switched to the mode returned by
- * getDisplayMode(), and a fullscreen context will be created. If isFullscreen() is false, a windowed context
- * will be created with the dimensions given in the mode returned by getDisplayMode(). If a context can't be
- * created with the given parameters, a LWJGLException will be thrown.
- * <p/>
- * <p>The window created will be set up in orthographic 2D projection, with 1:1 pixel ratio with GL coordinates.
- *
- * @param pixel_format Describes the minimum specifications the context must fulfill.
- * @param attribs The ContextAttribs to use when creating the context. (optional, may be null)
- *
- * @throws LWJGLException
- */
- public static void create(PixelFormat pixel_format, ContextAttribs attribs) throws LWJGLException {
- synchronized ( GlobalLock.lock ) {
- create(pixel_format, null, attribs);
- }
- }
-
- /**
- * Create the OpenGL context with the given minimum parameters. If isFullscreen() is true or if windowed
- * context are not supported on the platform, the display mode will be switched to the mode returned by
- * getDisplayMode(), and a fullscreen context will be created. If isFullscreen() is false, a windowed context
- * will be created with the dimensions given in the mode returned by getDisplayMode(). If a context can't be
- * created with the given parameters, a LWJGLException will be thrown.
- * <p/>
- * <p>The window created will be set up in orthographic 2D projection, with 1:1 pixel ratio with GL coordinates.
- *
- * @param pixel_format Describes the minimum specifications the context must fulfill.
- * @param shared_drawable The Drawable to share context with. (optional, may be null)
- * @param attribs The ContextAttribs to use when creating the context. (optional, may be null)
- *
- * @throws LWJGLException
- */
- public static void create(PixelFormat pixel_format, Drawable shared_drawable, ContextAttribs attribs) throws LWJGLException {
- synchronized ( GlobalLock.lock ) {
- if ( isCreated() )
- throw new IllegalStateException("Only one LWJGL context may be instantiated at any one time.");
- if ( pixel_format == null )
- throw new NullPointerException("pixel_format cannot be null");
- removeShutdownHook();
- registerShutdownHook();
- if (isFullscreen())
- switchDisplayMode();
- try {
- peer_info = display_impl.createPeerInfo(pixel_format);
- try {
- createWindow();
- try {
- context = new Context(peer_info, attribs, shared_drawable != null ? shared_drawable.getContext() : null);
- try {
- makeCurrentAndSetSwapInterval();
- initContext();
- } catch (LWJGLException e) {
- destroyContext();
- throw e;
- }
- } catch (LWJGLException e) {
- destroyWindow();
- throw e;
- }
- } catch (LWJGLException e) {
- destroyPeerInfo();
- throw e;
- }
- } catch (LWJGLException e) {
- display_impl.resetDisplayMode();
- throw e;
- }
- }
- }
-
- /**
- * Set the initial color of the Display. This method is called before the Display is created and will set the
- * background color to the one specified in this method.
- *
- * @param red - color value between 0 - 1
- * @param green - color value between 0 - 1
- * @param blue - color value between 0 - 1
- */
- public static void setInitialBackground(float red, float green, float blue) {
- r = red;
- g = green;
- b = blue;
- }
-
- private static void makeCurrentAndSetSwapInterval() throws LWJGLException {
- makeCurrent();
- try {
- Util.checkGLError();
- } catch (OpenGLException e) {
- LWJGLUtil.log("OpenGL error during context creation: " + e.getMessage());
- }
- setSwapInterval(swap_interval);
- }
-
- private static void initContext() {
- // set background clear color
- GL11.glClearColor(r, g, b, 1.0f);
- // Clear window to avoid the desktop "showing through"
- GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
- update();
- }
-
- static DisplayImplementation getImplementation() {
- return display_impl;
- }
-
- /** Gets a boolean property as a privileged action. */
- static boolean getPrivilegedBoolean(final String property_name) {
- Boolean value = (Boolean)AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return new Boolean(Boolean.getBoolean(property_name));
- }
- });
- return value.booleanValue();
- }
-
- private static void initControls() {
- // Automatically create mouse, keyboard and controller
- if ( !getPrivilegedBoolean("org.lwjgl.opengl.Display.noinput") ) {
- if ( !Mouse.isCreated() && !getPrivilegedBoolean("org.lwjgl.opengl.Display.nomouse") ) {
- try {
- Mouse.create();
- } catch (LWJGLException e) {
- if ( LWJGLUtil.DEBUG ) {
- e.printStackTrace(System.err);
- } else {
- LWJGLUtil.log("Failed to create Mouse: " + e);
- }
- }
- }
- if ( !Keyboard.isCreated() && !getPrivilegedBoolean("org.lwjgl.opengl.Display.nokeyboard") ) {
- try {
- Keyboard.create();
- } catch (LWJGLException e) {
- if ( LWJGLUtil.DEBUG ) {
- e.printStackTrace(System.err);
- } else {
- LWJGLUtil.log("Failed to create Keyboard: " + e);
- }
- }
- }
- }
- }
-
- /**
- * Destroy the Display. After this call, there will be no current GL rendering context,
- * regardless of whether the Display was the current rendering context.
- */
- public static void destroy() {
- synchronized ( GlobalLock.lock ) {
- if ( !isCreated() ) {
- return;
- }
-
- releaseDrawable();
- destroyContext();
- destroyWindow();
- destroyPeerInfo();
- x = y = -1;
- cached_icons = null;
- reset();
- removeShutdownHook();
- }
- }
-
- private static void destroyPeerInfo() {
- peer_info.destroy();
- peer_info = null;
- }
-
- private static void destroyContext() {
- try {
- context.forceDestroy();
- } catch (LWJGLException e) {
- throw new RuntimeException(e);
- } finally {
- context = null;
- }
- }
-
- /*
- * Reset display mode if fullscreen. This method is also called from the shutdown hook added
- * in the static constructor
- */
- private static void reset() {
- display_impl.resetDisplayMode();
- current_mode = initial_mode;
- }
-
- /** @return true if the window's native peer has been created */
- public static boolean isCreated() {
- synchronized ( GlobalLock.lock ) {
- return window_created;
- }
- }
-
- /**
- * Set the buffer swap interval. This call is a best-attempt at changing
- * the monitor swap interval, which is the minimum periodicity of color buffer swaps,
- * measured in video frame periods, and is not guaranteed to be successful.
- * <p/>
- * A video frame period is the time required to display a full frame of video data.
- *
- * @param value The swap interval in frames, 0 to disable
- */
- public static void setSwapInterval(int value) {
- synchronized ( GlobalLock.lock ) {
- swap_interval = value;
- if ( isCreated() )
- Context.setSwapInterval(swap_interval);
- }
- }
-
- /**
- * Enable or disable vertical monitor synchronization. This call is a best-attempt at changing
- * the vertical refresh synchronization of the monitor, and is not guaranteed to be successful.
- *
- * @param sync true to synchronize; false to ignore synchronization
- */
- public static void setVSyncEnabled(boolean sync) {
- synchronized ( GlobalLock.lock ) {
- setSwapInterval(sync ? 1 : 0);
- }
- }
-
- /**
- * Set the window's location. This is a no-op on fullscreen windows or when getParent() != null.
- * The window is clamped to remain entirely on the screen. If you attempt
- * to position the window such that it would extend off the screen, the window
- * is simply placed as close to the edge as possible.
- * <br><b>note</b>If no location has been specified (or x == y == -1) the window will be centered
- *
- * @param new_x The new window location on the x axis
- * @param new_y The new window location on the y axis
- */
- public static void setLocation(int new_x, int new_y) {
- synchronized ( GlobalLock.lock ) {
- // cache position
- x = new_x;
- y = new_y;
-
- // offset if already created
- if (isCreated() && !isFullscreen()) {
- reshape();
- }
- }
- }
-
- private static void reshape() {
- DisplayMode mode = getEffectiveMode();
- display_impl.reshape(getWindowX(), getWindowY(), mode.getWidth(), mode.getHeight());
- }
-
- /**
- * Get the driver adapter string. This is a unique string describing the actual card's hardware, eg. "Geforce2", "PS2",
- * "Radeon9700". If the adapter cannot be determined, this function returns null.
- *
- * @return a String
- */
- public static String getAdapter() {
- synchronized ( GlobalLock.lock ) {
- return display_impl.getAdapter();
- }
- }
-
- /**
- * Get the driver version. This is a vendor/adapter specific version string. If the version cannot be determined,
- * this function returns null.
- *
- * @return a String
- */
- public static String getVersion() {
- synchronized ( GlobalLock.lock ) {
- return display_impl.getVersion();
- }
- }
-
- /**
- * Sets one or more icons for the Display.
- * <ul>
- * <li>On Windows you should supply at least one 16x16 icon and one 32x32.</li>
- * <li>Linux (and similar platforms) expect one 32x32 icon.</li>
- * <li>Mac OS X should be supplied one 128x128 icon</li>
- * </ul>
- * The implementation will use the supplied ByteBuffers with image data in RGBA and perform any conversions nescesarry for the specific platform.
- * <p/>
- * <b>NOTE:</b> The display will make a deep copy of the supplied byte buffer array, for the purpose
- * of recreating the icons when you go back and forth fullscreen mode. You therefore only need to
- * set the icon once per instance.
- *
- * @param icons Array of icons in RGBA mode. Pass the icons in order of preference.
- *
- * @return number of icons used, or 0 if display hasn't been created
- */
- public static int setIcon(ByteBuffer[] icons) {
- synchronized ( GlobalLock.lock ) {
- // make deep copy so we dont rely on the supplied buffers later on
- // don't recache!
- if ( cached_icons != icons ) {
- cached_icons = new ByteBuffer[icons.length];
- for ( int i = 0; i < icons.length; i++ ) {
- cached_icons[i] = BufferUtils.createByteBuffer(icons[i].capacity());
- int old_position = icons[i].position();
- cached_icons[i].put(icons[i]);
- icons[i].position(old_position);
- cached_icons[i].flip();
- }
- }
-
- if ( Display.isCreated() && parent == null ) {
- return display_impl.setIcon(cached_icons);
- } else {
- return 0;
- }
- }
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+/**
+ * This is the abstract class for a Display in LWJGL. LWJGL displays have some
+ * peculiar characteristics:
+ *
+ * - the display may be closeable by the user or operating system, and may be minimized
+ * by the user or operating system
+ * - only one display may ever be open at once
+ * - the operating system may or may not be able to do fullscreen or windowed displays.
+ *
+ * @author foo
+ */
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.LWJGLException;
+import org.lwjgl.LWJGLUtil;
+import org.lwjgl.Sys;
+import org.lwjgl.input.Controllers;
+import org.lwjgl.input.Keyboard;
+import org.lwjgl.input.Mouse;
+
+import java.awt.*;
+import java.awt.event.ComponentAdapter;
+import java.awt.event.ComponentEvent;
+import java.awt.event.ComponentListener;
+import java.nio.ByteBuffer;
+import java.nio.FloatBuffer;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.Arrays;
+import java.util.HashSet;
+
+public final class Display {
+
+ private static final Thread shutdown_hook = new Thread() {
+ public void run() {
+ reset();
+ }
+ };
+
+ /** The display implementor */
+ private static final DisplayImplementation display_impl;
+
+ /** The initial display mode */
+ private static final DisplayMode initial_mode;
+
+ /** The parent, if any */
+ private static Canvas parent;
+
+ /** The current display mode, if created */
+ private static DisplayMode current_mode;
+
+ /** Timer for sync() */
+ private static long timeThen;
+
+ /** X coordinate of the window */
+ private static int x = -1;
+
+ /** Cached window icons, for when Display is recreated */
+ private static ByteBuffer[] cached_icons;
+
+ /**
+ * Y coordinate of the window. Y in window coordinates is from the top of the display down,
+ * unlike GL, where it is typically at the bottom of the display.
+ */
+ private static int y = -1;
+
+ /** Title of the window (never null) */
+ private static String title = "Game";
+
+ /** Fullscreen */
+ private static boolean fullscreen;
+
+ /** Swap interval */
+ private static int swap_interval;
+
+ /** A unique context object, so we can track different contexts between creates() and destroys() */
+ private static PeerInfo peer_info;
+ private static Context context;
+
+ /** The Drawable instance that tracks the current Display context */
+ private final static Drawable drawable;
+
+ private static boolean window_created = false;
+
+ private static boolean parent_resized;
+
+ /** Initial Background Color of Display */
+ private static float r = 0, g = 0, b = 0;
+
+ private static ComponentListener component_listener = new ComponentAdapter() {
+ public void componentResized(ComponentEvent e) {
+ synchronized ( GlobalLock.lock ) {
+ parent_resized = true;
+ }
+ }
+ };
+
+ static {
+ Sys.initialize();
+ display_impl = createDisplayImplementation();
+ try {
+ current_mode = initial_mode = display_impl.init();
+ LWJGLUtil.log("Initial mode: " + initial_mode);
+ } catch (LWJGLException e) {
+ throw new RuntimeException(e);
+ }
+ drawable = new Drawable() {
+ public Context getContext() {
+ synchronized ( GlobalLock.lock ) {
+ return isCreated() ? context : null;
+ }
+ }
+ };
+ }
+
+ /**
+ * Fetch the Drawable from the Display.
+ *
+ * @return the Drawable corresponding to the Display context
+ */
+ public static Drawable getDrawable() {
+ return drawable;
+ }
+
+ private static DisplayImplementation createDisplayImplementation() {
+ switch ( LWJGLUtil.getPlatform() ) {
+ case LWJGLUtil.PLATFORM_LINUX:
+ return new LinuxDisplay();
+ case LWJGLUtil.PLATFORM_WINDOWS:
+ return new WindowsDisplay();
+ case LWJGLUtil.PLATFORM_MACOSX:
+ return new MacOSXDisplay();
+ default:
+ throw new IllegalStateException("Unsupported platform");
+ }
+ }
+
+ /** Only constructed by ourselves */
+ private Display() {
+ }
+
+ /**
+ * Returns the entire list of possible fullscreen display modes as an array, in no
+ * particular order. Although best attempts to filter out invalid modes are done, any
+ * given mode is not guaranteed to be available nor is it guaranteed to be within the
+ * current monitor specs (this is especially a problem with the frequency parameter).
+ * Furthermore, it is not guaranteed that create() will detect an illegal display mode.
+ * <p/>
+ * The only certain way to check
+ * is to call create() and make sure it works.
+ * Only non-palette-indexed modes are returned (ie. bpp will be 16, 24, or 32).
+ * Only DisplayModes from this call can be used when the Display is in fullscreen
+ * mode.
+ *
+ * @return an array of all display modes the system reckons it can handle.
+ */
+ public static DisplayMode[] getAvailableDisplayModes() throws LWJGLException {
+ synchronized ( GlobalLock.lock ) {
+ DisplayMode[] unfilteredModes = display_impl.getAvailableDisplayModes();
+
+ if ( unfilteredModes == null ) {
+ return new DisplayMode[0];
+ }
+
+ // We'll use a HashSet to filter out the duplicated modes
+ HashSet modes = new HashSet(unfilteredModes.length);
+
+ modes.addAll(Arrays.asList(unfilteredModes));
+ DisplayMode[] filteredModes = new DisplayMode[modes.size()];
+ modes.toArray(filteredModes);
+
+ LWJGLUtil.log("Removed " + (unfilteredModes.length - filteredModes.length) + " duplicate displaymodes");
+
+ return filteredModes;
+ }
+ }
+
+ /**
+ * Return the initial desktop display mode.
+ *
+ * @return The desktop display mode
+ */
+ public static DisplayMode getDesktopDisplayMode() {
+ return initial_mode;
+ }
+
+ /**
+ * Return the current display mode, as set by setDisplayMode().
+ *
+ * @return The current display mode
+ */
+ public static DisplayMode getDisplayMode() {
+ return current_mode;
+ }
+
+ /**
+ * Set the current display mode. If no OpenGL context has been created, the given mode will apply to
+ * the context when create() is called, and no immediate mode switching will happen. If there is a
+ * context already, it will be resized according to the given mode. If the context is also a
+ * fullscreen context, the mode will also be switched immediately. The native cursor position
+ * is also reset.
+ *
+ * @param mode The new display mode to set
+ *
+ * @throws LWJGLException if the display mode could not be set
+ */
+ public static void setDisplayMode(DisplayMode mode) throws LWJGLException {
+ synchronized (GlobalLock.lock) {
+ if (mode == null)
+ throw new NullPointerException("mode must be non-null");
+ boolean was_fullscreen = isFullscreen();
+ current_mode = mode;
+ if (isCreated()) {
+ destroyWindow();
+ // If mode is not fullscreen capable, make sure we are in windowed mode
+ try {
+ if (was_fullscreen && !isFullscreen())
+ display_impl.resetDisplayMode();
+ else if (isFullscreen())
+ switchDisplayMode();
+ createWindow();
+ makeCurrentAndSetSwapInterval();
+ } catch (LWJGLException e) {
+ destroyContext();
+ destroyPeerInfo();
+ display_impl.resetDisplayMode();
+ throw e;
+ }
+ }
+ }
+ }
+
+ private static DisplayMode getEffectiveMode() {
+ return !isFullscreen() && parent != null ? new DisplayMode(parent.getWidth(), parent.getHeight()) : current_mode;
+ }
+
+ private static int getWindowX() {
+ if (!isFullscreen() && parent == null) {
+ // if no display location set, center window
+ if (x == -1) {
+ return Math.max(0, (initial_mode.getWidth() - current_mode.getWidth()) / 2);
+ } else {
+ return x;
+ }
+ } else {
+ return 0;
+ }
+ }
+
+ private static int getWindowY() {
+ if (!isFullscreen() && parent == null) {
+ // if no display location set, center window
+ if ( y == -1 ) {
+ return Math.max(0, (initial_mode.getHeight() - current_mode.getHeight()) / 2);
+ } else {
+ return y;
+ }
+ } else {
+ return 0;
+ }
+ }
+
+ /**
+ * Create the native window peer from the given mode and fullscreen flag.
+ * A native context must exist, and it will be attached to the window.
+ */
+ private static void createWindow() throws LWJGLException {
+ if ( window_created ) {
+ return;
+ }
+ Canvas tmp_parent = isFullscreen() ? null : parent;
+ if ( tmp_parent != null && !tmp_parent.isDisplayable() ) // Only a best effort check, since the parent can turn undisplayable hereafter
+ throw new LWJGLException("Parent.isDisplayable() must be true");
+ if ( tmp_parent != null ) {
+ tmp_parent.addComponentListener(component_listener);
+ }
+ DisplayMode mode = getEffectiveMode();
+ display_impl.createWindow(mode, tmp_parent, getWindowX(), getWindowY());
+ window_created = true;
+
+ setTitle(title);
+ initControls();
+
+ // set cached window icon if exists
+ if ( cached_icons != null ) {
+ setIcon(cached_icons);
+ } else {
+ setIcon(new ByteBuffer[] { LWJGLUtil.LWJGLIcon32x32, LWJGLUtil.LWJGLIcon16x16 });
+ }
+ }
+
+ private static void releaseDrawable() {
+ try {
+ if ( context != null && context.isCurrent() ) {
+ Context.releaseCurrentContext();
+ context.releaseDrawable();
+ }
+ } catch (LWJGLException e) {
+ LWJGLUtil.log("Exception occurred while trying to release context: " + e);
+ }
+ }
+
+ private static void destroyWindow() {
+ if ( !window_created ) {
+ return;
+ }
+ if ( parent != null ) {
+ parent.removeComponentListener(component_listener);
+ }
+ releaseDrawable();
+
+ // Automatically destroy keyboard & mouse
+ if ( Mouse.isCreated() ) {
+ Mouse.destroy();
+ }
+ if ( Keyboard.isCreated() ) {
+ Keyboard.destroy();
+ }
+ display_impl.destroyWindow();
+ window_created = false;
+ }
+
+ private static void switchDisplayMode() throws LWJGLException {
+ if ( !current_mode.isFullscreenCapable() ) {
+ throw new IllegalStateException("Only modes acquired from getAvailableDisplayModes() can be used for fullscreen display");
+ }
+ display_impl.switchDisplayMode(current_mode);
+ }
+
+ /**
+ * Set the display configuration to the specified gamma, brightness and contrast.
+ * The configuration changes will be reset when destroy() is called.
+ *
+ * @param gamma The gamma value
+ * @param brightness The brightness value between -1.0 and 1.0, inclusive
+ * @param contrast The contrast, larger than 0.0.
+ */
+ public static void setDisplayConfiguration(float gamma, float brightness, float contrast) throws LWJGLException {
+ synchronized ( GlobalLock.lock ) {
+ if ( !isCreated() ) {
+ throw new LWJGLException("Display not yet created.");
+ }
+ if ( brightness < -1.0f || brightness > 1.0f )
+ throw new IllegalArgumentException("Invalid brightness value");
+ if ( contrast < 0.0f )
+ throw new IllegalArgumentException("Invalid contrast value");
+ int rampSize = display_impl.getGammaRampLength();
+ if ( rampSize == 0 ) {
+ throw new LWJGLException("Display configuration not supported");
+ }
+ FloatBuffer gammaRamp = BufferUtils.createFloatBuffer(rampSize);
+ for ( int i = 0; i < rampSize; i++ ) {
+ float intensity = (float)i / (rampSize - 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.put(i, rampEntry);
+ }
+ display_impl.setGammaRamp(gammaRamp);
+ LWJGLUtil.log("Gamma set, gamma = " + gamma + ", brightness = " + brightness + ", contrast = " + contrast);
+ }
+ }
+
+ private static long timeLate;
+
+ /**
+ * Best sync method that works reliably.
+ *
+ * @param fps The desired frame rate, in frames per second
+ */
+ public static void sync(int fps) {
+ long timeNow;
+ long gapTo;
+ long savedTimeLate;
+ synchronized ( GlobalLock.lock ) {
+ gapTo = Sys.getTimerResolution() / fps + timeThen;
+ timeNow = Sys.getTime();
+ savedTimeLate = timeLate;
+ }
+
+ while ( gapTo > timeNow + savedTimeLate ) {
+ try {
+ Thread.sleep(1);
+ } catch (InterruptedException e) {
+ }
+ timeNow = Sys.getTime();
+ }
+
+ synchronized ( GlobalLock.lock ) {
+ if ( gapTo < timeNow )
+ timeLate = timeNow - gapTo;
+ else
+ timeLate = 0;
+
+ timeThen = timeNow;
+ }
+ }
+
+ /** @return the title of the window */
+ public static String getTitle() {
+ synchronized ( GlobalLock.lock ) {
+ return title;
+ }
+ }
+
+ /** Return the last parent set with setParent(). */
+ public static Canvas getParent() {
+ synchronized ( GlobalLock.lock ) {
+ return parent;
+ }
+ }
+
+ /**
+ * Set the parent of the Display. If parent is null, the Display will appear as a top level window.
+ * If parent is not null, the Display is made a child of the parent. A parent's isDisplayable() must be true when
+ * setParent() is called and remain true until setParent() is called again with
+ * null or a different parent. This generally means that the parent component must remain added to it's parent container.<p>
+ * It is not advisable to call this method from an AWT thread, since the context will be made current on the thread
+ * and it is difficult to predict which AWT thread will process any given AWT event.<p>
+ * While the Display is in fullscreen mode, the current parent will be ignored. Additionally, when a non null parent is specified,
+ * the Dispaly will inherit the size of the parent, disregarding the currently set display mode.<p>
+ */
+ public static void setParent(Canvas parent) throws LWJGLException {
+ synchronized ( GlobalLock.lock ) {
+ if (Display.parent != parent) {
+ Display.parent = parent;
+ if ( !isCreated() )
+ return;
+ destroyWindow();
+ try {
+ if (isFullscreen()) {
+ switchDisplayMode();
+ } else {
+ display_impl.resetDisplayMode();
+ }
+ createWindow();
+ makeCurrentAndSetSwapInterval();
+ } catch (LWJGLException e) {
+ destroyContext();
+ destroyPeerInfo();
+ display_impl.resetDisplayMode();
+ throw e;
+ }
+ }
+ }
+ }
+
+ /**
+ * Set the fullscreen mode of the context. If no context has been created through create(),
+ * the mode will apply when create() is called. If fullscreen is true, the context will become
+ * a fullscreen context and the display mode is switched to the mode given by getDisplayMode(). If
+ * fullscreen is false, the context will become a windowed context with the dimensions given in the
+ * mode returned by getDisplayMode(). The native cursor position is also reset.
+ *
+ * @param fullscreen Specify the fullscreen mode of the context.
+ *
+ * @throws LWJGLException If fullscreen is true, and the current DisplayMode instance is not
+ * from getAvailableDisplayModes() or if the mode switch fails.
+ */
+ public static void setFullscreen(boolean fullscreen) throws LWJGLException {
+ setDisplayModeAndFullscreenInternal(fullscreen, current_mode);
+ }
+
+ /**
+ * Set the mode of the context. If no context has been created through create(),
+ * the mode will apply when create() is called. If mode.isFullscreenCapable() is true, the context will become
+ * a fullscreen context and the display mode is switched to the mode given by getDisplayMode(). If
+ * mode.isFullscreenCapable() is false, the context will become a windowed context with the dimensions given in the
+ * mode returned by getDisplayMode(). The native cursor position is also reset.
+ *
+ * @param mode The new display mode to set. Must be non-null.
+ *
+ * @throws LWJGLException If the mode switch fails.
+ */
+ public static void setDisplayModeAndFullscreen(DisplayMode mode) throws LWJGLException {
+ setDisplayModeAndFullscreenInternal(mode.isFullscreenCapable(), mode);
+ }
+
+ private static void setDisplayModeAndFullscreenInternal(boolean fullscreen, DisplayMode mode) throws LWJGLException {
+ synchronized ( GlobalLock.lock ) {
+ if (mode == null)
+ throw new NullPointerException("mode must be non-null");
+ DisplayMode old_mode = current_mode;
+ current_mode = mode;
+ boolean was_fullscreen = isFullscreen();
+ Display.fullscreen = fullscreen;
+ if (was_fullscreen != isFullscreen() || !mode.equals(old_mode)) {
+ if (!isCreated())
+ return;
+ destroyWindow();
+ try {
+ if (isFullscreen()) {
+ switchDisplayMode();
+ } else {
+ display_impl.resetDisplayMode();
+ }
+ createWindow();
+ makeCurrentAndSetSwapInterval();
+ } catch (LWJGLException e) {
+ destroyContext();
+ destroyPeerInfo();
+ display_impl.resetDisplayMode();
+ throw e;
+ }
+ }
+ }
+ }
+
+ /** @return whether the Display is in fullscreen mode */
+ public static boolean isFullscreen() {
+ synchronized (GlobalLock.lock) {
+ return fullscreen && current_mode.isFullscreenCapable();
+ }
+ }
+
+ /**
+ * Set the title of the window. This may be ignored by the underlying OS.
+ *
+ * @param newTitle The new window title
+ */
+ public static void setTitle(String newTitle) {
+ synchronized ( GlobalLock.lock ) {
+ if ( newTitle == null ) {
+ newTitle = "";
+ }
+ title = newTitle;
+ if ( isCreated() )
+ display_impl.setTitle(title);
+ }
+ }
+
+ /** @return true if the user or operating system has asked the window to close */
+ public static boolean isCloseRequested() {
+ synchronized ( GlobalLock.lock ) {
+ if ( !isCreated() )
+ throw new IllegalStateException("Cannot determine close requested state of uncreated window");
+ return display_impl.isCloseRequested();
+ }
+ }
+
+ /** @return true if the window is visible, false if not */
+ public static boolean isVisible() {
+ synchronized ( GlobalLock.lock ) {
+ if ( !isCreated() )
+ throw new IllegalStateException("Cannot determine minimized state of uncreated window");
+ return display_impl.isVisible();
+ }
+ }
+
+ /** @return true if window is active, that is, the foreground display of the operating system. */
+ public static boolean isActive() {
+ synchronized ( GlobalLock.lock ) {
+ if ( !isCreated() )
+ throw new IllegalStateException("Cannot determine focused state of uncreated window");
+ return display_impl.isActive();
+ }
+ }
+
+ /**
+ * Determine if the window's contents have been damaged by external events.
+ * If you are writing a straightforward game rendering loop and simply paint
+ * every frame regardless, you can ignore this flag altogether. If you are
+ * trying to be kind to other processes you can check this flag and only
+ * redraw when it returns true. The flag is cleared when update() or isDirty() is called.
+ *
+ * @return true if the window has been damaged by external changes
+ * and needs to repaint itself
+ */
+ public static boolean isDirty() {
+ synchronized ( GlobalLock.lock ) {
+ if ( !isCreated() )
+ throw new IllegalStateException("Cannot determine dirty state of uncreated window");
+ return display_impl.isDirty();
+ }
+ }
+
+ /**
+ * Process operating system events. Call this to update the Display's state and to receive new
+ * input device events. This method is called from update(), so it is not necessary to call
+ * this method if update() is called periodically.
+ */
+ public static void processMessages() {
+ synchronized ( GlobalLock.lock ) {
+ if ( !isCreated() )
+ throw new IllegalStateException("Display not created");
+
+ display_impl.update();
+ }
+ pollDevices();
+ }
+
+ /**
+ * Swap the display buffers. This method is called from update(), and should normally not be called by
+ * the application.
+ *
+ * @throws OpenGLException if an OpenGL error has occured since the last call to GL11.glGetError()
+ */
+ public static void swapBuffers() throws LWJGLException {
+ synchronized ( GlobalLock.lock ) {
+ if ( !isCreated() )
+ throw new IllegalStateException("Display not created");
+
+ if ( LWJGLUtil.DEBUG )
+ Util.checkGLError();
+ Context.swapBuffers();
+ }
+ }
+
+ /**
+ * Update the window. If the window is visible clears
+ * the dirty flag and calls swapBuffers() and finally
+ * polls the input devices.
+ *
+ */
+ public static void update() {
+ update(true);
+ }
+
+ /**
+ * Update the window. If the window is visible clears
+ * the dirty flag and calls swapBuffers() and finally
+ * polls the input devices if processMessages is true.
+ *
+ * @param processMessages Poll input devices if true
+ */
+ public static void update(boolean processMessages) {
+ synchronized ( GlobalLock.lock ) {
+ if ( !isCreated() )
+ throw new IllegalStateException("Display not created");
+
+ // We paint only when the window is visible or dirty
+ if ( display_impl.isVisible() || display_impl.isDirty() ) {
+ try {
+ swapBuffers();
+ } catch (LWJGLException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ if ( parent_resized ) {
+ reshape();
+ parent_resized = false;
+ }
+
+ if ( processMessages )
+ processMessages();
+ }
+ }
+
+ static void pollDevices() {
+ // Poll the input devices while we're here
+ if ( Mouse.isCreated() ) {
+ Mouse.poll();
+ Mouse.updateCursor();
+ }
+
+ if ( Keyboard.isCreated() ) {
+ Keyboard.poll();
+ }
+
+ if ( Controllers.isCreated() ) {
+ Controllers.poll();
+ }
+ }
+
+ /**
+ * Release the Display context.
+ *
+ * @throws LWJGLException If the context could not be released
+ */
+ public static void releaseContext() throws LWJGLException {
+ synchronized ( GlobalLock.lock ) {
+ if ( !isCreated() )
+ throw new IllegalStateException("Display is not created");
+ if ( context.isCurrent() )
+ Context.releaseCurrentContext();
+ }
+ }
+
+ /**
+ * Make the Display the current rendering context for GL calls.
+ *
+ * @throws LWJGLException If the context could not be made current
+ */
+ public static void makeCurrent() throws LWJGLException {
+ synchronized ( GlobalLock.lock ) {
+ if ( !isCreated() )
+ throw new IllegalStateException("Display is not created");
+ context.makeCurrent();
+ }
+ }
+
+ private static void removeShutdownHook() {
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ Runtime.getRuntime().removeShutdownHook(shutdown_hook);
+ return null;
+ }
+ });
+ }
+
+ private static void registerShutdownHook() {
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ Runtime.getRuntime().addShutdownHook(shutdown_hook);
+ return null;
+ }
+ });
+ }
+
+ /**
+ * Create the OpenGL context. If isFullscreen() is true or if windowed
+ * context are not supported on the platform, the display mode will be switched to the mode returned by
+ * getDisplayMode(), and a fullscreen context will be created. If isFullscreen() is false, a windowed context
+ * will be created with the dimensions given in the mode returned by getDisplayMode(). If a context can't be
+ * created with the given parameters, a LWJGLException will be thrown.
+ * <p/>
+ * <p>The window created will be set up in orthographic 2D projection, with 1:1 pixel ratio with GL coordinates.
+ *
+ * @throws LWJGLException
+ */
+ public static void create() throws LWJGLException {
+ synchronized ( GlobalLock.lock ) {
+ create(new PixelFormat());
+ }
+ }
+
+ /**
+ * Create the OpenGL context with the given minimum parameters. If isFullscreen() is true or if windowed
+ * context are not supported on the platform, the display mode will be switched to the mode returned by
+ * getDisplayMode(), and a fullscreen context will be created. If isFullscreen() is false, a windowed context
+ * will be created with the dimensions given in the mode returned by getDisplayMode(). If a context can't be
+ * created with the given parameters, a LWJGLException will be thrown.
+ * <p/>
+ * <p>The window created will be set up in orthographic 2D projection, with 1:1 pixel ratio with GL coordinates.
+ *
+ * @param pixel_format Describes the minimum specifications the context must fulfill.
+ *
+ * @throws LWJGLException
+ */
+ public static void create(PixelFormat pixel_format) throws LWJGLException {
+ synchronized ( GlobalLock.lock ) {
+ create(pixel_format, null, null);
+ }
+ }
+
+ /**
+ * Create the OpenGL context with the given minimum parameters. If isFullscreen() is true or if windowed
+ * context are not supported on the platform, the display mode will be switched to the mode returned by
+ * getDisplayMode(), and a fullscreen context will be created. If isFullscreen() is false, a windowed context
+ * will be created with the dimensions given in the mode returned by getDisplayMode(). If a context can't be
+ * created with the given parameters, a LWJGLException will be thrown.
+ * <p/>
+ * <p>The window created will be set up in orthographic 2D projection, with 1:1 pixel ratio with GL coordinates.
+ *
+ * @param pixel_format Describes the minimum specifications the context must fulfill.
+ * @param shared_drawable The Drawable to share context with. (optional, may be null)
+ *
+ * @throws LWJGLException
+ */
+ public static void create(PixelFormat pixel_format, Drawable shared_drawable) throws LWJGLException {
+ synchronized ( GlobalLock.lock ) {
+ create(pixel_format, shared_drawable, null);
+ }
+ }
+
+ /**
+ * Create the OpenGL context with the given minimum parameters. If isFullscreen() is true or if windowed
+ * context are not supported on the platform, the display mode will be switched to the mode returned by
+ * getDisplayMode(), and a fullscreen context will be created. If isFullscreen() is false, a windowed context
+ * will be created with the dimensions given in the mode returned by getDisplayMode(). If a context can't be
+ * created with the given parameters, a LWJGLException will be thrown.
+ * <p/>
+ * <p>The window created will be set up in orthographic 2D projection, with 1:1 pixel ratio with GL coordinates.
+ *
+ * @param pixel_format Describes the minimum specifications the context must fulfill.
+ * @param attribs The ContextAttribs to use when creating the context. (optional, may be null)
+ *
+ * @throws LWJGLException
+ */
+ public static void create(PixelFormat pixel_format, ContextAttribs attribs) throws LWJGLException {
+ synchronized ( GlobalLock.lock ) {
+ create(pixel_format, null, attribs);
+ }
+ }
+
+ /**
+ * Create the OpenGL context with the given minimum parameters. If isFullscreen() is true or if windowed
+ * context are not supported on the platform, the display mode will be switched to the mode returned by
+ * getDisplayMode(), and a fullscreen context will be created. If isFullscreen() is false, a windowed context
+ * will be created with the dimensions given in the mode returned by getDisplayMode(). If a context can't be
+ * created with the given parameters, a LWJGLException will be thrown.
+ * <p/>
+ * <p>The window created will be set up in orthographic 2D projection, with 1:1 pixel ratio with GL coordinates.
+ *
+ * @param pixel_format Describes the minimum specifications the context must fulfill.
+ * @param shared_drawable The Drawable to share context with. (optional, may be null)
+ * @param attribs The ContextAttribs to use when creating the context. (optional, may be null)
+ *
+ * @throws LWJGLException
+ */
+ public static void create(PixelFormat pixel_format, Drawable shared_drawable, ContextAttribs attribs) throws LWJGLException {
+ synchronized ( GlobalLock.lock ) {
+ if ( isCreated() )
+ throw new IllegalStateException("Only one LWJGL context may be instantiated at any one time.");
+ if ( pixel_format == null )
+ throw new NullPointerException("pixel_format cannot be null");
+ removeShutdownHook();
+ registerShutdownHook();
+ if (isFullscreen())
+ switchDisplayMode();
+ try {
+ peer_info = display_impl.createPeerInfo(pixel_format);
+ try {
+ createWindow();
+ try {
+ context = new Context(peer_info, attribs, shared_drawable != null ? shared_drawable.getContext() : null);
+ try {
+ makeCurrentAndSetSwapInterval();
+ initContext();
+ } catch (LWJGLException e) {
+ destroyContext();
+ throw e;
+ }
+ } catch (LWJGLException e) {
+ destroyWindow();
+ throw e;
+ }
+ } catch (LWJGLException e) {
+ destroyPeerInfo();
+ throw e;
+ }
+ } catch (LWJGLException e) {
+ display_impl.resetDisplayMode();
+ throw e;
+ }
+ }
+ }
+
+ /**
+ * Set the initial color of the Display. This method is called before the Display is created and will set the
+ * background color to the one specified in this method.
+ *
+ * @param red - color value between 0 - 1
+ * @param green - color value between 0 - 1
+ * @param blue - color value between 0 - 1
+ */
+ public static void setInitialBackground(float red, float green, float blue) {
+ r = red;
+ g = green;
+ b = blue;
+ }
+
+ private static void makeCurrentAndSetSwapInterval() throws LWJGLException {
+ makeCurrent();
+ try {
+ Util.checkGLError();
+ } catch (OpenGLException e) {
+ LWJGLUtil.log("OpenGL error during context creation: " + e.getMessage());
+ }
+ setSwapInterval(swap_interval);
+ }
+
+ private static void initContext() {
+ // set background clear color
+ GL11.glClearColor(r, g, b, 1.0f);
+ // Clear window to avoid the desktop "showing through"
+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
+ update();
+ }
+
+ static DisplayImplementation getImplementation() {
+ return display_impl;
+ }
+
+ /** Gets a boolean property as a privileged action. */
+ static boolean getPrivilegedBoolean(final String property_name) {
+ Boolean value = (Boolean)AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ return new Boolean(Boolean.getBoolean(property_name));
+ }
+ });
+ return value.booleanValue();
+ }
+
+ private static void initControls() {
+ // Automatically create mouse, keyboard and controller
+ if ( !getPrivilegedBoolean("org.lwjgl.opengl.Display.noinput") ) {
+ if ( !Mouse.isCreated() && !getPrivilegedBoolean("org.lwjgl.opengl.Display.nomouse") ) {
+ try {
+ Mouse.create();
+ } catch (LWJGLException e) {
+ if ( LWJGLUtil.DEBUG ) {
+ e.printStackTrace(System.err);
+ } else {
+ LWJGLUtil.log("Failed to create Mouse: " + e);
+ }
+ }
+ }
+ if ( !Keyboard.isCreated() && !getPrivilegedBoolean("org.lwjgl.opengl.Display.nokeyboard") ) {
+ try {
+ Keyboard.create();
+ } catch (LWJGLException e) {
+ if ( LWJGLUtil.DEBUG ) {
+ e.printStackTrace(System.err);
+ } else {
+ LWJGLUtil.log("Failed to create Keyboard: " + e);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Destroy the Display. After this call, there will be no current GL rendering context,
+ * regardless of whether the Display was the current rendering context.
+ */
+ public static void destroy() {
+ synchronized ( GlobalLock.lock ) {
+ if ( !isCreated() ) {
+ return;
+ }
+
+ releaseDrawable();
+ destroyContext();
+ destroyWindow();
+ destroyPeerInfo();
+ x = y = -1;
+ cached_icons = null;
+ reset();
+ removeShutdownHook();
+ }
+ }
+
+ private static void destroyPeerInfo() {
+ peer_info.destroy();
+ peer_info = null;
+ }
+
+ private static void destroyContext() {
+ try {
+ context.forceDestroy();
+ } catch (LWJGLException e) {
+ throw new RuntimeException(e);
+ } finally {
+ context = null;
+ }
+ }
+
+ /*
+ * Reset display mode if fullscreen. This method is also called from the shutdown hook added
+ * in the static constructor
+ */
+ private static void reset() {
+ display_impl.resetDisplayMode();
+ current_mode = initial_mode;
+ }
+
+ /** @return true if the window's native peer has been created */
+ public static boolean isCreated() {
+ synchronized ( GlobalLock.lock ) {
+ return window_created;
+ }
+ }
+
+ /**
+ * Set the buffer swap interval. This call is a best-attempt at changing
+ * the monitor swap interval, which is the minimum periodicity of color buffer swaps,
+ * measured in video frame periods, and is not guaranteed to be successful.
+ * <p/>
+ * A video frame period is the time required to display a full frame of video data.
+ *
+ * @param value The swap interval in frames, 0 to disable
+ */
+ public static void setSwapInterval(int value) {
+ synchronized ( GlobalLock.lock ) {
+ swap_interval = value;
+ if ( isCreated() )
+ Context.setSwapInterval(swap_interval);
+ }
+ }
+
+ /**
+ * Enable or disable vertical monitor synchronization. This call is a best-attempt at changing
+ * the vertical refresh synchronization of the monitor, and is not guaranteed to be successful.
+ *
+ * @param sync true to synchronize; false to ignore synchronization
+ */
+ public static void setVSyncEnabled(boolean sync) {
+ synchronized ( GlobalLock.lock ) {
+ setSwapInterval(sync ? 1 : 0);
+ }
+ }
+
+ /**
+ * Set the window's location. This is a no-op on fullscreen windows or when getParent() != null.
+ * The window is clamped to remain entirely on the screen. If you attempt
+ * to position the window such that it would extend off the screen, the window
+ * is simply placed as close to the edge as possible.
+ * <br><b>note</b>If no location has been specified (or x == y == -1) the window will be centered
+ *
+ * @param new_x The new window location on the x axis
+ * @param new_y The new window location on the y axis
+ */
+ public static void setLocation(int new_x, int new_y) {
+ synchronized ( GlobalLock.lock ) {
+ // cache position
+ x = new_x;
+ y = new_y;
+
+ // offset if already created
+ if (isCreated() && !isFullscreen()) {
+ reshape();
+ }
+ }
+ }
+
+ private static void reshape() {
+ DisplayMode mode = getEffectiveMode();
+ display_impl.reshape(getWindowX(), getWindowY(), mode.getWidth(), mode.getHeight());
+ }
+
+ /**
+ * Get the driver adapter string. This is a unique string describing the actual card's hardware, eg. "Geforce2", "PS2",
+ * "Radeon9700". If the adapter cannot be determined, this function returns null.
+ *
+ * @return a String
+ */
+ public static String getAdapter() {
+ synchronized ( GlobalLock.lock ) {
+ return display_impl.getAdapter();
+ }
+ }
+
+ /**
+ * Get the driver version. This is a vendor/adapter specific version string. If the version cannot be determined,
+ * this function returns null.
+ *
+ * @return a String
+ */
+ public static String getVersion() {
+ synchronized ( GlobalLock.lock ) {
+ return display_impl.getVersion();
+ }
+ }
+
+ /**
+ * Sets one or more icons for the Display.
+ * <ul>
+ * <li>On Windows you should supply at least one 16x16 icon and one 32x32.</li>
+ * <li>Linux (and similar platforms) expect one 32x32 icon.</li>
+ * <li>Mac OS X should be supplied one 128x128 icon</li>
+ * </ul>
+ * The implementation will use the supplied ByteBuffers with image data in RGBA and perform any conversions nescesarry for the specific platform.
+ * <p/>
+ * <b>NOTE:</b> The display will make a deep copy of the supplied byte buffer array, for the purpose
+ * of recreating the icons when you go back and forth fullscreen mode. You therefore only need to
+ * set the icon once per instance.
+ *
+ * @param icons Array of icons in RGBA mode. Pass the icons in order of preference.
+ *
+ * @return number of icons used, or 0 if display hasn't been created
+ */
+ public static int setIcon(ByteBuffer[] icons) {
+ synchronized ( GlobalLock.lock ) {
+ // make deep copy so we dont rely on the supplied buffers later on
+ // don't recache!
+ if ( cached_icons != icons ) {
+ cached_icons = new ByteBuffer[icons.length];
+ for ( int i = 0; i < icons.length; i++ ) {
+ cached_icons[i] = BufferUtils.createByteBuffer(icons[i].capacity());
+ int old_position = icons[i].position();
+ cached_icons[i].put(icons[i]);
+ icons[i].position(old_position);
+ cached_icons[i].flip();
+ }
+ }
+
+ if ( Display.isCreated() && parent == null ) {
+ return display_impl.setIcon(cached_icons);
+ } else {
+ return 0;
+ }
+ }
+ }
+}
diff --git a/src/java/org/lwjgl/opengl/DisplayImplementation.java b/src/java/org/lwjgl/opengl/DisplayImplementation.java
index 2c1c6f0..fb5505e 100644
--- a/src/java/org/lwjgl/opengl/DisplayImplementation.java
+++ b/src/java/org/lwjgl/opengl/DisplayImplementation.java
@@ -1,162 +1,162 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-/**
- * This is the Display implementation interface. Display delegates
- * to implementors of this interface. There is one DisplayImplementation
- * for each supported platform.
- * @author elias_naur
- */
-
-import java.nio.ByteBuffer;
-import java.nio.FloatBuffer;
-import java.nio.IntBuffer;
-import java.awt.Canvas;
-
-import org.lwjgl.LWJGLException;
-
-interface DisplayImplementation extends InputImplementation {
-
- void createWindow(DisplayMode mode, Canvas parent, int x, int y) throws LWJGLException;
-
- void destroyWindow();
-
- void switchDisplayMode(DisplayMode mode) throws LWJGLException;
-
- /**
- * Reset the display mode to whatever it was when LWJGL was initialized.
- * Fails silently.
- */
- void resetDisplayMode();
-
- /**
- * Return the length of the gamma ramp arrays. Returns 0 if gamma settings are
- * unsupported.
- *
- * @return the length of each gamma ramp array, or 0 if gamma settings are unsupported.
- */
- int getGammaRampLength();
-
- /**
- * Method to set the gamma ramp.
- */
- void setGammaRamp(FloatBuffer gammaRamp) throws LWJGLException;
-
- /**
- * Get the driver adapter string. This is a unique string describing the actual card's hardware, eg. "Geforce2", "PS2",
- * "Radeon9700". If the adapter cannot be determined, this function returns null.
- * @return a String
- */
- String getAdapter();
-
- /**
- * Get the driver version. This is a vendor/adapter specific version string. If the version cannot be determined,
- * this function returns null.
- * @return a String
- */
- String getVersion();
-
- /**
- * Initialize and return the current display mode.
- */
- DisplayMode init() throws LWJGLException;
-
- /**
- * Implementation of setTitle(). This will read the window's title member
- * and stash it in the native title of the window.
- */
- void setTitle(String title);
-
- boolean isCloseRequested();
-
- boolean isVisible();
- boolean isActive();
-
- boolean isDirty();
-
- /**
- * Create the native PeerInfo.
- * @throws LWJGLException
- */
- PeerInfo createPeerInfo(PixelFormat pixel_format) throws LWJGLException;
-
-// void destroyPeerInfo();
-
- /**
- * Updates the windows internal state. This must be called at least once per video frame
- * to handle window close requests, moves, paints, etc.
- */
- void update();
-
- void reshape(int x, int y, int width, int height);
-
- /**
- * Method for getting displaymodes
- */
- DisplayMode[] getAvailableDisplayModes() throws LWJGLException;
-
- /* Pbuffer */
- int getPbufferCapabilities();
-
- /**
- * Method to test for buffer integrity
- */
- boolean isBufferLost(PeerInfo handle);
-
- /**
- * Method to create a Pbuffer
- */
- PeerInfo createPbuffer(int width, int height, PixelFormat pixel_format,
- IntBuffer pixelFormatCaps,
- IntBuffer pBufferAttribs) throws LWJGLException;
-
- void setPbufferAttrib(PeerInfo handle, int attrib, int value);
-
- void bindTexImageToPbuffer(PeerInfo handle, int buffer);
-
- void releaseTexImageFromPbuffer(PeerInfo handle, int buffer);
-
- /**
- * Sets one or more icons for the Display.
- * <ul>
- * <li>On Windows you should supply at least one 16x16 icon and one 32x32.</li>
- * <li>Linux (and similar platforms) expect one 32x32 icon.</li>
- * <li>Mac OS X should be supplied one 128x128 icon</li>
- * </ul>
- * The implementation will use the supplied ByteBuffers with image data in RGBA and perform any conversions nescesarry for the specific platform.
- *
- * @param icons Array of icons in RGBA mode
- * @return number of icons used.
- */
- int setIcon(ByteBuffer[] icons);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+/**
+ * This is the Display implementation interface. Display delegates
+ * to implementors of this interface. There is one DisplayImplementation
+ * for each supported platform.
+ * @author elias_naur
+ */
+
+import java.nio.ByteBuffer;
+import java.nio.FloatBuffer;
+import java.nio.IntBuffer;
+import java.awt.Canvas;
+
+import org.lwjgl.LWJGLException;
+
+interface DisplayImplementation extends InputImplementation {
+
+ void createWindow(DisplayMode mode, Canvas parent, int x, int y) throws LWJGLException;
+
+ void destroyWindow();
+
+ void switchDisplayMode(DisplayMode mode) throws LWJGLException;
+
+ /**
+ * Reset the display mode to whatever it was when LWJGL was initialized.
+ * Fails silently.
+ */
+ void resetDisplayMode();
+
+ /**
+ * Return the length of the gamma ramp arrays. Returns 0 if gamma settings are
+ * unsupported.
+ *
+ * @return the length of each gamma ramp array, or 0 if gamma settings are unsupported.
+ */
+ int getGammaRampLength();
+
+ /**
+ * Method to set the gamma ramp.
+ */
+ void setGammaRamp(FloatBuffer gammaRamp) throws LWJGLException;
+
+ /**
+ * Get the driver adapter string. This is a unique string describing the actual card's hardware, eg. "Geforce2", "PS2",
+ * "Radeon9700". If the adapter cannot be determined, this function returns null.
+ * @return a String
+ */
+ String getAdapter();
+
+ /**
+ * Get the driver version. This is a vendor/adapter specific version string. If the version cannot be determined,
+ * this function returns null.
+ * @return a String
+ */
+ String getVersion();
+
+ /**
+ * Initialize and return the current display mode.
+ */
+ DisplayMode init() throws LWJGLException;
+
+ /**
+ * Implementation of setTitle(). This will read the window's title member
+ * and stash it in the native title of the window.
+ */
+ void setTitle(String title);
+
+ boolean isCloseRequested();
+
+ boolean isVisible();
+ boolean isActive();
+
+ boolean isDirty();
+
+ /**
+ * Create the native PeerInfo.
+ * @throws LWJGLException
+ */
+ PeerInfo createPeerInfo(PixelFormat pixel_format) throws LWJGLException;
+
+// void destroyPeerInfo();
+
+ /**
+ * Updates the windows internal state. This must be called at least once per video frame
+ * to handle window close requests, moves, paints, etc.
+ */
+ void update();
+
+ void reshape(int x, int y, int width, int height);
+
+ /**
+ * Method for getting displaymodes
+ */
+ DisplayMode[] getAvailableDisplayModes() throws LWJGLException;
+
+ /* Pbuffer */
+ int getPbufferCapabilities();
+
+ /**
+ * Method to test for buffer integrity
+ */
+ boolean isBufferLost(PeerInfo handle);
+
+ /**
+ * Method to create a Pbuffer
+ */
+ PeerInfo createPbuffer(int width, int height, PixelFormat pixel_format,
+ IntBuffer pixelFormatCaps,
+ IntBuffer pBufferAttribs) throws LWJGLException;
+
+ void setPbufferAttrib(PeerInfo handle, int attrib, int value);
+
+ void bindTexImageToPbuffer(PeerInfo handle, int buffer);
+
+ void releaseTexImageFromPbuffer(PeerInfo handle, int buffer);
+
+ /**
+ * Sets one or more icons for the Display.
+ * <ul>
+ * <li>On Windows you should supply at least one 16x16 icon and one 32x32.</li>
+ * <li>Linux (and similar platforms) expect one 32x32 icon.</li>
+ * <li>Mac OS X should be supplied one 128x128 icon</li>
+ * </ul>
+ * The implementation will use the supplied ByteBuffers with image data in RGBA and perform any conversions nescesarry for the specific platform.
+ *
+ * @param icons Array of icons in RGBA mode
+ * @return number of icons used.
+ */
+ int setIcon(ByteBuffer[] icons);
+}
diff --git a/src/java/org/lwjgl/opengl/DisplayMode.java b/src/java/org/lwjgl/opengl/DisplayMode.java
index ca59acc..6bbe3aa 100644
--- a/src/java/org/lwjgl/opengl/DisplayMode.java
+++ b/src/java/org/lwjgl/opengl/DisplayMode.java
@@ -1,142 +1,142 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-/**
- *
- * This class encapsulates the properties for a given display mode.
- * This class is not instantiable, and is aquired from the <code>Display.
- * getAvailableDisplayModes()</code> method.
- *
- * @author cix_foo <cix_foo at users.sourceforge.net>
- * @version $Revision: 3171 $
- * $Id: DisplayMode.java 3171 2008-12-28 17:50:08Z elias_naur $
- */
-
-public final class DisplayMode {
-
- /** properties of the display mode */
- private final int width, height, bpp, freq;
- /** If true, this instance can be used for fullscreen modes */
- private final boolean fullscreen;
-
- /**
- * Construct a display mode. DisplayModes constructed through the
- * public constructor can only be used to specify the dimensions of
- * the Display in windowed mode. To get the available DisplayModes for
- * fullscreen modes, use Display.getAvailableDisplayModes().
- *
- * @param width The Display width.
- * @param height The Display height.
- * @see Display
- */
- public DisplayMode(int width, int height) {
- this(width, height, 0, 0, false);
- }
-
- DisplayMode(int width, int height, int bpp, int freq) {
- this(width, height, bpp, freq, true);
- }
-
- private DisplayMode(int width, int height, int bpp, int freq, boolean fullscreen) {
- this.width = width;
- this.height = height;
- this.bpp = bpp;
- this.freq = freq;
- this.fullscreen = fullscreen;
- }
-
- /** True iff this instance can be used for fullscreen modes */
- public boolean isFullscreenCapable() {
- return fullscreen;
- }
-
- public int getWidth() {
- return width;
- }
-
- public int getHeight() {
- return height;
- }
-
- public int getBitsPerPixel() {
- return bpp;
- }
-
- public int getFrequency() {
- return freq;
- }
-
- /**
- * Tests for <code>DisplayMode</code> equality
- *
- * @see java.lang.Object#equals(Object)
- */
- public boolean equals(Object obj) {
- if (obj == null || !(obj instanceof DisplayMode)) {
- return false;
- }
-
- DisplayMode dm = (DisplayMode) obj;
- return dm.width == width
- && dm.height == height
- && dm.bpp == bpp
- && dm.freq == freq;
- }
-
- /**
- * Retrieves the hashcode for this object
- *
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return width ^ height ^ freq ^ bpp;
- }
-
- /**
- * Retrieves a String representation of this <code>DisplayMode</code>
- *
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer sb = new StringBuffer(32);
- sb.append(width);
- sb.append(" x ");
- sb.append(height);
- sb.append(" x ");
- sb.append(bpp);
- sb.append(" @");
- sb.append(freq);
- sb.append("Hz");
- return sb.toString();
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+/**
+ *
+ * This class encapsulates the properties for a given display mode.
+ * This class is not instantiable, and is aquired from the <code>Display.
+ * getAvailableDisplayModes()</code> method.
+ *
+ * @author cix_foo <cix_foo at users.sourceforge.net>
+ * @version $Revision: 3171 $
+ * $Id: DisplayMode.java 3171 2008-12-28 17:50:08Z elias_naur $
+ */
+
+public final class DisplayMode {
+
+ /** properties of the display mode */
+ private final int width, height, bpp, freq;
+ /** If true, this instance can be used for fullscreen modes */
+ private final boolean fullscreen;
+
+ /**
+ * Construct a display mode. DisplayModes constructed through the
+ * public constructor can only be used to specify the dimensions of
+ * the Display in windowed mode. To get the available DisplayModes for
+ * fullscreen modes, use Display.getAvailableDisplayModes().
+ *
+ * @param width The Display width.
+ * @param height The Display height.
+ * @see Display
+ */
+ public DisplayMode(int width, int height) {
+ this(width, height, 0, 0, false);
+ }
+
+ DisplayMode(int width, int height, int bpp, int freq) {
+ this(width, height, bpp, freq, true);
+ }
+
+ private DisplayMode(int width, int height, int bpp, int freq, boolean fullscreen) {
+ this.width = width;
+ this.height = height;
+ this.bpp = bpp;
+ this.freq = freq;
+ this.fullscreen = fullscreen;
+ }
+
+ /** True iff this instance can be used for fullscreen modes */
+ public boolean isFullscreenCapable() {
+ return fullscreen;
+ }
+
+ public int getWidth() {
+ return width;
+ }
+
+ public int getHeight() {
+ return height;
+ }
+
+ public int getBitsPerPixel() {
+ return bpp;
+ }
+
+ public int getFrequency() {
+ return freq;
+ }
+
+ /**
+ * Tests for <code>DisplayMode</code> equality
+ *
+ * @see java.lang.Object#equals(Object)
+ */
+ public boolean equals(Object obj) {
+ if (obj == null || !(obj instanceof DisplayMode)) {
+ return false;
+ }
+
+ DisplayMode dm = (DisplayMode) obj;
+ return dm.width == width
+ && dm.height == height
+ && dm.bpp == bpp
+ && dm.freq == freq;
+ }
+
+ /**
+ * Retrieves the hashcode for this object
+ *
+ * @see java.lang.Object#hashCode()
+ */
+ public int hashCode() {
+ return width ^ height ^ freq ^ bpp;
+ }
+
+ /**
+ * Retrieves a String representation of this <code>DisplayMode</code>
+ *
+ * @see java.lang.Object#toString()
+ */
+ public String toString() {
+ StringBuffer sb = new StringBuffer(32);
+ sb.append(width);
+ sb.append(" x ");
+ sb.append(height);
+ sb.append(" x ");
+ sb.append(bpp);
+ sb.append(" @");
+ sb.append(freq);
+ sb.append("Hz");
+ return sb.toString();
+ }
+}
diff --git a/src/java/org/lwjgl/opengl/Drawable.java b/src/java/org/lwjgl/opengl/Drawable.java
index a4681bb..8e542f1 100644
--- a/src/java/org/lwjgl/opengl/Drawable.java
+++ b/src/java/org/lwjgl/opengl/Drawable.java
@@ -1,43 +1,43 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-/**
- * The Drawable interface describes an OpenGL drawable with an associated
- * Context.
- *
- * @author elias_naur
- */
-
-public interface Drawable {
- Context getContext();
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+/**
+ * The Drawable interface describes an OpenGL drawable with an associated
+ * Context.
+ *
+ * @author elias_naur
+ */
+
+public interface Drawable {
+ Context getContext();
+}
diff --git a/src/java/org/lwjgl/opengl/EventQueue.java b/src/java/org/lwjgl/opengl/EventQueue.java
index 60ec1f2..064a3f8 100644
--- a/src/java/org/lwjgl/opengl/EventQueue.java
+++ b/src/java/org/lwjgl/opengl/EventQueue.java
@@ -1,83 +1,83 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-/**
- * A java implementation of a LWJGL compatible event queue.
- * @author elias_naur
- */
-
-import java.nio.ByteBuffer;
-
-class EventQueue {
- private static final int QUEUE_SIZE = 200;
-
- private final int event_size;
-
- private final ByteBuffer queue;
-
- protected EventQueue(int event_size) {
- this.event_size = event_size;
- this.queue = ByteBuffer.allocate(QUEUE_SIZE*event_size);
- }
-
- protected synchronized void clearEvents() {
- queue.clear();
- }
-
- /**
- * Copy available events into the specified buffer.
- */
- public synchronized void copyEvents(ByteBuffer dest) {
- queue.flip();
- int old_limit = queue.limit();
- if (dest.remaining() < queue.remaining())
- queue.limit(dest.remaining() + queue.position());
- dest.put(queue);
- queue.limit(old_limit);
- queue.compact();
- }
-
- /**
- * Put an event into the queue.
- * @return true if the event fitted into the queue, false otherwise
- */
- public synchronized boolean putEvent(ByteBuffer event) {
- if (event.remaining() != event_size)
- throw new IllegalArgumentException("Internal error: event size " + event_size + " does not equal the given event size " + event.remaining());
- if (queue.remaining() >= event.remaining()) {
- queue.put(event);
- return true;
- } else
- return false;
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+/**
+ * A java implementation of a LWJGL compatible event queue.
+ * @author elias_naur
+ */
+
+import java.nio.ByteBuffer;
+
+class EventQueue {
+ private static final int QUEUE_SIZE = 200;
+
+ private final int event_size;
+
+ private final ByteBuffer queue;
+
+ protected EventQueue(int event_size) {
+ this.event_size = event_size;
+ this.queue = ByteBuffer.allocate(QUEUE_SIZE*event_size);
+ }
+
+ protected synchronized void clearEvents() {
+ queue.clear();
+ }
+
+ /**
+ * Copy available events into the specified buffer.
+ */
+ public synchronized void copyEvents(ByteBuffer dest) {
+ queue.flip();
+ int old_limit = queue.limit();
+ if (dest.remaining() < queue.remaining())
+ queue.limit(dest.remaining() + queue.position());
+ dest.put(queue);
+ queue.limit(old_limit);
+ queue.compact();
+ }
+
+ /**
+ * Put an event into the queue.
+ * @return true if the event fitted into the queue, false otherwise
+ */
+ public synchronized boolean putEvent(ByteBuffer event) {
+ if (event.remaining() != event_size)
+ throw new IllegalArgumentException("Internal error: event size " + event_size + " does not equal the given event size " + event.remaining());
+ if (queue.remaining() >= event.remaining()) {
+ queue.put(event);
+ return true;
+ } else
+ return false;
+ }
+}
diff --git a/src/java/org/lwjgl/opengl/GLChecks.java b/src/java/org/lwjgl/opengl/GLChecks.java
index df51ee5..b2d2339 100644
--- a/src/java/org/lwjgl/opengl/GLChecks.java
+++ b/src/java/org/lwjgl/opengl/GLChecks.java
@@ -1,256 +1,256 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import java.nio.Buffer;
-import java.nio.IntBuffer;
-
-import org.lwjgl.BufferUtils;
-
-/**
- * A class to check buffer boundaries in GL methods. Many GL
- * methods read data from the GL into a native Buffer at its current position. If there is unsufficient space in the buffer when
- * the call is made then a buffer overflow would otherwise occur and cause unexpected behaviour, a crash, or worse, a security
- * risk. Therefore in those methods where GL reads data back into a buffer, we will call a bounds check method from this class
- * to ensure that there is sufficient space in the buffer.
- * <p/>
- * Thrown by the debug build library of the LWJGL if any OpenGL operation causes an error.
- *
- * @author cix_foo <cix_foo at users.sourceforge.net>
- * @version $Revision: 3279 $
- * $Id: GLChecks.java 3279 2010-03-11 21:06:49Z spasi $
- */
-class GLChecks {
-
- /** Static methods only! */
- private GLChecks() {
- }
-
- static References getReferences(ContextCapabilities caps) {
- return StateTracker.getReferencesStack(caps).getReferences();
- }
-
- static int getBufferObjectSize(ContextCapabilities caps, int buffer_enum) {
- IntBuffer scratch_buffer = caps.scratch_int_buffer;
- GL15.glGetBufferParameter(buffer_enum, GL15.GL_BUFFER_SIZE, scratch_buffer);
- return scratch_buffer.get(0);
- }
-
- static int getBufferObjectSizeARB(ContextCapabilities caps, int buffer_enum) {
- IntBuffer scratch_buffer = caps.scratch_int_buffer;
- ARBBufferObject.glGetBufferParameterARB(buffer_enum, ARBBufferObject.GL_BUFFER_SIZE_ARB, scratch_buffer);
- return scratch_buffer.get(0);
- }
-
- static int getBufferObjectSizeATI(ContextCapabilities caps, int buffer) {
- IntBuffer scratch_buffer = caps.scratch_int_buffer;
- ATIVertexArrayObject.glGetObjectBufferATI(buffer, ATIVertexArrayObject.GL_OBJECT_BUFFER_SIZE_ATI, scratch_buffer);
- return scratch_buffer.get(0);
- }
-
- static int getNamedBufferObjectSize(ContextCapabilities caps, int buffer) {
- IntBuffer scratch_buffer = caps.scratch_int_buffer;
- EXTDirectStateAccess.glGetNamedBufferParameterEXT(buffer, GL15.GL_BUFFER_SIZE, scratch_buffer);
- return scratch_buffer.get(0);
- }
-
- private static boolean checkBufferObject(ContextCapabilities caps, int buffer_enum, boolean state) {
- IntBuffer scratch_buffer = caps.scratch_int_buffer;
- GL11.glGetInteger(buffer_enum, scratch_buffer);
- boolean is_enabled = scratch_buffer.get(0) != 0;
- return state == is_enabled;
- }
-
- /** Helper method to ensure that array buffer objects are disabled. If they are enabled, we'll throw an OpenGLException */
- static void ensureArrayVBOdisabled(ContextCapabilities caps) {
- if(StateTracker.getReferencesStack(caps).getReferences().arrayBuffer != 0)
- throw new OpenGLException("Cannot use Buffers when Array Buffer Object is enabled");
- }
-
- /** Helper method to ensure that array buffer objects are enabled. If they are disabled, we'll throw an OpenGLException */
- static void ensureArrayVBOenabled(ContextCapabilities caps) {
- if(StateTracker.getReferencesStack(caps).getReferences().arrayBuffer == 0)
- throw new OpenGLException("Cannot use offsets when Array Buffer Object is disabled");
- }
-
- /** Helper method to ensure that element array buffer objects are disabled. If they are enabled, we'll throw an OpenGLException */
- static void ensureElementVBOdisabled(ContextCapabilities caps) {
- if(StateTracker.getReferencesStack(caps).getReferences().elementArrayBuffer != 0)
- throw new OpenGLException("Cannot use Buffers when Element Array Buffer Object is enabled");
- }
-
- /** Helper method to ensure that element array buffer objects are enabled. If they are disabled, we'll throw an OpenGLException */
- static void ensureElementVBOenabled(ContextCapabilities caps) {
- if(StateTracker.getReferencesStack(caps).getReferences().elementArrayBuffer == 0)
- throw new OpenGLException("Cannot use offsets when Element Array Buffer Object is disabled");
- }
-
- /** Helper method to ensure that array buffer objects are disabled. If they are enabled, we'll throw an OpenGLException */
- static void ensureIndirectBOdisabled(ContextCapabilities caps) {
- if ( StateTracker.getReferencesStack(caps).getReferences().indirectBuffer != 0 )
- throw new OpenGLException("Cannot use Buffers when Draw Indirect Object is enabled");
- }
-
- /** Helper method to ensure that array buffer objects are enabled. If they are disabled, we'll throw an OpenGLException */
- static void ensureIndirectBOenabled(ContextCapabilities caps) {
- if ( StateTracker.getReferencesStack(caps).getReferences().indirectBuffer == 0 )
- throw new OpenGLException("Cannot use offsets when Draw Indirect Object is disabled");
- }
-
- /** Helper method to ensure that pixel pack buffer objects are disabled. If they are enabled, we'll throw an OpenGLException */
- static void ensurePackPBOdisabled(ContextCapabilities caps) {
- if ( StateTracker.getReferencesStack(caps).getReferences().pixelPackBuffer != 0 )
- throw new OpenGLException("Cannot use Buffers when Pixel Pack Buffer Object is enabled");
- }
-
- /** Helper method to ensure that pixel pack buffer objects are enabled. If they are disabled, we'll throw an OpenGLException */
- static void ensurePackPBOenabled(ContextCapabilities caps) {
- if ( StateTracker.getReferencesStack(caps).getReferences().pixelPackBuffer == 0 )
- throw new OpenGLException("Cannot use offsets when Pixel Pack Buffer Object is disabled");
- }
-
- /** Helper method to ensure that pixel unpack buffer objects are disabled. If they are enabled, we'll throw an OpenGLException */
- static void ensureUnpackPBOdisabled(ContextCapabilities caps) {
- if ( StateTracker.getReferencesStack(caps).getReferences().pixelUnpackBuffer != 0 )
- throw new OpenGLException("Cannot use Buffers when Pixel Unpack Buffer Object is enabled");
- }
-
- /** Helper method to ensure that pixel unpack buffer objects are enabled. If they are disabled, we'll throw an OpenGLException */
- static void ensureUnpackPBOenabled(ContextCapabilities caps) {
- if ( StateTracker.getReferencesStack(caps).getReferences().pixelUnpackBuffer == 0 )
- throw new OpenGLException("Cannot use offsets when Pixel Unpack Buffer Object is disabled");
- }
-
- /**
- * Calculate the storage required for an image in elements
- *
- * @param format The format of the image (example: GL_RGBA)
- * @param type The type of the image elements (example: GL_UNSIGNED_BYTE)
- * @param width The width of the image
- * @param height The height of the image (1 for 1D images)
- * @param depth The depth of the image (1 for 2D images)
- *
- * @return the size, in elements, of the image
- */
- static int calculateImageStorage(Buffer buffer, int format, int type, int width, int height, int depth) {
- return calculateImageStorage(format, type, width, height, depth) >> BufferUtils.getElementSizeExponent(buffer);
- }
-
- static int calculateTexImage1DStorage(Buffer buffer, int format, int type, int width) {
- return calculateTexImage1DStorage(format, type, width) >> BufferUtils.getElementSizeExponent(buffer);
- }
-
- static int calculateTexImage2DStorage(Buffer buffer, int format, int type, int width, int height) {
- return calculateTexImage2DStorage(format, type, width, height) >> BufferUtils.getElementSizeExponent(buffer);
- }
-
- static int calculateTexImage3DStorage(Buffer buffer, int format, int type, int width, int height, int depth) {
- return calculateTexImage3DStorage(format, type, width, height, depth) >> BufferUtils.getElementSizeExponent(buffer);
- }
-
- /**
- * Calculate the storage required for an image in bytes.
- *
- * @param format The format of the image (example: GL_RGBA)
- * @param type The type of the image elements (example: GL_UNSIGNED_BYTE)
- * @param width The width of the image
- * @param height The height of the image (1 for 1D images)
- * @param depth The depth of the image (1 for 2D images)
- *
- * @return the size, in bytes, of the image
- */
- private static int calculateImageStorage(int format, int type, int width, int height, int depth) {
- return calculateBytesPerPixel(format, type) * width * height * depth;
- }
-
- private static int calculateTexImage1DStorage(int format, int type, int width) {
- return calculateBytesPerPixel(format, type) * width;
- }
-
- private static int calculateTexImage2DStorage(int format, int type, int width, int height) {
- return calculateTexImage1DStorage(format, type, width) * height;
- }
-
- private static int calculateTexImage3DStorage(int format, int type, int width, int height, int depth) {
- return calculateTexImage2DStorage(format, type, width, height) * depth;
- }
-
- private static int calculateBytesPerPixel(int format, int type) {
- int bpe;
- switch ( type ) {
- case GL11.GL_UNSIGNED_BYTE:
- case GL11.GL_BYTE:
- bpe = 1;
- break;
- case GL11.GL_UNSIGNED_SHORT:
- case GL11.GL_SHORT:
- bpe = 2;
- break;
- case GL11.GL_UNSIGNED_INT:
- case GL11.GL_INT:
- case GL11.GL_FLOAT:
- bpe = 4;
- break;
- default :
- // TODO: Add more types (like the GL12 types GL_UNSIGNED_INT_8_8_8_8
- return 0;
- // throw new IllegalArgumentException("Unknown type " + type);
- }
- int epp;
- switch ( format ) {
- case GL11.GL_LUMINANCE:
- case GL11.GL_ALPHA:
- epp = 1;
- break;
-
- case GL11.GL_LUMINANCE_ALPHA:
- epp = 2;
- break;
- case GL11.GL_RGB:
- case EXTBgra.GL_BGR_EXT:
- epp = 3;
- break;
- case GL11.GL_RGBA:
- case EXTAbgr.GL_ABGR_EXT:
- case EXTBgra.GL_BGRA_EXT:
- epp = 4;
- break;
- default :
- // TODO: Add more formats. Assuming 4 is too wasteful on buffer sizes where e.g. 1 is enough (like GL_DEPTH_COMPONENT)
- return 0;
-/* // Assume 4 elements per pixel
- epp = 4;*/
- }
-
- return bpe * epp;
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import java.nio.Buffer;
+import java.nio.IntBuffer;
+
+import org.lwjgl.BufferUtils;
+
+/**
+ * A class to check buffer boundaries in GL methods. Many GL
+ * methods read data from the GL into a native Buffer at its current position. If there is unsufficient space in the buffer when
+ * the call is made then a buffer overflow would otherwise occur and cause unexpected behaviour, a crash, or worse, a security
+ * risk. Therefore in those methods where GL reads data back into a buffer, we will call a bounds check method from this class
+ * to ensure that there is sufficient space in the buffer.
+ * <p/>
+ * Thrown by the debug build library of the LWJGL if any OpenGL operation causes an error.
+ *
+ * @author cix_foo <cix_foo at users.sourceforge.net>
+ * @version $Revision: 3279 $
+ * $Id: GLChecks.java 3279 2010-03-11 21:06:49Z spasi $
+ */
+class GLChecks {
+
+ /** Static methods only! */
+ private GLChecks() {
+ }
+
+ static References getReferences(ContextCapabilities caps) {
+ return StateTracker.getReferencesStack(caps).getReferences();
+ }
+
+ static int getBufferObjectSize(ContextCapabilities caps, int buffer_enum) {
+ IntBuffer scratch_buffer = caps.scratch_int_buffer;
+ GL15.glGetBufferParameter(buffer_enum, GL15.GL_BUFFER_SIZE, scratch_buffer);
+ return scratch_buffer.get(0);
+ }
+
+ static int getBufferObjectSizeARB(ContextCapabilities caps, int buffer_enum) {
+ IntBuffer scratch_buffer = caps.scratch_int_buffer;
+ ARBBufferObject.glGetBufferParameterARB(buffer_enum, ARBBufferObject.GL_BUFFER_SIZE_ARB, scratch_buffer);
+ return scratch_buffer.get(0);
+ }
+
+ static int getBufferObjectSizeATI(ContextCapabilities caps, int buffer) {
+ IntBuffer scratch_buffer = caps.scratch_int_buffer;
+ ATIVertexArrayObject.glGetObjectBufferATI(buffer, ATIVertexArrayObject.GL_OBJECT_BUFFER_SIZE_ATI, scratch_buffer);
+ return scratch_buffer.get(0);
+ }
+
+ static int getNamedBufferObjectSize(ContextCapabilities caps, int buffer) {
+ IntBuffer scratch_buffer = caps.scratch_int_buffer;
+ EXTDirectStateAccess.glGetNamedBufferParameterEXT(buffer, GL15.GL_BUFFER_SIZE, scratch_buffer);
+ return scratch_buffer.get(0);
+ }
+
+ private static boolean checkBufferObject(ContextCapabilities caps, int buffer_enum, boolean state) {
+ IntBuffer scratch_buffer = caps.scratch_int_buffer;
+ GL11.glGetInteger(buffer_enum, scratch_buffer);
+ boolean is_enabled = scratch_buffer.get(0) != 0;
+ return state == is_enabled;
+ }
+
+ /** Helper method to ensure that array buffer objects are disabled. If they are enabled, we'll throw an OpenGLException */
+ static void ensureArrayVBOdisabled(ContextCapabilities caps) {
+ if(StateTracker.getReferencesStack(caps).getReferences().arrayBuffer != 0)
+ throw new OpenGLException("Cannot use Buffers when Array Buffer Object is enabled");
+ }
+
+ /** Helper method to ensure that array buffer objects are enabled. If they are disabled, we'll throw an OpenGLException */
+ static void ensureArrayVBOenabled(ContextCapabilities caps) {
+ if(StateTracker.getReferencesStack(caps).getReferences().arrayBuffer == 0)
+ throw new OpenGLException("Cannot use offsets when Array Buffer Object is disabled");
+ }
+
+ /** Helper method to ensure that element array buffer objects are disabled. If they are enabled, we'll throw an OpenGLException */
+ static void ensureElementVBOdisabled(ContextCapabilities caps) {
+ if(StateTracker.getReferencesStack(caps).getReferences().elementArrayBuffer != 0)
+ throw new OpenGLException("Cannot use Buffers when Element Array Buffer Object is enabled");
+ }
+
+ /** Helper method to ensure that element array buffer objects are enabled. If they are disabled, we'll throw an OpenGLException */
+ static void ensureElementVBOenabled(ContextCapabilities caps) {
+ if(StateTracker.getReferencesStack(caps).getReferences().elementArrayBuffer == 0)
+ throw new OpenGLException("Cannot use offsets when Element Array Buffer Object is disabled");
+ }
+
+ /** Helper method to ensure that array buffer objects are disabled. If they are enabled, we'll throw an OpenGLException */
+ static void ensureIndirectBOdisabled(ContextCapabilities caps) {
+ if ( StateTracker.getReferencesStack(caps).getReferences().indirectBuffer != 0 )
+ throw new OpenGLException("Cannot use Buffers when Draw Indirect Object is enabled");
+ }
+
+ /** Helper method to ensure that array buffer objects are enabled. If they are disabled, we'll throw an OpenGLException */
+ static void ensureIndirectBOenabled(ContextCapabilities caps) {
+ if ( StateTracker.getReferencesStack(caps).getReferences().indirectBuffer == 0 )
+ throw new OpenGLException("Cannot use offsets when Draw Indirect Object is disabled");
+ }
+
+ /** Helper method to ensure that pixel pack buffer objects are disabled. If they are enabled, we'll throw an OpenGLException */
+ static void ensurePackPBOdisabled(ContextCapabilities caps) {
+ if ( StateTracker.getReferencesStack(caps).getReferences().pixelPackBuffer != 0 )
+ throw new OpenGLException("Cannot use Buffers when Pixel Pack Buffer Object is enabled");
+ }
+
+ /** Helper method to ensure that pixel pack buffer objects are enabled. If they are disabled, we'll throw an OpenGLException */
+ static void ensurePackPBOenabled(ContextCapabilities caps) {
+ if ( StateTracker.getReferencesStack(caps).getReferences().pixelPackBuffer == 0 )
+ throw new OpenGLException("Cannot use offsets when Pixel Pack Buffer Object is disabled");
+ }
+
+ /** Helper method to ensure that pixel unpack buffer objects are disabled. If they are enabled, we'll throw an OpenGLException */
+ static void ensureUnpackPBOdisabled(ContextCapabilities caps) {
+ if ( StateTracker.getReferencesStack(caps).getReferences().pixelUnpackBuffer != 0 )
+ throw new OpenGLException("Cannot use Buffers when Pixel Unpack Buffer Object is enabled");
+ }
+
+ /** Helper method to ensure that pixel unpack buffer objects are enabled. If they are disabled, we'll throw an OpenGLException */
+ static void ensureUnpackPBOenabled(ContextCapabilities caps) {
+ if ( StateTracker.getReferencesStack(caps).getReferences().pixelUnpackBuffer == 0 )
+ throw new OpenGLException("Cannot use offsets when Pixel Unpack Buffer Object is disabled");
+ }
+
+ /**
+ * Calculate the storage required for an image in elements
+ *
+ * @param format The format of the image (example: GL_RGBA)
+ * @param type The type of the image elements (example: GL_UNSIGNED_BYTE)
+ * @param width The width of the image
+ * @param height The height of the image (1 for 1D images)
+ * @param depth The depth of the image (1 for 2D images)
+ *
+ * @return the size, in elements, of the image
+ */
+ static int calculateImageStorage(Buffer buffer, int format, int type, int width, int height, int depth) {
+ return calculateImageStorage(format, type, width, height, depth) >> BufferUtils.getElementSizeExponent(buffer);
+ }
+
+ static int calculateTexImage1DStorage(Buffer buffer, int format, int type, int width) {
+ return calculateTexImage1DStorage(format, type, width) >> BufferUtils.getElementSizeExponent(buffer);
+ }
+
+ static int calculateTexImage2DStorage(Buffer buffer, int format, int type, int width, int height) {
+ return calculateTexImage2DStorage(format, type, width, height) >> BufferUtils.getElementSizeExponent(buffer);
+ }
+
+ static int calculateTexImage3DStorage(Buffer buffer, int format, int type, int width, int height, int depth) {
+ return calculateTexImage3DStorage(format, type, width, height, depth) >> BufferUtils.getElementSizeExponent(buffer);
+ }
+
+ /**
+ * Calculate the storage required for an image in bytes.
+ *
+ * @param format The format of the image (example: GL_RGBA)
+ * @param type The type of the image elements (example: GL_UNSIGNED_BYTE)
+ * @param width The width of the image
+ * @param height The height of the image (1 for 1D images)
+ * @param depth The depth of the image (1 for 2D images)
+ *
+ * @return the size, in bytes, of the image
+ */
+ private static int calculateImageStorage(int format, int type, int width, int height, int depth) {
+ return calculateBytesPerPixel(format, type) * width * height * depth;
+ }
+
+ private static int calculateTexImage1DStorage(int format, int type, int width) {
+ return calculateBytesPerPixel(format, type) * width;
+ }
+
+ private static int calculateTexImage2DStorage(int format, int type, int width, int height) {
+ return calculateTexImage1DStorage(format, type, width) * height;
+ }
+
+ private static int calculateTexImage3DStorage(int format, int type, int width, int height, int depth) {
+ return calculateTexImage2DStorage(format, type, width, height) * depth;
+ }
+
+ private static int calculateBytesPerPixel(int format, int type) {
+ int bpe;
+ switch ( type ) {
+ case GL11.GL_UNSIGNED_BYTE:
+ case GL11.GL_BYTE:
+ bpe = 1;
+ break;
+ case GL11.GL_UNSIGNED_SHORT:
+ case GL11.GL_SHORT:
+ bpe = 2;
+ break;
+ case GL11.GL_UNSIGNED_INT:
+ case GL11.GL_INT:
+ case GL11.GL_FLOAT:
+ bpe = 4;
+ break;
+ default :
+ // TODO: Add more types (like the GL12 types GL_UNSIGNED_INT_8_8_8_8
+ return 0;
+ // throw new IllegalArgumentException("Unknown type " + type);
+ }
+ int epp;
+ switch ( format ) {
+ case GL11.GL_LUMINANCE:
+ case GL11.GL_ALPHA:
+ epp = 1;
+ break;
+
+ case GL11.GL_LUMINANCE_ALPHA:
+ epp = 2;
+ break;
+ case GL11.GL_RGB:
+ case EXTBgra.GL_BGR_EXT:
+ epp = 3;
+ break;
+ case GL11.GL_RGBA:
+ case EXTAbgr.GL_ABGR_EXT:
+ case EXTBgra.GL_BGRA_EXT:
+ epp = 4;
+ break;
+ default :
+ // TODO: Add more formats. Assuming 4 is too wasteful on buffer sizes where e.g. 1 is enough (like GL_DEPTH_COMPONENT)
+ return 0;
+/* // Assume 4 elements per pixel
+ epp = 4;*/
+ }
+
+ return bpe * epp;
+ }
+}
diff --git a/src/java/org/lwjgl/opengl/GLContext.java b/src/java/org/lwjgl/opengl/GLContext.java
index 35158f5..f98c41f 100644
--- a/src/java/org/lwjgl/opengl/GLContext.java
+++ b/src/java/org/lwjgl/opengl/GLContext.java
@@ -1,393 +1,393 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.BufferUtils;
-import org.lwjgl.LWJGLException;
-import org.lwjgl.LWJGLUtil;
-import org.lwjgl.Sys;
-
-import java.lang.reflect.Method;
-import java.nio.IntBuffer;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedExceptionAction;
-import java.util.*;
-
-/**
- * <p/>
- * Manages GL contexts. Before any rendering is done by a LWJGL system, a call should be made to GLContext.useContext() with a
- * context. This will ensure that GLContext has an accurate reflection of the current context's capabilities and function
- * pointers.
- * <p/>
- * This class is thread-safe in the sense that multiple threads can safely call all public methods. The class is also
- * thread-aware in the sense that it tracks a per-thread current context (including capabilities and function pointers).
- * That way, multiple threads can have multiple contexts current and render to them concurrently.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3279 $
- * $Id: GLContext.java 3279 2010-03-11 21:06:49Z spasi $
- */
-public final class GLContext {
-
- /** Maps threads to their current context's ContextCapabilities, if any */
- private final static ThreadLocal current_capabilities = new ThreadLocal();
-
- /**
- * The getCapabilities() method is a potential hot spot in any LWJGL application, since
- * it is needed for context capability discovery (e.g. is OpenGL 2.0 supported?), and
- * for the function pointers of gl functions. However, the 'current_capabilities' ThreadLocal
- * is (relatively) expensive to look up, and since most OpenGL applications use are single threaded
- * rendering, the following two is an optimization for this case.
- * <p/>
- * ThreadLocals can be thought of as a mapping between threads and values, so the idea
- * is to use a lock-less cache of mappings between threads and the current ContextCapabilities. The cache
- * could be any size, but in our case, we want a single sized cache for optimal performance
- * in the single threaded case.
- * <p/>
- * 'fast_path_cache' is the most recent ContextCapabilities (potentially null) and its owner. By
- * recent I mean the last thread setting the value in setCapabilities(). When getCapabilities()
- * is called, a check to see if the current is the owner of the ContextCapabilities instance in
- * fast_path_cache. If so, the instance is returned, if not, some thread has since taken ownership
- * of the cache entry and the slower current_capabilities ThreadLocal is queried instead.
- * <p/>
- * No locks are needed in get/setCapabilities, because even though fast_path_cache can be accessed
- * from multiple threads at once, we are guaranteed by the JVM spec that its value is always valid.
- * Furthermore, if the ownership test in getCapabilities() succeeds, the cache entry can only contain
- * the correct ContextCapabilites (that is, the one from getThreadLocalCapabilites()),
- * since no other thread can set the owner to anyone else than itself.
- */
- private static CapabilitiesCacheEntry fast_path_cache = new CapabilitiesCacheEntry();
-
- /**
- * Simple lock-free cache of CapabilitesEntryCache to avoid allocating more than one
- * cache entry per thread
- */
- private final static ThreadLocal thread_cache_entries = new ThreadLocal();
-
- /**
- * The weak mapping from context Object instances to ContextCapabilities. Used
- * to avoid recreating a ContextCapabilities every time a context is made current.
- */
- private final static Map capability_cache = new WeakHashMap();
-
- /** Reference count of the native opengl implementation library */
- private static int gl_ref_count;
- private static boolean did_auto_load;
-
- static {
- Sys.initialize();
- }
-
- /**
- * Get the current capabilities instance. It contains the flags used
- * to test for support of a particular extension.
- *
- * @return The current capabilities instance.
- */
- public static ContextCapabilities getCapabilities() {
- CapabilitiesCacheEntry recent_cache_entry = fast_path_cache;
- // Check owner of cache entry
- if ( recent_cache_entry.owner == Thread.currentThread() ) {
- /* The owner ship test succeeded, so the cache must contain the current ContextCapabilities instance
- * assert recent_cache_entry.capabilities == getThreadLocalCapabilities();
- */
- return recent_cache_entry.capabilities;
- } else // Some other thread has written to the cache since, and we fall back to the slower path
- return getThreadLocalCapabilities();
- }
-
- private static ContextCapabilities getThreadLocalCapabilities() {
- return ((ContextCapabilities)current_capabilities.get());
- }
-
- /**
- * Set the current capabilities instance. It contains the flags used
- * to test for support of a particular extension.
- *
- * @return The current capabilities instance.
- */
- static void setCapabilities(ContextCapabilities capabilities) {
- current_capabilities.set(capabilities);
-
- CapabilitiesCacheEntry thread_cache_entry = (CapabilitiesCacheEntry)thread_cache_entries.get();
- if ( thread_cache_entry == null ) {
- thread_cache_entry = new CapabilitiesCacheEntry();
- thread_cache_entries.set(thread_cache_entry);
- }
- thread_cache_entry.owner = Thread.currentThread();
- thread_cache_entry.capabilities = capabilities;
-
- fast_path_cache = thread_cache_entry;
- }
-
- /**
- * Helper method to get a pointer to a named function in the OpenGL library
- * with a name dependent on the current platform
- */
- static long getPlatformSpecificFunctionAddress(String function_prefix, String[] os_prefixes, String[] os_function_prefixes, String function) {
- String os_name = (String)AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return System.getProperty("os.name");
- }
- });
- for ( int i = 0; i < os_prefixes.length; i++ )
- if ( os_name.startsWith(os_prefixes[i]) ) {
- String platform_function_name = function.replaceFirst(function_prefix, os_function_prefixes[i]);
- long address = getFunctionAddress(platform_function_name);
- return address;
- }
- return 0;
- }
-
- /** Helper method to get a pointer to a named function in the OpenGL library */
- static native long getFunctionAddress(String name);
-
- /**
- * Determine which extensions are available and returns the context profile mask. Helper method to ContextCapabilities.
- *
- * @param supported_extensions the Set to fill with the available extension names
- *
- * @return the context profile mask, will be 0 for any version < 3.2
- */
- static int getSupportedExtensions(final Set supported_extensions) {
- // Detect OpenGL version first
-
- final String version = GL11.glGetString(GL11.GL_VERSION);
- if ( version == null )
- throw new IllegalStateException("glGetString(GL_VERSION) returned null - possibly caused by missing current context.");
-
- final StringTokenizer version_tokenizer = new StringTokenizer(version, ". ");
- final String major_string = version_tokenizer.nextToken();
- final String minor_string = version_tokenizer.nextToken();
-
- int majorVersion = 0;
- int minorVersion = 0;
- try {
- majorVersion = Integer.parseInt(major_string);
- minorVersion = Integer.parseInt(minor_string);
- } catch (NumberFormatException e) {
- LWJGLUtil.log("The major and/or minor OpenGL version is malformed: " + e.getMessage());
- }
-
- // ----------------------[ 4.X ]----------------------
- if ( 4 <= majorVersion )
- supported_extensions.add("OpenGL40");
-
- // ----------------------[ 3.X ]----------------------
- if ( 3 < majorVersion || (3 == majorVersion && 3 <= minorVersion) )
- supported_extensions.add("OpenGL33");
- if ( 3 < majorVersion || (3 == majorVersion && 2 <= minorVersion) )
- supported_extensions.add("OpenGL32");
- if ( 3 < majorVersion || (3 == majorVersion && 1 <= minorVersion) )
- supported_extensions.add("OpenGL31");
- if ( 3 <= majorVersion )
- supported_extensions.add("OpenGL30");
-
- // ----------------------[ 2.X ]----------------------
- if ( 2 < majorVersion || (2 == majorVersion && 1 <= minorVersion) )
- supported_extensions.add("OpenGL21");
- if ( 2 <= majorVersion )
- supported_extensions.add("OpenGL20");
-
- // ----------------------[ 1.X ]----------------------
- if ( 1 < majorVersion || 5 <= minorVersion )
- supported_extensions.add("OpenGL15");
- if ( 1 < majorVersion || 4 <= minorVersion )
- supported_extensions.add("OpenGL14");
- if ( 1 < majorVersion || 3 <= minorVersion )
- supported_extensions.add("OpenGL13");
- if ( 1 < majorVersion || 2 <= minorVersion )
- supported_extensions.add("OpenGL12");
- if ( 1 < majorVersion || 1 <= minorVersion )
- supported_extensions.add("OpenGL11");
-
- int profileMask = 0;
-
- if ( majorVersion < 3 ) {
- // Parse EXTENSIONS string
- final String extensions_string = GL11.glGetString(GL11.GL_EXTENSIONS);
- if ( extensions_string == null )
- throw new IllegalStateException("glGetString(GL_EXTENSIONS) returned null - is there a context current?");
-
- final StringTokenizer tokenizer = new StringTokenizer(extensions_string);
- while ( tokenizer.hasMoreTokens() )
- supported_extensions.add(tokenizer.nextToken());
- } else {
- // Use forward compatible indexed EXTENSIONS
- final IntBuffer buffer = BufferUtils.createIntBuffer(16);
- GL11.glGetInteger(GL30.GL_NUM_EXTENSIONS, buffer);
- final int extensionCount = buffer.get(0);
-
- for ( int i = 0; i < extensionCount; i++ )
- supported_extensions.add(GL30.glGetStringi(GL11.GL_EXTENSIONS, i));
-
- // Get the context profile mask for versions >= 3.2
- if ( 3 < majorVersion || 2 <= minorVersion ) {
- Util.checkGLError(); // Make sure we have no errors up to this point
-
- GL11.glGetInteger(GL32.GL_CONTEXT_PROFILE_MASK, buffer);
-
- try {
- // Retrieving GL_CONTEXT_PROFILE_MASK may generate an INVALID_OPERATION error on certain implementations, ignore.
- // Happens on pre10.1 ATI drivers, when ContextAttribs.withProfileCompatibility is not used
- Util.checkGLError();
- profileMask = buffer.get(0);
- } catch (OpenGLException e) {
- LWJGLUtil.log("Failed to retrieve CONTEXT_PROFILE_MASK");
- }
- }
- }
-
- return profileMask;
- }
-
- /**
- * Helper method to ContextCapabilities. It will try to initialize the native stubs,
- * and remove the given extension name from the extension set if the initialization fails.
- */
- static void initNativeStubs(final Class extension_class, Set supported_extensions, String ext_name) {
- resetNativeStubs(extension_class);
- if ( supported_extensions.contains(ext_name) ) {
- try {
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws Exception {
- Method init_stubs_method = extension_class.getDeclaredMethod("initNativeStubs", null);
- init_stubs_method.invoke(null, null);
- return null;
- }
- });
- } catch (Exception e) {
- LWJGLUtil.log("Failed to initialize extension " + extension_class + " - exception: " + e);
- supported_extensions.remove(ext_name);
- }
- }
- }
-
- /**
- * Makes a GL context the current LWJGL context by loading GL function pointers. The context must be current before a call to
- * this method! Instead it simply ensures that the current context is reflected accurately by GLContext's extension caps and
- * function pointers. Use useContext(null) when no context is active. <p>If the context is the same as last time, then this is
- * a no-op. <p>If the context has not been encountered before it will be fully initialized from scratch. Otherwise a cached set
- * of caps and function pointers will be used. <p>The reference to the context is held in a weak reference; therefore if no
- * strong reference exists to the GL context it will automatically be forgotten by the VM at an indeterminate point in the
- * future, freeing up a little RAM.
- *
- * @param context The context object, which uniquely identifies a GL context. If context is null, the native stubs are
- * unloaded.
- *
- * @throws LWJGLException if context non-null, and the gl library can't be loaded or the basic GL11 functions can't be loaded
- */
- public static synchronized void useContext(Object context) throws LWJGLException {
- useContext(context, false);
- }
-
- /**
- * Makes a GL context the current LWJGL context by loading GL function pointers. The context must be current before a call to
- * this method! Instead it simply ensures that the current context is reflected accurately by GLContext's extension caps and
- * function pointers. Use useContext(null) when no context is active. <p>If the context is the same as last time, then this is
- * a no-op. <p>If the context has not been encountered before it will be fully initialized from scratch. Otherwise a cached set
- * of caps and function pointers will be used. <p>The reference to the context is held in a weak reference; therefore if no
- * strong reference exists to the GL context it will automatically be forgotten by the VM at an indeterminate point in the
- * future, freeing up a little RAM.
- * <p>If forwardCompatible is true, function pointers of deprecated GL11-GL21 functionality will not be loaded. Calling a deprecated
- * function using the specified context will result in an <code>IllegalStateException</code>.
- *
- * @param context The context object, which uniquely identifies a GL context. If context is null, the native stubs are
- * unloaded.
- * @param forwardCompatible If the context is a forward compatible context (does not expose deprecated functionality, see XGL_ARB_create_context)
- *
- * @throws LWJGLException if context non-null, and the gl library can't be loaded or the basic GL11 functions can't be loaded
- */
- public static synchronized void useContext(Object context, boolean forwardCompatible) throws LWJGLException {
- if ( context == null ) {
- ContextCapabilities.unloadAllStubs();
- setCapabilities(null);
- if ( did_auto_load )
- unloadOpenGLLibrary();
- return;
- }
- if ( gl_ref_count == 0 ) {
- loadOpenGLLibrary();
- did_auto_load = true;
- }
- try {
- ContextCapabilities capabilities = (ContextCapabilities)capability_cache.get(context);
- if ( capabilities == null ) {
- /*
- * The capabilities object registers itself as current. This behaviour is caused
- * by a chicken-and-egg situation where the constructor needs to call GL functions
- * as part of its capability discovery, but GL functions cannot be called before
- * a capabilities object has been set.
- */
- new ContextCapabilities(forwardCompatible);
- capability_cache.put(context, getCapabilities());
- } else
- setCapabilities(capabilities);
- } catch (LWJGLException e) {
- if ( did_auto_load )
- unloadOpenGLLibrary();
- throw e;
- }
- }
-
- /** If the OpenGL reference count is 0, the library is loaded. The reference count is then incremented. */
- public static synchronized void loadOpenGLLibrary() throws LWJGLException {
- if ( gl_ref_count == 0 )
- nLoadOpenGLLibrary();
- gl_ref_count++;
- }
-
- private static native void nLoadOpenGLLibrary() throws LWJGLException;
-
- /** The OpenGL library reference count is decremented, and if it reaches 0, the library is unloaded. */
- public static synchronized void unloadOpenGLLibrary() {
- gl_ref_count--;
- /*
- * Unload the native OpenGL library unless we're on linux, since
- * some drivers (NVIDIA proprietary) crash on exit when unloading the library.
- */
- if ( gl_ref_count == 0 && LWJGLUtil.getPlatform() != LWJGLUtil.PLATFORM_LINUX )
- nUnloadOpenGLLibrary();
- }
-
- private static native void nUnloadOpenGLLibrary();
-
- /** Native method to clear native stub bindings */
- static native void resetNativeStubs(Class clazz);
-
- private final static class CapabilitiesCacheEntry {
-
- Thread owner;
- ContextCapabilities capabilities;
- }
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.LWJGLException;
+import org.lwjgl.LWJGLUtil;
+import org.lwjgl.Sys;
+
+import java.lang.reflect.Method;
+import java.nio.IntBuffer;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedExceptionAction;
+import java.util.*;
+
+/**
+ * <p/>
+ * Manages GL contexts. Before any rendering is done by a LWJGL system, a call should be made to GLContext.useContext() with a
+ * context. This will ensure that GLContext has an accurate reflection of the current context's capabilities and function
+ * pointers.
+ * <p/>
+ * This class is thread-safe in the sense that multiple threads can safely call all public methods. The class is also
+ * thread-aware in the sense that it tracks a per-thread current context (including capabilities and function pointers).
+ * That way, multiple threads can have multiple contexts current and render to them concurrently.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3279 $
+ * $Id: GLContext.java 3279 2010-03-11 21:06:49Z spasi $
+ */
+public final class GLContext {
+
+ /** Maps threads to their current context's ContextCapabilities, if any */
+ private final static ThreadLocal current_capabilities = new ThreadLocal();
+
+ /**
+ * The getCapabilities() method is a potential hot spot in any LWJGL application, since
+ * it is needed for context capability discovery (e.g. is OpenGL 2.0 supported?), and
+ * for the function pointers of gl functions. However, the 'current_capabilities' ThreadLocal
+ * is (relatively) expensive to look up, and since most OpenGL applications use are single threaded
+ * rendering, the following two is an optimization for this case.
+ * <p/>
+ * ThreadLocals can be thought of as a mapping between threads and values, so the idea
+ * is to use a lock-less cache of mappings between threads and the current ContextCapabilities. The cache
+ * could be any size, but in our case, we want a single sized cache for optimal performance
+ * in the single threaded case.
+ * <p/>
+ * 'fast_path_cache' is the most recent ContextCapabilities (potentially null) and its owner. By
+ * recent I mean the last thread setting the value in setCapabilities(). When getCapabilities()
+ * is called, a check to see if the current is the owner of the ContextCapabilities instance in
+ * fast_path_cache. If so, the instance is returned, if not, some thread has since taken ownership
+ * of the cache entry and the slower current_capabilities ThreadLocal is queried instead.
+ * <p/>
+ * No locks are needed in get/setCapabilities, because even though fast_path_cache can be accessed
+ * from multiple threads at once, we are guaranteed by the JVM spec that its value is always valid.
+ * Furthermore, if the ownership test in getCapabilities() succeeds, the cache entry can only contain
+ * the correct ContextCapabilites (that is, the one from getThreadLocalCapabilites()),
+ * since no other thread can set the owner to anyone else than itself.
+ */
+ private static CapabilitiesCacheEntry fast_path_cache = new CapabilitiesCacheEntry();
+
+ /**
+ * Simple lock-free cache of CapabilitesEntryCache to avoid allocating more than one
+ * cache entry per thread
+ */
+ private final static ThreadLocal thread_cache_entries = new ThreadLocal();
+
+ /**
+ * The weak mapping from context Object instances to ContextCapabilities. Used
+ * to avoid recreating a ContextCapabilities every time a context is made current.
+ */
+ private final static Map capability_cache = new WeakHashMap();
+
+ /** Reference count of the native opengl implementation library */
+ private static int gl_ref_count;
+ private static boolean did_auto_load;
+
+ static {
+ Sys.initialize();
+ }
+
+ /**
+ * Get the current capabilities instance. It contains the flags used
+ * to test for support of a particular extension.
+ *
+ * @return The current capabilities instance.
+ */
+ public static ContextCapabilities getCapabilities() {
+ CapabilitiesCacheEntry recent_cache_entry = fast_path_cache;
+ // Check owner of cache entry
+ if ( recent_cache_entry.owner == Thread.currentThread() ) {
+ /* The owner ship test succeeded, so the cache must contain the current ContextCapabilities instance
+ * assert recent_cache_entry.capabilities == getThreadLocalCapabilities();
+ */
+ return recent_cache_entry.capabilities;
+ } else // Some other thread has written to the cache since, and we fall back to the slower path
+ return getThreadLocalCapabilities();
+ }
+
+ private static ContextCapabilities getThreadLocalCapabilities() {
+ return ((ContextCapabilities)current_capabilities.get());
+ }
+
+ /**
+ * Set the current capabilities instance. It contains the flags used
+ * to test for support of a particular extension.
+ *
+ * @return The current capabilities instance.
+ */
+ static void setCapabilities(ContextCapabilities capabilities) {
+ current_capabilities.set(capabilities);
+
+ CapabilitiesCacheEntry thread_cache_entry = (CapabilitiesCacheEntry)thread_cache_entries.get();
+ if ( thread_cache_entry == null ) {
+ thread_cache_entry = new CapabilitiesCacheEntry();
+ thread_cache_entries.set(thread_cache_entry);
+ }
+ thread_cache_entry.owner = Thread.currentThread();
+ thread_cache_entry.capabilities = capabilities;
+
+ fast_path_cache = thread_cache_entry;
+ }
+
+ /**
+ * Helper method to get a pointer to a named function in the OpenGL library
+ * with a name dependent on the current platform
+ */
+ static long getPlatformSpecificFunctionAddress(String function_prefix, String[] os_prefixes, String[] os_function_prefixes, String function) {
+ String os_name = (String)AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ return System.getProperty("os.name");
+ }
+ });
+ for ( int i = 0; i < os_prefixes.length; i++ )
+ if ( os_name.startsWith(os_prefixes[i]) ) {
+ String platform_function_name = function.replaceFirst(function_prefix, os_function_prefixes[i]);
+ long address = getFunctionAddress(platform_function_name);
+ return address;
+ }
+ return 0;
+ }
+
+ /** Helper method to get a pointer to a named function in the OpenGL library */
+ static native long getFunctionAddress(String name);
+
+ /**
+ * Determine which extensions are available and returns the context profile mask. Helper method to ContextCapabilities.
+ *
+ * @param supported_extensions the Set to fill with the available extension names
+ *
+ * @return the context profile mask, will be 0 for any version < 3.2
+ */
+ static int getSupportedExtensions(final Set supported_extensions) {
+ // Detect OpenGL version first
+
+ final String version = GL11.glGetString(GL11.GL_VERSION);
+ if ( version == null )
+ throw new IllegalStateException("glGetString(GL_VERSION) returned null - possibly caused by missing current context.");
+
+ final StringTokenizer version_tokenizer = new StringTokenizer(version, ". ");
+ final String major_string = version_tokenizer.nextToken();
+ final String minor_string = version_tokenizer.nextToken();
+
+ int majorVersion = 0;
+ int minorVersion = 0;
+ try {
+ majorVersion = Integer.parseInt(major_string);
+ minorVersion = Integer.parseInt(minor_string);
+ } catch (NumberFormatException e) {
+ LWJGLUtil.log("The major and/or minor OpenGL version is malformed: " + e.getMessage());
+ }
+
+ // ----------------------[ 4.X ]----------------------
+ if ( 4 <= majorVersion )
+ supported_extensions.add("OpenGL40");
+
+ // ----------------------[ 3.X ]----------------------
+ if ( 3 < majorVersion || (3 == majorVersion && 3 <= minorVersion) )
+ supported_extensions.add("OpenGL33");
+ if ( 3 < majorVersion || (3 == majorVersion && 2 <= minorVersion) )
+ supported_extensions.add("OpenGL32");
+ if ( 3 < majorVersion || (3 == majorVersion && 1 <= minorVersion) )
+ supported_extensions.add("OpenGL31");
+ if ( 3 <= majorVersion )
+ supported_extensions.add("OpenGL30");
+
+ // ----------------------[ 2.X ]----------------------
+ if ( 2 < majorVersion || (2 == majorVersion && 1 <= minorVersion) )
+ supported_extensions.add("OpenGL21");
+ if ( 2 <= majorVersion )
+ supported_extensions.add("OpenGL20");
+
+ // ----------------------[ 1.X ]----------------------
+ if ( 1 < majorVersion || 5 <= minorVersion )
+ supported_extensions.add("OpenGL15");
+ if ( 1 < majorVersion || 4 <= minorVersion )
+ supported_extensions.add("OpenGL14");
+ if ( 1 < majorVersion || 3 <= minorVersion )
+ supported_extensions.add("OpenGL13");
+ if ( 1 < majorVersion || 2 <= minorVersion )
+ supported_extensions.add("OpenGL12");
+ if ( 1 < majorVersion || 1 <= minorVersion )
+ supported_extensions.add("OpenGL11");
+
+ int profileMask = 0;
+
+ if ( majorVersion < 3 ) {
+ // Parse EXTENSIONS string
+ final String extensions_string = GL11.glGetString(GL11.GL_EXTENSIONS);
+ if ( extensions_string == null )
+ throw new IllegalStateException("glGetString(GL_EXTENSIONS) returned null - is there a context current?");
+
+ final StringTokenizer tokenizer = new StringTokenizer(extensions_string);
+ while ( tokenizer.hasMoreTokens() )
+ supported_extensions.add(tokenizer.nextToken());
+ } else {
+ // Use forward compatible indexed EXTENSIONS
+ final IntBuffer buffer = BufferUtils.createIntBuffer(16);
+ GL11.glGetInteger(GL30.GL_NUM_EXTENSIONS, buffer);
+ final int extensionCount = buffer.get(0);
+
+ for ( int i = 0; i < extensionCount; i++ )
+ supported_extensions.add(GL30.glGetStringi(GL11.GL_EXTENSIONS, i));
+
+ // Get the context profile mask for versions >= 3.2
+ if ( 3 < majorVersion || 2 <= minorVersion ) {
+ Util.checkGLError(); // Make sure we have no errors up to this point
+
+ GL11.glGetInteger(GL32.GL_CONTEXT_PROFILE_MASK, buffer);
+
+ try {
+ // Retrieving GL_CONTEXT_PROFILE_MASK may generate an INVALID_OPERATION error on certain implementations, ignore.
+ // Happens on pre10.1 ATI drivers, when ContextAttribs.withProfileCompatibility is not used
+ Util.checkGLError();
+ profileMask = buffer.get(0);
+ } catch (OpenGLException e) {
+ LWJGLUtil.log("Failed to retrieve CONTEXT_PROFILE_MASK");
+ }
+ }
+ }
+
+ return profileMask;
+ }
+
+ /**
+ * Helper method to ContextCapabilities. It will try to initialize the native stubs,
+ * and remove the given extension name from the extension set if the initialization fails.
+ */
+ static void initNativeStubs(final Class extension_class, Set supported_extensions, String ext_name) {
+ resetNativeStubs(extension_class);
+ if ( supported_extensions.contains(ext_name) ) {
+ try {
+ AccessController.doPrivileged(new PrivilegedExceptionAction() {
+ public Object run() throws Exception {
+ Method init_stubs_method = extension_class.getDeclaredMethod("initNativeStubs", null);
+ init_stubs_method.invoke(null, null);
+ return null;
+ }
+ });
+ } catch (Exception e) {
+ LWJGLUtil.log("Failed to initialize extension " + extension_class + " - exception: " + e);
+ supported_extensions.remove(ext_name);
+ }
+ }
+ }
+
+ /**
+ * Makes a GL context the current LWJGL context by loading GL function pointers. The context must be current before a call to
+ * this method! Instead it simply ensures that the current context is reflected accurately by GLContext's extension caps and
+ * function pointers. Use useContext(null) when no context is active. <p>If the context is the same as last time, then this is
+ * a no-op. <p>If the context has not been encountered before it will be fully initialized from scratch. Otherwise a cached set
+ * of caps and function pointers will be used. <p>The reference to the context is held in a weak reference; therefore if no
+ * strong reference exists to the GL context it will automatically be forgotten by the VM at an indeterminate point in the
+ * future, freeing up a little RAM.
+ *
+ * @param context The context object, which uniquely identifies a GL context. If context is null, the native stubs are
+ * unloaded.
+ *
+ * @throws LWJGLException if context non-null, and the gl library can't be loaded or the basic GL11 functions can't be loaded
+ */
+ public static synchronized void useContext(Object context) throws LWJGLException {
+ useContext(context, false);
+ }
+
+ /**
+ * Makes a GL context the current LWJGL context by loading GL function pointers. The context must be current before a call to
+ * this method! Instead it simply ensures that the current context is reflected accurately by GLContext's extension caps and
+ * function pointers. Use useContext(null) when no context is active. <p>If the context is the same as last time, then this is
+ * a no-op. <p>If the context has not been encountered before it will be fully initialized from scratch. Otherwise a cached set
+ * of caps and function pointers will be used. <p>The reference to the context is held in a weak reference; therefore if no
+ * strong reference exists to the GL context it will automatically be forgotten by the VM at an indeterminate point in the
+ * future, freeing up a little RAM.
+ * <p>If forwardCompatible is true, function pointers of deprecated GL11-GL21 functionality will not be loaded. Calling a deprecated
+ * function using the specified context will result in an <code>IllegalStateException</code>.
+ *
+ * @param context The context object, which uniquely identifies a GL context. If context is null, the native stubs are
+ * unloaded.
+ * @param forwardCompatible If the context is a forward compatible context (does not expose deprecated functionality, see XGL_ARB_create_context)
+ *
+ * @throws LWJGLException if context non-null, and the gl library can't be loaded or the basic GL11 functions can't be loaded
+ */
+ public static synchronized void useContext(Object context, boolean forwardCompatible) throws LWJGLException {
+ if ( context == null ) {
+ ContextCapabilities.unloadAllStubs();
+ setCapabilities(null);
+ if ( did_auto_load )
+ unloadOpenGLLibrary();
+ return;
+ }
+ if ( gl_ref_count == 0 ) {
+ loadOpenGLLibrary();
+ did_auto_load = true;
+ }
+ try {
+ ContextCapabilities capabilities = (ContextCapabilities)capability_cache.get(context);
+ if ( capabilities == null ) {
+ /*
+ * The capabilities object registers itself as current. This behaviour is caused
+ * by a chicken-and-egg situation where the constructor needs to call GL functions
+ * as part of its capability discovery, but GL functions cannot be called before
+ * a capabilities object has been set.
+ */
+ new ContextCapabilities(forwardCompatible);
+ capability_cache.put(context, getCapabilities());
+ } else
+ setCapabilities(capabilities);
+ } catch (LWJGLException e) {
+ if ( did_auto_load )
+ unloadOpenGLLibrary();
+ throw e;
+ }
+ }
+
+ /** If the OpenGL reference count is 0, the library is loaded. The reference count is then incremented. */
+ public static synchronized void loadOpenGLLibrary() throws LWJGLException {
+ if ( gl_ref_count == 0 )
+ nLoadOpenGLLibrary();
+ gl_ref_count++;
+ }
+
+ private static native void nLoadOpenGLLibrary() throws LWJGLException;
+
+ /** The OpenGL library reference count is decremented, and if it reaches 0, the library is unloaded. */
+ public static synchronized void unloadOpenGLLibrary() {
+ gl_ref_count--;
+ /*
+ * Unload the native OpenGL library unless we're on linux, since
+ * some drivers (NVIDIA proprietary) crash on exit when unloading the library.
+ */
+ if ( gl_ref_count == 0 && LWJGLUtil.getPlatform() != LWJGLUtil.PLATFORM_LINUX )
+ nUnloadOpenGLLibrary();
+ }
+
+ private static native void nUnloadOpenGLLibrary();
+
+ /** Native method to clear native stub bindings */
+ static native void resetNativeStubs(Class clazz);
+
+ private final static class CapabilitiesCacheEntry {
+
+ Thread owner;
+ ContextCapabilities capabilities;
+ }
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/opengl/GLUConstants.java b/src/java/org/lwjgl/opengl/GLUConstants.java
index c2a8bcf..7023b8c 100644
--- a/src/java/org/lwjgl/opengl/GLUConstants.java
+++ b/src/java/org/lwjgl/opengl/GLUConstants.java
@@ -1,58 +1,58 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-/**
- * <p/>
- * GLU constants.
- *
- * @author cix_foo <cix_foo at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: GLUConstants.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public interface GLUConstants {
-
- /* Errors: (return value 0 = no error) */
- int GLU_INVALID_ENUM = 100900;
- int GLU_INVALID_VALUE = 100901;
- int GLU_OUT_OF_MEMORY = 100902;
- int GLU_INCOMPATIBLE_GL_VERSION = 100903;
-
- /* StringName */
- int GLU_VERSION = 100800;
- int GLU_EXTENSIONS = 100801;
-
- /* Boolean */
- int GLU_TRUE = GL11.GL_TRUE;
- int GLU_FALSE = GL11.GL_FALSE;
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+/**
+ * <p/>
+ * GLU constants.
+ *
+ * @author cix_foo <cix_foo at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: GLUConstants.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public interface GLUConstants {
+
+ /* Errors: (return value 0 = no error) */
+ int GLU_INVALID_ENUM = 100900;
+ int GLU_INVALID_VALUE = 100901;
+ int GLU_OUT_OF_MEMORY = 100902;
+ int GLU_INCOMPATIBLE_GL_VERSION = 100903;
+
+ /* StringName */
+ int GLU_VERSION = 100800;
+ int GLU_EXTENSIONS = 100801;
+
+ /* Boolean */
+ int GLU_TRUE = GL11.GL_TRUE;
+ int GLU_FALSE = GL11.GL_FALSE;
+
+}
diff --git a/src/java/org/lwjgl/opengl/KeyboardEventQueue.java b/src/java/org/lwjgl/opengl/KeyboardEventQueue.java
index 12a2a5c..54d7319 100644
--- a/src/java/org/lwjgl/opengl/KeyboardEventQueue.java
+++ b/src/java/org/lwjgl/opengl/KeyboardEventQueue.java
@@ -1,366 +1,366 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-/**
- * An AWT implementation of a LWJGL compatible Keyboard event queue.
- * @author elias_naur
- */
-
-import java.awt.event.KeyEvent;
-import java.awt.event.KeyListener;
-import java.awt.Component;
-import java.nio.ByteBuffer;
-
-import org.lwjgl.input.Keyboard;
-
-final class KeyboardEventQueue extends EventQueue implements KeyListener {
- private static final int[] KEY_MAP = new int[0xffff];
-
- private final byte[] key_states = new byte[Keyboard.KEYBOARD_SIZE];
-
- /** Event scratch array */
- private final ByteBuffer event = ByteBuffer.allocate(Keyboard.EVENT_SIZE);
-
- private final Component component;
-
- private boolean has_deferred_event;
- private long deferred_nanos;
- private int deferred_key_code;
- private int deferred_key_location;
- private byte deferred_key_state;
- private int deferred_character;
-
- static {
- KEY_MAP[KeyEvent.VK_0] = Keyboard.KEY_0;
- KEY_MAP[KeyEvent.VK_1] = Keyboard.KEY_1;
- KEY_MAP[KeyEvent.VK_2] = Keyboard.KEY_2;
- KEY_MAP[KeyEvent.VK_3] = Keyboard.KEY_3;
- KEY_MAP[KeyEvent.VK_4] = Keyboard.KEY_4;
- KEY_MAP[KeyEvent.VK_5] = Keyboard.KEY_5;
- KEY_MAP[KeyEvent.VK_6] = Keyboard.KEY_6;
- KEY_MAP[KeyEvent.VK_7] = Keyboard.KEY_7;
- KEY_MAP[KeyEvent.VK_8] = Keyboard.KEY_8;
- KEY_MAP[KeyEvent.VK_9] = Keyboard.KEY_9;
- KEY_MAP[KeyEvent.VK_A] = Keyboard.KEY_A;
-// KEY_MAP[KeyEvent.VK_ACCEPT] = Keyboard.KEY_ACCEPT;
- KEY_MAP[KeyEvent.VK_ADD] = Keyboard.KEY_ADD;
-// KEY_MAP[KeyEvent.VK_AGAIN] = Keyboard.KEY_AGAIN;
-// KEY_MAP[KeyEvent.VK_ALL_CANDIDATES] = Keyboard.KEY_ALL_CANDIDATES;
-// KEY_MAP[KeyEvent.VK_ALPHANUMERIC] = Keyboard.KEY_ALPHANUMERIC;
-// KEY_MAP[KeyEvent.VK_ALT] = Keyboard.KEY_LMENU; manually mapped
- KEY_MAP[KeyEvent.VK_ALT_GRAPH] = Keyboard.KEY_RMENU;
-// KEY_MAP[KeyEvent.VK_AMPERSAND] = Keyboard.KEY_AMPERSAND;
-// KEY_MAP[KeyEvent.VK_ASTERISK] = Keyboard.KEY_ASTERISK;
- KEY_MAP[KeyEvent.VK_AT] = Keyboard.KEY_AT;
- KEY_MAP[KeyEvent.VK_B] = Keyboard.KEY_B;
-// KEY_MAP[KeyEvent.VK_BACK_QUOTE] = Keyboard.KEY_BACK_QUOTE;
- KEY_MAP[KeyEvent.VK_BACK_SLASH] = Keyboard.KEY_BACKSLASH;
- KEY_MAP[KeyEvent.VK_BACK_SPACE] = Keyboard.KEY_BACK;
-// KEY_MAP[KeyEvent.VK_BRACELEFT] = Keyboard.KEY_BRACELEFT;
-// KEY_MAP[KeyEvent.VK_BRACERIGHT] = Keyboard.KEY_BRACERIGHT;
- KEY_MAP[KeyEvent.VK_C] = Keyboard.KEY_C;
-// KEY_MAP[KeyEvent.VK_CANCEL] = Keyboard.KEY_CANCEL;
- KEY_MAP[KeyEvent.VK_CAPS_LOCK] = Keyboard.KEY_CAPITAL;
- KEY_MAP[KeyEvent.VK_CIRCUMFLEX] = Keyboard.KEY_CIRCUMFLEX;
-// KEY_MAP[KeyEvent.VK_CLEAR] = Keyboard.KEY_CLEAR;
- KEY_MAP[KeyEvent.VK_CLOSE_BRACKET] = Keyboard.KEY_RBRACKET;
-// KEY_MAP[KeyEvent.VK_CODE_INPUT] = Keyboard.KEY_CODE_INPUT;
- KEY_MAP[KeyEvent.VK_COLON] = Keyboard.KEY_COLON;
- KEY_MAP[KeyEvent.VK_COMMA] = Keyboard.KEY_COMMA;
-// KEY_MAP[KeyEvent.VK_COMPOSE] = Keyboard.KEY_COMPOSE;
-// KEY_MAP[KeyEvent.VK_CONTROL] = Keyboard.KEY_LCONTROL; manually mapped
- KEY_MAP[KeyEvent.VK_CONVERT] = Keyboard.KEY_CONVERT;
-// KEY_MAP[KeyEvent.VK_COPY] = Keyboard.KEY_COPY;
-// KEY_MAP[KeyEvent.VK_CUT] = Keyboard.KEY_CUT;
- KEY_MAP[KeyEvent.VK_D] = Keyboard.KEY_D;
-// KEY_MAP[KeyEvent.VK_DEAD_ABOVEDOT] = Keyboard.KEY_DEAD_ABOVEDOT;
-// KEY_MAP[KeyEvent.VK_DEAD_ABOVERING] = Keyboard.KEY_DEAD_ABOVERING;
-// KEY_MAP[KeyEvent.VK_DEAD_ACUTE] = Keyboard.KEY_DEAD_ACUTE;
-// KEY_MAP[KeyEvent.VK_DEAD_BREVE] = Keyboard.KEY_DEAD_BREVE;
-// KEY_MAP[KeyEvent.VK_DEAD_CARON] = Keyboard.KEY_DEAD_CARON;
-// KEY_MAP[KeyEvent.VK_DEAD_CEDILLA] = Keyboard.KEY_DEAD_CEDILLA;
-// KEY_MAP[KeyEvent.VK_DEAD_CIRCUMFLEX] = Keyboard.KEY_DEAD_CIRCUMFLEX;
-// KEY_MAP[KeyEvent.VK_DEAD_DIAERESIS] = Keyboard.KEY_DEAD_DIAERESIS;
-// KEY_MAP[KeyEvent.VK_DEAD_DOUBLEACUTE] = Keyboard.KEY_DEAD_DOUBLEACUTE;
-// KEY_MAP[KeyEvent.VK_DEAD_GRAVE] = Keyboard.KEY_DEAD_GRAVE;
-// KEY_MAP[KeyEvent.VK_DEAD_IOTA] = Keyboard.KEY_DEAD_IOTA;
-// KEY_MAP[KeyEvent.VK_DEAD_MACRON] = Keyboard.KEY_DEAD_MACRON;
-// KEY_MAP[KeyEvent.VK_DEAD_OGONEK] = Keyboard.KEY_DEAD_OGONEK;
-// KEY_MAP[KeyEvent.VK_DEAD_SEMIVOICED_SOUND] = Keyboard.KEY_DEAD_SEMIVOICED_SOUND;
-// KEY_MAP[KeyEvent.VK_DEAD_TILDE] = Keyboard.KEY_DEAD_TILDE;
-// KEY_MAP[KeyEvent.VK_DEAD_VOICED_SOUND] = Keyboard.KEY_DEAD_VOICED_SOUND;
- KEY_MAP[KeyEvent.VK_DECIMAL] = Keyboard.KEY_DECIMAL;
- KEY_MAP[KeyEvent.VK_DELETE] = Keyboard.KEY_DELETE;
- KEY_MAP[KeyEvent.VK_DIVIDE] = Keyboard.KEY_DIVIDE;
-// KEY_MAP[KeyEvent.VK_DOLLAR] = Keyboard.KEY_DOLLAR;
- KEY_MAP[KeyEvent.VK_DOWN] = Keyboard.KEY_DOWN;
- KEY_MAP[KeyEvent.VK_E] = Keyboard.KEY_E;
- KEY_MAP[KeyEvent.VK_END] = Keyboard.KEY_END;
- KEY_MAP[KeyEvent.VK_ENTER] = Keyboard.KEY_RETURN;
- KEY_MAP[KeyEvent.VK_EQUALS] = Keyboard.KEY_EQUALS;
- KEY_MAP[KeyEvent.VK_ESCAPE] = Keyboard.KEY_ESCAPE;
-// KEY_MAP[KeyEvent.VK_EURO_SIGN] = Keyboard.KEY_EURO_SIGN;
-// KEY_MAP[KeyEvent.VK_EXCLAMATION_MARK] = Keyboard.KEY_EXCLAMATION_MARK;
- KEY_MAP[KeyEvent.VK_F] = Keyboard.KEY_F;
- KEY_MAP[KeyEvent.VK_F1] = Keyboard.KEY_F1;
- KEY_MAP[KeyEvent.VK_F10] = Keyboard.KEY_F10;
- KEY_MAP[KeyEvent.VK_F11] = Keyboard.KEY_F11;
- KEY_MAP[KeyEvent.VK_F12] = Keyboard.KEY_F12;
- KEY_MAP[KeyEvent.VK_F13] = Keyboard.KEY_F13;
- KEY_MAP[KeyEvent.VK_F14] = Keyboard.KEY_F14;
- KEY_MAP[KeyEvent.VK_F15] = Keyboard.KEY_F15;
-// KEY_MAP[KeyEvent.VK_F16] = Keyboard.KEY_F16;
-// KEY_MAP[KeyEvent.VK_F17] = Keyboard.KEY_F17;
-// KEY_MAP[KeyEvent.VK_F18] = Keyboard.KEY_F18;
-// KEY_MAP[KeyEvent.VK_F19] = Keyboard.KEY_F19;
- KEY_MAP[KeyEvent.VK_F2] = Keyboard.KEY_F2;
-// KEY_MAP[KeyEvent.VK_F20] = Keyboard.KEY_F20;
-// KEY_MAP[KeyEvent.VK_F21] = Keyboard.KEY_F21;
-// KEY_MAP[KeyEvent.VK_F22] = Keyboard.KEY_F22;
-// KEY_MAP[KeyEvent.VK_F23] = Keyboard.KEY_F23;
-// KEY_MAP[KeyEvent.VK_F24] = Keyboard.KEY_F24;
- KEY_MAP[KeyEvent.VK_F3] = Keyboard.KEY_F3;
- KEY_MAP[KeyEvent.VK_F4] = Keyboard.KEY_F4;
- KEY_MAP[KeyEvent.VK_F5] = Keyboard.KEY_F5;
- KEY_MAP[KeyEvent.VK_F6] = Keyboard.KEY_F6;
- KEY_MAP[KeyEvent.VK_F7] = Keyboard.KEY_F7;
- KEY_MAP[KeyEvent.VK_F8] = Keyboard.KEY_F8;
- KEY_MAP[KeyEvent.VK_F9] = Keyboard.KEY_F9;
-// KEY_MAP[KeyEvent.VK_FINAL] = Keyboard.KEY_FINAL;
-// KEY_MAP[KeyEvent.VK_FIND] = Keyboard.KEY_FIND;
-// KEY_MAP[KeyEvent.VK_FULL_WIDTH] = Keyboard.KEY_FULL_WIDTH;
- KEY_MAP[KeyEvent.VK_G] = Keyboard.KEY_G;
-// KEY_MAP[KeyEvent.VK_GREATER] = Keyboard.KEY_GREATER;
- KEY_MAP[KeyEvent.VK_H] = Keyboard.KEY_H;
-// KEY_MAP[KeyEvent.VK_HALF_WIDTH] = Keyboard.KEY_HALF_WIDTH;
-// KEY_MAP[KeyEvent.VK_HELP] = Keyboard.KEY_HELP;
-// KEY_MAP[KeyEvent.VK_HIRAGANA] = Keyboard.KEY_HIRAGANA;
- KEY_MAP[KeyEvent.VK_HOME] = Keyboard.KEY_HOME;
- KEY_MAP[KeyEvent.VK_I] = Keyboard.KEY_I;
-// KEY_MAP[KeyEvent.VK_INPUT_METHOD_ON_OFF] = Keyboard.KEY_INPUT_METHOD_ON_OFF;
- KEY_MAP[KeyEvent.VK_INSERT] = Keyboard.KEY_INSERT;
-// KEY_MAP[KeyEvent.VK_INVERTED_EXCLAMATION_MARK] = Keyboard.KEY_INVERTED_EXCLAMATION_MARK;
- KEY_MAP[KeyEvent.VK_J] = Keyboard.KEY_J;
-// KEY_MAP[KeyEvent.VK_JAPANESE_HIRAGANA] = Keyboard.KEY_JAPANESE_HIRAGANA;
-// KEY_MAP[KeyEvent.VK_JAPANESE_KATAKANA] = Keyboard.KEY_JAPANESE_KATAKANA;
-// KEY_MAP[KeyEvent.VK_JAPANESE_ROMAN] = Keyboard.KEY_JAPANESE_ROMAN;
- KEY_MAP[KeyEvent.VK_K] = Keyboard.KEY_K;
- KEY_MAP[KeyEvent.VK_KANA] = Keyboard.KEY_KANA;
-// KEY_MAP[KeyEvent.VK_KANA_LOCK] = Keyboard.KEY_KANA_LOCK;
- KEY_MAP[KeyEvent.VK_KANJI] = Keyboard.KEY_KANJI;
-// KEY_MAP[KeyEvent.VK_KATAKANA] = Keyboard.KEY_KATAKANA;
-// KEY_MAP[KeyEvent.VK_KP_DOWN] = Keyboard.KEY_KP_DOWN;
-// KEY_MAP[KeyEvent.VK_KP_LEFT] = Keyboard.KEY_KP_LEFT;
-// KEY_MAP[KeyEvent.VK_KP_RIGHT] = Keyboard.KEY_KP_RIGHT;
-// KEY_MAP[KeyEvent.VK_KP_UP] = Keyboard.KEY_KP_UP;
- KEY_MAP[KeyEvent.VK_L] = Keyboard.KEY_L;
- KEY_MAP[KeyEvent.VK_LEFT] = Keyboard.KEY_LEFT;
-// KEY_MAP[KeyEvent.VK_LEFT_PARENTHESIS] = Keyboard.KEY_LEFT_PARENTHESIS;
-// KEY_MAP[KeyEvent.VK_LESS] = Keyboard.KEY_LESS;
- KEY_MAP[KeyEvent.VK_M] = Keyboard.KEY_M;
-// KEY_MAP[KeyEvent.VK_META] = Keyboard.KEY_LMENU; manually mapped
- KEY_MAP[KeyEvent.VK_MINUS] = Keyboard.KEY_MINUS;
-// KEY_MAP[KeyEvent.VK_MODECHANGE] = Keyboard.KEY_MODECHANGE;
- KEY_MAP[KeyEvent.VK_MULTIPLY] = Keyboard.KEY_MULTIPLY;
- KEY_MAP[KeyEvent.VK_N] = Keyboard.KEY_N;
-// KEY_MAP[KeyEvent.VK_NONCONVERT] = Keyboard.KEY_NONCONVERT;
- KEY_MAP[KeyEvent.VK_NUM_LOCK] = Keyboard.KEY_NUMLOCK;
-// KEY_MAP[KeyEvent.VK_NUMBER_SIGN] = Keyboard.KEY_NUMBER_SIGN;
- KEY_MAP[KeyEvent.VK_NUMPAD0] = Keyboard.KEY_NUMPAD0;
- KEY_MAP[KeyEvent.VK_NUMPAD1] = Keyboard.KEY_NUMPAD1;
- KEY_MAP[KeyEvent.VK_NUMPAD2] = Keyboard.KEY_NUMPAD2;
- KEY_MAP[KeyEvent.VK_NUMPAD3] = Keyboard.KEY_NUMPAD3;
- KEY_MAP[KeyEvent.VK_NUMPAD4] = Keyboard.KEY_NUMPAD4;
- KEY_MAP[KeyEvent.VK_NUMPAD5] = Keyboard.KEY_NUMPAD5;
- KEY_MAP[KeyEvent.VK_NUMPAD6] = Keyboard.KEY_NUMPAD6;
- KEY_MAP[KeyEvent.VK_NUMPAD7] = Keyboard.KEY_NUMPAD7;
- KEY_MAP[KeyEvent.VK_NUMPAD8] = Keyboard.KEY_NUMPAD8;
- KEY_MAP[KeyEvent.VK_NUMPAD9] = Keyboard.KEY_NUMPAD9;
- KEY_MAP[KeyEvent.VK_O] = Keyboard.KEY_O;
- KEY_MAP[KeyEvent.VK_OPEN_BRACKET] = Keyboard.KEY_LBRACKET;
- KEY_MAP[KeyEvent.VK_P] = Keyboard.KEY_P;
- KEY_MAP[KeyEvent.VK_PAGE_DOWN] = Keyboard.KEY_NEXT;
- KEY_MAP[KeyEvent.VK_PAGE_UP] = Keyboard.KEY_PRIOR;
-// KEY_MAP[KeyEvent.VK_PASTE] = Keyboard.KEY_PASTE;
- KEY_MAP[KeyEvent.VK_PAUSE] = Keyboard.KEY_PAUSE;
- KEY_MAP[KeyEvent.VK_PERIOD] = Keyboard.KEY_PERIOD;
-// KEY_MAP[KeyEvent.VK_PLUS] = Keyboard.KEY_PLUS;
-// KEY_MAP[KeyEvent.VK_PREVIOUS_CANDIDATE] = Keyboard.KEY_PREVIOUS_CANDIDATE;
-// KEY_MAP[KeyEvent.VK_PRINTSCREEN] = Keyboard.KEY_PRINTSCREEN;
-// KEY_MAP[KeyEvent.VK_PROPS] = Keyboard.KEY_PROPS;
- KEY_MAP[KeyEvent.VK_Q] = Keyboard.KEY_Q;
-// KEY_MAP[KeyEvent.VK_QUOTE] = Keyboard.KEY_QUOTE;
-// KEY_MAP[KeyEvent.VK_QUOTEDBL] = Keyboard.KEY_QUOTEDBL;
- KEY_MAP[KeyEvent.VK_R] = Keyboard.KEY_R;
- KEY_MAP[KeyEvent.VK_RIGHT] = Keyboard.KEY_RIGHT;
-// KEY_MAP[KeyEvent.VK_RIGHT_PARENTHESIS] = Keyboard.KEY_RIGHT_PARENTHESIS;
-// KEY_MAP[KeyEvent.VK_ROMAN_CHARACTERS] = Keyboard.KEY_ROMAN_CHARACTERS;
- KEY_MAP[KeyEvent.VK_S] = Keyboard.KEY_S;
- KEY_MAP[KeyEvent.VK_SCROLL_LOCK] = Keyboard.KEY_SCROLL;
- KEY_MAP[KeyEvent.VK_SEMICOLON] = Keyboard.KEY_SEMICOLON;
- KEY_MAP[KeyEvent.VK_SEPARATOR] = Keyboard.KEY_DECIMAL;
-// KEY_MAP[KeyEvent.VK_SHIFT] = Keyboard.KEY_LSHIFT; manually mapped
- KEY_MAP[KeyEvent.VK_SLASH] = Keyboard.KEY_SLASH;
- KEY_MAP[KeyEvent.VK_SPACE] = Keyboard.KEY_SPACE;
- KEY_MAP[KeyEvent.VK_STOP] = Keyboard.KEY_STOP;
- KEY_MAP[KeyEvent.VK_SUBTRACT] = Keyboard.KEY_SUBTRACT;
- KEY_MAP[KeyEvent.VK_T] = Keyboard.KEY_T;
- KEY_MAP[KeyEvent.VK_TAB] = Keyboard.KEY_TAB;
- KEY_MAP[KeyEvent.VK_U] = Keyboard.KEY_U;
-// KEY_MAP[KeyEvent.VK_UNDERSCORE] = Keyboard.KEY_UNDERSCORE;
-// KEY_MAP[KeyEvent.VK_UNDO] = Keyboard.KEY_UNDO;
- KEY_MAP[KeyEvent.VK_UP] = Keyboard.KEY_UP;
- KEY_MAP[KeyEvent.VK_V] = Keyboard.KEY_V;
- KEY_MAP[KeyEvent.VK_W] = Keyboard.KEY_W;
- KEY_MAP[KeyEvent.VK_X] = Keyboard.KEY_X;
- KEY_MAP[KeyEvent.VK_Y] = Keyboard.KEY_Y;
- KEY_MAP[KeyEvent.VK_Z] = Keyboard.KEY_Z;
- }
-
- KeyboardEventQueue(Component component) {
- super(Keyboard.EVENT_SIZE);
- this.component = component;
- }
-
- public void register() {
- component.addKeyListener(this);
- }
-
- public void unregister() {
- /*
- * This line is commented out to work around AWT bug 4867453:
- * http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4867453
- */
- //component.removeKeyListener(this);
- }
-
- private void putKeyboardEvent(int key_code, byte state, int character, long nanos, boolean repeat) {
- event.clear();
- event.putInt(key_code).put(state).putInt(character).putLong(nanos).put(repeat ? (byte)1 : (byte)0);
- event.flip();
- putEvent(event);
- }
-
- public synchronized void poll(ByteBuffer key_down_buffer) {
- flushDeferredEvent();
- int old_position = key_down_buffer.position();
- key_down_buffer.put(key_states);
- key_down_buffer.position(old_position);
- }
-
- public synchronized void copyEvents(ByteBuffer dest) {
- flushDeferredEvent();
- super.copyEvents(dest);
- }
-
- private synchronized void handleKey(int key_code, int key_location, byte state, int character, long nanos) {
- if (character == KeyEvent.CHAR_UNDEFINED)
- character = Keyboard.CHAR_NONE;
- if (state == 1) {
- boolean repeat = false;
- if (has_deferred_event) {
- if ((nanos == deferred_nanos && deferred_key_code == key_code &&
- deferred_key_location == key_location)) {
- has_deferred_event = false;
- repeat = true; // Repeat event
- } else
- flushDeferredEvent();
- }
- putKeyEvent(key_code, key_location, state, character, nanos, repeat);
- } else {
- flushDeferredEvent();
- has_deferred_event = true;
- deferred_nanos = nanos;
- deferred_key_code = key_code;
- deferred_key_location = key_location;
- deferred_key_state = state;
- deferred_character = character;
- }
- }
-
- private void flushDeferredEvent() {
- if (has_deferred_event) {
- putKeyEvent(deferred_key_code, deferred_key_location, deferred_key_state, deferred_character, deferred_nanos, false);
- has_deferred_event = false;
- }
- }
-
- private void putKeyEvent(int key_code, int key_location, byte state, int character, long nanos, boolean repeat) {
- int key_code_mapped = getMappedKeyCode(key_code, key_location);
- /* Ignore repeating presses */
- if ( key_states[key_code_mapped] == state )
- repeat = true;
- key_states[key_code_mapped] = state;
- int key_int_char = character & 0xffff;
- putKeyboardEvent(key_code_mapped, state, key_int_char, nanos, repeat);
- }
-
- private int getMappedKeyCode(int key_code, int position) {
- // manually map positioned keys
- switch (key_code) {
- case KeyEvent.VK_ALT: // fall through
- if (position == KeyEvent.KEY_LOCATION_RIGHT)
- return Keyboard.KEY_RMENU;
- else
- return Keyboard.KEY_LMENU;
- case KeyEvent.VK_META:
- if (position == KeyEvent.KEY_LOCATION_RIGHT)
- return Keyboard.KEY_RMETA;
- else
- return Keyboard.KEY_LMETA;
- case KeyEvent.VK_SHIFT:
- if (position == KeyEvent.KEY_LOCATION_RIGHT)
- return Keyboard.KEY_RSHIFT;
- else
- return Keyboard.KEY_LSHIFT;
- case KeyEvent.VK_CONTROL:
- if (position == KeyEvent.KEY_LOCATION_RIGHT)
- return Keyboard.KEY_RCONTROL;
- else
- return Keyboard.KEY_LCONTROL;
- default:
- return KEY_MAP[key_code];
- }
- }
-
- public void keyPressed(KeyEvent e) {
- handleKey(e.getKeyCode(), e.getKeyLocation(), (byte)1, e.getKeyChar(), e.getWhen()*1000000);
- }
-
- public void keyReleased(KeyEvent e) {
- handleKey(e.getKeyCode(), e.getKeyLocation(), (byte)0, Keyboard.CHAR_NONE, e.getWhen()*1000000);
- }
-
- public void keyTyped(KeyEvent e) {
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+/**
+ * An AWT implementation of a LWJGL compatible Keyboard event queue.
+ * @author elias_naur
+ */
+
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import java.awt.Component;
+import java.nio.ByteBuffer;
+
+import org.lwjgl.input.Keyboard;
+
+final class KeyboardEventQueue extends EventQueue implements KeyListener {
+ private static final int[] KEY_MAP = new int[0xffff];
+
+ private final byte[] key_states = new byte[Keyboard.KEYBOARD_SIZE];
+
+ /** Event scratch array */
+ private final ByteBuffer event = ByteBuffer.allocate(Keyboard.EVENT_SIZE);
+
+ private final Component component;
+
+ private boolean has_deferred_event;
+ private long deferred_nanos;
+ private int deferred_key_code;
+ private int deferred_key_location;
+ private byte deferred_key_state;
+ private int deferred_character;
+
+ static {
+ KEY_MAP[KeyEvent.VK_0] = Keyboard.KEY_0;
+ KEY_MAP[KeyEvent.VK_1] = Keyboard.KEY_1;
+ KEY_MAP[KeyEvent.VK_2] = Keyboard.KEY_2;
+ KEY_MAP[KeyEvent.VK_3] = Keyboard.KEY_3;
+ KEY_MAP[KeyEvent.VK_4] = Keyboard.KEY_4;
+ KEY_MAP[KeyEvent.VK_5] = Keyboard.KEY_5;
+ KEY_MAP[KeyEvent.VK_6] = Keyboard.KEY_6;
+ KEY_MAP[KeyEvent.VK_7] = Keyboard.KEY_7;
+ KEY_MAP[KeyEvent.VK_8] = Keyboard.KEY_8;
+ KEY_MAP[KeyEvent.VK_9] = Keyboard.KEY_9;
+ KEY_MAP[KeyEvent.VK_A] = Keyboard.KEY_A;
+// KEY_MAP[KeyEvent.VK_ACCEPT] = Keyboard.KEY_ACCEPT;
+ KEY_MAP[KeyEvent.VK_ADD] = Keyboard.KEY_ADD;
+// KEY_MAP[KeyEvent.VK_AGAIN] = Keyboard.KEY_AGAIN;
+// KEY_MAP[KeyEvent.VK_ALL_CANDIDATES] = Keyboard.KEY_ALL_CANDIDATES;
+// KEY_MAP[KeyEvent.VK_ALPHANUMERIC] = Keyboard.KEY_ALPHANUMERIC;
+// KEY_MAP[KeyEvent.VK_ALT] = Keyboard.KEY_LMENU; manually mapped
+ KEY_MAP[KeyEvent.VK_ALT_GRAPH] = Keyboard.KEY_RMENU;
+// KEY_MAP[KeyEvent.VK_AMPERSAND] = Keyboard.KEY_AMPERSAND;
+// KEY_MAP[KeyEvent.VK_ASTERISK] = Keyboard.KEY_ASTERISK;
+ KEY_MAP[KeyEvent.VK_AT] = Keyboard.KEY_AT;
+ KEY_MAP[KeyEvent.VK_B] = Keyboard.KEY_B;
+// KEY_MAP[KeyEvent.VK_BACK_QUOTE] = Keyboard.KEY_BACK_QUOTE;
+ KEY_MAP[KeyEvent.VK_BACK_SLASH] = Keyboard.KEY_BACKSLASH;
+ KEY_MAP[KeyEvent.VK_BACK_SPACE] = Keyboard.KEY_BACK;
+// KEY_MAP[KeyEvent.VK_BRACELEFT] = Keyboard.KEY_BRACELEFT;
+// KEY_MAP[KeyEvent.VK_BRACERIGHT] = Keyboard.KEY_BRACERIGHT;
+ KEY_MAP[KeyEvent.VK_C] = Keyboard.KEY_C;
+// KEY_MAP[KeyEvent.VK_CANCEL] = Keyboard.KEY_CANCEL;
+ KEY_MAP[KeyEvent.VK_CAPS_LOCK] = Keyboard.KEY_CAPITAL;
+ KEY_MAP[KeyEvent.VK_CIRCUMFLEX] = Keyboard.KEY_CIRCUMFLEX;
+// KEY_MAP[KeyEvent.VK_CLEAR] = Keyboard.KEY_CLEAR;
+ KEY_MAP[KeyEvent.VK_CLOSE_BRACKET] = Keyboard.KEY_RBRACKET;
+// KEY_MAP[KeyEvent.VK_CODE_INPUT] = Keyboard.KEY_CODE_INPUT;
+ KEY_MAP[KeyEvent.VK_COLON] = Keyboard.KEY_COLON;
+ KEY_MAP[KeyEvent.VK_COMMA] = Keyboard.KEY_COMMA;
+// KEY_MAP[KeyEvent.VK_COMPOSE] = Keyboard.KEY_COMPOSE;
+// KEY_MAP[KeyEvent.VK_CONTROL] = Keyboard.KEY_LCONTROL; manually mapped
+ KEY_MAP[KeyEvent.VK_CONVERT] = Keyboard.KEY_CONVERT;
+// KEY_MAP[KeyEvent.VK_COPY] = Keyboard.KEY_COPY;
+// KEY_MAP[KeyEvent.VK_CUT] = Keyboard.KEY_CUT;
+ KEY_MAP[KeyEvent.VK_D] = Keyboard.KEY_D;
+// KEY_MAP[KeyEvent.VK_DEAD_ABOVEDOT] = Keyboard.KEY_DEAD_ABOVEDOT;
+// KEY_MAP[KeyEvent.VK_DEAD_ABOVERING] = Keyboard.KEY_DEAD_ABOVERING;
+// KEY_MAP[KeyEvent.VK_DEAD_ACUTE] = Keyboard.KEY_DEAD_ACUTE;
+// KEY_MAP[KeyEvent.VK_DEAD_BREVE] = Keyboard.KEY_DEAD_BREVE;
+// KEY_MAP[KeyEvent.VK_DEAD_CARON] = Keyboard.KEY_DEAD_CARON;
+// KEY_MAP[KeyEvent.VK_DEAD_CEDILLA] = Keyboard.KEY_DEAD_CEDILLA;
+// KEY_MAP[KeyEvent.VK_DEAD_CIRCUMFLEX] = Keyboard.KEY_DEAD_CIRCUMFLEX;
+// KEY_MAP[KeyEvent.VK_DEAD_DIAERESIS] = Keyboard.KEY_DEAD_DIAERESIS;
+// KEY_MAP[KeyEvent.VK_DEAD_DOUBLEACUTE] = Keyboard.KEY_DEAD_DOUBLEACUTE;
+// KEY_MAP[KeyEvent.VK_DEAD_GRAVE] = Keyboard.KEY_DEAD_GRAVE;
+// KEY_MAP[KeyEvent.VK_DEAD_IOTA] = Keyboard.KEY_DEAD_IOTA;
+// KEY_MAP[KeyEvent.VK_DEAD_MACRON] = Keyboard.KEY_DEAD_MACRON;
+// KEY_MAP[KeyEvent.VK_DEAD_OGONEK] = Keyboard.KEY_DEAD_OGONEK;
+// KEY_MAP[KeyEvent.VK_DEAD_SEMIVOICED_SOUND] = Keyboard.KEY_DEAD_SEMIVOICED_SOUND;
+// KEY_MAP[KeyEvent.VK_DEAD_TILDE] = Keyboard.KEY_DEAD_TILDE;
+// KEY_MAP[KeyEvent.VK_DEAD_VOICED_SOUND] = Keyboard.KEY_DEAD_VOICED_SOUND;
+ KEY_MAP[KeyEvent.VK_DECIMAL] = Keyboard.KEY_DECIMAL;
+ KEY_MAP[KeyEvent.VK_DELETE] = Keyboard.KEY_DELETE;
+ KEY_MAP[KeyEvent.VK_DIVIDE] = Keyboard.KEY_DIVIDE;
+// KEY_MAP[KeyEvent.VK_DOLLAR] = Keyboard.KEY_DOLLAR;
+ KEY_MAP[KeyEvent.VK_DOWN] = Keyboard.KEY_DOWN;
+ KEY_MAP[KeyEvent.VK_E] = Keyboard.KEY_E;
+ KEY_MAP[KeyEvent.VK_END] = Keyboard.KEY_END;
+ KEY_MAP[KeyEvent.VK_ENTER] = Keyboard.KEY_RETURN;
+ KEY_MAP[KeyEvent.VK_EQUALS] = Keyboard.KEY_EQUALS;
+ KEY_MAP[KeyEvent.VK_ESCAPE] = Keyboard.KEY_ESCAPE;
+// KEY_MAP[KeyEvent.VK_EURO_SIGN] = Keyboard.KEY_EURO_SIGN;
+// KEY_MAP[KeyEvent.VK_EXCLAMATION_MARK] = Keyboard.KEY_EXCLAMATION_MARK;
+ KEY_MAP[KeyEvent.VK_F] = Keyboard.KEY_F;
+ KEY_MAP[KeyEvent.VK_F1] = Keyboard.KEY_F1;
+ KEY_MAP[KeyEvent.VK_F10] = Keyboard.KEY_F10;
+ KEY_MAP[KeyEvent.VK_F11] = Keyboard.KEY_F11;
+ KEY_MAP[KeyEvent.VK_F12] = Keyboard.KEY_F12;
+ KEY_MAP[KeyEvent.VK_F13] = Keyboard.KEY_F13;
+ KEY_MAP[KeyEvent.VK_F14] = Keyboard.KEY_F14;
+ KEY_MAP[KeyEvent.VK_F15] = Keyboard.KEY_F15;
+// KEY_MAP[KeyEvent.VK_F16] = Keyboard.KEY_F16;
+// KEY_MAP[KeyEvent.VK_F17] = Keyboard.KEY_F17;
+// KEY_MAP[KeyEvent.VK_F18] = Keyboard.KEY_F18;
+// KEY_MAP[KeyEvent.VK_F19] = Keyboard.KEY_F19;
+ KEY_MAP[KeyEvent.VK_F2] = Keyboard.KEY_F2;
+// KEY_MAP[KeyEvent.VK_F20] = Keyboard.KEY_F20;
+// KEY_MAP[KeyEvent.VK_F21] = Keyboard.KEY_F21;
+// KEY_MAP[KeyEvent.VK_F22] = Keyboard.KEY_F22;
+// KEY_MAP[KeyEvent.VK_F23] = Keyboard.KEY_F23;
+// KEY_MAP[KeyEvent.VK_F24] = Keyboard.KEY_F24;
+ KEY_MAP[KeyEvent.VK_F3] = Keyboard.KEY_F3;
+ KEY_MAP[KeyEvent.VK_F4] = Keyboard.KEY_F4;
+ KEY_MAP[KeyEvent.VK_F5] = Keyboard.KEY_F5;
+ KEY_MAP[KeyEvent.VK_F6] = Keyboard.KEY_F6;
+ KEY_MAP[KeyEvent.VK_F7] = Keyboard.KEY_F7;
+ KEY_MAP[KeyEvent.VK_F8] = Keyboard.KEY_F8;
+ KEY_MAP[KeyEvent.VK_F9] = Keyboard.KEY_F9;
+// KEY_MAP[KeyEvent.VK_FINAL] = Keyboard.KEY_FINAL;
+// KEY_MAP[KeyEvent.VK_FIND] = Keyboard.KEY_FIND;
+// KEY_MAP[KeyEvent.VK_FULL_WIDTH] = Keyboard.KEY_FULL_WIDTH;
+ KEY_MAP[KeyEvent.VK_G] = Keyboard.KEY_G;
+// KEY_MAP[KeyEvent.VK_GREATER] = Keyboard.KEY_GREATER;
+ KEY_MAP[KeyEvent.VK_H] = Keyboard.KEY_H;
+// KEY_MAP[KeyEvent.VK_HALF_WIDTH] = Keyboard.KEY_HALF_WIDTH;
+// KEY_MAP[KeyEvent.VK_HELP] = Keyboard.KEY_HELP;
+// KEY_MAP[KeyEvent.VK_HIRAGANA] = Keyboard.KEY_HIRAGANA;
+ KEY_MAP[KeyEvent.VK_HOME] = Keyboard.KEY_HOME;
+ KEY_MAP[KeyEvent.VK_I] = Keyboard.KEY_I;
+// KEY_MAP[KeyEvent.VK_INPUT_METHOD_ON_OFF] = Keyboard.KEY_INPUT_METHOD_ON_OFF;
+ KEY_MAP[KeyEvent.VK_INSERT] = Keyboard.KEY_INSERT;
+// KEY_MAP[KeyEvent.VK_INVERTED_EXCLAMATION_MARK] = Keyboard.KEY_INVERTED_EXCLAMATION_MARK;
+ KEY_MAP[KeyEvent.VK_J] = Keyboard.KEY_J;
+// KEY_MAP[KeyEvent.VK_JAPANESE_HIRAGANA] = Keyboard.KEY_JAPANESE_HIRAGANA;
+// KEY_MAP[KeyEvent.VK_JAPANESE_KATAKANA] = Keyboard.KEY_JAPANESE_KATAKANA;
+// KEY_MAP[KeyEvent.VK_JAPANESE_ROMAN] = Keyboard.KEY_JAPANESE_ROMAN;
+ KEY_MAP[KeyEvent.VK_K] = Keyboard.KEY_K;
+ KEY_MAP[KeyEvent.VK_KANA] = Keyboard.KEY_KANA;
+// KEY_MAP[KeyEvent.VK_KANA_LOCK] = Keyboard.KEY_KANA_LOCK;
+ KEY_MAP[KeyEvent.VK_KANJI] = Keyboard.KEY_KANJI;
+// KEY_MAP[KeyEvent.VK_KATAKANA] = Keyboard.KEY_KATAKANA;
+// KEY_MAP[KeyEvent.VK_KP_DOWN] = Keyboard.KEY_KP_DOWN;
+// KEY_MAP[KeyEvent.VK_KP_LEFT] = Keyboard.KEY_KP_LEFT;
+// KEY_MAP[KeyEvent.VK_KP_RIGHT] = Keyboard.KEY_KP_RIGHT;
+// KEY_MAP[KeyEvent.VK_KP_UP] = Keyboard.KEY_KP_UP;
+ KEY_MAP[KeyEvent.VK_L] = Keyboard.KEY_L;
+ KEY_MAP[KeyEvent.VK_LEFT] = Keyboard.KEY_LEFT;
+// KEY_MAP[KeyEvent.VK_LEFT_PARENTHESIS] = Keyboard.KEY_LEFT_PARENTHESIS;
+// KEY_MAP[KeyEvent.VK_LESS] = Keyboard.KEY_LESS;
+ KEY_MAP[KeyEvent.VK_M] = Keyboard.KEY_M;
+// KEY_MAP[KeyEvent.VK_META] = Keyboard.KEY_LMENU; manually mapped
+ KEY_MAP[KeyEvent.VK_MINUS] = Keyboard.KEY_MINUS;
+// KEY_MAP[KeyEvent.VK_MODECHANGE] = Keyboard.KEY_MODECHANGE;
+ KEY_MAP[KeyEvent.VK_MULTIPLY] = Keyboard.KEY_MULTIPLY;
+ KEY_MAP[KeyEvent.VK_N] = Keyboard.KEY_N;
+// KEY_MAP[KeyEvent.VK_NONCONVERT] = Keyboard.KEY_NONCONVERT;
+ KEY_MAP[KeyEvent.VK_NUM_LOCK] = Keyboard.KEY_NUMLOCK;
+// KEY_MAP[KeyEvent.VK_NUMBER_SIGN] = Keyboard.KEY_NUMBER_SIGN;
+ KEY_MAP[KeyEvent.VK_NUMPAD0] = Keyboard.KEY_NUMPAD0;
+ KEY_MAP[KeyEvent.VK_NUMPAD1] = Keyboard.KEY_NUMPAD1;
+ KEY_MAP[KeyEvent.VK_NUMPAD2] = Keyboard.KEY_NUMPAD2;
+ KEY_MAP[KeyEvent.VK_NUMPAD3] = Keyboard.KEY_NUMPAD3;
+ KEY_MAP[KeyEvent.VK_NUMPAD4] = Keyboard.KEY_NUMPAD4;
+ KEY_MAP[KeyEvent.VK_NUMPAD5] = Keyboard.KEY_NUMPAD5;
+ KEY_MAP[KeyEvent.VK_NUMPAD6] = Keyboard.KEY_NUMPAD6;
+ KEY_MAP[KeyEvent.VK_NUMPAD7] = Keyboard.KEY_NUMPAD7;
+ KEY_MAP[KeyEvent.VK_NUMPAD8] = Keyboard.KEY_NUMPAD8;
+ KEY_MAP[KeyEvent.VK_NUMPAD9] = Keyboard.KEY_NUMPAD9;
+ KEY_MAP[KeyEvent.VK_O] = Keyboard.KEY_O;
+ KEY_MAP[KeyEvent.VK_OPEN_BRACKET] = Keyboard.KEY_LBRACKET;
+ KEY_MAP[KeyEvent.VK_P] = Keyboard.KEY_P;
+ KEY_MAP[KeyEvent.VK_PAGE_DOWN] = Keyboard.KEY_NEXT;
+ KEY_MAP[KeyEvent.VK_PAGE_UP] = Keyboard.KEY_PRIOR;
+// KEY_MAP[KeyEvent.VK_PASTE] = Keyboard.KEY_PASTE;
+ KEY_MAP[KeyEvent.VK_PAUSE] = Keyboard.KEY_PAUSE;
+ KEY_MAP[KeyEvent.VK_PERIOD] = Keyboard.KEY_PERIOD;
+// KEY_MAP[KeyEvent.VK_PLUS] = Keyboard.KEY_PLUS;
+// KEY_MAP[KeyEvent.VK_PREVIOUS_CANDIDATE] = Keyboard.KEY_PREVIOUS_CANDIDATE;
+// KEY_MAP[KeyEvent.VK_PRINTSCREEN] = Keyboard.KEY_PRINTSCREEN;
+// KEY_MAP[KeyEvent.VK_PROPS] = Keyboard.KEY_PROPS;
+ KEY_MAP[KeyEvent.VK_Q] = Keyboard.KEY_Q;
+// KEY_MAP[KeyEvent.VK_QUOTE] = Keyboard.KEY_QUOTE;
+// KEY_MAP[KeyEvent.VK_QUOTEDBL] = Keyboard.KEY_QUOTEDBL;
+ KEY_MAP[KeyEvent.VK_R] = Keyboard.KEY_R;
+ KEY_MAP[KeyEvent.VK_RIGHT] = Keyboard.KEY_RIGHT;
+// KEY_MAP[KeyEvent.VK_RIGHT_PARENTHESIS] = Keyboard.KEY_RIGHT_PARENTHESIS;
+// KEY_MAP[KeyEvent.VK_ROMAN_CHARACTERS] = Keyboard.KEY_ROMAN_CHARACTERS;
+ KEY_MAP[KeyEvent.VK_S] = Keyboard.KEY_S;
+ KEY_MAP[KeyEvent.VK_SCROLL_LOCK] = Keyboard.KEY_SCROLL;
+ KEY_MAP[KeyEvent.VK_SEMICOLON] = Keyboard.KEY_SEMICOLON;
+ KEY_MAP[KeyEvent.VK_SEPARATOR] = Keyboard.KEY_DECIMAL;
+// KEY_MAP[KeyEvent.VK_SHIFT] = Keyboard.KEY_LSHIFT; manually mapped
+ KEY_MAP[KeyEvent.VK_SLASH] = Keyboard.KEY_SLASH;
+ KEY_MAP[KeyEvent.VK_SPACE] = Keyboard.KEY_SPACE;
+ KEY_MAP[KeyEvent.VK_STOP] = Keyboard.KEY_STOP;
+ KEY_MAP[KeyEvent.VK_SUBTRACT] = Keyboard.KEY_SUBTRACT;
+ KEY_MAP[KeyEvent.VK_T] = Keyboard.KEY_T;
+ KEY_MAP[KeyEvent.VK_TAB] = Keyboard.KEY_TAB;
+ KEY_MAP[KeyEvent.VK_U] = Keyboard.KEY_U;
+// KEY_MAP[KeyEvent.VK_UNDERSCORE] = Keyboard.KEY_UNDERSCORE;
+// KEY_MAP[KeyEvent.VK_UNDO] = Keyboard.KEY_UNDO;
+ KEY_MAP[KeyEvent.VK_UP] = Keyboard.KEY_UP;
+ KEY_MAP[KeyEvent.VK_V] = Keyboard.KEY_V;
+ KEY_MAP[KeyEvent.VK_W] = Keyboard.KEY_W;
+ KEY_MAP[KeyEvent.VK_X] = Keyboard.KEY_X;
+ KEY_MAP[KeyEvent.VK_Y] = Keyboard.KEY_Y;
+ KEY_MAP[KeyEvent.VK_Z] = Keyboard.KEY_Z;
+ }
+
+ KeyboardEventQueue(Component component) {
+ super(Keyboard.EVENT_SIZE);
+ this.component = component;
+ }
+
+ public void register() {
+ component.addKeyListener(this);
+ }
+
+ public void unregister() {
+ /*
+ * This line is commented out to work around AWT bug 4867453:
+ * http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4867453
+ */
+ //component.removeKeyListener(this);
+ }
+
+ private void putKeyboardEvent(int key_code, byte state, int character, long nanos, boolean repeat) {
+ event.clear();
+ event.putInt(key_code).put(state).putInt(character).putLong(nanos).put(repeat ? (byte)1 : (byte)0);
+ event.flip();
+ putEvent(event);
+ }
+
+ public synchronized void poll(ByteBuffer key_down_buffer) {
+ flushDeferredEvent();
+ int old_position = key_down_buffer.position();
+ key_down_buffer.put(key_states);
+ key_down_buffer.position(old_position);
+ }
+
+ public synchronized void copyEvents(ByteBuffer dest) {
+ flushDeferredEvent();
+ super.copyEvents(dest);
+ }
+
+ private synchronized void handleKey(int key_code, int key_location, byte state, int character, long nanos) {
+ if (character == KeyEvent.CHAR_UNDEFINED)
+ character = Keyboard.CHAR_NONE;
+ if (state == 1) {
+ boolean repeat = false;
+ if (has_deferred_event) {
+ if ((nanos == deferred_nanos && deferred_key_code == key_code &&
+ deferred_key_location == key_location)) {
+ has_deferred_event = false;
+ repeat = true; // Repeat event
+ } else
+ flushDeferredEvent();
+ }
+ putKeyEvent(key_code, key_location, state, character, nanos, repeat);
+ } else {
+ flushDeferredEvent();
+ has_deferred_event = true;
+ deferred_nanos = nanos;
+ deferred_key_code = key_code;
+ deferred_key_location = key_location;
+ deferred_key_state = state;
+ deferred_character = character;
+ }
+ }
+
+ private void flushDeferredEvent() {
+ if (has_deferred_event) {
+ putKeyEvent(deferred_key_code, deferred_key_location, deferred_key_state, deferred_character, deferred_nanos, false);
+ has_deferred_event = false;
+ }
+ }
+
+ private void putKeyEvent(int key_code, int key_location, byte state, int character, long nanos, boolean repeat) {
+ int key_code_mapped = getMappedKeyCode(key_code, key_location);
+ /* Ignore repeating presses */
+ if ( key_states[key_code_mapped] == state )
+ repeat = true;
+ key_states[key_code_mapped] = state;
+ int key_int_char = character & 0xffff;
+ putKeyboardEvent(key_code_mapped, state, key_int_char, nanos, repeat);
+ }
+
+ private int getMappedKeyCode(int key_code, int position) {
+ // manually map positioned keys
+ switch (key_code) {
+ case KeyEvent.VK_ALT: // fall through
+ if (position == KeyEvent.KEY_LOCATION_RIGHT)
+ return Keyboard.KEY_RMENU;
+ else
+ return Keyboard.KEY_LMENU;
+ case KeyEvent.VK_META:
+ if (position == KeyEvent.KEY_LOCATION_RIGHT)
+ return Keyboard.KEY_RMETA;
+ else
+ return Keyboard.KEY_LMETA;
+ case KeyEvent.VK_SHIFT:
+ if (position == KeyEvent.KEY_LOCATION_RIGHT)
+ return Keyboard.KEY_RSHIFT;
+ else
+ return Keyboard.KEY_LSHIFT;
+ case KeyEvent.VK_CONTROL:
+ if (position == KeyEvent.KEY_LOCATION_RIGHT)
+ return Keyboard.KEY_RCONTROL;
+ else
+ return Keyboard.KEY_LCONTROL;
+ default:
+ return KEY_MAP[key_code];
+ }
+ }
+
+ public void keyPressed(KeyEvent e) {
+ handleKey(e.getKeyCode(), e.getKeyLocation(), (byte)1, e.getKeyChar(), e.getWhen()*1000000);
+ }
+
+ public void keyReleased(KeyEvent e) {
+ handleKey(e.getKeyCode(), e.getKeyLocation(), (byte)0, Keyboard.CHAR_NONE, e.getWhen()*1000000);
+ }
+
+ public void keyTyped(KeyEvent e) {
+ }
+}
diff --git a/src/java/org/lwjgl/opengl/LinuxAWTGLCanvasPeerInfo.java b/src/java/org/lwjgl/opengl/LinuxAWTGLCanvasPeerInfo.java
index 8258c77..f49d0eb 100644
--- a/src/java/org/lwjgl/opengl/LinuxAWTGLCanvasPeerInfo.java
+++ b/src/java/org/lwjgl/opengl/LinuxAWTGLCanvasPeerInfo.java
@@ -1,73 +1,73 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import java.nio.ByteBuffer;
-
-import org.lwjgl.LWJGLException;
-import org.lwjgl.LWJGLUtil;
-import java.awt.Canvas;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3116 $
- * $Id: LinuxAWTGLCanvasPeerInfo.java 3116 2008-08-19 16:46:03Z spasi $
- */
-final class LinuxAWTGLCanvasPeerInfo extends LinuxPeerInfo {
- private final Canvas component;
- private final AWTSurfaceLock awt_surface = new AWTSurfaceLock();
- private int screen = -1;
-
- LinuxAWTGLCanvasPeerInfo(Canvas component) {
- this.component = component;
- }
-
- protected void doLockAndInitHandle() throws LWJGLException {
- ByteBuffer surface_handle = awt_surface.lockAndGetHandle(component);
- if (screen == -1) {
- try {
- screen = getScreenFromSurfaceInfo(surface_handle);
- } catch (LWJGLException e) {
- LWJGLUtil.log("Got exception while trying to determine screen: " + e);
- screen = 0;
- }
- }
- nInitHandle(screen, surface_handle, getHandle());
- }
- private static native int getScreenFromSurfaceInfo(ByteBuffer surface_handle) throws LWJGLException;
- private static native void nInitHandle(int screen, ByteBuffer surface_buffer, ByteBuffer peer_info_handle) throws LWJGLException;
-
- protected void doUnlock() throws LWJGLException {
- awt_surface.unlock();
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import java.nio.ByteBuffer;
+
+import org.lwjgl.LWJGLException;
+import org.lwjgl.LWJGLUtil;
+import java.awt.Canvas;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3116 $
+ * $Id: LinuxAWTGLCanvasPeerInfo.java 3116 2008-08-19 16:46:03Z spasi $
+ */
+final class LinuxAWTGLCanvasPeerInfo extends LinuxPeerInfo {
+ private final Canvas component;
+ private final AWTSurfaceLock awt_surface = new AWTSurfaceLock();
+ private int screen = -1;
+
+ LinuxAWTGLCanvasPeerInfo(Canvas component) {
+ this.component = component;
+ }
+
+ protected void doLockAndInitHandle() throws LWJGLException {
+ ByteBuffer surface_handle = awt_surface.lockAndGetHandle(component);
+ if (screen == -1) {
+ try {
+ screen = getScreenFromSurfaceInfo(surface_handle);
+ } catch (LWJGLException e) {
+ LWJGLUtil.log("Got exception while trying to determine screen: " + e);
+ screen = 0;
+ }
+ }
+ nInitHandle(screen, surface_handle, getHandle());
+ }
+ private static native int getScreenFromSurfaceInfo(ByteBuffer surface_handle) throws LWJGLException;
+ private static native void nInitHandle(int screen, ByteBuffer surface_buffer, ByteBuffer peer_info_handle) throws LWJGLException;
+
+ protected void doUnlock() throws LWJGLException {
+ awt_surface.unlock();
+ }
+}
diff --git a/src/java/org/lwjgl/opengl/LinuxCanvasImplementation.java b/src/java/org/lwjgl/opengl/LinuxCanvasImplementation.java
index 42b610d..65e35ea 100644
--- a/src/java/org/lwjgl/opengl/LinuxCanvasImplementation.java
+++ b/src/java/org/lwjgl/opengl/LinuxCanvasImplementation.java
@@ -1,123 +1,123 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import java.awt.GraphicsConfiguration;
-import java.awt.GraphicsDevice;
-import java.awt.Canvas;
-import java.lang.reflect.Method;
-import java.security.AccessController;
-import java.security.PrivilegedExceptionAction;
-
-import org.lwjgl.LWJGLException;
-import org.lwjgl.LWJGLUtil;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3002 $
- * $Id: LinuxCanvasImplementation.java 3002 2008-04-10 20:25:54Z elias_naur $
- */
-final class LinuxCanvasImplementation implements AWTCanvasImplementation {
- static int getScreenFromDevice(final GraphicsDevice device) throws LWJGLException {
- try {
- Method getScreen_method = (Method)AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws Exception {
- return device.getClass().getMethod("getScreen", null);
- }
- });
- Integer screen = (Integer)getScreen_method.invoke(device, null);
- return screen.intValue();
- } catch (Exception e) {
- throw new LWJGLException(e);
- }
- }
-
- private static int getVisualIDFromConfiguration(final GraphicsConfiguration configuration) throws LWJGLException {
- try {
- Method getVisual_method = (Method)AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws Exception {
- return configuration.getClass().getMethod("getVisual", null);
- }
- });
- Integer visual = (Integer)getVisual_method.invoke(configuration, null);
- return visual.intValue();
- } catch (Exception e) {
- throw new LWJGLException(e);
- }
- }
-
- public PeerInfo createPeerInfo(Canvas component, PixelFormat pixel_format) throws LWJGLException {
- return new LinuxAWTGLCanvasPeerInfo(component);
- }
-
- /**
- * Find a proper GraphicsConfiguration from the given GraphicsDevice and PixelFormat.
- *
- * @return The GraphicsConfiguration corresponding to a visual that matches the pixel format.
- */
- public GraphicsConfiguration findConfiguration(GraphicsDevice device, PixelFormat pixel_format) throws LWJGLException {
- try {
- int screen = getScreenFromDevice(device);
- int visual_id_matching_format = findVisualIDFromFormat(screen, pixel_format);
- GraphicsConfiguration[] configurations = device.getConfigurations();
- for (int i = 0; i < configurations.length; i++) {
- int visual_id = getVisualIDFromConfiguration(configurations[i]);
- if (visual_id == visual_id_matching_format)
- return configurations[i];
- }
- } catch (LWJGLException e) {
- LWJGLUtil.log("Got exception while trying to determine configuration: " + e);
- }
- return null; // In case we failed to locate the visual, or if we're not on a SUN JDK
- }
-
- private static int findVisualIDFromFormat(int screen, PixelFormat pixel_format) throws LWJGLException {
- try {
- LinuxDisplay.lockAWT();
- try {
- GLContext.loadOpenGLLibrary();
- try {
- LinuxDisplay.incDisplay();
- return nFindVisualIDFromFormat(LinuxDisplay.getDisplay(), screen, pixel_format);
- } finally {
- LinuxDisplay.decDisplay();
- }
- } finally {
- GLContext.unloadOpenGLLibrary();
- }
- } finally {
- LinuxDisplay.unlockAWT();
- }
- }
- private static native int nFindVisualIDFromFormat(long display, int screen, PixelFormat pixel_format) throws LWJGLException;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+import java.awt.Canvas;
+import java.lang.reflect.Method;
+import java.security.AccessController;
+import java.security.PrivilegedExceptionAction;
+
+import org.lwjgl.LWJGLException;
+import org.lwjgl.LWJGLUtil;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3002 $
+ * $Id: LinuxCanvasImplementation.java 3002 2008-04-10 20:25:54Z elias_naur $
+ */
+final class LinuxCanvasImplementation implements AWTCanvasImplementation {
+ static int getScreenFromDevice(final GraphicsDevice device) throws LWJGLException {
+ try {
+ Method getScreen_method = (Method)AccessController.doPrivileged(new PrivilegedExceptionAction() {
+ public Object run() throws Exception {
+ return device.getClass().getMethod("getScreen", null);
+ }
+ });
+ Integer screen = (Integer)getScreen_method.invoke(device, null);
+ return screen.intValue();
+ } catch (Exception e) {
+ throw new LWJGLException(e);
+ }
+ }
+
+ private static int getVisualIDFromConfiguration(final GraphicsConfiguration configuration) throws LWJGLException {
+ try {
+ Method getVisual_method = (Method)AccessController.doPrivileged(new PrivilegedExceptionAction() {
+ public Object run() throws Exception {
+ return configuration.getClass().getMethod("getVisual", null);
+ }
+ });
+ Integer visual = (Integer)getVisual_method.invoke(configuration, null);
+ return visual.intValue();
+ } catch (Exception e) {
+ throw new LWJGLException(e);
+ }
+ }
+
+ public PeerInfo createPeerInfo(Canvas component, PixelFormat pixel_format) throws LWJGLException {
+ return new LinuxAWTGLCanvasPeerInfo(component);
+ }
+
+ /**
+ * Find a proper GraphicsConfiguration from the given GraphicsDevice and PixelFormat.
+ *
+ * @return The GraphicsConfiguration corresponding to a visual that matches the pixel format.
+ */
+ public GraphicsConfiguration findConfiguration(GraphicsDevice device, PixelFormat pixel_format) throws LWJGLException {
+ try {
+ int screen = getScreenFromDevice(device);
+ int visual_id_matching_format = findVisualIDFromFormat(screen, pixel_format);
+ GraphicsConfiguration[] configurations = device.getConfigurations();
+ for (int i = 0; i < configurations.length; i++) {
+ int visual_id = getVisualIDFromConfiguration(configurations[i]);
+ if (visual_id == visual_id_matching_format)
+ return configurations[i];
+ }
+ } catch (LWJGLException e) {
+ LWJGLUtil.log("Got exception while trying to determine configuration: " + e);
+ }
+ return null; // In case we failed to locate the visual, or if we're not on a SUN JDK
+ }
+
+ private static int findVisualIDFromFormat(int screen, PixelFormat pixel_format) throws LWJGLException {
+ try {
+ LinuxDisplay.lockAWT();
+ try {
+ GLContext.loadOpenGLLibrary();
+ try {
+ LinuxDisplay.incDisplay();
+ return nFindVisualIDFromFormat(LinuxDisplay.getDisplay(), screen, pixel_format);
+ } finally {
+ LinuxDisplay.decDisplay();
+ }
+ } finally {
+ GLContext.unloadOpenGLLibrary();
+ }
+ } finally {
+ LinuxDisplay.unlockAWT();
+ }
+ }
+ private static native int nFindVisualIDFromFormat(long display, int screen, PixelFormat pixel_format) throws LWJGLException;
+}
diff --git a/src/java/org/lwjgl/opengl/LinuxContextImplementation.java b/src/java/org/lwjgl/opengl/LinuxContextImplementation.java
index 1704dce..a048074 100644
--- a/src/java/org/lwjgl/opengl/LinuxContextImplementation.java
+++ b/src/java/org/lwjgl/opengl/LinuxContextImplementation.java
@@ -1,168 +1,168 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.LWJGLException;
-
-import java.nio.ByteBuffer;
-import java.nio.IntBuffer;
-
-/**
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3116 $
- * $Id: LinuxContextImplementation.java 3116 2008-08-19 16:46:03Z spasi $
- */
-final class LinuxContextImplementation implements ContextImplementation {
-
- public ByteBuffer create(PeerInfo peer_info, IntBuffer attribs, ByteBuffer shared_context_handle) throws LWJGLException {
- LinuxDisplay.lockAWT();
- try {
- ByteBuffer peer_handle = peer_info.lockAndGetHandle();
- try {
- return nCreate(peer_handle, attribs, shared_context_handle);
- } finally {
- peer_info.unlock();
- }
- } finally {
- LinuxDisplay.unlockAWT();
- }
- }
-
- private static native ByteBuffer nCreate(ByteBuffer peer_handle, IntBuffer attribs, ByteBuffer shared_context_handle) throws LWJGLException;
-
- public void releaseDrawable(ByteBuffer context_handle) throws LWJGLException {
- }
-
- public void swapBuffers() throws LWJGLException {
- Context current_context = Context.getCurrentContext();
- if ( current_context == null )
- throw new IllegalStateException("No context is current");
- synchronized ( current_context ) {
- PeerInfo current_peer_info = current_context.getPeerInfo();
- LinuxDisplay.lockAWT();
- try {
- ByteBuffer peer_handle = current_peer_info.lockAndGetHandle();
- try {
- nSwapBuffers(peer_handle);
- } finally {
- current_peer_info.unlock();
- }
- } finally {
- LinuxDisplay.unlockAWT();
- }
- }
- }
-
- private static native void nSwapBuffers(ByteBuffer peer_info_handle) throws LWJGLException;
-
- public void releaseCurrentContext() throws LWJGLException {
- Context current_context = Context.getCurrentContext();
- if ( current_context == null )
- throw new IllegalStateException("No context is current");
- synchronized ( current_context ) {
- PeerInfo current_peer_info = current_context.getPeerInfo();
- LinuxDisplay.lockAWT();
- try {
- ByteBuffer peer_handle = current_peer_info.lockAndGetHandle();
- try {
- nReleaseCurrentContext(peer_handle);
- } finally {
- current_peer_info.unlock();
- }
- } finally {
- LinuxDisplay.unlockAWT();
- }
- }
- }
-
- private static native void nReleaseCurrentContext(ByteBuffer peer_info_handle) throws LWJGLException;
-
- public void update(ByteBuffer context_handle) {
- }
-
- public void makeCurrent(PeerInfo peer_info, ByteBuffer handle) throws LWJGLException {
- LinuxDisplay.lockAWT();
- try {
- ByteBuffer peer_handle = peer_info.lockAndGetHandle();
- try {
- nMakeCurrent(peer_handle, handle);
- } finally {
- peer_info.unlock();
- }
- } finally {
- LinuxDisplay.unlockAWT();
- }
- }
-
- private static native void nMakeCurrent(ByteBuffer peer_handle, ByteBuffer context_handle) throws LWJGLException;
-
- public boolean isCurrent(ByteBuffer handle) throws LWJGLException {
- LinuxDisplay.lockAWT();
- try {
- boolean result = nIsCurrent(handle);
- return result;
- } finally {
- LinuxDisplay.unlockAWT();
- }
- }
-
- private static native boolean nIsCurrent(ByteBuffer context_handle) throws LWJGLException;
-
- public void setSwapInterval(int value) {
- Context current_context = Context.getCurrentContext();
- if ( current_context == null )
- throw new IllegalStateException("No context is current");
- synchronized ( current_context ) {
- LinuxDisplay.lockAWT();
- nSetSwapInterval(current_context.getHandle(), value);
- LinuxDisplay.unlockAWT();
- }
- }
-
- private static native void nSetSwapInterval(ByteBuffer context_handle, int value);
-
- public void destroy(PeerInfo peer_info, ByteBuffer handle) throws LWJGLException {
- LinuxDisplay.lockAWT();
- try {
- ByteBuffer peer_handle = peer_info.lockAndGetHandle();
- try {
- nDestroy(peer_handle, handle);
- } finally {
- peer_info.unlock();
- }
- } finally {
- LinuxDisplay.unlockAWT();
- }
- }
-
- private static native void nDestroy(ByteBuffer peer_handle, ByteBuffer context_handle) throws LWJGLException;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.LWJGLException;
+
+import java.nio.ByteBuffer;
+import java.nio.IntBuffer;
+
+/**
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3116 $
+ * $Id: LinuxContextImplementation.java 3116 2008-08-19 16:46:03Z spasi $
+ */
+final class LinuxContextImplementation implements ContextImplementation {
+
+ public ByteBuffer create(PeerInfo peer_info, IntBuffer attribs, ByteBuffer shared_context_handle) throws LWJGLException {
+ LinuxDisplay.lockAWT();
+ try {
+ ByteBuffer peer_handle = peer_info.lockAndGetHandle();
+ try {
+ return nCreate(peer_handle, attribs, shared_context_handle);
+ } finally {
+ peer_info.unlock();
+ }
+ } finally {
+ LinuxDisplay.unlockAWT();
+ }
+ }
+
+ private static native ByteBuffer nCreate(ByteBuffer peer_handle, IntBuffer attribs, ByteBuffer shared_context_handle) throws LWJGLException;
+
+ public void releaseDrawable(ByteBuffer context_handle) throws LWJGLException {
+ }
+
+ public void swapBuffers() throws LWJGLException {
+ Context current_context = Context.getCurrentContext();
+ if ( current_context == null )
+ throw new IllegalStateException("No context is current");
+ synchronized ( current_context ) {
+ PeerInfo current_peer_info = current_context.getPeerInfo();
+ LinuxDisplay.lockAWT();
+ try {
+ ByteBuffer peer_handle = current_peer_info.lockAndGetHandle();
+ try {
+ nSwapBuffers(peer_handle);
+ } finally {
+ current_peer_info.unlock();
+ }
+ } finally {
+ LinuxDisplay.unlockAWT();
+ }
+ }
+ }
+
+ private static native void nSwapBuffers(ByteBuffer peer_info_handle) throws LWJGLException;
+
+ public void releaseCurrentContext() throws LWJGLException {
+ Context current_context = Context.getCurrentContext();
+ if ( current_context == null )
+ throw new IllegalStateException("No context is current");
+ synchronized ( current_context ) {
+ PeerInfo current_peer_info = current_context.getPeerInfo();
+ LinuxDisplay.lockAWT();
+ try {
+ ByteBuffer peer_handle = current_peer_info.lockAndGetHandle();
+ try {
+ nReleaseCurrentContext(peer_handle);
+ } finally {
+ current_peer_info.unlock();
+ }
+ } finally {
+ LinuxDisplay.unlockAWT();
+ }
+ }
+ }
+
+ private static native void nReleaseCurrentContext(ByteBuffer peer_info_handle) throws LWJGLException;
+
+ public void update(ByteBuffer context_handle) {
+ }
+
+ public void makeCurrent(PeerInfo peer_info, ByteBuffer handle) throws LWJGLException {
+ LinuxDisplay.lockAWT();
+ try {
+ ByteBuffer peer_handle = peer_info.lockAndGetHandle();
+ try {
+ nMakeCurrent(peer_handle, handle);
+ } finally {
+ peer_info.unlock();
+ }
+ } finally {
+ LinuxDisplay.unlockAWT();
+ }
+ }
+
+ private static native void nMakeCurrent(ByteBuffer peer_handle, ByteBuffer context_handle) throws LWJGLException;
+
+ public boolean isCurrent(ByteBuffer handle) throws LWJGLException {
+ LinuxDisplay.lockAWT();
+ try {
+ boolean result = nIsCurrent(handle);
+ return result;
+ } finally {
+ LinuxDisplay.unlockAWT();
+ }
+ }
+
+ private static native boolean nIsCurrent(ByteBuffer context_handle) throws LWJGLException;
+
+ public void setSwapInterval(int value) {
+ Context current_context = Context.getCurrentContext();
+ if ( current_context == null )
+ throw new IllegalStateException("No context is current");
+ synchronized ( current_context ) {
+ LinuxDisplay.lockAWT();
+ nSetSwapInterval(current_context.getHandle(), value);
+ LinuxDisplay.unlockAWT();
+ }
+ }
+
+ private static native void nSetSwapInterval(ByteBuffer context_handle, int value);
+
+ public void destroy(PeerInfo peer_info, ByteBuffer handle) throws LWJGLException {
+ LinuxDisplay.lockAWT();
+ try {
+ ByteBuffer peer_handle = peer_info.lockAndGetHandle();
+ try {
+ nDestroy(peer_handle, handle);
+ } finally {
+ peer_info.unlock();
+ }
+ } finally {
+ LinuxDisplay.unlockAWT();
+ }
+ }
+
+ private static native void nDestroy(ByteBuffer peer_handle, ByteBuffer context_handle) throws LWJGLException;
+}
diff --git a/src/java/org/lwjgl/opengl/LinuxDisplay.java b/src/java/org/lwjgl/opengl/LinuxDisplay.java
index 609d86f..61332e8 100644
--- a/src/java/org/lwjgl/opengl/LinuxDisplay.java
+++ b/src/java/org/lwjgl/opengl/LinuxDisplay.java
@@ -1,1215 +1,1215 @@
-/*
- * Copyright (c) 2002-2010 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.
- */
-package org.lwjgl.opengl;
-
-/**
- * This is the Display implementation interface. Display delegates
- * to implementors of this interface. There is one DisplayImplementation
- * for each supported platform.
- * @author elias_naur
- */
-
-import java.awt.Canvas;
-import java.nio.ByteBuffer;
-import java.nio.FloatBuffer;
-import java.nio.IntBuffer;
-
-import org.lwjgl.BufferUtils;
-import org.lwjgl.LWJGLException;
-import org.lwjgl.LWJGLUtil;
-import org.lwjgl.opengl.XRandR.Screen;
-
-final class LinuxDisplay implements DisplayImplementation {
- /* X11 constants */
- public final static int CurrentTime = 0;
- public final static int GrabSuccess = 0;
- public final static int AutoRepeatModeOff = 0;
- public final static int AutoRepeatModeOn = 1;
- public final static int AutoRepeatModeDefault = 2;
- public final static int None = 0;
-
- private final static int KeyPressMask = 1 << 0;
- private final static int KeyReleaseMask = 1 << 1;
- private final static int ButtonPressMask = 1 << 2;
- private final static int ButtonReleaseMask = 1 << 3;
-
- private final static int NotifyAncestor = 0;
- private final static int NotifyNonlinear = 3;
- private final static int NotifyPointer = 5;
- private final static int NotifyPointerRoot = 6;
- private final static int NotifyDetailNone = 7;
-
- private final static int SetModeInsert = 0;
- private final static int SaveSetRoot = 1;
- private final static int SaveSetUnmap = 1;
-
- /** Window mode enum */
- private static final int FULLSCREEN_LEGACY = 1;
- private static final int FULLSCREEN_NETWM = 2;
- private static final int WINDOWED = 3;
-
- /** Current window mode */
- private static int current_window_mode = WINDOWED;
-
- /** Display mode switching API */
- private static final int XRANDR = 10;
- private static final int XF86VIDMODE = 11;
- private static final int NONE = 12;
-
- /** Current X11 Display pointer */
- private static long display;
- private static long current_window;
- private static long saved_error_handler;
-
- private static int display_connection_usage_count = 0;
-
- /** Event buffer */
- private final LinuxEvent event_buffer = new LinuxEvent();
- private final LinuxEvent tmp_event_buffer = new LinuxEvent();
-
- /** Current mode swithcing API */
- private int current_displaymode_extension = NONE;
-
- /** Atom used for the pointer warp messages */
- private long delete_atom;
-
- private PeerInfo peer_info;
-
- /** Saved gamma used to restore display settings */
- private ByteBuffer saved_gamma;
- private ByteBuffer current_gamma;
-
- /** Saved mode to restore with */
- private DisplayMode saved_mode;
- private DisplayMode current_mode;
-
- private Screen[] savedXrandrConfig;
-
- private boolean keyboard_grabbed;
- private boolean pointer_grabbed;
- private boolean input_released;
- private boolean grab;
- private boolean focused;
- private boolean minimized;
- private boolean dirty;
- private boolean close_requested;
- private long current_cursor;
- private long blank_cursor;
- private Canvas parent;
- private long parent_window;
- private boolean xembedded;
- private boolean parent_focus;
-
- private LinuxKeyboard keyboard;
- private LinuxMouse mouse;
-
- private static ByteBuffer getCurrentGammaRamp() throws LWJGLException {
- lockAWT();
- try {
- incDisplay();
- try {
- if (isXF86VidModeSupported())
- return nGetCurrentGammaRamp(getDisplay(), getDefaultScreen());
- else
- return null;
- } finally {
- decDisplay();
- }
- } finally {
- unlockAWT();
- }
- }
- private static native ByteBuffer nGetCurrentGammaRamp(long display, int screen) throws LWJGLException;
-
- private static int getBestDisplayModeExtension() {
- int result;
- if (isXrandrSupported()) {
- LWJGLUtil.log("Using Xrandr for display mode switching");
- result = XRANDR;
- } else if (isXF86VidModeSupported()) {
- LWJGLUtil.log("Using XF86VidMode for display mode switching");
- result = XF86VIDMODE;
- } else {
- LWJGLUtil.log("No display mode extensions available");
- result = NONE;
- }
- return result;
- }
-
- private static boolean isXrandrSupported() {
- if (Display.getPrivilegedBoolean("LWJGL_DISABLE_XRANDR"))
- return false;
- lockAWT();
- try {
- incDisplay();
- try {
- return nIsXrandrSupported(getDisplay());
- } finally {
- decDisplay();
- }
- } catch (LWJGLException e) {
- LWJGLUtil.log("Got exception while querying Xrandr support: " + e);
- return false;
- } finally {
- unlockAWT();
- }
- }
- private static native boolean nIsXrandrSupported(long display) throws LWJGLException;
-
- private static boolean isXF86VidModeSupported() {
- lockAWT();
- try {
- incDisplay();
- try {
- return nIsXF86VidModeSupported(getDisplay());
- } finally {
- decDisplay();
- }
- } catch (LWJGLException e) {
- LWJGLUtil.log("Got exception while querying XF86VM support: " + e);
- return false;
- } finally {
- unlockAWT();
- }
- }
- private static native boolean nIsXF86VidModeSupported(long display) throws LWJGLException;
-
- private static boolean isNetWMFullscreenSupported() throws LWJGLException {
- if (Display.getPrivilegedBoolean("LWJGL_DISABLE_NETWM"))
- return false;
- lockAWT();
- try {
- incDisplay();
- try {
- return nIsNetWMFullscreenSupported(getDisplay(), getDefaultScreen());
- } finally {
- decDisplay();
- }
- } catch (LWJGLException e) {
- LWJGLUtil.log("Got exception while querying NetWM support: " + e);
- return false;
- } finally {
- unlockAWT();
- }
- }
- private static native boolean nIsNetWMFullscreenSupported(long display, int screen) throws LWJGLException;
-
- /* Since Xlib is not guaranteed to be thread safe, we need a way to synchronize LWJGL
- * Xlib calls with AWT Xlib calls. Fortunately, JAWT implements Lock()/Unlock() to
- * do just that.
- */
- static void lockAWT() {
- try {
- nLockAWT();
- } catch (LWJGLException e) {
- LWJGLUtil.log("Caught exception while locking AWT: " + e);
- }
- }
- private static native void nLockAWT() throws LWJGLException;
-
- static void unlockAWT() {
- try {
- nUnlockAWT();
- } catch (LWJGLException e) {
- LWJGLUtil.log("Caught exception while unlocking AWT: " + e);
- }
- }
- private static native void nUnlockAWT() throws LWJGLException;
-
- /**
- * increment and decrement display usage.
- */
- static void incDisplay() throws LWJGLException {
- if (display_connection_usage_count == 0) {
- GLContext.loadOpenGLLibrary();
- saved_error_handler = setErrorHandler();
- display = openDisplay();
-// synchronize(display, true);
- }
- display_connection_usage_count++;
- }
- private static native int callErrorHandler(long handler, long display, long error_ptr);
- private static native long setErrorHandler();
- private static native long resetErrorHandler(long handler);
- private static native void synchronize(long display, boolean synchronize);
-
- private static int globalErrorHandler(long display, long event_ptr, long error_display, long serial, long error_code, long request_code, long minor_code) throws LWJGLException {
- if (display == getDisplay()) {
- String error_msg = getErrorText(display, error_code);
- throw new LWJGLException("X Error - disp: 0x" + Long.toHexString(error_display) + " serial: " + serial + " error: " + error_msg + " request_code: " + request_code + " minor_code: " + minor_code);
- } else if (saved_error_handler != 0)
- return callErrorHandler(saved_error_handler, display, event_ptr);
- return 0;
- }
- private static native String getErrorText(long display, long error_code);
-
- static void decDisplay() {
- /*
- * Some drivers (at least some versions of the radeon dri driver)
- * don't like it when the display is closed and later re-opened,
- * so we'll just let the singleton display connection leak.
- */
-/* display_connection_usage_count--;
- if (display_connection_usage_count < 0)
- throw new InternalError("display_connection_usage_count < 0: " + display_connection_usage_count);
- if (display_connection_usage_count == 0) {
- closeDisplay(display);
- resetErrorHandler(saved_error_handler);
- display = 0;
- GLContext.unloadOpenGLLibrary();
- }*/
- }
-
- static native long openDisplay() throws LWJGLException;
- static native void closeDisplay(long display);
-
- private int getWindowMode(boolean fullscreen) throws LWJGLException {
- if (fullscreen) {
- if (current_displaymode_extension == XRANDR && isNetWMFullscreenSupported()) {
- LWJGLUtil.log("Using NetWM for fullscreen window");
- return FULLSCREEN_NETWM;
- } else {
- LWJGLUtil.log("Using legacy mode for fullscreen window");
- return FULLSCREEN_LEGACY;
- }
- } else
- return WINDOWED;
- }
-
- static long getDisplay() {
- if (display_connection_usage_count <= 0)
- throw new InternalError("display_connection_usage_count = " + display_connection_usage_count);
- return display;
- }
-
- static int getDefaultScreen() {
- return nGetDefaultScreen(getDisplay());
- }
- static native int nGetDefaultScreen(long display);
-
- static long getWindow() {
- return current_window;
- }
-
- private void ungrabKeyboard() {
- if (keyboard_grabbed) {
- nUngrabKeyboard(getDisplay());
- keyboard_grabbed = false;
- }
- }
- static native int nUngrabKeyboard(long display);
-
- private void grabKeyboard() {
- if (!keyboard_grabbed) {
- int res = nGrabKeyboard(getDisplay(), getWindow());
- if (res == GrabSuccess)
- keyboard_grabbed = true;
- }
- }
- static native int nGrabKeyboard(long display, long window);
-
- private void grabPointer() {
- if (!pointer_grabbed) {
- int result = nGrabPointer(getDisplay(), getWindow(), None);
- if (result == GrabSuccess) {
- pointer_grabbed = true;
- // make sure we have a centered window
- if (isLegacyFullscreen()) {
- nSetViewPort(getDisplay(), getWindow(), getDefaultScreen());
- }
- }
- }
- }
- static native int nGrabPointer(long display, long window, long cursor);
- private static native void nSetViewPort(long display, long window, int screen);
-
- private void ungrabPointer() {
- if (pointer_grabbed) {
- pointer_grabbed = false;
- nUngrabPointer(getDisplay());
- }
- }
- static native int nUngrabPointer(long display);
-
- private boolean isFullscreen() {
- return current_window_mode == FULLSCREEN_LEGACY || current_window_mode == FULLSCREEN_NETWM;
- }
-
- private boolean shouldGrab() {
- return !input_released && grab && mouse != null;
- }
-
- private void updatePointerGrab() {
- if (isFullscreen() || shouldGrab()) {
- grabPointer();
- } else {
- ungrabPointer();
- }
- updateCursor();
- }
-
- private void updateCursor() {
- long cursor;
- if (shouldGrab()) {
- cursor = blank_cursor;
- } else {
- cursor = current_cursor;
- }
- nDefineCursor(getDisplay(), getWindow(), cursor);
- }
- private static native void nDefineCursor(long display, long window, long cursor_handle);
-
- private boolean isLegacyFullscreen() {
- return current_window_mode == FULLSCREEN_LEGACY;
- }
-
- private void updateKeyboardGrab() {
- if (isLegacyFullscreen())
- grabKeyboard();
- else
- ungrabKeyboard();
- }
-
- public void createWindow(DisplayMode mode, Canvas parent, int x, int y) throws LWJGLException {
- lockAWT();
- try {
- incDisplay();
- try {
- ByteBuffer handle = peer_info.lockAndGetHandle();
- try {
- current_window_mode = getWindowMode(Display.isFullscreen());
- boolean undecorated = Display.getPrivilegedBoolean("org.lwjgl.opengl.Window.undecorated") || current_window_mode != WINDOWED;
- this.parent = parent;
- parent_window = parent != null ? getHandle(parent) : getRootWindow(getDisplay(), getDefaultScreen());
- current_window = nCreateWindow(getDisplay(), getDefaultScreen(), handle, mode, current_window_mode, x, y, undecorated, parent_window);
- mapRaised(getDisplay(), current_window);
- xembedded = parent != null && isAncestorXEmbedded(parent_window);
- blank_cursor = createBlankCursor();
- current_cursor = None;
- focused = false;
- input_released = false;
- pointer_grabbed = false;
- keyboard_grabbed = false;
- close_requested = false;
- grab = false;
- minimized = false;
- dirty = true;
- } finally {
- peer_info.unlock();
- }
- } catch (LWJGLException e) {
- decDisplay();
- throw e;
- }
- } finally {
- unlockAWT();
- }
- }
- private static native long nCreateWindow(long display, int screen, ByteBuffer peer_info_handle, DisplayMode mode, int window_mode, int x, int y, boolean undecorated, long parent_handle) throws LWJGLException;
- private static native long getRootWindow(long display, int screen);
- private static native boolean hasProperty(long display, long window, long property);
- private static native long getParentWindow(long display, long window) throws LWJGLException;
- private static native void mapRaised(long display, long window);
- private static native void reparentWindow(long display, long window, long parent, int x, int y);
-
- private boolean isAncestorXEmbedded(long window) throws LWJGLException {
- long xembed_atom = internAtom("_XEMBED_INFO", true);
- if (xembed_atom != None) {
- long w = window;
- while (w != None) {
- if (hasProperty(getDisplay(), w, xembed_atom))
- return true;
- w = getParentWindow(getDisplay(), w);
- }
- }
- return false;
- }
-
- private static long getHandle(Canvas parent) throws LWJGLException {
- AWTCanvasImplementation awt_impl = AWTGLCanvas.createImplementation();
- LinuxPeerInfo parent_peer_info = (LinuxPeerInfo)awt_impl.createPeerInfo(parent, null);
- ByteBuffer parent_peer_info_handle = parent_peer_info.lockAndGetHandle();
- try {
- return parent_peer_info.getDrawable();
- } finally {
- parent_peer_info.unlock();
- }
- }
-
- private void updateInputGrab() {
- updatePointerGrab();
- updateKeyboardGrab();
- }
-
- public void destroyWindow() {
- lockAWT();
- try {
- try {
- setNativeCursor(null);
- } catch (LWJGLException e) {
- LWJGLUtil.log("Failed to reset cursor: " + e.getMessage());
- }
- nDestroyCursor(getDisplay(), blank_cursor);
- blank_cursor = None;
- ungrabKeyboard();
- nDestroyWindow(getDisplay(), getWindow());
- decDisplay();
- } finally {
- unlockAWT();
- }
- }
- static native void nDestroyWindow(long display, long window);
-
- public void switchDisplayMode(DisplayMode mode) throws LWJGLException {
- lockAWT();
- try {
- switchDisplayModeOnTmpDisplay(mode);
- current_mode = mode;
- } finally {
- unlockAWT();
- }
- }
-
- private void switchDisplayModeOnTmpDisplay(DisplayMode mode) throws LWJGLException {
- incDisplay();
- try {
- nSwitchDisplayMode(getDisplay(), getDefaultScreen(), current_displaymode_extension, mode);
- } finally {
- decDisplay();
- }
- }
- private static native void nSwitchDisplayMode(long display, int screen, int extension, DisplayMode mode) throws LWJGLException;
-
- private static long internAtom(String atom_name, boolean only_if_exists) throws LWJGLException {
- incDisplay();
- try {
- return nInternAtom(getDisplay(), atom_name, only_if_exists);
- } finally {
- decDisplay();
- }
- }
- static native long nInternAtom(long display, String atom_name, boolean only_if_exists);
-
- public void resetDisplayMode() {
- lockAWT();
- try {
- if( current_displaymode_extension == XRANDR && savedXrandrConfig.length > 0 )
- {
- XRandR.setConfiguration( savedXrandrConfig );
- }
- else
- {
- switchDisplayMode(saved_mode);
- }
- if (isXF86VidModeSupported())
- doSetGamma(saved_gamma);
- } catch (LWJGLException e) {
- LWJGLUtil.log("Caught exception while resetting mode: " + e);
- } finally {
- unlockAWT();
- }
- }
-
- public int getGammaRampLength() {
- if (!isXF86VidModeSupported())
- return 0;
- lockAWT();
- try {
- try {
- incDisplay();
- try {
- return nGetGammaRampLength(getDisplay(), getDefaultScreen());
- } catch (LWJGLException e) {
- LWJGLUtil.log("Got exception while querying gamma length: " + e);
- return 0;
- } finally {
- decDisplay();
- }
- } catch (LWJGLException e) {
- LWJGLUtil.log("Failed to get gamma ramp length: " + e);
- return 0;
- }
- } finally {
- unlockAWT();
- }
- }
- private static native int nGetGammaRampLength(long display, int screen) throws LWJGLException;
-
- public void setGammaRamp(FloatBuffer gammaRamp) throws LWJGLException {
- if (!isXF86VidModeSupported())
- throw new LWJGLException("No gamma ramp support (Missing XF86VM extension)");
- doSetGamma(convertToNativeRamp(gammaRamp));
- }
-
- private void doSetGamma(ByteBuffer native_gamma) throws LWJGLException {
- lockAWT();
- try {
- setGammaRampOnTmpDisplay(native_gamma);
- current_gamma = native_gamma;
- } finally {
- unlockAWT();
- }
- }
-
- private void setGammaRampOnTmpDisplay(ByteBuffer native_gamma) throws LWJGLException {
- incDisplay();
- try {
- nSetGammaRamp(getDisplay(), getDefaultScreen(), native_gamma);
- } finally {
- decDisplay();
- }
- }
- private static native void nSetGammaRamp(long display, int screen, ByteBuffer gammaRamp) throws LWJGLException;
-
- private static ByteBuffer convertToNativeRamp(FloatBuffer ramp) throws LWJGLException {
- return nConvertToNativeRamp(ramp, ramp.position(), ramp.remaining());
- }
- private static native ByteBuffer nConvertToNativeRamp(FloatBuffer ramp, int offset, int length) throws LWJGLException;
-
- public String getAdapter() {
- return null;
- }
-
- public String getVersion() {
- return null;
- }
-
- public DisplayMode init() throws LWJGLException {
- lockAWT();
- try {
- delete_atom = internAtom("WM_DELETE_WINDOW", false);
- current_displaymode_extension = getBestDisplayModeExtension();
- if (current_displaymode_extension == NONE)
- throw new LWJGLException("No display mode extension is available");
- DisplayMode[] modes = getAvailableDisplayModes();
- if (modes == null || modes.length == 0)
- throw new LWJGLException("No modes available");
- switch (current_displaymode_extension) {
- case XRANDR:
- savedXrandrConfig = XRandR.getConfiguration();
- saved_mode = getCurrentXRandrMode();
- break;
- case XF86VIDMODE:
- saved_mode = modes[0];
- break;
- default:
- throw new LWJGLException("Unknown display mode extension: " + current_displaymode_extension);
- }
- current_mode = saved_mode;
- saved_gamma = getCurrentGammaRamp();
- current_gamma = saved_gamma;
- return saved_mode;
- } finally {
- unlockAWT();
- }
- }
-
- private static DisplayMode getCurrentXRandrMode() throws LWJGLException {
- lockAWT();
- try {
- incDisplay();
- try {
- return nGetCurrentXRandrMode(getDisplay(), getDefaultScreen());
- } finally {
- decDisplay();
- }
- } finally {
- unlockAWT();
- }
- }
-
- /** Assumes extension == XRANDR */
- private static native DisplayMode nGetCurrentXRandrMode(long display, int screen) throws LWJGLException;
-
- public void setTitle(String title) {
- lockAWT();
- try {
- nSetTitle(getDisplay(), getWindow(), title);
- } finally {
- unlockAWT();
- }
- }
- private static native void nSetTitle(long display, long window, String title);
-
- public boolean isCloseRequested() {
- boolean result = close_requested;
- close_requested = false;
- return result;
- }
-
- public boolean isVisible() {
- return !minimized;
- }
-
- public boolean isActive() {
- return focused || isLegacyFullscreen();
- }
-
- public boolean isDirty() {
- boolean result = dirty;
- dirty = false;
- return result;
- }
-
- public PeerInfo createPeerInfo(PixelFormat pixel_format) throws LWJGLException {
- peer_info = new LinuxDisplayPeerInfo(pixel_format);
- return peer_info;
- }
-
- static native void setInputFocus(long display, long window, long time);
-
- private void relayEventToParent(LinuxEvent event_buffer, int event_mask) {
- tmp_event_buffer.copyFrom(event_buffer);
- tmp_event_buffer.setWindow(parent_window);
- tmp_event_buffer.sendEvent(getDisplay(), parent_window, true, event_mask);
- }
-
- private void relayEventToParent(LinuxEvent event_buffer) {
- if (parent == null)
- return;
- switch (event_buffer.getType()) {
- case LinuxEvent.KeyPress:
- relayEventToParent(event_buffer, KeyPressMask);
- break;
- case LinuxEvent.KeyRelease:
- relayEventToParent(event_buffer, KeyPressMask);
- break;
- case LinuxEvent.ButtonPress:
- relayEventToParent(event_buffer, KeyPressMask);
- break;
- case LinuxEvent.ButtonRelease:
- relayEventToParent(event_buffer, KeyPressMask);
- break;
- default:
- break;
- }
- }
-
- private void processEvents() {
- while (LinuxEvent.getPending(getDisplay()) > 0) {
- event_buffer.nextEvent(getDisplay());
- long event_window = event_buffer.getWindow();
- relayEventToParent(event_buffer);
- if (event_window != getWindow() || event_buffer.filterEvent(event_window) ||
- (mouse != null && mouse.filterEvent(grab, shouldWarpPointer(), event_buffer)) ||
- (keyboard != null && keyboard.filterEvent(event_buffer)))
- continue;
- switch (event_buffer.getType()) {
- case LinuxEvent.FocusIn:
- setFocused(true, event_buffer.getFocusDetail());
- break;
- case LinuxEvent.FocusOut:
- setFocused(false, event_buffer.getFocusDetail());
- break;
- case LinuxEvent.ClientMessage:
- if ((event_buffer.getClientFormat() == 32) && (event_buffer.getClientData(0) == delete_atom))
- close_requested = true;
- break;
- case LinuxEvent.MapNotify:
- dirty = true;
- minimized = false;
- break;
- case LinuxEvent.UnmapNotify:
- dirty = true;
- minimized = true;
- break;
- case LinuxEvent.Expose:
- dirty = true;
- break;
- default:
- break;
- }
- }
- }
-
- public void update() {
- lockAWT();
- try {
- processEvents();
- checkInput();
- } finally {
- unlockAWT();
- }
- }
-
- public void reshape(int x, int y, int width, int height) {
- lockAWT();
- try {
- nReshape(getDisplay(), getWindow(), x, y, width, height);
- } finally {
- unlockAWT();
- }
- }
- private static native void nReshape(long display, long window, int x, int y, int width, int height);
-
- public DisplayMode[] getAvailableDisplayModes() throws LWJGLException {
- lockAWT();
- try {
- incDisplay();
- try {
- DisplayMode[] modes = nGetAvailableDisplayModes(getDisplay(), getDefaultScreen(), current_displaymode_extension);
- return modes;
- } finally {
- decDisplay();
- }
- } finally {
- unlockAWT();
- }
- }
- private static native DisplayMode[] nGetAvailableDisplayModes(long display, int screen, int extension) throws LWJGLException;
-
- /* Mouse */
- public boolean hasWheel() {
- return true;
- }
-
- public int getButtonCount() {
- return mouse.getButtonCount();
- }
-
- public void createMouse() throws LWJGLException {
- lockAWT();
- try {
- mouse = new LinuxMouse(getDisplay(), getWindow(), getWindow());
- } finally {
- unlockAWT();
- }
- }
-
- public void destroyMouse() {
- mouse = null;
- updateInputGrab();
- }
-
- public void pollMouse(IntBuffer coord_buffer, ByteBuffer buttons) {
- lockAWT();
- try {
- mouse.poll(grab, coord_buffer, buttons);
- } finally {
- unlockAWT();
- }
- }
-
- public void readMouse(ByteBuffer buffer) {
- lockAWT();
- try {
- mouse.read(buffer);
- } finally {
- unlockAWT();
- }
- }
-
- public void setCursorPosition(int x, int y) {
- lockAWT();
- try {
- mouse.setCursorPosition(x, y);
- } finally {
- unlockAWT();
- }
- }
-
- private void checkInput() {
- if (parent == null) return;
-
- if (parent_focus != parent.hasFocus()) {
- parent_focus = parent.hasFocus();
-
- if (parent_focus) {
- setInputFocusUnsafe(current_window);
- }
- else if (xembedded) {
- setInputFocusUnsafe(0);
- }
- }
- else if (parent_focus && !focused) {
- setInputFocusUnsafe(current_window);
- }
- }
-
- private void setFocused(boolean got_focus, int focus_detail) {
- if (focused == got_focus || focus_detail == NotifyDetailNone || focus_detail == NotifyPointer || focus_detail == NotifyPointerRoot)
- return;
- focused = got_focus;
-
- if (focused) {
- acquireInput();
- }
- else {
- releaseInput();
- }
- }
- static native long nGetInputFocus(long display);
-
- private void setInputFocusUnsafe(long window) {
- try {
- setInputFocus(getDisplay(), window, CurrentTime);
- sync(getDisplay(), false);
- } catch (LWJGLException e) {
- // Since we don't have any event timings for XSetInputFocus, a race condition might give a BadMatch, which we'll catch and ignore
- LWJGLUtil.log("Got exception while trying to focus: " + e);
- }
- }
- private static native void sync(long display, boolean throw_away_events) throws LWJGLException;
-
- private void releaseInput() {
- if (isLegacyFullscreen() || input_released)
- return;
- input_released = true;
- updateInputGrab();
- if (current_window_mode == FULLSCREEN_NETWM) {
- nIconifyWindow(getDisplay(), getWindow(), getDefaultScreen());
- try {
- if( current_displaymode_extension == XRANDR && savedXrandrConfig.length > 0 )
- {
- XRandR.setConfiguration( savedXrandrConfig );
- }
- else
- {
- switchDisplayModeOnTmpDisplay(saved_mode);
- }
- setGammaRampOnTmpDisplay(saved_gamma);
- } catch (LWJGLException e) {
- LWJGLUtil.log("Failed to restore saved mode: " + e.getMessage());
- }
- }
- }
- private static native void nIconifyWindow(long display, long window, int screen);
-
- private void acquireInput() {
- if (isLegacyFullscreen() || !input_released)
- return;
- input_released = false;
- updateInputGrab();
- if (current_window_mode == FULLSCREEN_NETWM) {
- try {
- switchDisplayModeOnTmpDisplay(current_mode);
- setGammaRampOnTmpDisplay(current_gamma);
- } catch (LWJGLException e) {
- LWJGLUtil.log("Failed to restore mode: " + e.getMessage());
- }
- }
- }
-
- public void grabMouse(boolean new_grab) {
- lockAWT();
- try {
- if (new_grab != grab) {
- grab = new_grab;
- updateInputGrab();
- mouse.changeGrabbed(grab, shouldWarpPointer());
- }
- } finally {
- unlockAWT();
- }
- }
-
- private boolean shouldWarpPointer() {
- return pointer_grabbed && shouldGrab();
- }
-
- public int getNativeCursorCapabilities() {
- lockAWT();
- try {
- incDisplay();
- try {
- return nGetNativeCursorCapabilities(getDisplay());
- } finally {
- decDisplay();
- }
- } catch (LWJGLException e) {
- throw new RuntimeException(e);
- } finally {
- unlockAWT();
- }
- }
- private static native int nGetNativeCursorCapabilities(long display) throws LWJGLException;
-
- public void setNativeCursor(Object handle) throws LWJGLException {
- current_cursor = getCursorHandle(handle);
- lockAWT();
- try {
- updateCursor();
- } finally {
- unlockAWT();
- }
- }
-
- public int getMinCursorSize() {
- lockAWT();
- try {
- incDisplay();
- try {
- return nGetMinCursorSize(getDisplay(), getWindow());
- } finally {
- decDisplay();
- }
- } catch (LWJGLException e) {
- LWJGLUtil.log("Exception occurred in getMinCursorSize: " + e);
- return 0;
- } finally {
- unlockAWT();
- }
- }
- private static native int nGetMinCursorSize(long display, long window);
-
- public int getMaxCursorSize() {
- lockAWT();
- try {
- incDisplay();
- try {
- return nGetMaxCursorSize(getDisplay(), getWindow());
- } finally {
- decDisplay();
- }
- } catch (LWJGLException e) {
- LWJGLUtil.log("Exception occurred in getMaxCursorSize: " + e);
- return 0;
- } finally {
- unlockAWT();
- }
- }
- private static native int nGetMaxCursorSize(long display, long window);
-
- /* Keyboard */
- public void createKeyboard() throws LWJGLException {
- lockAWT();
- try {
- keyboard = new LinuxKeyboard(getDisplay(), getWindow());
- } finally {
- unlockAWT();
- }
- }
-
- public void destroyKeyboard() {
- lockAWT();
- try {
- keyboard.destroy(getDisplay());
- keyboard = null;
- } finally {
- unlockAWT();
- }
- }
-
- public void pollKeyboard(ByteBuffer keyDownBuffer) {
- lockAWT();
- try {
- keyboard.poll(keyDownBuffer);
- } finally {
- unlockAWT();
- }
- }
-
- public void readKeyboard(ByteBuffer buffer) {
- lockAWT();
- try {
- keyboard.read(buffer);
- } finally {
- unlockAWT();
- }
- }
-
- private static native long nCreateCursor(long display, int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, int images_offset, IntBuffer delays, int delays_offset) throws LWJGLException;
-
- private static long createBlankCursor() {
- return nCreateBlankCursor(getDisplay(), getWindow());
- }
- static native long nCreateBlankCursor(long display, long window);
-
- public Object createCursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws LWJGLException {
- lockAWT();
- try {
- incDisplay();
- try {
- long cursor = nCreateCursor(getDisplay(), width, height, xHotspot, yHotspot, numImages, images, images.position(), delays, delays != null ? delays.position() : -1);
- return new Long(cursor);
- } catch (LWJGLException e) {
- decDisplay();
- throw e;
- }
- } finally {
- unlockAWT();
- }
- }
-
- private static long getCursorHandle(Object cursor_handle) {
- return cursor_handle != null ? ((Long)cursor_handle).longValue() : None;
- }
-
- public void destroyCursor(Object cursorHandle) {
- lockAWT();
- try {
- nDestroyCursor(getDisplay(), getCursorHandle(cursorHandle));
- decDisplay();
- } finally {
- unlockAWT();
- }
- }
- static native void nDestroyCursor(long display, long cursorHandle);
-
- public int getPbufferCapabilities() {
- lockAWT();
- try {
- incDisplay();
- try {
- return nGetPbufferCapabilities(getDisplay(), getDefaultScreen());
- } finally {
- decDisplay();
- }
- } catch (LWJGLException e) {
- LWJGLUtil.log("Exception occurred in getPbufferCapabilities: " + e);
- return 0;
- } finally {
- unlockAWT();
- }
- }
- private static native int nGetPbufferCapabilities(long display, int screen);
-
- public boolean isBufferLost(PeerInfo handle) {
- return false;
- }
-
- public PeerInfo createPbuffer(int width, int height, PixelFormat pixel_format,
- IntBuffer pixelFormatCaps,
- IntBuffer pBufferAttribs) throws LWJGLException {
- return new LinuxPbufferPeerInfo(width, height, pixel_format);
- }
-
- public void setPbufferAttrib(PeerInfo handle, int attrib, int value) {
- throw new UnsupportedOperationException();
- }
-
- public void bindTexImageToPbuffer(PeerInfo handle, int buffer) {
- throw new UnsupportedOperationException();
- }
-
- public void releaseTexImageFromPbuffer(PeerInfo handle, int buffer) {
- throw new UnsupportedOperationException();
- }
-
- private static ByteBuffer convertIcon(ByteBuffer icon, int width, int height) {
- ByteBuffer icon_rgb = BufferUtils.createByteBuffer(icon.capacity());
- int x;
- int y;
- byte r,g,b;
-
- int depth = 4;
-
- for (y = 0; y < height; y++) {
- for (x = 0; x < width; x++) {
- r = icon.get((x*4)+(y*width*4));
- g = icon.get((x*4)+(y*width*4)+1);
- b = icon.get((x*4)+(y*width*4)+2);
-
- icon_rgb.put((x*depth)+(y*width*depth), b); // blue
- icon_rgb.put((x*depth)+(y*width*depth)+1, g); // green
- icon_rgb.put((x*depth)+(y*width*depth)+2, r);
- }
- }
- return icon_rgb;
- }
-
- private static ByteBuffer convertIconMask(ByteBuffer icon, int width, int height) {
- ByteBuffer icon_mask = BufferUtils.createByteBuffer((icon.capacity()/4)/8);
- int x;
- int y;
- byte a;
-
- int depth = 4;
-
- for (y = 0; y < height; y++) {
- for (x = 0; x < width; x++) {
- a = icon.get((x*4)+(y*width*4)+3);
-
- int mask_index = x + y*width;
- int mask_byte_index = mask_index/8;
- int mask_bit_index = mask_index%8;
- byte bit = (((int)a) & 0xff) >= 127 ? (byte)1 : (byte)0;
- byte new_byte = (byte)((icon_mask.get(mask_byte_index) | (bit<<mask_bit_index)) & 0xff);
- icon_mask.put(mask_byte_index, new_byte);
- }
- }
- return icon_mask;
- }
-
- /**
- * Sets one or more icons for the Display.
- * <ul>
- * <li>On Windows you should supply at least one 16x16 icon and one 32x32.</li>
- * <li>Linux (and similar platforms) expect one 32x32 icon.</li>
- * <li>Mac OS X should be supplied one 128x128 icon</li>
- * </ul>
- * The implementation will use the supplied ByteBuffers with image data in RGBA and perform any conversions necessary for the specific platform.
- *
- * @param icons Array of icons in RGBA mode
- * @return number of icons used.
- */
- public int setIcon(ByteBuffer[] icons) {
- lockAWT();
- try {
- incDisplay();
- try {
- for (int i=0;i<icons.length;i++) {
- int size = icons[i].limit() / 4;
- int dimension = (int)Math.sqrt(size);
- if (dimension > 0) {
- ByteBuffer icon_rgb = convertIcon(icons[i], dimension, dimension);
- ByteBuffer icon_mask = convertIconMask(icons[i], dimension, dimension);
- nSetWindowIcon(getDisplay(), getWindow(), icon_rgb, icon_rgb.capacity(), icon_mask, icon_mask.capacity(), dimension, dimension);
- return 1;
- }
- }
- return 0;
- } finally {
- decDisplay();
- }
- } catch (LWJGLException e) {
- LWJGLUtil.log("Failed to set display icon: " + e);
- return 0;
- } finally {
- unlockAWT();
- }
- }
-
- private static native void nSetWindowIcon(long display, long window, ByteBuffer icon_rgb, int icon_rgb_size, ByteBuffer icon_mask, int icon_mask_size, int width, int height);
-
- public int getWidth() {
- return Display.getDisplayMode().getWidth();
- }
-
- public int getHeight() {
- return Display.getDisplayMode().getHeight();
- }
-
- public boolean isInsideWindow() {
- return true;
- }
-}
+/*
+ * Copyright (c) 2002-2010 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.
+ */
+package org.lwjgl.opengl;
+
+/**
+ * This is the Display implementation interface. Display delegates
+ * to implementors of this interface. There is one DisplayImplementation
+ * for each supported platform.
+ * @author elias_naur
+ */
+
+import java.awt.Canvas;
+import java.nio.ByteBuffer;
+import java.nio.FloatBuffer;
+import java.nio.IntBuffer;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.LWJGLException;
+import org.lwjgl.LWJGLUtil;
+import org.lwjgl.opengl.XRandR.Screen;
+
+final class LinuxDisplay implements DisplayImplementation {
+ /* X11 constants */
+ public final static int CurrentTime = 0;
+ public final static int GrabSuccess = 0;
+ public final static int AutoRepeatModeOff = 0;
+ public final static int AutoRepeatModeOn = 1;
+ public final static int AutoRepeatModeDefault = 2;
+ public final static int None = 0;
+
+ private final static int KeyPressMask = 1 << 0;
+ private final static int KeyReleaseMask = 1 << 1;
+ private final static int ButtonPressMask = 1 << 2;
+ private final static int ButtonReleaseMask = 1 << 3;
+
+ private final static int NotifyAncestor = 0;
+ private final static int NotifyNonlinear = 3;
+ private final static int NotifyPointer = 5;
+ private final static int NotifyPointerRoot = 6;
+ private final static int NotifyDetailNone = 7;
+
+ private final static int SetModeInsert = 0;
+ private final static int SaveSetRoot = 1;
+ private final static int SaveSetUnmap = 1;
+
+ /** Window mode enum */
+ private static final int FULLSCREEN_LEGACY = 1;
+ private static final int FULLSCREEN_NETWM = 2;
+ private static final int WINDOWED = 3;
+
+ /** Current window mode */
+ private static int current_window_mode = WINDOWED;
+
+ /** Display mode switching API */
+ private static final int XRANDR = 10;
+ private static final int XF86VIDMODE = 11;
+ private static final int NONE = 12;
+
+ /** Current X11 Display pointer */
+ private static long display;
+ private static long current_window;
+ private static long saved_error_handler;
+
+ private static int display_connection_usage_count = 0;
+
+ /** Event buffer */
+ private final LinuxEvent event_buffer = new LinuxEvent();
+ private final LinuxEvent tmp_event_buffer = new LinuxEvent();
+
+ /** Current mode swithcing API */
+ private int current_displaymode_extension = NONE;
+
+ /** Atom used for the pointer warp messages */
+ private long delete_atom;
+
+ private PeerInfo peer_info;
+
+ /** Saved gamma used to restore display settings */
+ private ByteBuffer saved_gamma;
+ private ByteBuffer current_gamma;
+
+ /** Saved mode to restore with */
+ private DisplayMode saved_mode;
+ private DisplayMode current_mode;
+
+ private Screen[] savedXrandrConfig;
+
+ private boolean keyboard_grabbed;
+ private boolean pointer_grabbed;
+ private boolean input_released;
+ private boolean grab;
+ private boolean focused;
+ private boolean minimized;
+ private boolean dirty;
+ private boolean close_requested;
+ private long current_cursor;
+ private long blank_cursor;
+ private Canvas parent;
+ private long parent_window;
+ private boolean xembedded;
+ private boolean parent_focus;
+
+ private LinuxKeyboard keyboard;
+ private LinuxMouse mouse;
+
+ private static ByteBuffer getCurrentGammaRamp() throws LWJGLException {
+ lockAWT();
+ try {
+ incDisplay();
+ try {
+ if (isXF86VidModeSupported())
+ return nGetCurrentGammaRamp(getDisplay(), getDefaultScreen());
+ else
+ return null;
+ } finally {
+ decDisplay();
+ }
+ } finally {
+ unlockAWT();
+ }
+ }
+ private static native ByteBuffer nGetCurrentGammaRamp(long display, int screen) throws LWJGLException;
+
+ private static int getBestDisplayModeExtension() {
+ int result;
+ if (isXrandrSupported()) {
+ LWJGLUtil.log("Using Xrandr for display mode switching");
+ result = XRANDR;
+ } else if (isXF86VidModeSupported()) {
+ LWJGLUtil.log("Using XF86VidMode for display mode switching");
+ result = XF86VIDMODE;
+ } else {
+ LWJGLUtil.log("No display mode extensions available");
+ result = NONE;
+ }
+ return result;
+ }
+
+ private static boolean isXrandrSupported() {
+ if (Display.getPrivilegedBoolean("LWJGL_DISABLE_XRANDR"))
+ return false;
+ lockAWT();
+ try {
+ incDisplay();
+ try {
+ return nIsXrandrSupported(getDisplay());
+ } finally {
+ decDisplay();
+ }
+ } catch (LWJGLException e) {
+ LWJGLUtil.log("Got exception while querying Xrandr support: " + e);
+ return false;
+ } finally {
+ unlockAWT();
+ }
+ }
+ private static native boolean nIsXrandrSupported(long display) throws LWJGLException;
+
+ private static boolean isXF86VidModeSupported() {
+ lockAWT();
+ try {
+ incDisplay();
+ try {
+ return nIsXF86VidModeSupported(getDisplay());
+ } finally {
+ decDisplay();
+ }
+ } catch (LWJGLException e) {
+ LWJGLUtil.log("Got exception while querying XF86VM support: " + e);
+ return false;
+ } finally {
+ unlockAWT();
+ }
+ }
+ private static native boolean nIsXF86VidModeSupported(long display) throws LWJGLException;
+
+ private static boolean isNetWMFullscreenSupported() throws LWJGLException {
+ if (Display.getPrivilegedBoolean("LWJGL_DISABLE_NETWM"))
+ return false;
+ lockAWT();
+ try {
+ incDisplay();
+ try {
+ return nIsNetWMFullscreenSupported(getDisplay(), getDefaultScreen());
+ } finally {
+ decDisplay();
+ }
+ } catch (LWJGLException e) {
+ LWJGLUtil.log("Got exception while querying NetWM support: " + e);
+ return false;
+ } finally {
+ unlockAWT();
+ }
+ }
+ private static native boolean nIsNetWMFullscreenSupported(long display, int screen) throws LWJGLException;
+
+ /* Since Xlib is not guaranteed to be thread safe, we need a way to synchronize LWJGL
+ * Xlib calls with AWT Xlib calls. Fortunately, JAWT implements Lock()/Unlock() to
+ * do just that.
+ */
+ static void lockAWT() {
+ try {
+ nLockAWT();
+ } catch (LWJGLException e) {
+ LWJGLUtil.log("Caught exception while locking AWT: " + e);
+ }
+ }
+ private static native void nLockAWT() throws LWJGLException;
+
+ static void unlockAWT() {
+ try {
+ nUnlockAWT();
+ } catch (LWJGLException e) {
+ LWJGLUtil.log("Caught exception while unlocking AWT: " + e);
+ }
+ }
+ private static native void nUnlockAWT() throws LWJGLException;
+
+ /**
+ * increment and decrement display usage.
+ */
+ static void incDisplay() throws LWJGLException {
+ if (display_connection_usage_count == 0) {
+ GLContext.loadOpenGLLibrary();
+ saved_error_handler = setErrorHandler();
+ display = openDisplay();
+// synchronize(display, true);
+ }
+ display_connection_usage_count++;
+ }
+ private static native int callErrorHandler(long handler, long display, long error_ptr);
+ private static native long setErrorHandler();
+ private static native long resetErrorHandler(long handler);
+ private static native void synchronize(long display, boolean synchronize);
+
+ private static int globalErrorHandler(long display, long event_ptr, long error_display, long serial, long error_code, long request_code, long minor_code) throws LWJGLException {
+ if (display == getDisplay()) {
+ String error_msg = getErrorText(display, error_code);
+ throw new LWJGLException("X Error - disp: 0x" + Long.toHexString(error_display) + " serial: " + serial + " error: " + error_msg + " request_code: " + request_code + " minor_code: " + minor_code);
+ } else if (saved_error_handler != 0)
+ return callErrorHandler(saved_error_handler, display, event_ptr);
+ return 0;
+ }
+ private static native String getErrorText(long display, long error_code);
+
+ static void decDisplay() {
+ /*
+ * Some drivers (at least some versions of the radeon dri driver)
+ * don't like it when the display is closed and later re-opened,
+ * so we'll just let the singleton display connection leak.
+ */
+/* display_connection_usage_count--;
+ if (display_connection_usage_count < 0)
+ throw new InternalError("display_connection_usage_count < 0: " + display_connection_usage_count);
+ if (display_connection_usage_count == 0) {
+ closeDisplay(display);
+ resetErrorHandler(saved_error_handler);
+ display = 0;
+ GLContext.unloadOpenGLLibrary();
+ }*/
+ }
+
+ static native long openDisplay() throws LWJGLException;
+ static native void closeDisplay(long display);
+
+ private int getWindowMode(boolean fullscreen) throws LWJGLException {
+ if (fullscreen) {
+ if (current_displaymode_extension == XRANDR && isNetWMFullscreenSupported()) {
+ LWJGLUtil.log("Using NetWM for fullscreen window");
+ return FULLSCREEN_NETWM;
+ } else {
+ LWJGLUtil.log("Using legacy mode for fullscreen window");
+ return FULLSCREEN_LEGACY;
+ }
+ } else
+ return WINDOWED;
+ }
+
+ static long getDisplay() {
+ if (display_connection_usage_count <= 0)
+ throw new InternalError("display_connection_usage_count = " + display_connection_usage_count);
+ return display;
+ }
+
+ static int getDefaultScreen() {
+ return nGetDefaultScreen(getDisplay());
+ }
+ static native int nGetDefaultScreen(long display);
+
+ static long getWindow() {
+ return current_window;
+ }
+
+ private void ungrabKeyboard() {
+ if (keyboard_grabbed) {
+ nUngrabKeyboard(getDisplay());
+ keyboard_grabbed = false;
+ }
+ }
+ static native int nUngrabKeyboard(long display);
+
+ private void grabKeyboard() {
+ if (!keyboard_grabbed) {
+ int res = nGrabKeyboard(getDisplay(), getWindow());
+ if (res == GrabSuccess)
+ keyboard_grabbed = true;
+ }
+ }
+ static native int nGrabKeyboard(long display, long window);
+
+ private void grabPointer() {
+ if (!pointer_grabbed) {
+ int result = nGrabPointer(getDisplay(), getWindow(), None);
+ if (result == GrabSuccess) {
+ pointer_grabbed = true;
+ // make sure we have a centered window
+ if (isLegacyFullscreen()) {
+ nSetViewPort(getDisplay(), getWindow(), getDefaultScreen());
+ }
+ }
+ }
+ }
+ static native int nGrabPointer(long display, long window, long cursor);
+ private static native void nSetViewPort(long display, long window, int screen);
+
+ private void ungrabPointer() {
+ if (pointer_grabbed) {
+ pointer_grabbed = false;
+ nUngrabPointer(getDisplay());
+ }
+ }
+ static native int nUngrabPointer(long display);
+
+ private boolean isFullscreen() {
+ return current_window_mode == FULLSCREEN_LEGACY || current_window_mode == FULLSCREEN_NETWM;
+ }
+
+ private boolean shouldGrab() {
+ return !input_released && grab && mouse != null;
+ }
+
+ private void updatePointerGrab() {
+ if (isFullscreen() || shouldGrab()) {
+ grabPointer();
+ } else {
+ ungrabPointer();
+ }
+ updateCursor();
+ }
+
+ private void updateCursor() {
+ long cursor;
+ if (shouldGrab()) {
+ cursor = blank_cursor;
+ } else {
+ cursor = current_cursor;
+ }
+ nDefineCursor(getDisplay(), getWindow(), cursor);
+ }
+ private static native void nDefineCursor(long display, long window, long cursor_handle);
+
+ private boolean isLegacyFullscreen() {
+ return current_window_mode == FULLSCREEN_LEGACY;
+ }
+
+ private void updateKeyboardGrab() {
+ if (isLegacyFullscreen())
+ grabKeyboard();
+ else
+ ungrabKeyboard();
+ }
+
+ public void createWindow(DisplayMode mode, Canvas parent, int x, int y) throws LWJGLException {
+ lockAWT();
+ try {
+ incDisplay();
+ try {
+ ByteBuffer handle = peer_info.lockAndGetHandle();
+ try {
+ current_window_mode = getWindowMode(Display.isFullscreen());
+ boolean undecorated = Display.getPrivilegedBoolean("org.lwjgl.opengl.Window.undecorated") || current_window_mode != WINDOWED;
+ this.parent = parent;
+ parent_window = parent != null ? getHandle(parent) : getRootWindow(getDisplay(), getDefaultScreen());
+ current_window = nCreateWindow(getDisplay(), getDefaultScreen(), handle, mode, current_window_mode, x, y, undecorated, parent_window);
+ mapRaised(getDisplay(), current_window);
+ xembedded = parent != null && isAncestorXEmbedded(parent_window);
+ blank_cursor = createBlankCursor();
+ current_cursor = None;
+ focused = false;
+ input_released = false;
+ pointer_grabbed = false;
+ keyboard_grabbed = false;
+ close_requested = false;
+ grab = false;
+ minimized = false;
+ dirty = true;
+ } finally {
+ peer_info.unlock();
+ }
+ } catch (LWJGLException e) {
+ decDisplay();
+ throw e;
+ }
+ } finally {
+ unlockAWT();
+ }
+ }
+ private static native long nCreateWindow(long display, int screen, ByteBuffer peer_info_handle, DisplayMode mode, int window_mode, int x, int y, boolean undecorated, long parent_handle) throws LWJGLException;
+ private static native long getRootWindow(long display, int screen);
+ private static native boolean hasProperty(long display, long window, long property);
+ private static native long getParentWindow(long display, long window) throws LWJGLException;
+ private static native void mapRaised(long display, long window);
+ private static native void reparentWindow(long display, long window, long parent, int x, int y);
+
+ private boolean isAncestorXEmbedded(long window) throws LWJGLException {
+ long xembed_atom = internAtom("_XEMBED_INFO", true);
+ if (xembed_atom != None) {
+ long w = window;
+ while (w != None) {
+ if (hasProperty(getDisplay(), w, xembed_atom))
+ return true;
+ w = getParentWindow(getDisplay(), w);
+ }
+ }
+ return false;
+ }
+
+ private static long getHandle(Canvas parent) throws LWJGLException {
+ AWTCanvasImplementation awt_impl = AWTGLCanvas.createImplementation();
+ LinuxPeerInfo parent_peer_info = (LinuxPeerInfo)awt_impl.createPeerInfo(parent, null);
+ ByteBuffer parent_peer_info_handle = parent_peer_info.lockAndGetHandle();
+ try {
+ return parent_peer_info.getDrawable();
+ } finally {
+ parent_peer_info.unlock();
+ }
+ }
+
+ private void updateInputGrab() {
+ updatePointerGrab();
+ updateKeyboardGrab();
+ }
+
+ public void destroyWindow() {
+ lockAWT();
+ try {
+ try {
+ setNativeCursor(null);
+ } catch (LWJGLException e) {
+ LWJGLUtil.log("Failed to reset cursor: " + e.getMessage());
+ }
+ nDestroyCursor(getDisplay(), blank_cursor);
+ blank_cursor = None;
+ ungrabKeyboard();
+ nDestroyWindow(getDisplay(), getWindow());
+ decDisplay();
+ } finally {
+ unlockAWT();
+ }
+ }
+ static native void nDestroyWindow(long display, long window);
+
+ public void switchDisplayMode(DisplayMode mode) throws LWJGLException {
+ lockAWT();
+ try {
+ switchDisplayModeOnTmpDisplay(mode);
+ current_mode = mode;
+ } finally {
+ unlockAWT();
+ }
+ }
+
+ private void switchDisplayModeOnTmpDisplay(DisplayMode mode) throws LWJGLException {
+ incDisplay();
+ try {
+ nSwitchDisplayMode(getDisplay(), getDefaultScreen(), current_displaymode_extension, mode);
+ } finally {
+ decDisplay();
+ }
+ }
+ private static native void nSwitchDisplayMode(long display, int screen, int extension, DisplayMode mode) throws LWJGLException;
+
+ private static long internAtom(String atom_name, boolean only_if_exists) throws LWJGLException {
+ incDisplay();
+ try {
+ return nInternAtom(getDisplay(), atom_name, only_if_exists);
+ } finally {
+ decDisplay();
+ }
+ }
+ static native long nInternAtom(long display, String atom_name, boolean only_if_exists);
+
+ public void resetDisplayMode() {
+ lockAWT();
+ try {
+ if( current_displaymode_extension == XRANDR && savedXrandrConfig.length > 0 )
+ {
+ XRandR.setConfiguration( savedXrandrConfig );
+ }
+ else
+ {
+ switchDisplayMode(saved_mode);
+ }
+ if (isXF86VidModeSupported())
+ doSetGamma(saved_gamma);
+ } catch (LWJGLException e) {
+ LWJGLUtil.log("Caught exception while resetting mode: " + e);
+ } finally {
+ unlockAWT();
+ }
+ }
+
+ public int getGammaRampLength() {
+ if (!isXF86VidModeSupported())
+ return 0;
+ lockAWT();
+ try {
+ try {
+ incDisplay();
+ try {
+ return nGetGammaRampLength(getDisplay(), getDefaultScreen());
+ } catch (LWJGLException e) {
+ LWJGLUtil.log("Got exception while querying gamma length: " + e);
+ return 0;
+ } finally {
+ decDisplay();
+ }
+ } catch (LWJGLException e) {
+ LWJGLUtil.log("Failed to get gamma ramp length: " + e);
+ return 0;
+ }
+ } finally {
+ unlockAWT();
+ }
+ }
+ private static native int nGetGammaRampLength(long display, int screen) throws LWJGLException;
+
+ public void setGammaRamp(FloatBuffer gammaRamp) throws LWJGLException {
+ if (!isXF86VidModeSupported())
+ throw new LWJGLException("No gamma ramp support (Missing XF86VM extension)");
+ doSetGamma(convertToNativeRamp(gammaRamp));
+ }
+
+ private void doSetGamma(ByteBuffer native_gamma) throws LWJGLException {
+ lockAWT();
+ try {
+ setGammaRampOnTmpDisplay(native_gamma);
+ current_gamma = native_gamma;
+ } finally {
+ unlockAWT();
+ }
+ }
+
+ private void setGammaRampOnTmpDisplay(ByteBuffer native_gamma) throws LWJGLException {
+ incDisplay();
+ try {
+ nSetGammaRamp(getDisplay(), getDefaultScreen(), native_gamma);
+ } finally {
+ decDisplay();
+ }
+ }
+ private static native void nSetGammaRamp(long display, int screen, ByteBuffer gammaRamp) throws LWJGLException;
+
+ private static ByteBuffer convertToNativeRamp(FloatBuffer ramp) throws LWJGLException {
+ return nConvertToNativeRamp(ramp, ramp.position(), ramp.remaining());
+ }
+ private static native ByteBuffer nConvertToNativeRamp(FloatBuffer ramp, int offset, int length) throws LWJGLException;
+
+ public String getAdapter() {
+ return null;
+ }
+
+ public String getVersion() {
+ return null;
+ }
+
+ public DisplayMode init() throws LWJGLException {
+ lockAWT();
+ try {
+ delete_atom = internAtom("WM_DELETE_WINDOW", false);
+ current_displaymode_extension = getBestDisplayModeExtension();
+ if (current_displaymode_extension == NONE)
+ throw new LWJGLException("No display mode extension is available");
+ DisplayMode[] modes = getAvailableDisplayModes();
+ if (modes == null || modes.length == 0)
+ throw new LWJGLException("No modes available");
+ switch (current_displaymode_extension) {
+ case XRANDR:
+ savedXrandrConfig = XRandR.getConfiguration();
+ saved_mode = getCurrentXRandrMode();
+ break;
+ case XF86VIDMODE:
+ saved_mode = modes[0];
+ break;
+ default:
+ throw new LWJGLException("Unknown display mode extension: " + current_displaymode_extension);
+ }
+ current_mode = saved_mode;
+ saved_gamma = getCurrentGammaRamp();
+ current_gamma = saved_gamma;
+ return saved_mode;
+ } finally {
+ unlockAWT();
+ }
+ }
+
+ private static DisplayMode getCurrentXRandrMode() throws LWJGLException {
+ lockAWT();
+ try {
+ incDisplay();
+ try {
+ return nGetCurrentXRandrMode(getDisplay(), getDefaultScreen());
+ } finally {
+ decDisplay();
+ }
+ } finally {
+ unlockAWT();
+ }
+ }
+
+ /** Assumes extension == XRANDR */
+ private static native DisplayMode nGetCurrentXRandrMode(long display, int screen) throws LWJGLException;
+
+ public void setTitle(String title) {
+ lockAWT();
+ try {
+ nSetTitle(getDisplay(), getWindow(), title);
+ } finally {
+ unlockAWT();
+ }
+ }
+ private static native void nSetTitle(long display, long window, String title);
+
+ public boolean isCloseRequested() {
+ boolean result = close_requested;
+ close_requested = false;
+ return result;
+ }
+
+ public boolean isVisible() {
+ return !minimized;
+ }
+
+ public boolean isActive() {
+ return focused || isLegacyFullscreen();
+ }
+
+ public boolean isDirty() {
+ boolean result = dirty;
+ dirty = false;
+ return result;
+ }
+
+ public PeerInfo createPeerInfo(PixelFormat pixel_format) throws LWJGLException {
+ peer_info = new LinuxDisplayPeerInfo(pixel_format);
+ return peer_info;
+ }
+
+ static native void setInputFocus(long display, long window, long time);
+
+ private void relayEventToParent(LinuxEvent event_buffer, int event_mask) {
+ tmp_event_buffer.copyFrom(event_buffer);
+ tmp_event_buffer.setWindow(parent_window);
+ tmp_event_buffer.sendEvent(getDisplay(), parent_window, true, event_mask);
+ }
+
+ private void relayEventToParent(LinuxEvent event_buffer) {
+ if (parent == null)
+ return;
+ switch (event_buffer.getType()) {
+ case LinuxEvent.KeyPress:
+ relayEventToParent(event_buffer, KeyPressMask);
+ break;
+ case LinuxEvent.KeyRelease:
+ relayEventToParent(event_buffer, KeyPressMask);
+ break;
+ case LinuxEvent.ButtonPress:
+ relayEventToParent(event_buffer, KeyPressMask);
+ break;
+ case LinuxEvent.ButtonRelease:
+ relayEventToParent(event_buffer, KeyPressMask);
+ break;
+ default:
+ break;
+ }
+ }
+
+ private void processEvents() {
+ while (LinuxEvent.getPending(getDisplay()) > 0) {
+ event_buffer.nextEvent(getDisplay());
+ long event_window = event_buffer.getWindow();
+ relayEventToParent(event_buffer);
+ if (event_window != getWindow() || event_buffer.filterEvent(event_window) ||
+ (mouse != null && mouse.filterEvent(grab, shouldWarpPointer(), event_buffer)) ||
+ (keyboard != null && keyboard.filterEvent(event_buffer)))
+ continue;
+ switch (event_buffer.getType()) {
+ case LinuxEvent.FocusIn:
+ setFocused(true, event_buffer.getFocusDetail());
+ break;
+ case LinuxEvent.FocusOut:
+ setFocused(false, event_buffer.getFocusDetail());
+ break;
+ case LinuxEvent.ClientMessage:
+ if ((event_buffer.getClientFormat() == 32) && (event_buffer.getClientData(0) == delete_atom))
+ close_requested = true;
+ break;
+ case LinuxEvent.MapNotify:
+ dirty = true;
+ minimized = false;
+ break;
+ case LinuxEvent.UnmapNotify:
+ dirty = true;
+ minimized = true;
+ break;
+ case LinuxEvent.Expose:
+ dirty = true;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ public void update() {
+ lockAWT();
+ try {
+ processEvents();
+ checkInput();
+ } finally {
+ unlockAWT();
+ }
+ }
+
+ public void reshape(int x, int y, int width, int height) {
+ lockAWT();
+ try {
+ nReshape(getDisplay(), getWindow(), x, y, width, height);
+ } finally {
+ unlockAWT();
+ }
+ }
+ private static native void nReshape(long display, long window, int x, int y, int width, int height);
+
+ public DisplayMode[] getAvailableDisplayModes() throws LWJGLException {
+ lockAWT();
+ try {
+ incDisplay();
+ try {
+ DisplayMode[] modes = nGetAvailableDisplayModes(getDisplay(), getDefaultScreen(), current_displaymode_extension);
+ return modes;
+ } finally {
+ decDisplay();
+ }
+ } finally {
+ unlockAWT();
+ }
+ }
+ private static native DisplayMode[] nGetAvailableDisplayModes(long display, int screen, int extension) throws LWJGLException;
+
+ /* Mouse */
+ public boolean hasWheel() {
+ return true;
+ }
+
+ public int getButtonCount() {
+ return mouse.getButtonCount();
+ }
+
+ public void createMouse() throws LWJGLException {
+ lockAWT();
+ try {
+ mouse = new LinuxMouse(getDisplay(), getWindow(), getWindow());
+ } finally {
+ unlockAWT();
+ }
+ }
+
+ public void destroyMouse() {
+ mouse = null;
+ updateInputGrab();
+ }
+
+ public void pollMouse(IntBuffer coord_buffer, ByteBuffer buttons) {
+ lockAWT();
+ try {
+ mouse.poll(grab, coord_buffer, buttons);
+ } finally {
+ unlockAWT();
+ }
+ }
+
+ public void readMouse(ByteBuffer buffer) {
+ lockAWT();
+ try {
+ mouse.read(buffer);
+ } finally {
+ unlockAWT();
+ }
+ }
+
+ public void setCursorPosition(int x, int y) {
+ lockAWT();
+ try {
+ mouse.setCursorPosition(x, y);
+ } finally {
+ unlockAWT();
+ }
+ }
+
+ private void checkInput() {
+ if (parent == null) return;
+
+ if (parent_focus != parent.hasFocus()) {
+ parent_focus = parent.hasFocus();
+
+ if (parent_focus) {
+ setInputFocusUnsafe(current_window);
+ }
+ else if (xembedded) {
+ setInputFocusUnsafe(0);
+ }
+ }
+ else if (parent_focus && !focused) {
+ setInputFocusUnsafe(current_window);
+ }
+ }
+
+ private void setFocused(boolean got_focus, int focus_detail) {
+ if (focused == got_focus || focus_detail == NotifyDetailNone || focus_detail == NotifyPointer || focus_detail == NotifyPointerRoot)
+ return;
+ focused = got_focus;
+
+ if (focused) {
+ acquireInput();
+ }
+ else {
+ releaseInput();
+ }
+ }
+ static native long nGetInputFocus(long display);
+
+ private void setInputFocusUnsafe(long window) {
+ try {
+ setInputFocus(getDisplay(), window, CurrentTime);
+ sync(getDisplay(), false);
+ } catch (LWJGLException e) {
+ // Since we don't have any event timings for XSetInputFocus, a race condition might give a BadMatch, which we'll catch and ignore
+ LWJGLUtil.log("Got exception while trying to focus: " + e);
+ }
+ }
+ private static native void sync(long display, boolean throw_away_events) throws LWJGLException;
+
+ private void releaseInput() {
+ if (isLegacyFullscreen() || input_released)
+ return;
+ input_released = true;
+ updateInputGrab();
+ if (current_window_mode == FULLSCREEN_NETWM) {
+ nIconifyWindow(getDisplay(), getWindow(), getDefaultScreen());
+ try {
+ if( current_displaymode_extension == XRANDR && savedXrandrConfig.length > 0 )
+ {
+ XRandR.setConfiguration( savedXrandrConfig );
+ }
+ else
+ {
+ switchDisplayModeOnTmpDisplay(saved_mode);
+ }
+ setGammaRampOnTmpDisplay(saved_gamma);
+ } catch (LWJGLException e) {
+ LWJGLUtil.log("Failed to restore saved mode: " + e.getMessage());
+ }
+ }
+ }
+ private static native void nIconifyWindow(long display, long window, int screen);
+
+ private void acquireInput() {
+ if (isLegacyFullscreen() || !input_released)
+ return;
+ input_released = false;
+ updateInputGrab();
+ if (current_window_mode == FULLSCREEN_NETWM) {
+ try {
+ switchDisplayModeOnTmpDisplay(current_mode);
+ setGammaRampOnTmpDisplay(current_gamma);
+ } catch (LWJGLException e) {
+ LWJGLUtil.log("Failed to restore mode: " + e.getMessage());
+ }
+ }
+ }
+
+ public void grabMouse(boolean new_grab) {
+ lockAWT();
+ try {
+ if (new_grab != grab) {
+ grab = new_grab;
+ updateInputGrab();
+ mouse.changeGrabbed(grab, shouldWarpPointer());
+ }
+ } finally {
+ unlockAWT();
+ }
+ }
+
+ private boolean shouldWarpPointer() {
+ return pointer_grabbed && shouldGrab();
+ }
+
+ public int getNativeCursorCapabilities() {
+ lockAWT();
+ try {
+ incDisplay();
+ try {
+ return nGetNativeCursorCapabilities(getDisplay());
+ } finally {
+ decDisplay();
+ }
+ } catch (LWJGLException e) {
+ throw new RuntimeException(e);
+ } finally {
+ unlockAWT();
+ }
+ }
+ private static native int nGetNativeCursorCapabilities(long display) throws LWJGLException;
+
+ public void setNativeCursor(Object handle) throws LWJGLException {
+ current_cursor = getCursorHandle(handle);
+ lockAWT();
+ try {
+ updateCursor();
+ } finally {
+ unlockAWT();
+ }
+ }
+
+ public int getMinCursorSize() {
+ lockAWT();
+ try {
+ incDisplay();
+ try {
+ return nGetMinCursorSize(getDisplay(), getWindow());
+ } finally {
+ decDisplay();
+ }
+ } catch (LWJGLException e) {
+ LWJGLUtil.log("Exception occurred in getMinCursorSize: " + e);
+ return 0;
+ } finally {
+ unlockAWT();
+ }
+ }
+ private static native int nGetMinCursorSize(long display, long window);
+
+ public int getMaxCursorSize() {
+ lockAWT();
+ try {
+ incDisplay();
+ try {
+ return nGetMaxCursorSize(getDisplay(), getWindow());
+ } finally {
+ decDisplay();
+ }
+ } catch (LWJGLException e) {
+ LWJGLUtil.log("Exception occurred in getMaxCursorSize: " + e);
+ return 0;
+ } finally {
+ unlockAWT();
+ }
+ }
+ private static native int nGetMaxCursorSize(long display, long window);
+
+ /* Keyboard */
+ public void createKeyboard() throws LWJGLException {
+ lockAWT();
+ try {
+ keyboard = new LinuxKeyboard(getDisplay(), getWindow());
+ } finally {
+ unlockAWT();
+ }
+ }
+
+ public void destroyKeyboard() {
+ lockAWT();
+ try {
+ keyboard.destroy(getDisplay());
+ keyboard = null;
+ } finally {
+ unlockAWT();
+ }
+ }
+
+ public void pollKeyboard(ByteBuffer keyDownBuffer) {
+ lockAWT();
+ try {
+ keyboard.poll(keyDownBuffer);
+ } finally {
+ unlockAWT();
+ }
+ }
+
+ public void readKeyboard(ByteBuffer buffer) {
+ lockAWT();
+ try {
+ keyboard.read(buffer);
+ } finally {
+ unlockAWT();
+ }
+ }
+
+ private static native long nCreateCursor(long display, int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, int images_offset, IntBuffer delays, int delays_offset) throws LWJGLException;
+
+ private static long createBlankCursor() {
+ return nCreateBlankCursor(getDisplay(), getWindow());
+ }
+ static native long nCreateBlankCursor(long display, long window);
+
+ public Object createCursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws LWJGLException {
+ lockAWT();
+ try {
+ incDisplay();
+ try {
+ long cursor = nCreateCursor(getDisplay(), width, height, xHotspot, yHotspot, numImages, images, images.position(), delays, delays != null ? delays.position() : -1);
+ return new Long(cursor);
+ } catch (LWJGLException e) {
+ decDisplay();
+ throw e;
+ }
+ } finally {
+ unlockAWT();
+ }
+ }
+
+ private static long getCursorHandle(Object cursor_handle) {
+ return cursor_handle != null ? ((Long)cursor_handle).longValue() : None;
+ }
+
+ public void destroyCursor(Object cursorHandle) {
+ lockAWT();
+ try {
+ nDestroyCursor(getDisplay(), getCursorHandle(cursorHandle));
+ decDisplay();
+ } finally {
+ unlockAWT();
+ }
+ }
+ static native void nDestroyCursor(long display, long cursorHandle);
+
+ public int getPbufferCapabilities() {
+ lockAWT();
+ try {
+ incDisplay();
+ try {
+ return nGetPbufferCapabilities(getDisplay(), getDefaultScreen());
+ } finally {
+ decDisplay();
+ }
+ } catch (LWJGLException e) {
+ LWJGLUtil.log("Exception occurred in getPbufferCapabilities: " + e);
+ return 0;
+ } finally {
+ unlockAWT();
+ }
+ }
+ private static native int nGetPbufferCapabilities(long display, int screen);
+
+ public boolean isBufferLost(PeerInfo handle) {
+ return false;
+ }
+
+ public PeerInfo createPbuffer(int width, int height, PixelFormat pixel_format,
+ IntBuffer pixelFormatCaps,
+ IntBuffer pBufferAttribs) throws LWJGLException {
+ return new LinuxPbufferPeerInfo(width, height, pixel_format);
+ }
+
+ public void setPbufferAttrib(PeerInfo handle, int attrib, int value) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void bindTexImageToPbuffer(PeerInfo handle, int buffer) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void releaseTexImageFromPbuffer(PeerInfo handle, int buffer) {
+ throw new UnsupportedOperationException();
+ }
+
+ private static ByteBuffer convertIcon(ByteBuffer icon, int width, int height) {
+ ByteBuffer icon_rgb = BufferUtils.createByteBuffer(icon.capacity());
+ int x;
+ int y;
+ byte r,g,b;
+
+ int depth = 4;
+
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++) {
+ r = icon.get((x*4)+(y*width*4));
+ g = icon.get((x*4)+(y*width*4)+1);
+ b = icon.get((x*4)+(y*width*4)+2);
+
+ icon_rgb.put((x*depth)+(y*width*depth), b); // blue
+ icon_rgb.put((x*depth)+(y*width*depth)+1, g); // green
+ icon_rgb.put((x*depth)+(y*width*depth)+2, r);
+ }
+ }
+ return icon_rgb;
+ }
+
+ private static ByteBuffer convertIconMask(ByteBuffer icon, int width, int height) {
+ ByteBuffer icon_mask = BufferUtils.createByteBuffer((icon.capacity()/4)/8);
+ int x;
+ int y;
+ byte a;
+
+ int depth = 4;
+
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++) {
+ a = icon.get((x*4)+(y*width*4)+3);
+
+ int mask_index = x + y*width;
+ int mask_byte_index = mask_index/8;
+ int mask_bit_index = mask_index%8;
+ byte bit = (((int)a) & 0xff) >= 127 ? (byte)1 : (byte)0;
+ byte new_byte = (byte)((icon_mask.get(mask_byte_index) | (bit<<mask_bit_index)) & 0xff);
+ icon_mask.put(mask_byte_index, new_byte);
+ }
+ }
+ return icon_mask;
+ }
+
+ /**
+ * Sets one or more icons for the Display.
+ * <ul>
+ * <li>On Windows you should supply at least one 16x16 icon and one 32x32.</li>
+ * <li>Linux (and similar platforms) expect one 32x32 icon.</li>
+ * <li>Mac OS X should be supplied one 128x128 icon</li>
+ * </ul>
+ * The implementation will use the supplied ByteBuffers with image data in RGBA and perform any conversions necessary for the specific platform.
+ *
+ * @param icons Array of icons in RGBA mode
+ * @return number of icons used.
+ */
+ public int setIcon(ByteBuffer[] icons) {
+ lockAWT();
+ try {
+ incDisplay();
+ try {
+ for (int i=0;i<icons.length;i++) {
+ int size = icons[i].limit() / 4;
+ int dimension = (int)Math.sqrt(size);
+ if (dimension > 0) {
+ ByteBuffer icon_rgb = convertIcon(icons[i], dimension, dimension);
+ ByteBuffer icon_mask = convertIconMask(icons[i], dimension, dimension);
+ nSetWindowIcon(getDisplay(), getWindow(), icon_rgb, icon_rgb.capacity(), icon_mask, icon_mask.capacity(), dimension, dimension);
+ return 1;
+ }
+ }
+ return 0;
+ } finally {
+ decDisplay();
+ }
+ } catch (LWJGLException e) {
+ LWJGLUtil.log("Failed to set display icon: " + e);
+ return 0;
+ } finally {
+ unlockAWT();
+ }
+ }
+
+ private static native void nSetWindowIcon(long display, long window, ByteBuffer icon_rgb, int icon_rgb_size, ByteBuffer icon_mask, int icon_mask_size, int width, int height);
+
+ public int getWidth() {
+ return Display.getDisplayMode().getWidth();
+ }
+
+ public int getHeight() {
+ return Display.getDisplayMode().getHeight();
+ }
+
+ public boolean isInsideWindow() {
+ return true;
+ }
+}
diff --git a/src/java/org/lwjgl/opengl/LinuxDisplayPeerInfo.java b/src/java/org/lwjgl/opengl/LinuxDisplayPeerInfo.java
index d702170..debfa8d 100644
--- a/src/java/org/lwjgl/opengl/LinuxDisplayPeerInfo.java
+++ b/src/java/org/lwjgl/opengl/LinuxDisplayPeerInfo.java
@@ -1,88 +1,88 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import java.nio.ByteBuffer;
-
-import org.lwjgl.LWJGLException;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3116 $
- * $Id: LinuxDisplayPeerInfo.java 3116 2008-08-19 16:46:03Z spasi $
- */
-final class LinuxDisplayPeerInfo extends LinuxPeerInfo {
- LinuxDisplayPeerInfo(PixelFormat pixel_format) throws LWJGLException {
- LinuxDisplay.lockAWT();
- try {
- GLContext.loadOpenGLLibrary();
- try {
- LinuxDisplay.incDisplay();
- try {
- initDefaultPeerInfo(LinuxDisplay.getDisplay(), LinuxDisplay.getDefaultScreen(), getHandle(), pixel_format);
- } catch (LWJGLException e) {
- LinuxDisplay.decDisplay();
- throw e;
- }
- } catch (LWJGLException e) {
- GLContext.unloadOpenGLLibrary();
- throw e;
- }
- } finally {
- LinuxDisplay.unlockAWT();
- }
- }
- private static native void initDefaultPeerInfo(long display, int screen, ByteBuffer peer_info_handle, PixelFormat pixel_format) throws LWJGLException;
-
- protected void doLockAndInitHandle() throws LWJGLException {
- LinuxDisplay.lockAWT();
- try {
- initDrawable(LinuxDisplay.getWindow(), getHandle());
- } finally {
- LinuxDisplay.unlockAWT();
- }
- }
- private static native void initDrawable(long window, ByteBuffer peer_info_handle);
-
- protected void doUnlock() throws LWJGLException {
- // NO-OP
- }
-
- public void destroy() {
- super.destroy();
- LinuxDisplay.lockAWT();
- LinuxDisplay.decDisplay();
- GLContext.unloadOpenGLLibrary();
- LinuxDisplay.unlockAWT();
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import java.nio.ByteBuffer;
+
+import org.lwjgl.LWJGLException;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3116 $
+ * $Id: LinuxDisplayPeerInfo.java 3116 2008-08-19 16:46:03Z spasi $
+ */
+final class LinuxDisplayPeerInfo extends LinuxPeerInfo {
+ LinuxDisplayPeerInfo(PixelFormat pixel_format) throws LWJGLException {
+ LinuxDisplay.lockAWT();
+ try {
+ GLContext.loadOpenGLLibrary();
+ try {
+ LinuxDisplay.incDisplay();
+ try {
+ initDefaultPeerInfo(LinuxDisplay.getDisplay(), LinuxDisplay.getDefaultScreen(), getHandle(), pixel_format);
+ } catch (LWJGLException e) {
+ LinuxDisplay.decDisplay();
+ throw e;
+ }
+ } catch (LWJGLException e) {
+ GLContext.unloadOpenGLLibrary();
+ throw e;
+ }
+ } finally {
+ LinuxDisplay.unlockAWT();
+ }
+ }
+ private static native void initDefaultPeerInfo(long display, int screen, ByteBuffer peer_info_handle, PixelFormat pixel_format) throws LWJGLException;
+
+ protected void doLockAndInitHandle() throws LWJGLException {
+ LinuxDisplay.lockAWT();
+ try {
+ initDrawable(LinuxDisplay.getWindow(), getHandle());
+ } finally {
+ LinuxDisplay.unlockAWT();
+ }
+ }
+ private static native void initDrawable(long window, ByteBuffer peer_info_handle);
+
+ protected void doUnlock() throws LWJGLException {
+ // NO-OP
+ }
+
+ public void destroy() {
+ super.destroy();
+ LinuxDisplay.lockAWT();
+ LinuxDisplay.decDisplay();
+ GLContext.unloadOpenGLLibrary();
+ LinuxDisplay.unlockAWT();
+ }
+}
diff --git a/src/java/org/lwjgl/opengl/LinuxKeyboard.java b/src/java/org/lwjgl/opengl/LinuxKeyboard.java
index 2777671..9966503 100644
--- a/src/java/org/lwjgl/opengl/LinuxKeyboard.java
+++ b/src/java/org/lwjgl/opengl/LinuxKeyboard.java
@@ -1,353 +1,353 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-/**
- * @author elias_naur
- */
-
-import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
-import java.nio.charset.Charset;
-import java.nio.charset.CharsetDecoder;
-
-import org.lwjgl.BufferUtils;
-import org.lwjgl.LWJGLUtil;
-import org.lwjgl.input.Keyboard;
-
-final class LinuxKeyboard {
- private static final int LockMapIndex = 1;
- private static final long NoSymbol = 0;
- private static final long ShiftMask = 1 << 0;
- private static final long LockMask = 1 << 1;
- private static final int XLookupChars = 2;
- private static final int XLookupBoth = 4;
-
- private static final int KEYBOARD_BUFFER_SIZE = 50;
-
- private final long xim;
- private final long xic;
-
- private final int numlock_mask;
- private final int modeswitch_mask;
- private final int caps_lock_mask;
- private final int shift_lock_mask;
-
- private final ByteBuffer compose_status;
-
- private final byte[] key_down_buffer = new byte[Keyboard.KEYBOARD_SIZE];
- private final EventQueue event_queue = new EventQueue(Keyboard.EVENT_SIZE);
-
- private final ByteBuffer tmp_event = ByteBuffer.allocate(Keyboard.EVENT_SIZE);
- private final int[] temp_translation_buffer = new int[KEYBOARD_BUFFER_SIZE];
- private final ByteBuffer native_translation_buffer = BufferUtils.createByteBuffer(KEYBOARD_BUFFER_SIZE);
- private final CharsetDecoder utf8_decoder = Charset.forName("UTF-8").newDecoder();
- private final CharBuffer char_buffer = CharBuffer.allocate(KEYBOARD_BUFFER_SIZE);
-
- // Deferred key released event, to detect key repeat
- private boolean has_deferred_event;
- private int deferred_keycode;
- private int deferred_event_keycode;
- private long deferred_nanos;
- private byte deferred_key_state;
-
- LinuxKeyboard(long display, long window) {
- long modifier_map = getModifierMapping(display);
- int tmp_numlock_mask = 0;
- int tmp_modeswitch_mask = 0;
- int tmp_caps_lock_mask = 0;
- int tmp_shift_lock_mask = 0;
- if (modifier_map != 0) {
- int max_keypermod = getMaxKeyPerMod(modifier_map);
- // Find modifier masks
- int i, j;
- for (i = 0; i < 8; i++) {
- for (j = 0; j < max_keypermod; j++) {
- int key_code = lookupModifierMap(modifier_map, i*max_keypermod + j);
- int key_sym = (int)keycodeToKeySym(display, key_code);
- int mask = 1 << i;
- switch (key_sym) {
- case LinuxKeycodes.XK_Num_Lock:
- tmp_numlock_mask |= mask;
- break;
- case LinuxKeycodes.XK_Mode_switch:
- tmp_modeswitch_mask |= mask;
- break;
- case LinuxKeycodes.XK_Caps_Lock:
- if (i == LockMapIndex) {
- tmp_caps_lock_mask = mask;
- tmp_shift_lock_mask = 0;
- }
- break;
- case LinuxKeycodes.XK_Shift_Lock:
- if (i == LockMapIndex && tmp_caps_lock_mask == 0)
- tmp_shift_lock_mask = mask;
- break;
- default:
- break;
- }
- }
- }
- freeModifierMapping(modifier_map);
- }
- numlock_mask = tmp_numlock_mask;
- modeswitch_mask = tmp_modeswitch_mask;
- caps_lock_mask = tmp_caps_lock_mask;
- shift_lock_mask = tmp_shift_lock_mask;
- setDetectableKeyRepeat(display, true);
- xim = openIM(display);
- if (xim != 0) {
- xic = createIC(xim, window);
- if (xic != 0) {
- setupIMEventMask(display, window, xic);
- } else {
- destroy(display);
- }
- } else {
- xic = 0;
- }
- compose_status = allocateComposeStatus();
- }
- private static native long getModifierMapping(long display);
- private static native void freeModifierMapping(long modifier_map);
- private static native int getMaxKeyPerMod(long modifier_map);
- private static native int lookupModifierMap(long modifier_map, int index);
- private static native long keycodeToKeySym(long display, int key_code);
-
- private static native long openIM(long display);
- private static native long createIC(long xim, long window);
- private static native void setupIMEventMask(long display, long window, long xic);
- private static native ByteBuffer allocateComposeStatus();
-
- private static void setDetectableKeyRepeat(long display, boolean enabled) {
- boolean success = nSetDetectableKeyRepeat(display, enabled);
- if (!success)
- LWJGLUtil.log("Failed to set detectable key repeat to " + enabled);
- }
- private static native boolean nSetDetectableKeyRepeat(long display, boolean enabled);
-
- public void destroy(long display) {
- if (xic != 0)
- destroyIC(xic);
- if (xim != 0)
- closeIM(xim);
- setDetectableKeyRepeat(display, false);
- }
- private static native void destroyIC(long xic);
- private static native void closeIM(long xim);
-
- public void read(ByteBuffer buffer) {
- flushDeferredEvent();
- event_queue.copyEvents(buffer);
- }
-
- public void poll(ByteBuffer keyDownBuffer) {
- flushDeferredEvent();
- int old_position = keyDownBuffer.position();
- keyDownBuffer.put(key_down_buffer);
- keyDownBuffer.position(old_position);
- }
-
- private void putKeyboardEvent(int keycode, byte state, int ch, long nanos, boolean repeat) {
- tmp_event.clear();
- tmp_event.putInt(keycode).put(state).putInt(ch).putLong(nanos).put(repeat ? (byte)1 : (byte)0);
- tmp_event.flip();
- event_queue.putEvent(tmp_event);
- }
-
- private int lookupStringISO88591(long event_ptr, int[] translation_buffer) {
- int i;
-
- int num_chars = lookupString(event_ptr, native_translation_buffer, compose_status);
- for (i = 0; i < num_chars; i++) {
- translation_buffer[i] = ((int)native_translation_buffer.get(i)) & 0xff;
- }
- return num_chars;
- }
- private static native int lookupString(long event_ptr, ByteBuffer buffer, ByteBuffer compose_status);
-
- private int lookupStringUnicode(long event_ptr, int[] translation_buffer) {
- int status = utf8LookupString(xic, event_ptr, native_translation_buffer, native_translation_buffer.position(), native_translation_buffer.remaining());
- if (status != XLookupChars && status != XLookupBoth)
- return 0;
- native_translation_buffer.flip();
- utf8_decoder.decode(native_translation_buffer, char_buffer, true);
- native_translation_buffer.compact();
- char_buffer.flip();
- int i = 0;
- while (char_buffer.hasRemaining() && i < translation_buffer.length) {
- translation_buffer[i++] = char_buffer.get();
- }
- char_buffer.compact();
- return i;
- }
- private static native int utf8LookupString(long xic, long event_ptr, ByteBuffer buffer, int pos, int size);
-
- private int lookupString(long event_ptr, int[] translation_buffer) {
- if (xic != 0) {
- return lookupStringUnicode(event_ptr, translation_buffer);
- } else
- return lookupStringISO88591(event_ptr, translation_buffer);
- }
-
- private void translateEvent(long event_ptr, int keycode, byte key_state, long nanos, boolean repeat) {
- int num_chars, i;
- int ch;
-
- num_chars = lookupString(event_ptr, temp_translation_buffer);
- if (num_chars > 0) {
- ch = temp_translation_buffer[0];
- putKeyboardEvent(keycode, key_state, ch, nanos, repeat);
- for (i = 1; i < num_chars; i++) {
- ch = temp_translation_buffer[i];
- putKeyboardEvent(0, (byte)0, ch, nanos, repeat);
- }
- } else {
- putKeyboardEvent(keycode, key_state, 0, nanos, repeat);
- }
- }
-
- private static boolean isKeypadKeysym(long keysym) {
- return (0xFF80 <= keysym && keysym <= 0xFFBD) ||
- (0x11000000 <= keysym && keysym <= 0x1100FFFF);
- }
-
- private static boolean isNoSymbolOrVendorSpecific(long keysym) {
- return keysym == NoSymbol || (keysym & (1 << 28)) != 0;
- }
-
- private static long getKeySym(long event_ptr, int group, int index) {
- long keysym = lookupKeysym(event_ptr, group*2 + index);
- if (isNoSymbolOrVendorSpecific(keysym) && index == 1) {
- keysym = lookupKeysym(event_ptr, group*2 + 0);
- }
- if (isNoSymbolOrVendorSpecific(keysym) && group == 1)
- keysym = getKeySym(event_ptr, 0, index);
- return keysym;
- }
- private static native long lookupKeysym(long event_ptr, int index);
- private static native long toUpper(long keysym);
-
- private long mapEventToKeySym(long event_ptr, int event_state) {
- int group;
- long keysym;
- if ((event_state & modeswitch_mask) != 0)
- group = 1;
- else
- group = 0;
- if ((event_state & numlock_mask) != 0 && isKeypadKeysym(keysym = getKeySym(event_ptr, group, 1))) {
- if ((event_state & (ShiftMask | shift_lock_mask)) != 0) {
- return getKeySym(event_ptr, group, 0);
- } else {
- return keysym;
- }
- } else if ((event_state & (ShiftMask | LockMask)) == 0) {
- return getKeySym(event_ptr, group, 0);
- } else if ((event_state & ShiftMask) == 0) {
- keysym = getKeySym(event_ptr, group, 0);
- if ((event_state & caps_lock_mask) != 0)
- keysym = toUpper(keysym);
- return keysym;
- } else {
- keysym = getKeySym(event_ptr, group, 1);
- if ((event_state & caps_lock_mask) != 0)
- keysym = toUpper(keysym);
- return keysym;
- }
- }
-
- private int getKeycode(long event_ptr, int event_state) {
- long keysym = mapEventToKeySym(event_ptr, event_state);
- int keycode = LinuxKeycodes.mapKeySymToLWJGLKeyCode(keysym);
- if (keycode == Keyboard.KEY_NONE) {
- // Try unshifted keysym mapping
- keysym = lookupKeysym(event_ptr, 0);
- keycode = LinuxKeycodes.mapKeySymToLWJGLKeyCode(keysym);
- }
- return keycode;
- }
-
- private byte getKeyState(int event_type) {
- switch (event_type) {
- case LinuxEvent.KeyPress:
- return 1;
- case LinuxEvent.KeyRelease:
- return 0;
- default:
- throw new IllegalArgumentException("Unknown event_type: " + event_type);
- }
- }
-
- private void handleKeyEvent(long event_ptr, long millis, int event_type, int event_keycode, int event_state) {
- int keycode = getKeycode(event_ptr, event_state);
- byte key_state = getKeyState(event_type);
- boolean repeat = key_state == key_down_buffer[keycode];
- key_down_buffer[keycode] = key_state;
- long nanos = millis*1000000;
- if (event_type == LinuxEvent.KeyPress) {
- if (has_deferred_event) {
- if (nanos == deferred_nanos && event_keycode == deferred_event_keycode) {
- has_deferred_event = false;
- repeat = true; // Repeated event
- } else
- flushDeferredEvent();
- }
- translateEvent(event_ptr, keycode, key_state, nanos, repeat);
- } else {
- flushDeferredEvent();
- has_deferred_event = true;
- deferred_keycode = keycode;
- deferred_event_keycode = event_keycode;
- deferred_nanos = nanos;
- deferred_key_state = key_state;
- }
- }
-
- private void flushDeferredEvent() {
- if (has_deferred_event) {
- putKeyboardEvent(deferred_keycode, deferred_key_state, 0, deferred_nanos, false);
- has_deferred_event = false;
- }
- }
-
- public boolean filterEvent(LinuxEvent event) {
- switch (event.getType()) {
- case LinuxEvent.KeyPress: /* Fall through */
- case LinuxEvent.KeyRelease:
- handleKeyEvent(event.getKeyAddress(), event.getKeyTime(), event.getKeyType(), event.getKeyKeyCode(), event.getKeyState());
- return true;
- default:
- break;
- }
- return false;
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+/**
+ * @author elias_naur
+ */
+
+import java.nio.ByteBuffer;
+import java.nio.CharBuffer;
+import java.nio.charset.Charset;
+import java.nio.charset.CharsetDecoder;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.LWJGLUtil;
+import org.lwjgl.input.Keyboard;
+
+final class LinuxKeyboard {
+ private static final int LockMapIndex = 1;
+ private static final long NoSymbol = 0;
+ private static final long ShiftMask = 1 << 0;
+ private static final long LockMask = 1 << 1;
+ private static final int XLookupChars = 2;
+ private static final int XLookupBoth = 4;
+
+ private static final int KEYBOARD_BUFFER_SIZE = 50;
+
+ private final long xim;
+ private final long xic;
+
+ private final int numlock_mask;
+ private final int modeswitch_mask;
+ private final int caps_lock_mask;
+ private final int shift_lock_mask;
+
+ private final ByteBuffer compose_status;
+
+ private final byte[] key_down_buffer = new byte[Keyboard.KEYBOARD_SIZE];
+ private final EventQueue event_queue = new EventQueue(Keyboard.EVENT_SIZE);
+
+ private final ByteBuffer tmp_event = ByteBuffer.allocate(Keyboard.EVENT_SIZE);
+ private final int[] temp_translation_buffer = new int[KEYBOARD_BUFFER_SIZE];
+ private final ByteBuffer native_translation_buffer = BufferUtils.createByteBuffer(KEYBOARD_BUFFER_SIZE);
+ private final CharsetDecoder utf8_decoder = Charset.forName("UTF-8").newDecoder();
+ private final CharBuffer char_buffer = CharBuffer.allocate(KEYBOARD_BUFFER_SIZE);
+
+ // Deferred key released event, to detect key repeat
+ private boolean has_deferred_event;
+ private int deferred_keycode;
+ private int deferred_event_keycode;
+ private long deferred_nanos;
+ private byte deferred_key_state;
+
+ LinuxKeyboard(long display, long window) {
+ long modifier_map = getModifierMapping(display);
+ int tmp_numlock_mask = 0;
+ int tmp_modeswitch_mask = 0;
+ int tmp_caps_lock_mask = 0;
+ int tmp_shift_lock_mask = 0;
+ if (modifier_map != 0) {
+ int max_keypermod = getMaxKeyPerMod(modifier_map);
+ // Find modifier masks
+ int i, j;
+ for (i = 0; i < 8; i++) {
+ for (j = 0; j < max_keypermod; j++) {
+ int key_code = lookupModifierMap(modifier_map, i*max_keypermod + j);
+ int key_sym = (int)keycodeToKeySym(display, key_code);
+ int mask = 1 << i;
+ switch (key_sym) {
+ case LinuxKeycodes.XK_Num_Lock:
+ tmp_numlock_mask |= mask;
+ break;
+ case LinuxKeycodes.XK_Mode_switch:
+ tmp_modeswitch_mask |= mask;
+ break;
+ case LinuxKeycodes.XK_Caps_Lock:
+ if (i == LockMapIndex) {
+ tmp_caps_lock_mask = mask;
+ tmp_shift_lock_mask = 0;
+ }
+ break;
+ case LinuxKeycodes.XK_Shift_Lock:
+ if (i == LockMapIndex && tmp_caps_lock_mask == 0)
+ tmp_shift_lock_mask = mask;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ freeModifierMapping(modifier_map);
+ }
+ numlock_mask = tmp_numlock_mask;
+ modeswitch_mask = tmp_modeswitch_mask;
+ caps_lock_mask = tmp_caps_lock_mask;
+ shift_lock_mask = tmp_shift_lock_mask;
+ setDetectableKeyRepeat(display, true);
+ xim = openIM(display);
+ if (xim != 0) {
+ xic = createIC(xim, window);
+ if (xic != 0) {
+ setupIMEventMask(display, window, xic);
+ } else {
+ destroy(display);
+ }
+ } else {
+ xic = 0;
+ }
+ compose_status = allocateComposeStatus();
+ }
+ private static native long getModifierMapping(long display);
+ private static native void freeModifierMapping(long modifier_map);
+ private static native int getMaxKeyPerMod(long modifier_map);
+ private static native int lookupModifierMap(long modifier_map, int index);
+ private static native long keycodeToKeySym(long display, int key_code);
+
+ private static native long openIM(long display);
+ private static native long createIC(long xim, long window);
+ private static native void setupIMEventMask(long display, long window, long xic);
+ private static native ByteBuffer allocateComposeStatus();
+
+ private static void setDetectableKeyRepeat(long display, boolean enabled) {
+ boolean success = nSetDetectableKeyRepeat(display, enabled);
+ if (!success)
+ LWJGLUtil.log("Failed to set detectable key repeat to " + enabled);
+ }
+ private static native boolean nSetDetectableKeyRepeat(long display, boolean enabled);
+
+ public void destroy(long display) {
+ if (xic != 0)
+ destroyIC(xic);
+ if (xim != 0)
+ closeIM(xim);
+ setDetectableKeyRepeat(display, false);
+ }
+ private static native void destroyIC(long xic);
+ private static native void closeIM(long xim);
+
+ public void read(ByteBuffer buffer) {
+ flushDeferredEvent();
+ event_queue.copyEvents(buffer);
+ }
+
+ public void poll(ByteBuffer keyDownBuffer) {
+ flushDeferredEvent();
+ int old_position = keyDownBuffer.position();
+ keyDownBuffer.put(key_down_buffer);
+ keyDownBuffer.position(old_position);
+ }
+
+ private void putKeyboardEvent(int keycode, byte state, int ch, long nanos, boolean repeat) {
+ tmp_event.clear();
+ tmp_event.putInt(keycode).put(state).putInt(ch).putLong(nanos).put(repeat ? (byte)1 : (byte)0);
+ tmp_event.flip();
+ event_queue.putEvent(tmp_event);
+ }
+
+ private int lookupStringISO88591(long event_ptr, int[] translation_buffer) {
+ int i;
+
+ int num_chars = lookupString(event_ptr, native_translation_buffer, compose_status);
+ for (i = 0; i < num_chars; i++) {
+ translation_buffer[i] = ((int)native_translation_buffer.get(i)) & 0xff;
+ }
+ return num_chars;
+ }
+ private static native int lookupString(long event_ptr, ByteBuffer buffer, ByteBuffer compose_status);
+
+ private int lookupStringUnicode(long event_ptr, int[] translation_buffer) {
+ int status = utf8LookupString(xic, event_ptr, native_translation_buffer, native_translation_buffer.position(), native_translation_buffer.remaining());
+ if (status != XLookupChars && status != XLookupBoth)
+ return 0;
+ native_translation_buffer.flip();
+ utf8_decoder.decode(native_translation_buffer, char_buffer, true);
+ native_translation_buffer.compact();
+ char_buffer.flip();
+ int i = 0;
+ while (char_buffer.hasRemaining() && i < translation_buffer.length) {
+ translation_buffer[i++] = char_buffer.get();
+ }
+ char_buffer.compact();
+ return i;
+ }
+ private static native int utf8LookupString(long xic, long event_ptr, ByteBuffer buffer, int pos, int size);
+
+ private int lookupString(long event_ptr, int[] translation_buffer) {
+ if (xic != 0) {
+ return lookupStringUnicode(event_ptr, translation_buffer);
+ } else
+ return lookupStringISO88591(event_ptr, translation_buffer);
+ }
+
+ private void translateEvent(long event_ptr, int keycode, byte key_state, long nanos, boolean repeat) {
+ int num_chars, i;
+ int ch;
+
+ num_chars = lookupString(event_ptr, temp_translation_buffer);
+ if (num_chars > 0) {
+ ch = temp_translation_buffer[0];
+ putKeyboardEvent(keycode, key_state, ch, nanos, repeat);
+ for (i = 1; i < num_chars; i++) {
+ ch = temp_translation_buffer[i];
+ putKeyboardEvent(0, (byte)0, ch, nanos, repeat);
+ }
+ } else {
+ putKeyboardEvent(keycode, key_state, 0, nanos, repeat);
+ }
+ }
+
+ private static boolean isKeypadKeysym(long keysym) {
+ return (0xFF80 <= keysym && keysym <= 0xFFBD) ||
+ (0x11000000 <= keysym && keysym <= 0x1100FFFF);
+ }
+
+ private static boolean isNoSymbolOrVendorSpecific(long keysym) {
+ return keysym == NoSymbol || (keysym & (1 << 28)) != 0;
+ }
+
+ private static long getKeySym(long event_ptr, int group, int index) {
+ long keysym = lookupKeysym(event_ptr, group*2 + index);
+ if (isNoSymbolOrVendorSpecific(keysym) && index == 1) {
+ keysym = lookupKeysym(event_ptr, group*2 + 0);
+ }
+ if (isNoSymbolOrVendorSpecific(keysym) && group == 1)
+ keysym = getKeySym(event_ptr, 0, index);
+ return keysym;
+ }
+ private static native long lookupKeysym(long event_ptr, int index);
+ private static native long toUpper(long keysym);
+
+ private long mapEventToKeySym(long event_ptr, int event_state) {
+ int group;
+ long keysym;
+ if ((event_state & modeswitch_mask) != 0)
+ group = 1;
+ else
+ group = 0;
+ if ((event_state & numlock_mask) != 0 && isKeypadKeysym(keysym = getKeySym(event_ptr, group, 1))) {
+ if ((event_state & (ShiftMask | shift_lock_mask)) != 0) {
+ return getKeySym(event_ptr, group, 0);
+ } else {
+ return keysym;
+ }
+ } else if ((event_state & (ShiftMask | LockMask)) == 0) {
+ return getKeySym(event_ptr, group, 0);
+ } else if ((event_state & ShiftMask) == 0) {
+ keysym = getKeySym(event_ptr, group, 0);
+ if ((event_state & caps_lock_mask) != 0)
+ keysym = toUpper(keysym);
+ return keysym;
+ } else {
+ keysym = getKeySym(event_ptr, group, 1);
+ if ((event_state & caps_lock_mask) != 0)
+ keysym = toUpper(keysym);
+ return keysym;
+ }
+ }
+
+ private int getKeycode(long event_ptr, int event_state) {
+ long keysym = mapEventToKeySym(event_ptr, event_state);
+ int keycode = LinuxKeycodes.mapKeySymToLWJGLKeyCode(keysym);
+ if (keycode == Keyboard.KEY_NONE) {
+ // Try unshifted keysym mapping
+ keysym = lookupKeysym(event_ptr, 0);
+ keycode = LinuxKeycodes.mapKeySymToLWJGLKeyCode(keysym);
+ }
+ return keycode;
+ }
+
+ private byte getKeyState(int event_type) {
+ switch (event_type) {
+ case LinuxEvent.KeyPress:
+ return 1;
+ case LinuxEvent.KeyRelease:
+ return 0;
+ default:
+ throw new IllegalArgumentException("Unknown event_type: " + event_type);
+ }
+ }
+
+ private void handleKeyEvent(long event_ptr, long millis, int event_type, int event_keycode, int event_state) {
+ int keycode = getKeycode(event_ptr, event_state);
+ byte key_state = getKeyState(event_type);
+ boolean repeat = key_state == key_down_buffer[keycode];
+ key_down_buffer[keycode] = key_state;
+ long nanos = millis*1000000;
+ if (event_type == LinuxEvent.KeyPress) {
+ if (has_deferred_event) {
+ if (nanos == deferred_nanos && event_keycode == deferred_event_keycode) {
+ has_deferred_event = false;
+ repeat = true; // Repeated event
+ } else
+ flushDeferredEvent();
+ }
+ translateEvent(event_ptr, keycode, key_state, nanos, repeat);
+ } else {
+ flushDeferredEvent();
+ has_deferred_event = true;
+ deferred_keycode = keycode;
+ deferred_event_keycode = event_keycode;
+ deferred_nanos = nanos;
+ deferred_key_state = key_state;
+ }
+ }
+
+ private void flushDeferredEvent() {
+ if (has_deferred_event) {
+ putKeyboardEvent(deferred_keycode, deferred_key_state, 0, deferred_nanos, false);
+ has_deferred_event = false;
+ }
+ }
+
+ public boolean filterEvent(LinuxEvent event) {
+ switch (event.getType()) {
+ case LinuxEvent.KeyPress: /* Fall through */
+ case LinuxEvent.KeyRelease:
+ handleKeyEvent(event.getKeyAddress(), event.getKeyTime(), event.getKeyType(), event.getKeyKeyCode(), event.getKeyState());
+ return true;
+ default:
+ break;
+ }
+ return false;
+ }
+}
diff --git a/src/java/org/lwjgl/opengl/LinuxPbufferPeerInfo.java b/src/java/org/lwjgl/opengl/LinuxPbufferPeerInfo.java
index 6e3e2b7..65f40d1 100644
--- a/src/java/org/lwjgl/opengl/LinuxPbufferPeerInfo.java
+++ b/src/java/org/lwjgl/opengl/LinuxPbufferPeerInfo.java
@@ -1,83 +1,83 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import java.nio.ByteBuffer;
-
-import org.lwjgl.LWJGLException;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3116 $
- * $Id: LinuxPbufferPeerInfo.java 3116 2008-08-19 16:46:03Z spasi $
- */
-final class LinuxPbufferPeerInfo extends LinuxPeerInfo {
- LinuxPbufferPeerInfo(int width, int height, PixelFormat pixel_format) throws LWJGLException {
- LinuxDisplay.lockAWT();
- try {
- GLContext.loadOpenGLLibrary();
- try {
- LinuxDisplay.incDisplay();
- try {
- nInitHandle(LinuxDisplay.getDisplay(), LinuxDisplay.getDefaultScreen(), getHandle(), width, height, pixel_format);
- } catch (LWJGLException e) {
- LinuxDisplay.decDisplay();
- throw e;
- }
- } catch (LWJGLException e) {
- GLContext.unloadOpenGLLibrary();
- throw e;
- }
- } finally {
- LinuxDisplay.unlockAWT();
- }
- }
- private static native void nInitHandle(long display, int screen, ByteBuffer handle, int width, int height, PixelFormat pixel_format) throws LWJGLException;
-
- public void destroy() {
- LinuxDisplay.lockAWT();
- nDestroy(getHandle());
- LinuxDisplay.decDisplay();
- GLContext.unloadOpenGLLibrary();
- LinuxDisplay.unlockAWT();
- }
- private static native void nDestroy(ByteBuffer handle);
-
- protected void doLockAndInitHandle() throws LWJGLException {
- // NO-OP
- }
-
- protected void doUnlock() throws LWJGLException {
- // NO-OP
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import java.nio.ByteBuffer;
+
+import org.lwjgl.LWJGLException;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3116 $
+ * $Id: LinuxPbufferPeerInfo.java 3116 2008-08-19 16:46:03Z spasi $
+ */
+final class LinuxPbufferPeerInfo extends LinuxPeerInfo {
+ LinuxPbufferPeerInfo(int width, int height, PixelFormat pixel_format) throws LWJGLException {
+ LinuxDisplay.lockAWT();
+ try {
+ GLContext.loadOpenGLLibrary();
+ try {
+ LinuxDisplay.incDisplay();
+ try {
+ nInitHandle(LinuxDisplay.getDisplay(), LinuxDisplay.getDefaultScreen(), getHandle(), width, height, pixel_format);
+ } catch (LWJGLException e) {
+ LinuxDisplay.decDisplay();
+ throw e;
+ }
+ } catch (LWJGLException e) {
+ GLContext.unloadOpenGLLibrary();
+ throw e;
+ }
+ } finally {
+ LinuxDisplay.unlockAWT();
+ }
+ }
+ private static native void nInitHandle(long display, int screen, ByteBuffer handle, int width, int height, PixelFormat pixel_format) throws LWJGLException;
+
+ public void destroy() {
+ LinuxDisplay.lockAWT();
+ nDestroy(getHandle());
+ LinuxDisplay.decDisplay();
+ GLContext.unloadOpenGLLibrary();
+ LinuxDisplay.unlockAWT();
+ }
+ private static native void nDestroy(ByteBuffer handle);
+
+ protected void doLockAndInitHandle() throws LWJGLException {
+ // NO-OP
+ }
+
+ protected void doUnlock() throws LWJGLException {
+ // NO-OP
+ }
+}
diff --git a/src/java/org/lwjgl/opengl/LinuxPeerInfo.java b/src/java/org/lwjgl/opengl/LinuxPeerInfo.java
index 2654f73..84930a7 100644
--- a/src/java/org/lwjgl/opengl/LinuxPeerInfo.java
+++ b/src/java/org/lwjgl/opengl/LinuxPeerInfo.java
@@ -1,57 +1,57 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import java.nio.ByteBuffer;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3116 $
- * $Id: LinuxPeerInfo.java 3116 2008-08-19 16:46:03Z spasi $
- */
-abstract class LinuxPeerInfo extends PeerInfo {
- LinuxPeerInfo() {
- super(createHandle());
- }
- private static native ByteBuffer createHandle();
-
- public final long getDisplay() {
- return nGetDisplay(getHandle());
- }
- private static native long nGetDisplay(ByteBuffer handle);
-
- public final long getDrawable() {
- return nGetDrawable(getHandle());
- }
- private static native long nGetDrawable(ByteBuffer handle);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import java.nio.ByteBuffer;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3116 $
+ * $Id: LinuxPeerInfo.java 3116 2008-08-19 16:46:03Z spasi $
+ */
+abstract class LinuxPeerInfo extends PeerInfo {
+ LinuxPeerInfo() {
+ super(createHandle());
+ }
+ private static native ByteBuffer createHandle();
+
+ public final long getDisplay() {
+ return nGetDisplay(getHandle());
+ }
+ private static native long nGetDisplay(ByteBuffer handle);
+
+ public final long getDrawable() {
+ return nGetDrawable(getHandle());
+ }
+ private static native long nGetDrawable(ByteBuffer handle);
+}
diff --git a/src/java/org/lwjgl/opengl/MacOSXAWTGLCanvasPeerInfo.java b/src/java/org/lwjgl/opengl/MacOSXAWTGLCanvasPeerInfo.java
index 4f09051..50a8f00 100644
--- a/src/java/org/lwjgl/opengl/MacOSXAWTGLCanvasPeerInfo.java
+++ b/src/java/org/lwjgl/opengl/MacOSXAWTGLCanvasPeerInfo.java
@@ -1,55 +1,55 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.LWJGLException;
-
-import java.awt.Canvas;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3116 $
- * $Id: MacOSXAWTGLCanvasPeerInfo.java 3116 2008-08-19 16:46:03Z spasi $
- */
-final class MacOSXAWTGLCanvasPeerInfo extends MacOSXCanvasPeerInfo {
- private final Canvas component;
-
- MacOSXAWTGLCanvasPeerInfo(Canvas component, PixelFormat pixel_format, boolean support_pbuffer) throws LWJGLException {
- super(pixel_format, support_pbuffer);
- this.component = component;
- }
-
- protected void doLockAndInitHandle() throws LWJGLException {
- initHandle(component);
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.LWJGLException;
+
+import java.awt.Canvas;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3116 $
+ * $Id: MacOSXAWTGLCanvasPeerInfo.java 3116 2008-08-19 16:46:03Z spasi $
+ */
+final class MacOSXAWTGLCanvasPeerInfo extends MacOSXCanvasPeerInfo {
+ private final Canvas component;
+
+ MacOSXAWTGLCanvasPeerInfo(Canvas component, PixelFormat pixel_format, boolean support_pbuffer) throws LWJGLException {
+ super(pixel_format, support_pbuffer);
+ this.component = component;
+ }
+
+ protected void doLockAndInitHandle() throws LWJGLException {
+ initHandle(component);
+ }
+}
diff --git a/src/java/org/lwjgl/opengl/MacOSXCanvasImplementation.java b/src/java/org/lwjgl/opengl/MacOSXCanvasImplementation.java
index e040bfe..258fcca 100644
--- a/src/java/org/lwjgl/opengl/MacOSXCanvasImplementation.java
+++ b/src/java/org/lwjgl/opengl/MacOSXCanvasImplementation.java
@@ -1,66 +1,66 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import java.awt.GraphicsConfiguration;
-import java.awt.GraphicsDevice;
-import java.awt.Canvas;
-
-import org.lwjgl.LWJGLException;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3002 $
- * $Id: MacOSXCanvasImplementation.java 3002 2008-04-10 20:25:54Z elias_naur $
- */
-final class MacOSXCanvasImplementation implements AWTCanvasImplementation {
- public PeerInfo createPeerInfo(Canvas component, PixelFormat pixel_format) throws LWJGLException {
- try {
- return new MacOSXAWTGLCanvasPeerInfo(component, pixel_format, true);
- } catch (LWJGLException e) {
- return new MacOSXAWTGLCanvasPeerInfo(component, pixel_format, false);
- }
- }
-
- /**
- * Find a proper GraphicsConfiguration from the given GraphicsDevice and PixelFormat.
- *
- * @return The GraphicsConfiguration corresponding to a visual that matches the pixel format.
- */
- public GraphicsConfiguration findConfiguration(GraphicsDevice device, PixelFormat pixel_format) throws LWJGLException {
- /*
- * It seems like the best way is to simply return null
- */
- return null;
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+import java.awt.Canvas;
+
+import org.lwjgl.LWJGLException;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3002 $
+ * $Id: MacOSXCanvasImplementation.java 3002 2008-04-10 20:25:54Z elias_naur $
+ */
+final class MacOSXCanvasImplementation implements AWTCanvasImplementation {
+ public PeerInfo createPeerInfo(Canvas component, PixelFormat pixel_format) throws LWJGLException {
+ try {
+ return new MacOSXAWTGLCanvasPeerInfo(component, pixel_format, true);
+ } catch (LWJGLException e) {
+ return new MacOSXAWTGLCanvasPeerInfo(component, pixel_format, false);
+ }
+ }
+
+ /**
+ * Find a proper GraphicsConfiguration from the given GraphicsDevice and PixelFormat.
+ *
+ * @return The GraphicsConfiguration corresponding to a visual that matches the pixel format.
+ */
+ public GraphicsConfiguration findConfiguration(GraphicsDevice device, PixelFormat pixel_format) throws LWJGLException {
+ /*
+ * It seems like the best way is to simply return null
+ */
+ return null;
+ }
+}
diff --git a/src/java/org/lwjgl/opengl/MacOSXCanvasPeerInfo.java b/src/java/org/lwjgl/opengl/MacOSXCanvasPeerInfo.java
index 95e8014..be8dd57 100644
--- a/src/java/org/lwjgl/opengl/MacOSXCanvasPeerInfo.java
+++ b/src/java/org/lwjgl/opengl/MacOSXCanvasPeerInfo.java
@@ -1,60 +1,60 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import java.awt.Canvas;
-import java.nio.ByteBuffer;
-
-import org.lwjgl.LWJGLException;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3116 $
- * $Id: MacOSXCanvasPeerInfo.java 3116 2008-08-19 16:46:03Z spasi $
- */
-abstract class MacOSXCanvasPeerInfo extends MacOSXPeerInfo {
- private final AWTSurfaceLock awt_surface = new AWTSurfaceLock();
-
- protected MacOSXCanvasPeerInfo(PixelFormat pixel_format, boolean support_pbuffer) throws LWJGLException {
- super(pixel_format, true, true, support_pbuffer, true);
- }
-
- protected void initHandle(Canvas component) throws LWJGLException {
- nInitHandle(awt_surface.lockAndGetHandle(component), getHandle());
- }
- private static native void nInitHandle(ByteBuffer surface_buffer, ByteBuffer peer_info_handle) throws LWJGLException;
-
- protected void doUnlock() throws LWJGLException {
- awt_surface.unlock();
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import java.awt.Canvas;
+import java.nio.ByteBuffer;
+
+import org.lwjgl.LWJGLException;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3116 $
+ * $Id: MacOSXCanvasPeerInfo.java 3116 2008-08-19 16:46:03Z spasi $
+ */
+abstract class MacOSXCanvasPeerInfo extends MacOSXPeerInfo {
+ private final AWTSurfaceLock awt_surface = new AWTSurfaceLock();
+
+ protected MacOSXCanvasPeerInfo(PixelFormat pixel_format, boolean support_pbuffer) throws LWJGLException {
+ super(pixel_format, true, true, support_pbuffer, true);
+ }
+
+ protected void initHandle(Canvas component) throws LWJGLException {
+ nInitHandle(awt_surface.lockAndGetHandle(component), getHandle());
+ }
+ private static native void nInitHandle(ByteBuffer surface_buffer, ByteBuffer peer_info_handle) throws LWJGLException;
+
+ protected void doUnlock() throws LWJGLException {
+ awt_surface.unlock();
+ }
+}
diff --git a/src/java/org/lwjgl/opengl/MacOSXContextImplementation.java b/src/java/org/lwjgl/opengl/MacOSXContextImplementation.java
index 70ff274..62711c5 100644
--- a/src/java/org/lwjgl/opengl/MacOSXContextImplementation.java
+++ b/src/java/org/lwjgl/opengl/MacOSXContextImplementation.java
@@ -1,133 +1,133 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.LWJGLException;
-
-import java.nio.ByteBuffer;
-import java.nio.IntBuffer;
-
-/**
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3116 $
- * $Id: MacOSXContextImplementation.java 3116 2008-08-19 16:46:03Z spasi $
- */
-final class MacOSXContextImplementation implements ContextImplementation {
-
- public ByteBuffer create(PeerInfo peer_info, IntBuffer attribs, ByteBuffer shared_context_handle) throws LWJGLException {
- ByteBuffer peer_handle = peer_info.lockAndGetHandle();
- try {
- return nCreate(peer_handle, attribs, shared_context_handle);
- } finally {
- peer_info.unlock();
- }
- }
-
- private static native ByteBuffer nCreate(ByteBuffer peer_handle, IntBuffer attribs, ByteBuffer shared_context_handle) throws LWJGLException;
-
- public void swapBuffers() throws LWJGLException {
- Context current_context = Context.getCurrentContext();
- if ( current_context == null )
- throw new IllegalStateException("No context is current");
- synchronized ( current_context ) {
- nSwapBuffers(current_context.getHandle());
- }
- }
-
- private static native void nSwapBuffers(ByteBuffer context_handle) throws LWJGLException;
-
- public void update(ByteBuffer context_handle) {
- nUpdate(context_handle);
- }
-
- private static native void nUpdate(ByteBuffer context_handle);
-
- public void releaseCurrentContext() throws LWJGLException {
- nReleaseCurrentContext();
- }
-
- private static native void nReleaseCurrentContext() throws LWJGLException;
-
- public void releaseDrawable(ByteBuffer context_handle) throws LWJGLException {
- clearDrawable(context_handle);
- }
-
- private static native void clearDrawable(ByteBuffer handle) throws LWJGLException;
-
- static void resetView(PeerInfo peer_info, Context context) throws LWJGLException {
- ByteBuffer peer_handle = peer_info.lockAndGetHandle();
- try {
- synchronized ( context ) {
- clearDrawable(context.getHandle());
- setView(peer_handle, context.getHandle());
- }
- } finally {
- peer_info.unlock();
- }
- }
-
- public void makeCurrent(PeerInfo peer_info, ByteBuffer handle) throws LWJGLException {
- ByteBuffer peer_handle = peer_info.lockAndGetHandle();
- try {
- setView(peer_handle, handle);
- nMakeCurrent(handle);
- } finally {
- peer_info.unlock();
- }
- }
-
- private static native void setView(ByteBuffer peer_handle, ByteBuffer context_handle) throws LWJGLException;
-
- private static native void nMakeCurrent(ByteBuffer context_handle) throws LWJGLException;
-
- public boolean isCurrent(ByteBuffer handle) throws LWJGLException {
- boolean result = nIsCurrent(handle);
- return result;
- }
-
- private static native boolean nIsCurrent(ByteBuffer context_handle) throws LWJGLException;
-
- public void setSwapInterval(int value) {
- Context current_context = Context.getCurrentContext();
- synchronized ( current_context ) {
- nSetSwapInterval(current_context.getHandle(), value);
- }
- }
-
- private static native void nSetSwapInterval(ByteBuffer context_handle, int value);
-
- public void destroy(PeerInfo peer_info, ByteBuffer handle) throws LWJGLException {
- nDestroy(handle);
- }
-
- private static native void nDestroy(ByteBuffer context_handle) throws LWJGLException;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.LWJGLException;
+
+import java.nio.ByteBuffer;
+import java.nio.IntBuffer;
+
+/**
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3116 $
+ * $Id: MacOSXContextImplementation.java 3116 2008-08-19 16:46:03Z spasi $
+ */
+final class MacOSXContextImplementation implements ContextImplementation {
+
+ public ByteBuffer create(PeerInfo peer_info, IntBuffer attribs, ByteBuffer shared_context_handle) throws LWJGLException {
+ ByteBuffer peer_handle = peer_info.lockAndGetHandle();
+ try {
+ return nCreate(peer_handle, attribs, shared_context_handle);
+ } finally {
+ peer_info.unlock();
+ }
+ }
+
+ private static native ByteBuffer nCreate(ByteBuffer peer_handle, IntBuffer attribs, ByteBuffer shared_context_handle) throws LWJGLException;
+
+ public void swapBuffers() throws LWJGLException {
+ Context current_context = Context.getCurrentContext();
+ if ( current_context == null )
+ throw new IllegalStateException("No context is current");
+ synchronized ( current_context ) {
+ nSwapBuffers(current_context.getHandle());
+ }
+ }
+
+ private static native void nSwapBuffers(ByteBuffer context_handle) throws LWJGLException;
+
+ public void update(ByteBuffer context_handle) {
+ nUpdate(context_handle);
+ }
+
+ private static native void nUpdate(ByteBuffer context_handle);
+
+ public void releaseCurrentContext() throws LWJGLException {
+ nReleaseCurrentContext();
+ }
+
+ private static native void nReleaseCurrentContext() throws LWJGLException;
+
+ public void releaseDrawable(ByteBuffer context_handle) throws LWJGLException {
+ clearDrawable(context_handle);
+ }
+
+ private static native void clearDrawable(ByteBuffer handle) throws LWJGLException;
+
+ static void resetView(PeerInfo peer_info, Context context) throws LWJGLException {
+ ByteBuffer peer_handle = peer_info.lockAndGetHandle();
+ try {
+ synchronized ( context ) {
+ clearDrawable(context.getHandle());
+ setView(peer_handle, context.getHandle());
+ }
+ } finally {
+ peer_info.unlock();
+ }
+ }
+
+ public void makeCurrent(PeerInfo peer_info, ByteBuffer handle) throws LWJGLException {
+ ByteBuffer peer_handle = peer_info.lockAndGetHandle();
+ try {
+ setView(peer_handle, handle);
+ nMakeCurrent(handle);
+ } finally {
+ peer_info.unlock();
+ }
+ }
+
+ private static native void setView(ByteBuffer peer_handle, ByteBuffer context_handle) throws LWJGLException;
+
+ private static native void nMakeCurrent(ByteBuffer context_handle) throws LWJGLException;
+
+ public boolean isCurrent(ByteBuffer handle) throws LWJGLException {
+ boolean result = nIsCurrent(handle);
+ return result;
+ }
+
+ private static native boolean nIsCurrent(ByteBuffer context_handle) throws LWJGLException;
+
+ public void setSwapInterval(int value) {
+ Context current_context = Context.getCurrentContext();
+ synchronized ( current_context ) {
+ nSetSwapInterval(current_context.getHandle(), value);
+ }
+ }
+
+ private static native void nSetSwapInterval(ByteBuffer context_handle, int value);
+
+ public void destroy(PeerInfo peer_info, ByteBuffer handle) throws LWJGLException {
+ nDestroy(handle);
+ }
+
+ private static native void nDestroy(ByteBuffer context_handle) throws LWJGLException;
+}
diff --git a/src/java/org/lwjgl/opengl/MacOSXDisplay.java b/src/java/org/lwjgl/opengl/MacOSXDisplay.java
index bdbeb96..25be1ba 100644
--- a/src/java/org/lwjgl/opengl/MacOSXDisplay.java
+++ b/src/java/org/lwjgl/opengl/MacOSXDisplay.java
@@ -1,508 +1,508 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-/**
- * This is the Display implementation interface. Display delegates
- * to implementors of this interface. There is one DisplayImplementation
- * for each supported platform.
- * @author elias_naur
- */
-
-import java.awt.Canvas;
-import java.awt.Cursor;
-import java.awt.Robot;
-import java.nio.ByteBuffer;
-import java.nio.FloatBuffer;
-import java.nio.IntBuffer;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedExceptionAction;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.lwjgl.BufferUtils;
-import org.lwjgl.LWJGLException;
-import org.lwjgl.LWJGLUtil;
-
-import com.apple.eawt.Application;
-import com.apple.eawt.ApplicationAdapter;
-import com.apple.eawt.ApplicationEvent;
-
-final class MacOSXDisplay implements DisplayImplementation {
- private static final int PBUFFER_HANDLE_SIZE = 24;
- private static final int GAMMA_LENGTH = 256;
-
- private MacOSXCanvasListener canvas_listener;
- private MacOSXFrame frame;
- private Canvas canvas;
- private Robot robot;
- private MacOSXMouseEventQueue mouse_queue;
- private KeyboardEventQueue keyboard_queue;
- private java.awt.DisplayMode requested_mode;
-
- /* States */
- private boolean close_requested;
-
- MacOSXDisplay() {
- try {
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws Exception {
- Application.getApplication().addApplicationListener(new ApplicationAdapter() {
- public final void handleQuit(ApplicationEvent event) {
- doHandleQuit();
- }
- });
- return null;
- }
- });
- } catch (Throwable e) {
- /**
- * In an applet environment, referencing com.apple.eawt.Application can fail with
- * a native exception. So log any exceptions instead of re-throwing.
- */
- LWJGLUtil.log("Failed to register quit handler: " + e.getMessage());
- }
- }
-
- public void createWindow(DisplayMode mode, Canvas parent, int x, int y) throws LWJGLException {
- boolean fullscreen = Display.isFullscreen();
- hideUI(fullscreen);
- close_requested = false;
- try {
- if (parent == null) {
- frame = new MacOSXFrame(mode, requested_mode, fullscreen, x, y);
- canvas = frame.getCanvas();
- } else {
- frame = null;
- canvas = parent;
- }
- canvas_listener = new MacOSXCanvasListener(canvas);
- robot = AWTUtil.createRobot(canvas);
- } catch (LWJGLException e) {
- destroyWindow();
- throw e;
- }
- }
-
- private void doHandleQuit() {
- synchronized (this) {
- close_requested = true;
- }
- }
-
- public void destroyWindow() {
- if (canvas_listener != null) {
- canvas_listener.disableListeners();
- canvas_listener = null;
- }
- if (frame != null) {
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- if (MacOSXFrame.getDevice().getFullScreenWindow() == frame)
- MacOSXFrame.getDevice().setFullScreenWindow(null);
- return null;
- }
- });
- if (frame.isDisplayable())
- frame.dispose();
- frame = null;
- }
- hideUI(false);
- }
-
- public int getGammaRampLength() {
- return GAMMA_LENGTH;
- }
-
- public native void setGammaRamp(FloatBuffer gammaRamp) throws LWJGLException;
-
- public String getAdapter() {
- return null;
- }
-
- public String getVersion() {
- return null;
- }
-
- private boolean equals(java.awt.DisplayMode awt_mode, DisplayMode mode) {
- return awt_mode.getWidth() == mode.getWidth() && awt_mode.getHeight() == mode.getHeight()
- && awt_mode.getBitDepth() == mode.getBitsPerPixel() && awt_mode.getRefreshRate() == mode.getFrequency();
- }
-
- public void switchDisplayMode(DisplayMode mode) throws LWJGLException {
- java.awt.DisplayMode[] awt_modes = MacOSXFrame.getDevice().getDisplayModes();
- for (int i = 0; i < awt_modes.length; i++)
- if (equals(awt_modes[i], mode)) {
- requested_mode = awt_modes[i];
- return;
- }
- throw new LWJGLException(mode + " is not supported");
- }
-
- public void resetDisplayMode() {
- if (MacOSXFrame.getDevice().getFullScreenWindow() != null)
- MacOSXFrame.getDevice().setFullScreenWindow(null);
- requested_mode = null;
- restoreGamma();
- }
-
- private native void restoreGamma();
-
- private DisplayMode createLWJGLDisplayMode(java.awt.DisplayMode awt_mode) {
- int bit_depth;
- int refresh_rate;
- int awt_bit_depth = awt_mode.getBitDepth();
- int awt_refresh_rate = awt_mode.getRefreshRate();
- if (awt_bit_depth != java.awt.DisplayMode.BIT_DEPTH_MULTI)
- bit_depth = awt_bit_depth;
- else
- bit_depth = 32; // Assume the best bit depth
- if (awt_refresh_rate != java.awt.DisplayMode.REFRESH_RATE_UNKNOWN)
- refresh_rate = awt_refresh_rate;
- else
- refresh_rate = 0;
- return new DisplayMode(awt_mode.getWidth(), awt_mode.getHeight(), bit_depth, refresh_rate);
- }
-
- public DisplayMode init() throws LWJGLException {
- return createLWJGLDisplayMode(MacOSXFrame.getDevice().getDisplayMode());
- }
-
- public DisplayMode[] getAvailableDisplayModes() throws LWJGLException {
- java.awt.DisplayMode[] awt_modes = MacOSXFrame.getDevice().getDisplayModes();
- List modes = new ArrayList();
- for (int i = 0; i < awt_modes.length; i++)
- if (awt_modes[i].getBitDepth() >= 16)
- modes.add(createLWJGLDisplayMode(awt_modes[i]));
- DisplayMode[] mode_list = new DisplayMode[modes.size()];
- modes.toArray(mode_list);
- return mode_list;
- }
-
- public void setTitle(String title) {
- if (frame != null)
- frame.setTitle(title);
- }
-
- public boolean isCloseRequested() {
- boolean result;
- synchronized (this) {
- result = close_requested || (frame != null && frame.syncIsCloseRequested());
- close_requested = false;
- }
- return result;
- }
-
- public boolean isVisible() {
- return frame == null || frame.syncIsVisible();
- }
-
- public boolean isActive() {
- return canvas.isFocusOwner();
- }
-
- public Canvas getCanvas() {
- return canvas;
- }
-
- public boolean isDirty() {
- return frame != null && frame.getCanvas().syncIsDirty();
- }
-
- public PeerInfo createPeerInfo(PixelFormat pixel_format) throws LWJGLException {
- try {
- return new MacOSXDisplayPeerInfo(pixel_format, true);
- } catch (LWJGLException e) {
- return new MacOSXDisplayPeerInfo(pixel_format, false);
- }
- }
-
- private final static IntBuffer current_viewport = BufferUtils.createIntBuffer(16);
- public void update() {
- boolean should_update = canvas_listener.syncShouldUpdateContext();
- /*
- * Workaround for the "white screen in fullscreen mode" problem
- *
- * Sometimes, switching from windowed mode to fullscreen or simply creating the Display
- * in fullscreen mode will result in the context not being bound to the window correctly.
- * The program runs fine, but the canvas background (white) is shown instead of the context
- * front buffer.
- *
- * I've discovered that re-binding the context with another setView() won't fix the problem, while a
- * clearDrawable() followed by a setView() does work. A straightforward workaround would be
- * to simply run the combination at every update(). This is not sufficient, since the clearDrawable()
- * call makes the the background appear shortly, causing visual artifacts.
- * What we really need is a way to detect that a setView() failed, and then do the magic combo. I've not
- * been able to find such a detection so alternatively I'm triggering the combo if the display is fullscreen
- * (I've not seen the white screen problem in windowed mode) and if the canvas has gotten a paint message or
- * if its update flag was set.
- *
- * My testing seems to indicate that the workaround works, since I've not seen the problem after the fix.
- *
- * - elias
- */
- if (Display.isFullscreen() && (frame != null && frame.getCanvas().syncCanvasPainted() || should_update)) {
- try {
- MacOSXContextImplementation.resetView(Display.getDrawable().getContext().getPeerInfo(), Display.getDrawable().getContext());
- } catch (LWJGLException e) {
- LWJGLUtil.log("Failed to reset context: " + e);
- }
- }
- if (should_update) {
- Display.getDrawable().getContext().update();
- /* This is necessary to make sure the context won't "forget" about the view size */
- GL11.glGetInteger(GL11.GL_VIEWPORT, current_viewport);
- GL11.glViewport(current_viewport.get(0), current_viewport.get(1), current_viewport.get(2), current_viewport.get(3));
- }
- if (frame != null && mouse_queue != null) {
- if (frame.syncShouldReleaseCursor())
- MacOSXMouseEventQueue.nGrabMouse(false);
- if (frame.syncShouldWarpCursor())
- mouse_queue.warpCursor();
- }
- }
-
- /**
- * This is an interface to the native Carbon call
- * SetSystemUIMode. It is used to hide the dock in a way
- * that will prevent AWT from shifting the fullscreen window
- *
- * The workaround is not necessary on 10.4, and since 10.4 shows
- * instability problems calling SetSystemUIMode, we'll only call it
- * when the OS version is 10.3 or lower.
- */
- private void hideUI(boolean hide) {
- if (!LWJGLUtil.isMacOSXEqualsOrBetterThan(10, 4))
- nHideUI(hide);
- }
-
- private native void nHideUI(boolean hide);
-
- public void reshape(int x, int y, int width, int height) {
- if (frame != null)
- frame.resize(x, y, width, height);
- }
-
- /* Mouse */
- public boolean hasWheel() {
- return AWTUtil.hasWheel();
- }
-
- public int getButtonCount() {
- return AWTUtil.getButtonCount();
- }
-
- public void createMouse() throws LWJGLException {
- this.mouse_queue = new MacOSXMouseEventQueue(canvas);
- mouse_queue.register();
- }
-
- public void destroyMouse() {
- if (mouse_queue != null) {
- MacOSXMouseEventQueue.nGrabMouse(false);
- mouse_queue.unregister();
- }
- this.mouse_queue = null;
- }
-
- public void pollMouse(IntBuffer coord_buffer, ByteBuffer buttons_buffer) {
- mouse_queue.poll(coord_buffer, buttons_buffer);
- }
-
- public void readMouse(ByteBuffer buffer) {
- mouse_queue.copyEvents(buffer);
- }
-
- public void grabMouse(boolean grab) {
- mouse_queue.setGrabbed(grab);
- }
-
- public int getNativeCursorCapabilities() {
- return AWTUtil.getNativeCursorCapabilities();
- }
-
- public void setCursorPosition(int x, int y) {
- AWTUtil.setCursorPosition(canvas, robot, x, y);
- }
-
- public void setNativeCursor(Object handle) throws LWJGLException {
- Cursor awt_cursor = (Cursor)handle;
- if (frame != null)
- frame.setCursor(awt_cursor);
- }
-
- public int getMinCursorSize() {
- return AWTUtil.getMinCursorSize();
- }
-
- public int getMaxCursorSize() {
- return AWTUtil.getMaxCursorSize();
- }
-
- /* Keyboard */
- public void createKeyboard() throws LWJGLException {
- this.keyboard_queue = new KeyboardEventQueue(canvas);
- keyboard_queue.register();
- }
-
- public void destroyKeyboard() {
- if (keyboard_queue != null)
- keyboard_queue.unregister();
- this.keyboard_queue = null;
- }
-
- public void pollKeyboard(ByteBuffer keyDownBuffer) {
- keyboard_queue.poll(keyDownBuffer);
- }
-
- public void readKeyboard(ByteBuffer buffer) {
- keyboard_queue.copyEvents(buffer);
- }
-
-/* public int isStateKeySet(int key) {
- int awt_key;
- switch (key) {
- case Keyboard.KEY_CAPITAL:
- awt_key = KeyEvent.VK_CAPS_LOCK;
- break;
- case Keyboard.KEY_NUMLOCK:
- awt_key = KeyEvent.VK_NUM_LOCK;
- break;
- case Keyboard.KEY_SYSRQ:
- awt_key = KeyEvent.VK_SCROLL_LOCK;
- break;
- default:
- return Keyboard.STATE_UNKNOWN;
- }
- try {
- boolean state = Toolkit.getDefaultToolkit().getLockingKeyState(awt_key);
- return state ? Keyboard.STATE_ON : Keyboard.STATE_OFF;
- } catch (Exception e) {
- LWJGLUtil.log("Failed to query key state: " + e);
- return Keyboard.STATE_UNKNOWN;
- }
- }
-*/
- /** Native cursor handles */
- public Object createCursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws LWJGLException {
- return AWTUtil.createCursor(width, height, xHotspot, yHotspot, numImages, images, delays);
- }
-
- public void destroyCursor(Object cursor_handle) {
- }
-
- public int getPbufferCapabilities() {
- if (LWJGLUtil.isMacOSXEqualsOrBetterThan(10, 3))
- return Pbuffer.PBUFFER_SUPPORTED;
- else
- return 0;
- }
-
- public boolean isBufferLost(PeerInfo handle) {
- return false;
- }
-
- public PeerInfo createPbuffer(int width, int height, PixelFormat pixel_format,
- IntBuffer pixelFormatCaps,
- IntBuffer pBufferAttribs) throws LWJGLException {
- return new MacOSXPbufferPeerInfo(width, height, pixel_format);
- }
-
- public void setPbufferAttrib(PeerInfo handle, int attrib, int value) {
- throw new UnsupportedOperationException();
- }
-
- public void bindTexImageToPbuffer(PeerInfo handle, int buffer) {
- throw new UnsupportedOperationException();
- }
-
- public void releaseTexImageFromPbuffer(PeerInfo handle, int buffer) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Sets one or more icons for the Display.
- * <ul>
- * <li>On Windows you should supply at least one 16x16 icon and one 32x32.</li>
- * <li>Linux (and similar platforms) expect one 32x32 icon.</li>
- * <li>Mac OS X should be supplied one 128x128 icon</li>
- * </ul>
- * The implementation will use the supplied ByteBuffers with image data in RGBA and perform any conversions nescesarry for the specific platform.
- *
- * @param icons Array of icons in RGBA mode
- * @return number of icons used.
- */
- public int setIcon(ByteBuffer[] icons) {
-/* int size = 0;
- int biggest = -1;
-
- for (int i=0;i<icons.length;i++) {
- if (icons[i].remaining() > size) {
- biggest = i;
- size = icons[i].remaining();
- }
- }
-
- if (biggest == -1) {
- return 0;
- }
-
- int width;
- int height;
-
- IntBuffer biggest_icon = icons[biggest].asIntBuffer();
- int[] imageData = new int[biggest_icon.remaining()];
- width = height = (int) Math.sqrt(imageData.length);
- biggest_icon.get(imageData);
-
- BufferedImage img = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
- img.setRGB(0, 0, width, height, imageData, 0, width);
- frame.setIconImage(img);
-
- return 1;*/
- // Don't use any icon, since Mac OS X windows don't have window icons
- return 0;
- }
-
- public int getWidth() {
- return Display.getDisplayMode().getWidth();
- }
-
- public int getHeight() {
- return Display.getDisplayMode().getHeight();
- }
-
- public boolean isInsideWindow() {
- return true;
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+/**
+ * This is the Display implementation interface. Display delegates
+ * to implementors of this interface. There is one DisplayImplementation
+ * for each supported platform.
+ * @author elias_naur
+ */
+
+import java.awt.Canvas;
+import java.awt.Cursor;
+import java.awt.Robot;
+import java.nio.ByteBuffer;
+import java.nio.FloatBuffer;
+import java.nio.IntBuffer;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedExceptionAction;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.LWJGLException;
+import org.lwjgl.LWJGLUtil;
+
+import com.apple.eawt.Application;
+import com.apple.eawt.ApplicationAdapter;
+import com.apple.eawt.ApplicationEvent;
+
+final class MacOSXDisplay implements DisplayImplementation {
+ private static final int PBUFFER_HANDLE_SIZE = 24;
+ private static final int GAMMA_LENGTH = 256;
+
+ private MacOSXCanvasListener canvas_listener;
+ private MacOSXFrame frame;
+ private Canvas canvas;
+ private Robot robot;
+ private MacOSXMouseEventQueue mouse_queue;
+ private KeyboardEventQueue keyboard_queue;
+ private java.awt.DisplayMode requested_mode;
+
+ /* States */
+ private boolean close_requested;
+
+ MacOSXDisplay() {
+ try {
+ AccessController.doPrivileged(new PrivilegedExceptionAction() {
+ public Object run() throws Exception {
+ Application.getApplication().addApplicationListener(new ApplicationAdapter() {
+ public final void handleQuit(ApplicationEvent event) {
+ doHandleQuit();
+ }
+ });
+ return null;
+ }
+ });
+ } catch (Throwable e) {
+ /**
+ * In an applet environment, referencing com.apple.eawt.Application can fail with
+ * a native exception. So log any exceptions instead of re-throwing.
+ */
+ LWJGLUtil.log("Failed to register quit handler: " + e.getMessage());
+ }
+ }
+
+ public void createWindow(DisplayMode mode, Canvas parent, int x, int y) throws LWJGLException {
+ boolean fullscreen = Display.isFullscreen();
+ hideUI(fullscreen);
+ close_requested = false;
+ try {
+ if (parent == null) {
+ frame = new MacOSXFrame(mode, requested_mode, fullscreen, x, y);
+ canvas = frame.getCanvas();
+ } else {
+ frame = null;
+ canvas = parent;
+ }
+ canvas_listener = new MacOSXCanvasListener(canvas);
+ robot = AWTUtil.createRobot(canvas);
+ } catch (LWJGLException e) {
+ destroyWindow();
+ throw e;
+ }
+ }
+
+ private void doHandleQuit() {
+ synchronized (this) {
+ close_requested = true;
+ }
+ }
+
+ public void destroyWindow() {
+ if (canvas_listener != null) {
+ canvas_listener.disableListeners();
+ canvas_listener = null;
+ }
+ if (frame != null) {
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ if (MacOSXFrame.getDevice().getFullScreenWindow() == frame)
+ MacOSXFrame.getDevice().setFullScreenWindow(null);
+ return null;
+ }
+ });
+ if (frame.isDisplayable())
+ frame.dispose();
+ frame = null;
+ }
+ hideUI(false);
+ }
+
+ public int getGammaRampLength() {
+ return GAMMA_LENGTH;
+ }
+
+ public native void setGammaRamp(FloatBuffer gammaRamp) throws LWJGLException;
+
+ public String getAdapter() {
+ return null;
+ }
+
+ public String getVersion() {
+ return null;
+ }
+
+ private boolean equals(java.awt.DisplayMode awt_mode, DisplayMode mode) {
+ return awt_mode.getWidth() == mode.getWidth() && awt_mode.getHeight() == mode.getHeight()
+ && awt_mode.getBitDepth() == mode.getBitsPerPixel() && awt_mode.getRefreshRate() == mode.getFrequency();
+ }
+
+ public void switchDisplayMode(DisplayMode mode) throws LWJGLException {
+ java.awt.DisplayMode[] awt_modes = MacOSXFrame.getDevice().getDisplayModes();
+ for (int i = 0; i < awt_modes.length; i++)
+ if (equals(awt_modes[i], mode)) {
+ requested_mode = awt_modes[i];
+ return;
+ }
+ throw new LWJGLException(mode + " is not supported");
+ }
+
+ public void resetDisplayMode() {
+ if (MacOSXFrame.getDevice().getFullScreenWindow() != null)
+ MacOSXFrame.getDevice().setFullScreenWindow(null);
+ requested_mode = null;
+ restoreGamma();
+ }
+
+ private native void restoreGamma();
+
+ private DisplayMode createLWJGLDisplayMode(java.awt.DisplayMode awt_mode) {
+ int bit_depth;
+ int refresh_rate;
+ int awt_bit_depth = awt_mode.getBitDepth();
+ int awt_refresh_rate = awt_mode.getRefreshRate();
+ if (awt_bit_depth != java.awt.DisplayMode.BIT_DEPTH_MULTI)
+ bit_depth = awt_bit_depth;
+ else
+ bit_depth = 32; // Assume the best bit depth
+ if (awt_refresh_rate != java.awt.DisplayMode.REFRESH_RATE_UNKNOWN)
+ refresh_rate = awt_refresh_rate;
+ else
+ refresh_rate = 0;
+ return new DisplayMode(awt_mode.getWidth(), awt_mode.getHeight(), bit_depth, refresh_rate);
+ }
+
+ public DisplayMode init() throws LWJGLException {
+ return createLWJGLDisplayMode(MacOSXFrame.getDevice().getDisplayMode());
+ }
+
+ public DisplayMode[] getAvailableDisplayModes() throws LWJGLException {
+ java.awt.DisplayMode[] awt_modes = MacOSXFrame.getDevice().getDisplayModes();
+ List modes = new ArrayList();
+ for (int i = 0; i < awt_modes.length; i++)
+ if (awt_modes[i].getBitDepth() >= 16)
+ modes.add(createLWJGLDisplayMode(awt_modes[i]));
+ DisplayMode[] mode_list = new DisplayMode[modes.size()];
+ modes.toArray(mode_list);
+ return mode_list;
+ }
+
+ public void setTitle(String title) {
+ if (frame != null)
+ frame.setTitle(title);
+ }
+
+ public boolean isCloseRequested() {
+ boolean result;
+ synchronized (this) {
+ result = close_requested || (frame != null && frame.syncIsCloseRequested());
+ close_requested = false;
+ }
+ return result;
+ }
+
+ public boolean isVisible() {
+ return frame == null || frame.syncIsVisible();
+ }
+
+ public boolean isActive() {
+ return canvas.isFocusOwner();
+ }
+
+ public Canvas getCanvas() {
+ return canvas;
+ }
+
+ public boolean isDirty() {
+ return frame != null && frame.getCanvas().syncIsDirty();
+ }
+
+ public PeerInfo createPeerInfo(PixelFormat pixel_format) throws LWJGLException {
+ try {
+ return new MacOSXDisplayPeerInfo(pixel_format, true);
+ } catch (LWJGLException e) {
+ return new MacOSXDisplayPeerInfo(pixel_format, false);
+ }
+ }
+
+ private final static IntBuffer current_viewport = BufferUtils.createIntBuffer(16);
+ public void update() {
+ boolean should_update = canvas_listener.syncShouldUpdateContext();
+ /*
+ * Workaround for the "white screen in fullscreen mode" problem
+ *
+ * Sometimes, switching from windowed mode to fullscreen or simply creating the Display
+ * in fullscreen mode will result in the context not being bound to the window correctly.
+ * The program runs fine, but the canvas background (white) is shown instead of the context
+ * front buffer.
+ *
+ * I've discovered that re-binding the context with another setView() won't fix the problem, while a
+ * clearDrawable() followed by a setView() does work. A straightforward workaround would be
+ * to simply run the combination at every update(). This is not sufficient, since the clearDrawable()
+ * call makes the the background appear shortly, causing visual artifacts.
+ * What we really need is a way to detect that a setView() failed, and then do the magic combo. I've not
+ * been able to find such a detection so alternatively I'm triggering the combo if the display is fullscreen
+ * (I've not seen the white screen problem in windowed mode) and if the canvas has gotten a paint message or
+ * if its update flag was set.
+ *
+ * My testing seems to indicate that the workaround works, since I've not seen the problem after the fix.
+ *
+ * - elias
+ */
+ if (Display.isFullscreen() && (frame != null && frame.getCanvas().syncCanvasPainted() || should_update)) {
+ try {
+ MacOSXContextImplementation.resetView(Display.getDrawable().getContext().getPeerInfo(), Display.getDrawable().getContext());
+ } catch (LWJGLException e) {
+ LWJGLUtil.log("Failed to reset context: " + e);
+ }
+ }
+ if (should_update) {
+ Display.getDrawable().getContext().update();
+ /* This is necessary to make sure the context won't "forget" about the view size */
+ GL11.glGetInteger(GL11.GL_VIEWPORT, current_viewport);
+ GL11.glViewport(current_viewport.get(0), current_viewport.get(1), current_viewport.get(2), current_viewport.get(3));
+ }
+ if (frame != null && mouse_queue != null) {
+ if (frame.syncShouldReleaseCursor())
+ MacOSXMouseEventQueue.nGrabMouse(false);
+ if (frame.syncShouldWarpCursor())
+ mouse_queue.warpCursor();
+ }
+ }
+
+ /**
+ * This is an interface to the native Carbon call
+ * SetSystemUIMode. It is used to hide the dock in a way
+ * that will prevent AWT from shifting the fullscreen window
+ *
+ * The workaround is not necessary on 10.4, and since 10.4 shows
+ * instability problems calling SetSystemUIMode, we'll only call it
+ * when the OS version is 10.3 or lower.
+ */
+ private void hideUI(boolean hide) {
+ if (!LWJGLUtil.isMacOSXEqualsOrBetterThan(10, 4))
+ nHideUI(hide);
+ }
+
+ private native void nHideUI(boolean hide);
+
+ public void reshape(int x, int y, int width, int height) {
+ if (frame != null)
+ frame.resize(x, y, width, height);
+ }
+
+ /* Mouse */
+ public boolean hasWheel() {
+ return AWTUtil.hasWheel();
+ }
+
+ public int getButtonCount() {
+ return AWTUtil.getButtonCount();
+ }
+
+ public void createMouse() throws LWJGLException {
+ this.mouse_queue = new MacOSXMouseEventQueue(canvas);
+ mouse_queue.register();
+ }
+
+ public void destroyMouse() {
+ if (mouse_queue != null) {
+ MacOSXMouseEventQueue.nGrabMouse(false);
+ mouse_queue.unregister();
+ }
+ this.mouse_queue = null;
+ }
+
+ public void pollMouse(IntBuffer coord_buffer, ByteBuffer buttons_buffer) {
+ mouse_queue.poll(coord_buffer, buttons_buffer);
+ }
+
+ public void readMouse(ByteBuffer buffer) {
+ mouse_queue.copyEvents(buffer);
+ }
+
+ public void grabMouse(boolean grab) {
+ mouse_queue.setGrabbed(grab);
+ }
+
+ public int getNativeCursorCapabilities() {
+ return AWTUtil.getNativeCursorCapabilities();
+ }
+
+ public void setCursorPosition(int x, int y) {
+ AWTUtil.setCursorPosition(canvas, robot, x, y);
+ }
+
+ public void setNativeCursor(Object handle) throws LWJGLException {
+ Cursor awt_cursor = (Cursor)handle;
+ if (frame != null)
+ frame.setCursor(awt_cursor);
+ }
+
+ public int getMinCursorSize() {
+ return AWTUtil.getMinCursorSize();
+ }
+
+ public int getMaxCursorSize() {
+ return AWTUtil.getMaxCursorSize();
+ }
+
+ /* Keyboard */
+ public void createKeyboard() throws LWJGLException {
+ this.keyboard_queue = new KeyboardEventQueue(canvas);
+ keyboard_queue.register();
+ }
+
+ public void destroyKeyboard() {
+ if (keyboard_queue != null)
+ keyboard_queue.unregister();
+ this.keyboard_queue = null;
+ }
+
+ public void pollKeyboard(ByteBuffer keyDownBuffer) {
+ keyboard_queue.poll(keyDownBuffer);
+ }
+
+ public void readKeyboard(ByteBuffer buffer) {
+ keyboard_queue.copyEvents(buffer);
+ }
+
+/* public int isStateKeySet(int key) {
+ int awt_key;
+ switch (key) {
+ case Keyboard.KEY_CAPITAL:
+ awt_key = KeyEvent.VK_CAPS_LOCK;
+ break;
+ case Keyboard.KEY_NUMLOCK:
+ awt_key = KeyEvent.VK_NUM_LOCK;
+ break;
+ case Keyboard.KEY_SYSRQ:
+ awt_key = KeyEvent.VK_SCROLL_LOCK;
+ break;
+ default:
+ return Keyboard.STATE_UNKNOWN;
+ }
+ try {
+ boolean state = Toolkit.getDefaultToolkit().getLockingKeyState(awt_key);
+ return state ? Keyboard.STATE_ON : Keyboard.STATE_OFF;
+ } catch (Exception e) {
+ LWJGLUtil.log("Failed to query key state: " + e);
+ return Keyboard.STATE_UNKNOWN;
+ }
+ }
+*/
+ /** Native cursor handles */
+ public Object createCursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws LWJGLException {
+ return AWTUtil.createCursor(width, height, xHotspot, yHotspot, numImages, images, delays);
+ }
+
+ public void destroyCursor(Object cursor_handle) {
+ }
+
+ public int getPbufferCapabilities() {
+ if (LWJGLUtil.isMacOSXEqualsOrBetterThan(10, 3))
+ return Pbuffer.PBUFFER_SUPPORTED;
+ else
+ return 0;
+ }
+
+ public boolean isBufferLost(PeerInfo handle) {
+ return false;
+ }
+
+ public PeerInfo createPbuffer(int width, int height, PixelFormat pixel_format,
+ IntBuffer pixelFormatCaps,
+ IntBuffer pBufferAttribs) throws LWJGLException {
+ return new MacOSXPbufferPeerInfo(width, height, pixel_format);
+ }
+
+ public void setPbufferAttrib(PeerInfo handle, int attrib, int value) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void bindTexImageToPbuffer(PeerInfo handle, int buffer) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void releaseTexImageFromPbuffer(PeerInfo handle, int buffer) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Sets one or more icons for the Display.
+ * <ul>
+ * <li>On Windows you should supply at least one 16x16 icon and one 32x32.</li>
+ * <li>Linux (and similar platforms) expect one 32x32 icon.</li>
+ * <li>Mac OS X should be supplied one 128x128 icon</li>
+ * </ul>
+ * The implementation will use the supplied ByteBuffers with image data in RGBA and perform any conversions nescesarry for the specific platform.
+ *
+ * @param icons Array of icons in RGBA mode
+ * @return number of icons used.
+ */
+ public int setIcon(ByteBuffer[] icons) {
+/* int size = 0;
+ int biggest = -1;
+
+ for (int i=0;i<icons.length;i++) {
+ if (icons[i].remaining() > size) {
+ biggest = i;
+ size = icons[i].remaining();
+ }
+ }
+
+ if (biggest == -1) {
+ return 0;
+ }
+
+ int width;
+ int height;
+
+ IntBuffer biggest_icon = icons[biggest].asIntBuffer();
+ int[] imageData = new int[biggest_icon.remaining()];
+ width = height = (int) Math.sqrt(imageData.length);
+ biggest_icon.get(imageData);
+
+ BufferedImage img = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
+ img.setRGB(0, 0, width, height, imageData, 0, width);
+ frame.setIconImage(img);
+
+ return 1;*/
+ // Don't use any icon, since Mac OS X windows don't have window icons
+ return 0;
+ }
+
+ public int getWidth() {
+ return Display.getDisplayMode().getWidth();
+ }
+
+ public int getHeight() {
+ return Display.getDisplayMode().getHeight();
+ }
+
+ public boolean isInsideWindow() {
+ return true;
+ }
+}
diff --git a/src/java/org/lwjgl/opengl/MacOSXDisplayPeerInfo.java b/src/java/org/lwjgl/opengl/MacOSXDisplayPeerInfo.java
index 853b520..3122ee1 100644
--- a/src/java/org/lwjgl/opengl/MacOSXDisplayPeerInfo.java
+++ b/src/java/org/lwjgl/opengl/MacOSXDisplayPeerInfo.java
@@ -1,67 +1,67 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import java.awt.Canvas;
-
-import org.lwjgl.LWJGLException;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3116 $
- * $Id: MacOSXDisplayPeerInfo.java 3116 2008-08-19 16:46:03Z spasi $
- */
-final class MacOSXDisplayPeerInfo extends MacOSXCanvasPeerInfo {
- private boolean locked = false;
-
- MacOSXDisplayPeerInfo(PixelFormat pixel_format, boolean support_pbuffer) throws LWJGLException {
- super(pixel_format, support_pbuffer);
- }
-
- protected void doLockAndInitHandle() throws LWJGLException {
- if (locked)
- throw new RuntimeException("Already locked");
- Canvas canvas = ((MacOSXDisplay)Display.getImplementation()).getCanvas();
- if (canvas != null) {
- initHandle(canvas);
- locked = true;
- }
- }
-
- protected void doUnlock() throws LWJGLException {
- if (locked) {
- super.doUnlock();
- locked = false;
- }
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import java.awt.Canvas;
+
+import org.lwjgl.LWJGLException;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3116 $
+ * $Id: MacOSXDisplayPeerInfo.java 3116 2008-08-19 16:46:03Z spasi $
+ */
+final class MacOSXDisplayPeerInfo extends MacOSXCanvasPeerInfo {
+ private boolean locked = false;
+
+ MacOSXDisplayPeerInfo(PixelFormat pixel_format, boolean support_pbuffer) throws LWJGLException {
+ super(pixel_format, support_pbuffer);
+ }
+
+ protected void doLockAndInitHandle() throws LWJGLException {
+ if (locked)
+ throw new RuntimeException("Already locked");
+ Canvas canvas = ((MacOSXDisplay)Display.getImplementation()).getCanvas();
+ if (canvas != null) {
+ initHandle(canvas);
+ locked = true;
+ }
+ }
+
+ protected void doUnlock() throws LWJGLException {
+ if (locked) {
+ super.doUnlock();
+ locked = false;
+ }
+ }
+}
diff --git a/src/java/org/lwjgl/opengl/MacOSXFrame.java b/src/java/org/lwjgl/opengl/MacOSXFrame.java
index 2ca1c72..e258522 100644
--- a/src/java/org/lwjgl/opengl/MacOSXFrame.java
+++ b/src/java/org/lwjgl/opengl/MacOSXFrame.java
@@ -1,228 +1,228 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-/**
- * This is the Mac OS X AWT Frame. It contains thread safe
- * methods to manipulateit from non-AWT threads
- * @author elias_naur
- */
-
-import java.awt.BorderLayout;
-import java.awt.Frame;
-import java.awt.GraphicsDevice;
-import java.awt.GraphicsEnvironment;
-import java.awt.Insets;
-import java.awt.Rectangle;
-import java.awt.event.ComponentEvent;
-import java.awt.event.ComponentListener;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-
-import org.lwjgl.LWJGLException;
-
-final class MacOSXFrame extends Frame implements WindowListener, ComponentListener {
-
- private static final long serialVersionUID = -5823294716668988777L;
-
- private final MacOSXGLCanvas canvas;
- private boolean close_requested;
-
- /* States */
- private Rectangle bounds;
- private boolean active;
- private boolean minimized;
- private boolean should_warp_cursor;
- private boolean should_release_cursor;
-
- MacOSXFrame(DisplayMode mode, final java.awt.DisplayMode requested_mode, boolean fullscreen, int x, int y) throws LWJGLException {
- setResizable(false);
- addWindowListener(this);
- addComponentListener(this);
- canvas = new MacOSXGLCanvas();
- canvas.setFocusTraversalKeysEnabled(false);
- add(canvas, BorderLayout.CENTER);
- boolean undecorated = Display.getPrivilegedBoolean("org.lwjgl.opengl.Window.undecorated");
- setUndecorated(fullscreen || undecorated);
- if ( fullscreen ) {
- try {
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws Exception {
- getDevice().setFullScreenWindow(MacOSXFrame.this);
- getDevice().setDisplayMode(requested_mode);
- java.awt.DisplayMode real_mode = getDevice().getDisplayMode();
- /** For some strange reason, the display mode is sometimes silently capped even though the mode is reported as supported */
- if ( requested_mode.getWidth() != real_mode.getWidth() || requested_mode.getHeight() != real_mode.getHeight() ) {
- getDevice().setFullScreenWindow(null);
- if (isDisplayable())
- dispose();
- throw new LWJGLException("AWT capped mode: requested mode = " + requested_mode.getWidth() + "x" + requested_mode.getHeight() +
- " but got " + real_mode.getWidth() + " " + real_mode.getHeight());
- }
- return null;
- }
- });
- } catch (PrivilegedActionException e) {
- throw new LWJGLException(e);
- }
- }
- pack();
- resize(x, y, mode.getWidth(), mode.getHeight());
- setVisible(true);
- requestFocus();
- canvas.requestFocus();
- updateBounds();
- }
-
- public void resize(int x, int y, int width, int height) {
- Insets insets = getInsets();
- setBounds(x, y, width + insets.left + insets.right, height + insets.top + insets.bottom);
- }
-
- public Rectangle syncGetBounds() {
- synchronized ( this ) {
- return bounds;
- }
- }
-
- public void componentShown(ComponentEvent e) {
- }
-
- public void componentHidden(ComponentEvent e) {
- }
-
- private void updateBounds() {
- synchronized ( this ) {
- bounds = getBounds();
- }
- }
-
- public void componentResized(ComponentEvent e) {
- updateBounds();
- }
-
- public void componentMoved(ComponentEvent e) {
- updateBounds();
- }
-
- public static GraphicsDevice getDevice() {
- GraphicsEnvironment g_env = GraphicsEnvironment.getLocalGraphicsEnvironment();
- GraphicsDevice device = g_env.getDefaultScreenDevice();
- return device;
- }
-
- public void windowIconified(WindowEvent e) {
- synchronized ( this ) {
- minimized = true;
- }
- }
-
- public void windowDeiconified(WindowEvent e) {
- synchronized ( this ) {
- minimized = false;
- }
- }
-
- public void windowOpened(WindowEvent e) {
- }
-
- public void windowClosed(WindowEvent e) {
- }
-
- public void windowClosing(WindowEvent e) {
- synchronized ( this ) {
- close_requested = true;
- }
- }
-
- public void windowDeactivated(WindowEvent e) {
- synchronized ( this ) {
- active = false;
- should_release_cursor = true;
- should_warp_cursor = false;
- }
- }
-
- public void windowActivated(WindowEvent e) {
- synchronized ( this ) {
- active = true;
- should_warp_cursor = true;
- should_release_cursor = false;
- }
- }
-
- public boolean syncIsCloseRequested() {
- boolean result;
- synchronized ( this ) {
- result = close_requested;
- close_requested = false;
- }
- return result;
- }
-
- public boolean syncIsVisible() {
- synchronized ( this ) {
- return !minimized;
- }
- }
-
- public boolean syncIsActive() {
- synchronized ( this ) {
- return active;
- }
- }
-
- public MacOSXGLCanvas getCanvas() {
- return canvas;
- }
-
- public boolean syncShouldReleaseCursor() {
- boolean result;
- synchronized ( this ) {
- result = should_release_cursor;
- should_release_cursor = false;
- }
- return result;
- }
-
- public boolean syncShouldWarpCursor() {
- boolean result;
- synchronized ( this ) {
- result = should_warp_cursor;
- should_warp_cursor = false;
- }
- return result;
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+/**
+ * This is the Mac OS X AWT Frame. It contains thread safe
+ * methods to manipulateit from non-AWT threads
+ * @author elias_naur
+ */
+
+import java.awt.BorderLayout;
+import java.awt.Frame;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import java.awt.Insets;
+import java.awt.Rectangle;
+import java.awt.event.ComponentEvent;
+import java.awt.event.ComponentListener;
+import java.awt.event.WindowEvent;
+import java.awt.event.WindowListener;
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+
+import org.lwjgl.LWJGLException;
+
+final class MacOSXFrame extends Frame implements WindowListener, ComponentListener {
+
+ private static final long serialVersionUID = -5823294716668988777L;
+
+ private final MacOSXGLCanvas canvas;
+ private boolean close_requested;
+
+ /* States */
+ private Rectangle bounds;
+ private boolean active;
+ private boolean minimized;
+ private boolean should_warp_cursor;
+ private boolean should_release_cursor;
+
+ MacOSXFrame(DisplayMode mode, final java.awt.DisplayMode requested_mode, boolean fullscreen, int x, int y) throws LWJGLException {
+ setResizable(false);
+ addWindowListener(this);
+ addComponentListener(this);
+ canvas = new MacOSXGLCanvas();
+ canvas.setFocusTraversalKeysEnabled(false);
+ add(canvas, BorderLayout.CENTER);
+ boolean undecorated = Display.getPrivilegedBoolean("org.lwjgl.opengl.Window.undecorated");
+ setUndecorated(fullscreen || undecorated);
+ if ( fullscreen ) {
+ try {
+ AccessController.doPrivileged(new PrivilegedExceptionAction() {
+ public Object run() throws Exception {
+ getDevice().setFullScreenWindow(MacOSXFrame.this);
+ getDevice().setDisplayMode(requested_mode);
+ java.awt.DisplayMode real_mode = getDevice().getDisplayMode();
+ /** For some strange reason, the display mode is sometimes silently capped even though the mode is reported as supported */
+ if ( requested_mode.getWidth() != real_mode.getWidth() || requested_mode.getHeight() != real_mode.getHeight() ) {
+ getDevice().setFullScreenWindow(null);
+ if (isDisplayable())
+ dispose();
+ throw new LWJGLException("AWT capped mode: requested mode = " + requested_mode.getWidth() + "x" + requested_mode.getHeight() +
+ " but got " + real_mode.getWidth() + " " + real_mode.getHeight());
+ }
+ return null;
+ }
+ });
+ } catch (PrivilegedActionException e) {
+ throw new LWJGLException(e);
+ }
+ }
+ pack();
+ resize(x, y, mode.getWidth(), mode.getHeight());
+ setVisible(true);
+ requestFocus();
+ canvas.requestFocus();
+ updateBounds();
+ }
+
+ public void resize(int x, int y, int width, int height) {
+ Insets insets = getInsets();
+ setBounds(x, y, width + insets.left + insets.right, height + insets.top + insets.bottom);
+ }
+
+ public Rectangle syncGetBounds() {
+ synchronized ( this ) {
+ return bounds;
+ }
+ }
+
+ public void componentShown(ComponentEvent e) {
+ }
+
+ public void componentHidden(ComponentEvent e) {
+ }
+
+ private void updateBounds() {
+ synchronized ( this ) {
+ bounds = getBounds();
+ }
+ }
+
+ public void componentResized(ComponentEvent e) {
+ updateBounds();
+ }
+
+ public void componentMoved(ComponentEvent e) {
+ updateBounds();
+ }
+
+ public static GraphicsDevice getDevice() {
+ GraphicsEnvironment g_env = GraphicsEnvironment.getLocalGraphicsEnvironment();
+ GraphicsDevice device = g_env.getDefaultScreenDevice();
+ return device;
+ }
+
+ public void windowIconified(WindowEvent e) {
+ synchronized ( this ) {
+ minimized = true;
+ }
+ }
+
+ public void windowDeiconified(WindowEvent e) {
+ synchronized ( this ) {
+ minimized = false;
+ }
+ }
+
+ public void windowOpened(WindowEvent e) {
+ }
+
+ public void windowClosed(WindowEvent e) {
+ }
+
+ public void windowClosing(WindowEvent e) {
+ synchronized ( this ) {
+ close_requested = true;
+ }
+ }
+
+ public void windowDeactivated(WindowEvent e) {
+ synchronized ( this ) {
+ active = false;
+ should_release_cursor = true;
+ should_warp_cursor = false;
+ }
+ }
+
+ public void windowActivated(WindowEvent e) {
+ synchronized ( this ) {
+ active = true;
+ should_warp_cursor = true;
+ should_release_cursor = false;
+ }
+ }
+
+ public boolean syncIsCloseRequested() {
+ boolean result;
+ synchronized ( this ) {
+ result = close_requested;
+ close_requested = false;
+ }
+ return result;
+ }
+
+ public boolean syncIsVisible() {
+ synchronized ( this ) {
+ return !minimized;
+ }
+ }
+
+ public boolean syncIsActive() {
+ synchronized ( this ) {
+ return active;
+ }
+ }
+
+ public MacOSXGLCanvas getCanvas() {
+ return canvas;
+ }
+
+ public boolean syncShouldReleaseCursor() {
+ boolean result;
+ synchronized ( this ) {
+ result = should_release_cursor;
+ should_release_cursor = false;
+ }
+ return result;
+ }
+
+ public boolean syncShouldWarpCursor() {
+ boolean result;
+ synchronized ( this ) {
+ result = should_warp_cursor;
+ should_warp_cursor = false;
+ }
+ return result;
+ }
+}
diff --git a/src/java/org/lwjgl/opengl/MacOSXGLCanvas.java b/src/java/org/lwjgl/opengl/MacOSXGLCanvas.java
index 39f8050..3ec8a60 100644
--- a/src/java/org/lwjgl/opengl/MacOSXGLCanvas.java
+++ b/src/java/org/lwjgl/opengl/MacOSXGLCanvas.java
@@ -1,77 +1,77 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-/**
- * The AWT compatible Canvas for Mac OS X.
- * @author elias_naur
- */
-
-import java.awt.Canvas;
-import java.awt.Graphics;
-
-final class MacOSXGLCanvas extends Canvas {
-
- private static final long serialVersionUID = 6916664741667434870L;
-
- private boolean canvas_painted;
- private boolean dirty;
-
- public void update(Graphics g) {
- paint(g);
- }
-
- public void paint(Graphics g) {
- synchronized ( this ) {
- dirty = true;
- canvas_painted = true;
- }
- }
-
- public boolean syncCanvasPainted() {
- boolean result;
- synchronized (this) {
- result = canvas_painted;
- canvas_painted = false;
- }
- return result;
- }
-
- public boolean syncIsDirty() {
- boolean result;
- synchronized ( this ) {
- result = dirty;
- dirty = false;
- }
- return result;
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+/**
+ * The AWT compatible Canvas for Mac OS X.
+ * @author elias_naur
+ */
+
+import java.awt.Canvas;
+import java.awt.Graphics;
+
+final class MacOSXGLCanvas extends Canvas {
+
+ private static final long serialVersionUID = 6916664741667434870L;
+
+ private boolean canvas_painted;
+ private boolean dirty;
+
+ public void update(Graphics g) {
+ paint(g);
+ }
+
+ public void paint(Graphics g) {
+ synchronized ( this ) {
+ dirty = true;
+ canvas_painted = true;
+ }
+ }
+
+ public boolean syncCanvasPainted() {
+ boolean result;
+ synchronized (this) {
+ result = canvas_painted;
+ canvas_painted = false;
+ }
+ return result;
+ }
+
+ public boolean syncIsDirty() {
+ boolean result;
+ synchronized ( this ) {
+ result = dirty;
+ dirty = false;
+ }
+ return result;
+ }
+}
diff --git a/src/java/org/lwjgl/opengl/MacOSXMouseEventQueue.java b/src/java/org/lwjgl/opengl/MacOSXMouseEventQueue.java
index c6b6195..75922d8 100644
--- a/src/java/org/lwjgl/opengl/MacOSXMouseEventQueue.java
+++ b/src/java/org/lwjgl/opengl/MacOSXMouseEventQueue.java
@@ -1,113 +1,113 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-/**
- * An AWT implementation of a LWJGL compatible Mouse event queue.
- * @author elias_naur
- */
-
-import java.awt.Component;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.nio.IntBuffer;
-
-import org.lwjgl.BufferUtils;
-
-final class MacOSXMouseEventQueue extends MouseEventQueue {
- private final IntBuffer delta_buffer = BufferUtils.createIntBuffer(2);
-
- private boolean skip_event;
- private static boolean is_grabbed;
-
- MacOSXMouseEventQueue(Component component) {
- super(component);
- }
-
- public void setGrabbed(boolean grab) {
- super.setGrabbed(grab);
- warpCursor();
- grabMouse(grab);
- }
-
- private static synchronized void grabMouse(boolean grab) {
- if (is_grabbed != grab) {
- is_grabbed = grab;
- if (!grab)
- nGrabMouse(grab);
- }
- }
-
- protected void resetCursorToCenter() {
- super.resetCursorToCenter();
- /* Clear accumulated deltas */
- getMouseDeltas(delta_buffer);
- }
-
- protected void updateDeltas(long nanos) {
- super.updateDeltas(nanos);
- synchronized ( this ) {
- getMouseDeltas(delta_buffer);
- int dx = delta_buffer.get(0);
- int dy = -delta_buffer.get(1);
- if (skip_event) {
- skip_event = false;
- nGrabMouse(isGrabbed());
- return;
- }
- if ( dx != 0 || dy != 0 ) {
- putMouseEventWithCoords((byte)-1, (byte)0, dx, dy, 0, nanos);
- addDelta(dx, dy);
- }
- }
- }
-
- void warpCursor() {
- synchronized (this) {
- // If we're going to warp the cursor position, we'll skip the next event to avoid bogus delta values
- skip_event = isGrabbed();
- }
-/* if (isGrabbed()) {
- Rectangle bounds = getComponent().getBounds();
- Point location_on_screen = getComponent().getLocationOnScreen();
- int x = location_on_screen.x + bounds.width/2;
- int y = location_on_screen.y + bounds.height/2;
- nWarpCursor(x, y);
- }*/
- }
-
- private static native void getMouseDeltas(IntBuffer delta_buffer);
-
- private static native void nWarpCursor(int x, int y);
-
- static native void nGrabMouse(boolean grab);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+/**
+ * An AWT implementation of a LWJGL compatible Mouse event queue.
+ * @author elias_naur
+ */
+
+import java.awt.Component;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.nio.IntBuffer;
+
+import org.lwjgl.BufferUtils;
+
+final class MacOSXMouseEventQueue extends MouseEventQueue {
+ private final IntBuffer delta_buffer = BufferUtils.createIntBuffer(2);
+
+ private boolean skip_event;
+ private static boolean is_grabbed;
+
+ MacOSXMouseEventQueue(Component component) {
+ super(component);
+ }
+
+ public void setGrabbed(boolean grab) {
+ super.setGrabbed(grab);
+ warpCursor();
+ grabMouse(grab);
+ }
+
+ private static synchronized void grabMouse(boolean grab) {
+ if (is_grabbed != grab) {
+ is_grabbed = grab;
+ if (!grab)
+ nGrabMouse(grab);
+ }
+ }
+
+ protected void resetCursorToCenter() {
+ super.resetCursorToCenter();
+ /* Clear accumulated deltas */
+ getMouseDeltas(delta_buffer);
+ }
+
+ protected void updateDeltas(long nanos) {
+ super.updateDeltas(nanos);
+ synchronized ( this ) {
+ getMouseDeltas(delta_buffer);
+ int dx = delta_buffer.get(0);
+ int dy = -delta_buffer.get(1);
+ if (skip_event) {
+ skip_event = false;
+ nGrabMouse(isGrabbed());
+ return;
+ }
+ if ( dx != 0 || dy != 0 ) {
+ putMouseEventWithCoords((byte)-1, (byte)0, dx, dy, 0, nanos);
+ addDelta(dx, dy);
+ }
+ }
+ }
+
+ void warpCursor() {
+ synchronized (this) {
+ // If we're going to warp the cursor position, we'll skip the next event to avoid bogus delta values
+ skip_event = isGrabbed();
+ }
+/* if (isGrabbed()) {
+ Rectangle bounds = getComponent().getBounds();
+ Point location_on_screen = getComponent().getLocationOnScreen();
+ int x = location_on_screen.x + bounds.width/2;
+ int y = location_on_screen.y + bounds.height/2;
+ nWarpCursor(x, y);
+ }*/
+ }
+
+ private static native void getMouseDeltas(IntBuffer delta_buffer);
+
+ private static native void nWarpCursor(int x, int y);
+
+ static native void nGrabMouse(boolean grab);
+}
diff --git a/src/java/org/lwjgl/opengl/MacOSXPbufferPeerInfo.java b/src/java/org/lwjgl/opengl/MacOSXPbufferPeerInfo.java
index 574853d..3a5b52a 100644
--- a/src/java/org/lwjgl/opengl/MacOSXPbufferPeerInfo.java
+++ b/src/java/org/lwjgl/opengl/MacOSXPbufferPeerInfo.java
@@ -1,63 +1,63 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import java.nio.ByteBuffer;
-
-import org.lwjgl.LWJGLException;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3116 $
- * $Id: MacOSXPbufferPeerInfo.java 3116 2008-08-19 16:46:03Z spasi $
- */
-final class MacOSXPbufferPeerInfo extends MacOSXPeerInfo {
- MacOSXPbufferPeerInfo(int width, int height, PixelFormat pixel_format) throws LWJGLException {
- super(pixel_format, false, false, true, false);
- nCreate(getHandle(), width, height);
- }
- private static native void nCreate(ByteBuffer handle, int width, int height) throws LWJGLException;
-
- public void destroy() {
- nDestroy(getHandle());
- }
- private static native void nDestroy(ByteBuffer handle);
-
- protected void doLockAndInitHandle() throws LWJGLException {
- // NO-OP
- }
-
- protected void doUnlock() throws LWJGLException {
- // NO-OP
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import java.nio.ByteBuffer;
+
+import org.lwjgl.LWJGLException;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3116 $
+ * $Id: MacOSXPbufferPeerInfo.java 3116 2008-08-19 16:46:03Z spasi $
+ */
+final class MacOSXPbufferPeerInfo extends MacOSXPeerInfo {
+ MacOSXPbufferPeerInfo(int width, int height, PixelFormat pixel_format) throws LWJGLException {
+ super(pixel_format, false, false, true, false);
+ nCreate(getHandle(), width, height);
+ }
+ private static native void nCreate(ByteBuffer handle, int width, int height) throws LWJGLException;
+
+ public void destroy() {
+ nDestroy(getHandle());
+ }
+ private static native void nDestroy(ByteBuffer handle);
+
+ protected void doLockAndInitHandle() throws LWJGLException {
+ // NO-OP
+ }
+
+ protected void doUnlock() throws LWJGLException {
+ // NO-OP
+ }
+}
diff --git a/src/java/org/lwjgl/opengl/MacOSXPeerInfo.java b/src/java/org/lwjgl/opengl/MacOSXPeerInfo.java
index f7e6ddb..a008ad7 100644
--- a/src/java/org/lwjgl/opengl/MacOSXPeerInfo.java
+++ b/src/java/org/lwjgl/opengl/MacOSXPeerInfo.java
@@ -1,63 +1,63 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import java.nio.ByteBuffer;
-
-import org.lwjgl.LWJGLException;
-import org.lwjgl.LWJGLUtil;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3116 $
- * $Id: MacOSXPeerInfo.java 3116 2008-08-19 16:46:03Z spasi $
- */
-abstract class MacOSXPeerInfo extends PeerInfo {
- MacOSXPeerInfo(PixelFormat pixel_format, boolean use_display_bpp, boolean support_window, boolean support_pbuffer, boolean double_buffered) throws LWJGLException {
- super(createHandle());
- if (pixel_format.isFloatingPoint() && !LWJGLUtil.isMacOSXEqualsOrBetterThan(10, 4))
- throw new LWJGLException("Floating point pixel format requested, but is not supported");
- choosePixelFormat(pixel_format, use_display_bpp, support_window, support_pbuffer, double_buffered);
- }
- private static native ByteBuffer createHandle();
-
- private void choosePixelFormat(PixelFormat pixel_format, boolean use_display_bpp, boolean support_window, boolean support_pbuffer, boolean double_buffered) throws LWJGLException {
- nChoosePixelFormat(getHandle(), pixel_format, use_display_bpp, support_window, support_pbuffer, double_buffered);
- }
- private static native void nChoosePixelFormat(ByteBuffer peer_info_handle, PixelFormat pixel_format, boolean use_display_bpp, boolean support_window, boolean support_pbuffer, boolean double_buffered) throws LWJGLException;
-
- public void destroy() {
- nDestroy(getHandle());
- }
- private static native void nDestroy(ByteBuffer handle);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import java.nio.ByteBuffer;
+
+import org.lwjgl.LWJGLException;
+import org.lwjgl.LWJGLUtil;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3116 $
+ * $Id: MacOSXPeerInfo.java 3116 2008-08-19 16:46:03Z spasi $
+ */
+abstract class MacOSXPeerInfo extends PeerInfo {
+ MacOSXPeerInfo(PixelFormat pixel_format, boolean use_display_bpp, boolean support_window, boolean support_pbuffer, boolean double_buffered) throws LWJGLException {
+ super(createHandle());
+ if (pixel_format.isFloatingPoint() && !LWJGLUtil.isMacOSXEqualsOrBetterThan(10, 4))
+ throw new LWJGLException("Floating point pixel format requested, but is not supported");
+ choosePixelFormat(pixel_format, use_display_bpp, support_window, support_pbuffer, double_buffered);
+ }
+ private static native ByteBuffer createHandle();
+
+ private void choosePixelFormat(PixelFormat pixel_format, boolean use_display_bpp, boolean support_window, boolean support_pbuffer, boolean double_buffered) throws LWJGLException {
+ nChoosePixelFormat(getHandle(), pixel_format, use_display_bpp, support_window, support_pbuffer, double_buffered);
+ }
+ private static native void nChoosePixelFormat(ByteBuffer peer_info_handle, PixelFormat pixel_format, boolean use_display_bpp, boolean support_window, boolean support_pbuffer, boolean double_buffered) throws LWJGLException;
+
+ public void destroy() {
+ nDestroy(getHandle());
+ }
+ private static native void nDestroy(ByteBuffer handle);
+}
diff --git a/src/java/org/lwjgl/opengl/MouseEventQueue.java b/src/java/org/lwjgl/opengl/MouseEventQueue.java
index 167eee3..fa537cd 100644
--- a/src/java/org/lwjgl/opengl/MouseEventQueue.java
+++ b/src/java/org/lwjgl/opengl/MouseEventQueue.java
@@ -1,261 +1,261 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-/**
- * An AWT implementation of a LWJGL compatible Mouse event queue.
- * @author elias_naur
- */
-
-import java.awt.Component;
-import java.awt.Point;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-import java.awt.event.MouseMotionListener;
-import java.awt.event.MouseWheelEvent;
-import java.awt.event.MouseWheelListener;
-import java.nio.ByteBuffer;
-import java.nio.IntBuffer;
-
-import org.lwjgl.input.Mouse;
-
-class MouseEventQueue extends EventQueue implements MouseListener, MouseMotionListener, MouseWheelListener {
- private static final int WHEEL_SCALE = 120;
- public static final int NUM_BUTTONS = 3;
-
- private final Component component;
-
- private boolean grabbed;
-
- /** The accumulated mouse deltas returned by poll() */
- private int accum_dx;
- private int accum_dy;
- private int accum_dz;
-
- /** The last mouse position */
- private int last_x;
- private int last_y;
-
- /** Saved control key state for ctrl-click right button emulation */
- private boolean saved_control_state;
-
- /** Event scratch array */
- private final ByteBuffer event = ByteBuffer.allocate(Mouse.EVENT_SIZE);
-
- /** Buttons array */
- private final byte[] buttons = new byte[NUM_BUTTONS];
-
- MouseEventQueue(Component component) {
- super(Mouse.EVENT_SIZE);
- this.component = component;
- }
-
- public synchronized void register() {
- resetCursorToCenter();
- component.addMouseListener(this);
- component.addMouseMotionListener(this);
- component.addMouseWheelListener(this);
- }
-
- public synchronized void unregister() {
- component.removeMouseListener(this);
- component.removeMouseMotionListener(this);
- component.removeMouseWheelListener(this);
- }
-
- protected Component getComponent() {
- return component;
- }
-
- public synchronized void setGrabbed(boolean grabbed) {
- this.grabbed = grabbed;
- resetCursorToCenter();
- }
-
- public synchronized boolean isGrabbed() {
- return grabbed;
- }
-
- private int transformY(int y) {
- return component.getHeight() - 1 - y;
- }
-
- protected void resetCursorToCenter() {
- clearEvents();
- accum_dx = accum_dy = 0;
- Point cursor_location = AWTUtil.getCursorPosition(component);
- if (cursor_location != null) {
- last_x = cursor_location.x;
- last_y = cursor_location.y;
- }
- }
-
- private void putMouseEvent(byte button, byte state, int dz, long nanos) {
- if (grabbed)
- putMouseEventWithCoords(button, state, 0, 0, dz, nanos);
- else
- putMouseEventWithCoords(button, state, last_x, last_y, dz, nanos);
- }
-
- protected void putMouseEventWithCoords(byte button, byte state, int coord1, int coord2, int dz, long nanos) {
- event.clear();
- event.put(button).put(state).putInt(coord1).putInt(coord2).putInt(dz).putLong(nanos);
- event.flip();
- putEvent(event);
- }
-
- public synchronized void poll(IntBuffer coord_buffer, ByteBuffer buttons_buffer) {
- if ( grabbed ) {
- coord_buffer.put(0, accum_dx);
- coord_buffer.put(1, accum_dy);
- } else {
- coord_buffer.put(0, last_x);
- coord_buffer.put(1, last_y);
- }
- coord_buffer.put(2, accum_dz);
- accum_dx = accum_dy = accum_dz = 0;
- int old_position = buttons_buffer.position();
- buttons_buffer.put(buttons, 0, buttons.length);
- buttons_buffer.position(old_position);
- }
-
- private void setCursorPos(int x, int y, long nanos) {
- y = transformY(y);
- if ( grabbed )
- return;
- int dx = x - last_x;
- int dy = y - last_y;
- addDelta(dx, dy);
- last_x = x;
- last_y = y;
- putMouseEventWithCoords((byte)-1, (byte)0, x, y, 0, nanos);
- }
-
- protected void addDelta(int dx, int dy) {
- accum_dx += dx;
- accum_dy += dy;
- }
-
- public void mouseClicked(MouseEvent e) {
- }
-
- public void mouseEntered(MouseEvent e) {
- }
-
- public void mouseExited(MouseEvent e) {
- }
-
- private void handleButton(MouseEvent e) {
- byte state;
- switch (e.getID()) {
- case MouseEvent.MOUSE_PRESSED:
- state = 1;
- break;
- case MouseEvent.MOUSE_RELEASED:
- state = 0;
- break;
- default:
- throw new IllegalArgumentException("Not a valid event ID: " + e.getID());
- }
- byte button;
- switch (e.getButton()) {
- case MouseEvent.NOBUTTON:
- // Nothing to do, so return
- return;
- case MouseEvent.BUTTON1:
- // Emulate right click if ctrl is down
- if (state == 1)
- saved_control_state = e.isControlDown();
- if (saved_control_state) {
- if (buttons[1] == state)
- return; // ignore
- button = (byte)1;
- } else {
- button = (byte)0;
- }
- break;
- case MouseEvent.BUTTON2:
- button = (byte)2;
- break;
- case MouseEvent.BUTTON3:
- if (buttons[1] == state)
- return; // ignore
- button = (byte)1;
- break;
- default:
- throw new IllegalArgumentException("Not a valid button: " + e.getButton());
- }
- setButton(button, state, e.getWhen()*1000000);
- }
-
- public synchronized void mousePressed(MouseEvent e) {
- handleButton(e);
- }
-
- private void setButton(byte button, byte state, long nanos) {
- buttons[button] = state;
- putMouseEvent(button, state, 0, nanos);
- }
-
- public synchronized void mouseReleased(MouseEvent e) {
- handleButton(e);
- }
-
- private void handleMotion(MouseEvent e) {
- if (grabbed) {
- updateDeltas(e.getWhen()*1000000);
- } else {
- setCursorPos(e.getX(), e.getY(), e.getWhen()*1000000);
- }
- }
-
- public synchronized void mouseDragged(MouseEvent e) {
- handleMotion(e);
- }
-
- public synchronized void mouseMoved(MouseEvent e) {
- handleMotion(e);
- }
-
- private void handleWheel(int amount, long nanos) {
- accum_dz += amount;
- putMouseEvent((byte)-1, (byte)0, amount, nanos);
- }
-
- protected void updateDeltas(long nanos) {
- }
-
- public synchronized void mouseWheelMoved(MouseWheelEvent e) {
- int wheel_amount = -e.getWheelRotation() * WHEEL_SCALE;
- handleWheel(wheel_amount, e.getWhen()*1000000);
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+/**
+ * An AWT implementation of a LWJGL compatible Mouse event queue.
+ * @author elias_naur
+ */
+
+import java.awt.Component;
+import java.awt.Point;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.awt.event.MouseMotionListener;
+import java.awt.event.MouseWheelEvent;
+import java.awt.event.MouseWheelListener;
+import java.nio.ByteBuffer;
+import java.nio.IntBuffer;
+
+import org.lwjgl.input.Mouse;
+
+class MouseEventQueue extends EventQueue implements MouseListener, MouseMotionListener, MouseWheelListener {
+ private static final int WHEEL_SCALE = 120;
+ public static final int NUM_BUTTONS = 3;
+
+ private final Component component;
+
+ private boolean grabbed;
+
+ /** The accumulated mouse deltas returned by poll() */
+ private int accum_dx;
+ private int accum_dy;
+ private int accum_dz;
+
+ /** The last mouse position */
+ private int last_x;
+ private int last_y;
+
+ /** Saved control key state for ctrl-click right button emulation */
+ private boolean saved_control_state;
+
+ /** Event scratch array */
+ private final ByteBuffer event = ByteBuffer.allocate(Mouse.EVENT_SIZE);
+
+ /** Buttons array */
+ private final byte[] buttons = new byte[NUM_BUTTONS];
+
+ MouseEventQueue(Component component) {
+ super(Mouse.EVENT_SIZE);
+ this.component = component;
+ }
+
+ public synchronized void register() {
+ resetCursorToCenter();
+ component.addMouseListener(this);
+ component.addMouseMotionListener(this);
+ component.addMouseWheelListener(this);
+ }
+
+ public synchronized void unregister() {
+ component.removeMouseListener(this);
+ component.removeMouseMotionListener(this);
+ component.removeMouseWheelListener(this);
+ }
+
+ protected Component getComponent() {
+ return component;
+ }
+
+ public synchronized void setGrabbed(boolean grabbed) {
+ this.grabbed = grabbed;
+ resetCursorToCenter();
+ }
+
+ public synchronized boolean isGrabbed() {
+ return grabbed;
+ }
+
+ private int transformY(int y) {
+ return component.getHeight() - 1 - y;
+ }
+
+ protected void resetCursorToCenter() {
+ clearEvents();
+ accum_dx = accum_dy = 0;
+ Point cursor_location = AWTUtil.getCursorPosition(component);
+ if (cursor_location != null) {
+ last_x = cursor_location.x;
+ last_y = cursor_location.y;
+ }
+ }
+
+ private void putMouseEvent(byte button, byte state, int dz, long nanos) {
+ if (grabbed)
+ putMouseEventWithCoords(button, state, 0, 0, dz, nanos);
+ else
+ putMouseEventWithCoords(button, state, last_x, last_y, dz, nanos);
+ }
+
+ protected void putMouseEventWithCoords(byte button, byte state, int coord1, int coord2, int dz, long nanos) {
+ event.clear();
+ event.put(button).put(state).putInt(coord1).putInt(coord2).putInt(dz).putLong(nanos);
+ event.flip();
+ putEvent(event);
+ }
+
+ public synchronized void poll(IntBuffer coord_buffer, ByteBuffer buttons_buffer) {
+ if ( grabbed ) {
+ coord_buffer.put(0, accum_dx);
+ coord_buffer.put(1, accum_dy);
+ } else {
+ coord_buffer.put(0, last_x);
+ coord_buffer.put(1, last_y);
+ }
+ coord_buffer.put(2, accum_dz);
+ accum_dx = accum_dy = accum_dz = 0;
+ int old_position = buttons_buffer.position();
+ buttons_buffer.put(buttons, 0, buttons.length);
+ buttons_buffer.position(old_position);
+ }
+
+ private void setCursorPos(int x, int y, long nanos) {
+ y = transformY(y);
+ if ( grabbed )
+ return;
+ int dx = x - last_x;
+ int dy = y - last_y;
+ addDelta(dx, dy);
+ last_x = x;
+ last_y = y;
+ putMouseEventWithCoords((byte)-1, (byte)0, x, y, 0, nanos);
+ }
+
+ protected void addDelta(int dx, int dy) {
+ accum_dx += dx;
+ accum_dy += dy;
+ }
+
+ public void mouseClicked(MouseEvent e) {
+ }
+
+ public void mouseEntered(MouseEvent e) {
+ }
+
+ public void mouseExited(MouseEvent e) {
+ }
+
+ private void handleButton(MouseEvent e) {
+ byte state;
+ switch (e.getID()) {
+ case MouseEvent.MOUSE_PRESSED:
+ state = 1;
+ break;
+ case MouseEvent.MOUSE_RELEASED:
+ state = 0;
+ break;
+ default:
+ throw new IllegalArgumentException("Not a valid event ID: " + e.getID());
+ }
+ byte button;
+ switch (e.getButton()) {
+ case MouseEvent.NOBUTTON:
+ // Nothing to do, so return
+ return;
+ case MouseEvent.BUTTON1:
+ // Emulate right click if ctrl is down
+ if (state == 1)
+ saved_control_state = e.isControlDown();
+ if (saved_control_state) {
+ if (buttons[1] == state)
+ return; // ignore
+ button = (byte)1;
+ } else {
+ button = (byte)0;
+ }
+ break;
+ case MouseEvent.BUTTON2:
+ button = (byte)2;
+ break;
+ case MouseEvent.BUTTON3:
+ if (buttons[1] == state)
+ return; // ignore
+ button = (byte)1;
+ break;
+ default:
+ throw new IllegalArgumentException("Not a valid button: " + e.getButton());
+ }
+ setButton(button, state, e.getWhen()*1000000);
+ }
+
+ public synchronized void mousePressed(MouseEvent e) {
+ handleButton(e);
+ }
+
+ private void setButton(byte button, byte state, long nanos) {
+ buttons[button] = state;
+ putMouseEvent(button, state, 0, nanos);
+ }
+
+ public synchronized void mouseReleased(MouseEvent e) {
+ handleButton(e);
+ }
+
+ private void handleMotion(MouseEvent e) {
+ if (grabbed) {
+ updateDeltas(e.getWhen()*1000000);
+ } else {
+ setCursorPos(e.getX(), e.getY(), e.getWhen()*1000000);
+ }
+ }
+
+ public synchronized void mouseDragged(MouseEvent e) {
+ handleMotion(e);
+ }
+
+ public synchronized void mouseMoved(MouseEvent e) {
+ handleMotion(e);
+ }
+
+ private void handleWheel(int amount, long nanos) {
+ accum_dz += amount;
+ putMouseEvent((byte)-1, (byte)0, amount, nanos);
+ }
+
+ protected void updateDeltas(long nanos) {
+ }
+
+ public synchronized void mouseWheelMoved(MouseWheelEvent e) {
+ int wheel_amount = -e.getWheelRotation() * WHEEL_SCALE;
+ handleWheel(wheel_amount, e.getWhen()*1000000);
+ }
+}
diff --git a/src/java/org/lwjgl/opengl/OpenGLException.java b/src/java/org/lwjgl/opengl/OpenGLException.java
index aad05fa..bdc7715 100644
--- a/src/java/org/lwjgl/opengl/OpenGLException.java
+++ b/src/java/org/lwjgl/opengl/OpenGLException.java
@@ -1,89 +1,89 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-/**
- * <p/>
- * Thrown by the debug build library of the LWJGL if any OpenGL operation causes an error.
- *
- * @author cix_foo <cix_foo at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: OpenGLException.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public class OpenGLException extends RuntimeException {
-
- private static final long serialVersionUID = 1L;
-
- /** Constructor for OpenGLException. */
- public OpenGLException(int gl_error_code) {
- this(createErrorMessage(gl_error_code));
- }
-
- private static String createErrorMessage(int gl_error_code) {
- String error_string = Util.translateGLErrorString(gl_error_code);
- return error_string + " (" + gl_error_code + ")";
- }
-
- /** Constructor for OpenGLException. */
- public OpenGLException() {
- super();
- }
-
- /**
- * Constructor for OpenGLException.
- *
- * @param message
- */
- public OpenGLException(String message) {
- super(message);
- }
-
- /**
- * Constructor for OpenGLException.
- *
- * @param message
- * @param cause
- */
- public OpenGLException(String message, Throwable cause) {
- super(message, cause);
- }
-
- /**
- * Constructor for OpenGLException.
- *
- * @param cause
- */
- public OpenGLException(Throwable cause) {
- super(cause);
- }
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+/**
+ * <p/>
+ * Thrown by the debug build library of the LWJGL if any OpenGL operation causes an error.
+ *
+ * @author cix_foo <cix_foo at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: OpenGLException.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public class OpenGLException extends RuntimeException {
+
+ private static final long serialVersionUID = 1L;
+
+ /** Constructor for OpenGLException. */
+ public OpenGLException(int gl_error_code) {
+ this(createErrorMessage(gl_error_code));
+ }
+
+ private static String createErrorMessage(int gl_error_code) {
+ String error_string = Util.translateGLErrorString(gl_error_code);
+ return error_string + " (" + gl_error_code + ")";
+ }
+
+ /** Constructor for OpenGLException. */
+ public OpenGLException() {
+ super();
+ }
+
+ /**
+ * Constructor for OpenGLException.
+ *
+ * @param message
+ */
+ public OpenGLException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructor for OpenGLException.
+ *
+ * @param message
+ * @param cause
+ */
+ public OpenGLException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * Constructor for OpenGLException.
+ *
+ * @param cause
+ */
+ public OpenGLException(Throwable cause) {
+ super(cause);
+ }
+
+}
diff --git a/src/java/org/lwjgl/opengl/Pbuffer.java b/src/java/org/lwjgl/opengl/Pbuffer.java
index 066328e..877b192 100644
--- a/src/java/org/lwjgl/opengl/Pbuffer.java
+++ b/src/java/org/lwjgl/opengl/Pbuffer.java
@@ -1,367 +1,367 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import java.nio.IntBuffer;
-
-import org.lwjgl.BufferUtils;
-import org.lwjgl.LWJGLException;
-import org.lwjgl.LWJGLUtil;
-import org.lwjgl.Sys;
-
-/**
- * <p/>
- * Pbuffer encapsulates an OpenGL pbuffer.
- * <p/>
- *
- * This class is thread-safe.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3116 $
- * $Id: Pbuffer.java 3116 2008-08-19 16:46:03Z spasi $
- */
-public final class Pbuffer implements Drawable {
- /**
- * Indicates that Pbuffers can be created.
- */
- public static final int PBUFFER_SUPPORTED = 1 << 0;
-
- /**
- * Indicates that Pbuffers can be used as render-textures.
- */
- public static final int RENDER_TEXTURE_SUPPORTED = 1 << 1;
-
- /**
- * Indicates that Pbuffers can be used as non-power-of-two render-textures.
- */
- public static final int RENDER_TEXTURE_RECTANGLE_SUPPORTED = 1 << 2;
-
- /**
- * Indicates that Pbuffers can be used as depth render-textures.
- */
- public static final int RENDER_DEPTH_TEXTURE_SUPPORTED = 1 << 3;
-
- /**
- * The render-to-texture mipmap level attribute.
- */
- public static final int MIPMAP_LEVEL = RenderTexture.WGL_MIPMAP_LEVEL_ARB;
-
- /**
- * The render-to-texture cube map face attribute.
- */
- public static final int CUBE_MAP_FACE = RenderTexture.WGL_CUBE_MAP_FACE_ARB;
-
- /**
- * The render-to-texture cube map positive X face value.
- */
- public static final int TEXTURE_CUBE_MAP_POSITIVE_X = RenderTexture.WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB;
-
- /**
- * The render-to-texture cube map negative X face value.
- */
- public static final int TEXTURE_CUBE_MAP_NEGATIVE_X = RenderTexture.WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB;
-
- /**
- * The render-to-texture cube map positive Y face value.
- */
- public static final int TEXTURE_CUBE_MAP_POSITIVE_Y = RenderTexture.WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB;
-
- /**
- * The render-to-texture cube map negative Y face value.
- */
- public static final int TEXTURE_CUBE_MAP_NEGATIVE_Y = RenderTexture.WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB;
-
- /**
- * The render-to-texture cube map positive Z face value.
- */
- public static final int TEXTURE_CUBE_MAP_POSITIVE_Z = RenderTexture.WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB;
-
- /**
- * The render-to-texture cube map negative Z face value.
- */
- public static final int TEXTURE_CUBE_MAP_NEGATIVE_Z = RenderTexture.WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB;
-
- /**
- * The Pbuffer front left buffer.
- */
- public static final int FRONT_LEFT_BUFFER = RenderTexture.WGL_FRONT_LEFT_ARB;
-
- /**
- * The Pbuffer front right buffer.
- */
- public static final int FRONT_RIGHT_BUFFER = RenderTexture.WGL_FRONT_RIGHT_ARB;
-
- /**
- * The Pbuffer back left buffer.
- */
- public static final int BACK_LEFT_BUFFER = RenderTexture.WGL_BACK_LEFT_ARB;
-
- /**
- * The Pbuffer back right buffer.
- */
- public static final int BACK_RIGHT_BUFFER = RenderTexture.WGL_BACK_RIGHT_ARB;
-
- /**
- * The Pbuffer depth buffer.
- */
- public static final int DEPTH_BUFFER = RenderTexture.WGL_DEPTH_COMPONENT_NV;
-
- /**
- * Handle to the native GL rendering context
- */
- private final PeerInfo peer_info;
-
- /**
- * Width
- */
- private final int width;
-
- /**
- * Height
- */
- private final int height;
-
- private final Context context;
-
- private boolean destroyed;
-
- static {
- Sys.initialize();
- }
-
- /**
- * Create an instance of a Pbuffer with a unique OpenGL context. The buffer is single-buffered.
- * <p/>
- * NOTE: The Pbuffer will have its own context that shares display lists and textures with <code>shared_context</code>,
- * or, if <code>shared_context</code> is <code>null</code>, the Display context if it is created. The Pbuffer
- * will have its own OpenGL state. Therefore, state changes to a pbuffer will not be seen in the window context and vice versa.
- * <p/>
- *
- * @param width Pbuffer width
- * @param height Pbuffer height
- * @param pixel_format Minimum Pbuffer context properties
- * @param shared_drawable If non-null the Pbuffer will share display lists and textures with it. Otherwise, the Pbuffer will share
- * with the Display context (if created).
- */
- public Pbuffer(int width, int height, PixelFormat pixel_format, Drawable shared_drawable) throws LWJGLException {
- this(width, height, pixel_format, null, shared_drawable);
- }
-
- /**
- * Create an instance of a Pbuffer with a unique OpenGL context. The buffer is single-buffered.
- * <p/>
- * NOTE: The Pbuffer will have its own context that shares display lists and textures with <code>shared_context</code>,
- * or, if <code>shared_context</code> is <code>null</code>, the Display context if it is created. The Pbuffer
- * will have its own OpenGL state. Therefore, state changes to a pbuffer will not be seen in the window context and vice versa.
- * <p/>
- * The renderTexture parameter defines the necessary state for enabling render-to-texture. When this parameter is null,
- * render-to-texture is not available. Before using render-to-texture, the Pbuffer capabilities must be queried to ensure that
- * it is supported. Currently only windows platform can support this feature, so it is recommended that EXT_framebuffer_object
- * or similar is used if available, for maximum portability.
- * <p/>
- *
- * @param width Pbuffer width
- * @param height Pbuffer height
- * @param pixel_format Minimum Pbuffer context properties
- * @param renderTexture
- * @param shared_drawable If non-null the Pbuffer will share display lists and textures with it. Otherwise, the Pbuffer will share
- * with the Display context (if created).
- */
- public Pbuffer(int width, int height, PixelFormat pixel_format, RenderTexture renderTexture, Drawable shared_drawable) throws LWJGLException {
- this(width, height, pixel_format, renderTexture, shared_drawable, null);
- }
-
- /**
- * Create an instance of a Pbuffer with a unique OpenGL context. The buffer is single-buffered.
- * <p/>
- * NOTE: The Pbuffer will have its own context that shares display lists and textures with <code>shared_context</code>,
- * or, if <code>shared_context</code> is <code>null</code>, the Display context if it is created. The Pbuffer
- * will have its own OpenGL state. Therefore, state changes to a pbuffer will not be seen in the window context and vice versa.
- * <p/>
- * The renderTexture parameter defines the necessary state for enabling render-to-texture. When this parameter is null,
- * render-to-texture is not available. Before using render-to-texture, the Pbuffer capabilities must be queried to ensure that
- * it is supported. Currently only windows platform can support this feature, so it is recommended that EXT_framebuffer_object
- * or similar is used if available, for maximum portability.
- * <p/>
- *
- * @param width Pbuffer width
- * @param height Pbuffer height
- * @param pixel_format Minimum Pbuffer context properties
- * @param renderTexture
- * @param shared_drawable If non-null the Pbuffer will share display lists and textures with it. Otherwise, the Pbuffer will share
- * with the Display context (if created).
- * @param attribs The ContextAttribs to use when creating the context. (optional, may be null)
- */
- public Pbuffer(int width, int height, PixelFormat pixel_format, RenderTexture renderTexture, Drawable shared_drawable, ContextAttribs attribs) throws LWJGLException {
- if (pixel_format == null)
- throw new NullPointerException("Pixel format must be non-null");
- this.width = width;
- this.height = height;
- this.peer_info = createPbuffer(width, height, pixel_format, renderTexture);
- Context shared_context = null;
- if (shared_drawable != null) {
- shared_context = shared_drawable.getContext();
- } else {
- Drawable display_drawable = Display.getDrawable();
- if (display_drawable != null)
- shared_context = display_drawable.getContext();
- }
- this.context = new Context(peer_info, attribs, shared_context);
- }
-
- private static PeerInfo createPbuffer(int width, int height, PixelFormat pixel_format, RenderTexture renderTexture) throws LWJGLException {
- if ( renderTexture == null ) {
- // Though null is a perfectly valid argument, Matrox Parhelia drivers expect
- // a 0 terminated list, or else they crash. Supplying NULL or 0, should
- // cause the drivers to use default settings
- IntBuffer defaultAttribs = BufferUtils.createIntBuffer(1);
- return Display.getImplementation().createPbuffer(width, height, pixel_format, null, defaultAttribs);
- } else
- return Display.getImplementation().createPbuffer(width, height, pixel_format,
- renderTexture.pixelFormatCaps,
- renderTexture.pBufferAttribs);
- }
-
- public Context getContext() {
- return context;
- }
-
- private void checkDestroyed() {
- if (destroyed)
- throw new IllegalStateException("Pbuffer is destroyed");
- }
-
- /**
- * Method to test for validity of the buffer. If this function returns true, the buffer contents is lost. The buffer can still
- * be used, but the results are undefined. The application is expected to release the buffer if needed, destroy it and recreate
- * a new buffer.
- *
- * @return true if the buffer is lost and destroyed, false if the buffer is valid.
- */
- public synchronized boolean isBufferLost() {
- checkDestroyed();
- return Display.getImplementation().isBufferLost(peer_info);
- }
-
- /**
- * Method to make the Pbuffer context current. All subsequent OpenGL calls will go to this buffer.
- * @throws LWJGLException if the context could not be made current
- */
- public synchronized void makeCurrent() throws LWJGLException {
- checkDestroyed();
- context.makeCurrent();
- }
-
- /**
- * Gets the Pbuffer capabilities.
- *
- * @return a bitmask of Pbuffer capabilities.
- */
- public static int getCapabilities() {
- return Display.getImplementation().getPbufferCapabilities();
- }
-
- /**
- * Destroys the Pbuffer. After this call, there will be no valid GL rendering context - regardless of whether this Pbuffer was
- * the current rendering context or not.
- */
- public synchronized void destroy() {
- if (destroyed)
- return;
- try {
- context.forceDestroy();
- peer_info.destroy();
- destroyed = true;
- } catch (LWJGLException e) {
- LWJGLUtil.log("Exception occurred while destroying pbuffer: " + e);
- }
- }
-
- // -----------------------------------------------------------------------------------------
- // ------------------------------- Render-to-Texture Methods -------------------------------
- // -----------------------------------------------------------------------------------------
-
- /**
- * Sets a render-to-texture attribute.
- * <p/>
- * The attrib parameter can be one of MIPMAP_LEVEL and CUBE_MAP_FACE. When the attrib parameter is CUBE_MAP_FACE then the value
- * parameter can be on of the following:
- * <p/>
- * TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y
- * TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z
- *
- * @param attrib
- * @param value
- */
- public synchronized void setAttrib(int attrib, int value) {
- checkDestroyed();
- Display.getImplementation().setPbufferAttrib(peer_info, attrib, value);
- }
-
- /**
- * Binds the currently bound texture to the buffer specified. The buffer can be one of the following:
- * <p/>
- * FRONT_LEFT_BUFFER FRONT_RIGHT_BUFFER BACK_LEFT_BUFFER BACK_RIGHT_BUFFER DEPTH_BUFFER
- *
- * @param buffer
- */
- public synchronized void bindTexImage(int buffer) {
- checkDestroyed();
- Display.getImplementation().bindTexImageToPbuffer(peer_info, buffer);
- }
-
- /**
- * Releases the currently bound texture from the buffer specified.
- *
- * @param buffer
- */
- public synchronized void releaseTexImage(int buffer) {
- checkDestroyed();
- Display.getImplementation().releaseTexImageFromPbuffer(peer_info, buffer);
- }
-
- /**
- * @return Returns the height.
- */
- public synchronized int getHeight() {
- checkDestroyed();
- return height;
- }
-
- /**
- * @return Returns the width.
- */
- public synchronized int getWidth() {
- checkDestroyed();
- return width;
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import java.nio.IntBuffer;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.LWJGLException;
+import org.lwjgl.LWJGLUtil;
+import org.lwjgl.Sys;
+
+/**
+ * <p/>
+ * Pbuffer encapsulates an OpenGL pbuffer.
+ * <p/>
+ *
+ * This class is thread-safe.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3116 $
+ * $Id: Pbuffer.java 3116 2008-08-19 16:46:03Z spasi $
+ */
+public final class Pbuffer implements Drawable {
+ /**
+ * Indicates that Pbuffers can be created.
+ */
+ public static final int PBUFFER_SUPPORTED = 1 << 0;
+
+ /**
+ * Indicates that Pbuffers can be used as render-textures.
+ */
+ public static final int RENDER_TEXTURE_SUPPORTED = 1 << 1;
+
+ /**
+ * Indicates that Pbuffers can be used as non-power-of-two render-textures.
+ */
+ public static final int RENDER_TEXTURE_RECTANGLE_SUPPORTED = 1 << 2;
+
+ /**
+ * Indicates that Pbuffers can be used as depth render-textures.
+ */
+ public static final int RENDER_DEPTH_TEXTURE_SUPPORTED = 1 << 3;
+
+ /**
+ * The render-to-texture mipmap level attribute.
+ */
+ public static final int MIPMAP_LEVEL = RenderTexture.WGL_MIPMAP_LEVEL_ARB;
+
+ /**
+ * The render-to-texture cube map face attribute.
+ */
+ public static final int CUBE_MAP_FACE = RenderTexture.WGL_CUBE_MAP_FACE_ARB;
+
+ /**
+ * The render-to-texture cube map positive X face value.
+ */
+ public static final int TEXTURE_CUBE_MAP_POSITIVE_X = RenderTexture.WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB;
+
+ /**
+ * The render-to-texture cube map negative X face value.
+ */
+ public static final int TEXTURE_CUBE_MAP_NEGATIVE_X = RenderTexture.WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB;
+
+ /**
+ * The render-to-texture cube map positive Y face value.
+ */
+ public static final int TEXTURE_CUBE_MAP_POSITIVE_Y = RenderTexture.WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB;
+
+ /**
+ * The render-to-texture cube map negative Y face value.
+ */
+ public static final int TEXTURE_CUBE_MAP_NEGATIVE_Y = RenderTexture.WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB;
+
+ /**
+ * The render-to-texture cube map positive Z face value.
+ */
+ public static final int TEXTURE_CUBE_MAP_POSITIVE_Z = RenderTexture.WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB;
+
+ /**
+ * The render-to-texture cube map negative Z face value.
+ */
+ public static final int TEXTURE_CUBE_MAP_NEGATIVE_Z = RenderTexture.WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB;
+
+ /**
+ * The Pbuffer front left buffer.
+ */
+ public static final int FRONT_LEFT_BUFFER = RenderTexture.WGL_FRONT_LEFT_ARB;
+
+ /**
+ * The Pbuffer front right buffer.
+ */
+ public static final int FRONT_RIGHT_BUFFER = RenderTexture.WGL_FRONT_RIGHT_ARB;
+
+ /**
+ * The Pbuffer back left buffer.
+ */
+ public static final int BACK_LEFT_BUFFER = RenderTexture.WGL_BACK_LEFT_ARB;
+
+ /**
+ * The Pbuffer back right buffer.
+ */
+ public static final int BACK_RIGHT_BUFFER = RenderTexture.WGL_BACK_RIGHT_ARB;
+
+ /**
+ * The Pbuffer depth buffer.
+ */
+ public static final int DEPTH_BUFFER = RenderTexture.WGL_DEPTH_COMPONENT_NV;
+
+ /**
+ * Handle to the native GL rendering context
+ */
+ private final PeerInfo peer_info;
+
+ /**
+ * Width
+ */
+ private final int width;
+
+ /**
+ * Height
+ */
+ private final int height;
+
+ private final Context context;
+
+ private boolean destroyed;
+
+ static {
+ Sys.initialize();
+ }
+
+ /**
+ * Create an instance of a Pbuffer with a unique OpenGL context. The buffer is single-buffered.
+ * <p/>
+ * NOTE: The Pbuffer will have its own context that shares display lists and textures with <code>shared_context</code>,
+ * or, if <code>shared_context</code> is <code>null</code>, the Display context if it is created. The Pbuffer
+ * will have its own OpenGL state. Therefore, state changes to a pbuffer will not be seen in the window context and vice versa.
+ * <p/>
+ *
+ * @param width Pbuffer width
+ * @param height Pbuffer height
+ * @param pixel_format Minimum Pbuffer context properties
+ * @param shared_drawable If non-null the Pbuffer will share display lists and textures with it. Otherwise, the Pbuffer will share
+ * with the Display context (if created).
+ */
+ public Pbuffer(int width, int height, PixelFormat pixel_format, Drawable shared_drawable) throws LWJGLException {
+ this(width, height, pixel_format, null, shared_drawable);
+ }
+
+ /**
+ * Create an instance of a Pbuffer with a unique OpenGL context. The buffer is single-buffered.
+ * <p/>
+ * NOTE: The Pbuffer will have its own context that shares display lists and textures with <code>shared_context</code>,
+ * or, if <code>shared_context</code> is <code>null</code>, the Display context if it is created. The Pbuffer
+ * will have its own OpenGL state. Therefore, state changes to a pbuffer will not be seen in the window context and vice versa.
+ * <p/>
+ * The renderTexture parameter defines the necessary state for enabling render-to-texture. When this parameter is null,
+ * render-to-texture is not available. Before using render-to-texture, the Pbuffer capabilities must be queried to ensure that
+ * it is supported. Currently only windows platform can support this feature, so it is recommended that EXT_framebuffer_object
+ * or similar is used if available, for maximum portability.
+ * <p/>
+ *
+ * @param width Pbuffer width
+ * @param height Pbuffer height
+ * @param pixel_format Minimum Pbuffer context properties
+ * @param renderTexture
+ * @param shared_drawable If non-null the Pbuffer will share display lists and textures with it. Otherwise, the Pbuffer will share
+ * with the Display context (if created).
+ */
+ public Pbuffer(int width, int height, PixelFormat pixel_format, RenderTexture renderTexture, Drawable shared_drawable) throws LWJGLException {
+ this(width, height, pixel_format, renderTexture, shared_drawable, null);
+ }
+
+ /**
+ * Create an instance of a Pbuffer with a unique OpenGL context. The buffer is single-buffered.
+ * <p/>
+ * NOTE: The Pbuffer will have its own context that shares display lists and textures with <code>shared_context</code>,
+ * or, if <code>shared_context</code> is <code>null</code>, the Display context if it is created. The Pbuffer
+ * will have its own OpenGL state. Therefore, state changes to a pbuffer will not be seen in the window context and vice versa.
+ * <p/>
+ * The renderTexture parameter defines the necessary state for enabling render-to-texture. When this parameter is null,
+ * render-to-texture is not available. Before using render-to-texture, the Pbuffer capabilities must be queried to ensure that
+ * it is supported. Currently only windows platform can support this feature, so it is recommended that EXT_framebuffer_object
+ * or similar is used if available, for maximum portability.
+ * <p/>
+ *
+ * @param width Pbuffer width
+ * @param height Pbuffer height
+ * @param pixel_format Minimum Pbuffer context properties
+ * @param renderTexture
+ * @param shared_drawable If non-null the Pbuffer will share display lists and textures with it. Otherwise, the Pbuffer will share
+ * with the Display context (if created).
+ * @param attribs The ContextAttribs to use when creating the context. (optional, may be null)
+ */
+ public Pbuffer(int width, int height, PixelFormat pixel_format, RenderTexture renderTexture, Drawable shared_drawable, ContextAttribs attribs) throws LWJGLException {
+ if (pixel_format == null)
+ throw new NullPointerException("Pixel format must be non-null");
+ this.width = width;
+ this.height = height;
+ this.peer_info = createPbuffer(width, height, pixel_format, renderTexture);
+ Context shared_context = null;
+ if (shared_drawable != null) {
+ shared_context = shared_drawable.getContext();
+ } else {
+ Drawable display_drawable = Display.getDrawable();
+ if (display_drawable != null)
+ shared_context = display_drawable.getContext();
+ }
+ this.context = new Context(peer_info, attribs, shared_context);
+ }
+
+ private static PeerInfo createPbuffer(int width, int height, PixelFormat pixel_format, RenderTexture renderTexture) throws LWJGLException {
+ if ( renderTexture == null ) {
+ // Though null is a perfectly valid argument, Matrox Parhelia drivers expect
+ // a 0 terminated list, or else they crash. Supplying NULL or 0, should
+ // cause the drivers to use default settings
+ IntBuffer defaultAttribs = BufferUtils.createIntBuffer(1);
+ return Display.getImplementation().createPbuffer(width, height, pixel_format, null, defaultAttribs);
+ } else
+ return Display.getImplementation().createPbuffer(width, height, pixel_format,
+ renderTexture.pixelFormatCaps,
+ renderTexture.pBufferAttribs);
+ }
+
+ public Context getContext() {
+ return context;
+ }
+
+ private void checkDestroyed() {
+ if (destroyed)
+ throw new IllegalStateException("Pbuffer is destroyed");
+ }
+
+ /**
+ * Method to test for validity of the buffer. If this function returns true, the buffer contents is lost. The buffer can still
+ * be used, but the results are undefined. The application is expected to release the buffer if needed, destroy it and recreate
+ * a new buffer.
+ *
+ * @return true if the buffer is lost and destroyed, false if the buffer is valid.
+ */
+ public synchronized boolean isBufferLost() {
+ checkDestroyed();
+ return Display.getImplementation().isBufferLost(peer_info);
+ }
+
+ /**
+ * Method to make the Pbuffer context current. All subsequent OpenGL calls will go to this buffer.
+ * @throws LWJGLException if the context could not be made current
+ */
+ public synchronized void makeCurrent() throws LWJGLException {
+ checkDestroyed();
+ context.makeCurrent();
+ }
+
+ /**
+ * Gets the Pbuffer capabilities.
+ *
+ * @return a bitmask of Pbuffer capabilities.
+ */
+ public static int getCapabilities() {
+ return Display.getImplementation().getPbufferCapabilities();
+ }
+
+ /**
+ * Destroys the Pbuffer. After this call, there will be no valid GL rendering context - regardless of whether this Pbuffer was
+ * the current rendering context or not.
+ */
+ public synchronized void destroy() {
+ if (destroyed)
+ return;
+ try {
+ context.forceDestroy();
+ peer_info.destroy();
+ destroyed = true;
+ } catch (LWJGLException e) {
+ LWJGLUtil.log("Exception occurred while destroying pbuffer: " + e);
+ }
+ }
+
+ // -----------------------------------------------------------------------------------------
+ // ------------------------------- Render-to-Texture Methods -------------------------------
+ // -----------------------------------------------------------------------------------------
+
+ /**
+ * Sets a render-to-texture attribute.
+ * <p/>
+ * The attrib parameter can be one of MIPMAP_LEVEL and CUBE_MAP_FACE. When the attrib parameter is CUBE_MAP_FACE then the value
+ * parameter can be on of the following:
+ * <p/>
+ * TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y
+ * TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z
+ *
+ * @param attrib
+ * @param value
+ */
+ public synchronized void setAttrib(int attrib, int value) {
+ checkDestroyed();
+ Display.getImplementation().setPbufferAttrib(peer_info, attrib, value);
+ }
+
+ /**
+ * Binds the currently bound texture to the buffer specified. The buffer can be one of the following:
+ * <p/>
+ * FRONT_LEFT_BUFFER FRONT_RIGHT_BUFFER BACK_LEFT_BUFFER BACK_RIGHT_BUFFER DEPTH_BUFFER
+ *
+ * @param buffer
+ */
+ public synchronized void bindTexImage(int buffer) {
+ checkDestroyed();
+ Display.getImplementation().bindTexImageToPbuffer(peer_info, buffer);
+ }
+
+ /**
+ * Releases the currently bound texture from the buffer specified.
+ *
+ * @param buffer
+ */
+ public synchronized void releaseTexImage(int buffer) {
+ checkDestroyed();
+ Display.getImplementation().releaseTexImageFromPbuffer(peer_info, buffer);
+ }
+
+ /**
+ * @return Returns the height.
+ */
+ public synchronized int getHeight() {
+ checkDestroyed();
+ return height;
+ }
+
+ /**
+ * @return Returns the width.
+ */
+ public synchronized int getWidth() {
+ checkDestroyed();
+ return width;
+ }
+}
diff --git a/src/java/org/lwjgl/opengl/PeerInfo.java b/src/java/org/lwjgl/opengl/PeerInfo.java
index 26c9563..bc3386c 100644
--- a/src/java/org/lwjgl/opengl/PeerInfo.java
+++ b/src/java/org/lwjgl/opengl/PeerInfo.java
@@ -1,97 +1,97 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import java.nio.ByteBuffer;
-
-import org.lwjgl.LWJGLException;
-import org.lwjgl.LWJGLUtil;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3116 $
- * $Id: PeerInfo.java 3116 2008-08-19 16:46:03Z spasi $
- */
-abstract class PeerInfo {
- private final ByteBuffer handle;
- private Thread locking_thread; // Thread that has locked this PeerInfo
- private int lock_count;
-
- protected PeerInfo(ByteBuffer handle) {
- this.handle = handle;
- }
-
- private void lockAndInitHandle() throws LWJGLException {
- doLockAndInitHandle();
- }
-
- public synchronized final void unlock() throws LWJGLException {
- if (lock_count <= 0)
- throw new IllegalStateException("PeerInfo not locked!");
- if (Thread.currentThread() != locking_thread)
- throw new IllegalStateException("PeerInfo already locked by " + locking_thread);
- lock_count--;
- if (lock_count == 0) {
- doUnlock();
- locking_thread = null;
- notify();
- }
- }
-
- protected abstract void doLockAndInitHandle() throws LWJGLException;
- protected abstract void doUnlock() throws LWJGLException;
-
- public synchronized final ByteBuffer lockAndGetHandle() throws LWJGLException {
- Thread this_thread = Thread.currentThread();
- while (locking_thread != null && locking_thread != this_thread) {
- try {
- wait();
- } catch (InterruptedException e) {
- LWJGLUtil.log("Interrupted while waiting for PeerInfo lock: " + e);
- }
- }
- if (lock_count == 0) {
- locking_thread = this_thread;
- doLockAndInitHandle();
- }
- lock_count++;
- return getHandle();
- }
-
- protected final ByteBuffer getHandle() {
- return handle;
- }
-
- public void destroy() {
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import java.nio.ByteBuffer;
+
+import org.lwjgl.LWJGLException;
+import org.lwjgl.LWJGLUtil;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3116 $
+ * $Id: PeerInfo.java 3116 2008-08-19 16:46:03Z spasi $
+ */
+abstract class PeerInfo {
+ private final ByteBuffer handle;
+ private Thread locking_thread; // Thread that has locked this PeerInfo
+ private int lock_count;
+
+ protected PeerInfo(ByteBuffer handle) {
+ this.handle = handle;
+ }
+
+ private void lockAndInitHandle() throws LWJGLException {
+ doLockAndInitHandle();
+ }
+
+ public synchronized final void unlock() throws LWJGLException {
+ if (lock_count <= 0)
+ throw new IllegalStateException("PeerInfo not locked!");
+ if (Thread.currentThread() != locking_thread)
+ throw new IllegalStateException("PeerInfo already locked by " + locking_thread);
+ lock_count--;
+ if (lock_count == 0) {
+ doUnlock();
+ locking_thread = null;
+ notify();
+ }
+ }
+
+ protected abstract void doLockAndInitHandle() throws LWJGLException;
+ protected abstract void doUnlock() throws LWJGLException;
+
+ public synchronized final ByteBuffer lockAndGetHandle() throws LWJGLException {
+ Thread this_thread = Thread.currentThread();
+ while (locking_thread != null && locking_thread != this_thread) {
+ try {
+ wait();
+ } catch (InterruptedException e) {
+ LWJGLUtil.log("Interrupted while waiting for PeerInfo lock: " + e);
+ }
+ }
+ if (lock_count == 0) {
+ locking_thread = this_thread;
+ doLockAndInitHandle();
+ }
+ lock_count++;
+ return getHandle();
+ }
+
+ protected final ByteBuffer getHandle() {
+ return handle;
+ }
+
+ public void destroy() {
+ }
+}
diff --git a/src/java/org/lwjgl/opengl/PixelFormat.java b/src/java/org/lwjgl/opengl/PixelFormat.java
index a94233f..5219367 100644
--- a/src/java/org/lwjgl/opengl/PixelFormat.java
+++ b/src/java/org/lwjgl/opengl/PixelFormat.java
@@ -1,378 +1,378 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-/**
- * This class describes pixel format properties for an OpenGL context. Instances
- * of this class is used as arguments to Display.create(), Pbuffer.create() and
- * AWTGLCanvas, to indicate minimum required properties.
- * <p/>
- * Instants of this class are immutable. An example of the expected way to set
- * the PixelFormat property values is the following:
- * <code>PixelFormat pf = new PixelFormat().withDepth(24).withSamples(4).withSRGB(true);</code>
- * <p/>
- * WARNING: Some pixel formats are known to cause troubles on certain buggy drivers.
- * Example: Under Windows, specifying samples != 0 will enable the ARB
- * pixel format selection path, which could trigger a crash.
- *
- * @author elias_naur at sourceforge.net
- * @version $Revision: 3116 $
- */
-
-public final class PixelFormat {
-
- /**
- * The number of bits per pixel, exluding alpha.
- * This parameter is ignored in Display.create().
- */
- private int bpp;
- /** The number of alpha bits. */
- private int alpha;
- /** The number of depth buffer bits */
- private int depth;
- /** The number of stencil bits */
- private int stencil;
- /**
- * The number of samples to use in anti-aliasing.
- * 0 means that anti-aliasing is disabled.
- */
- private int samples;
- /** The number of auxiliary buffers */
- private int num_aux_buffers;
- /** The number of bits per pixel in the accumulation buffer */
- private int accum_bpp;
- /** The number of alpha bits in the accumulation buffer */
- private int accum_alpha;
- /** Whether this format requires a stereo buffer */
- private boolean stereo;
- /** Whether this format specifies a floating point format */
- private boolean floating_point;
- /** Whether this format specifies a packed floating point format (32 bit unsigned - R11F_G11F_B10F) */
- private boolean floating_point_packed;
- /** Whether this format specifies an sRGB format */
- private boolean sRGB;
-
- /**
- * Default pixel format is minimum 8 bits depth, and no alpha
- * nor stencil requirements.
- */
- public PixelFormat() {
- this(0, 8, 0);
- }
-
- public PixelFormat(int alpha, int depth, int stencil) {
- this(alpha, depth, stencil, 0);
- }
-
- public PixelFormat(int alpha, int depth, int stencil, int samples) {
- this(0, alpha, depth, stencil, samples);
- }
-
- public PixelFormat(int bpp, int alpha, int depth, int stencil, int samples) {
- this(bpp, alpha, depth, stencil, samples, 0, 0, 0, false);
- }
-
- public PixelFormat(int bpp, int alpha, int depth, int stencil, int samples, int num_aux_buffers, int accum_bpp, int accum_alpha, boolean stereo) {
- this(bpp, alpha, depth, stencil, samples, num_aux_buffers, accum_bpp, accum_alpha, stereo, false);
- }
-
- public PixelFormat(int bpp, int alpha, int depth, int stencil, int samples, int num_aux_buffers, int accum_bpp, int accum_alpha, boolean stereo, boolean floating_point) {
- this.bpp = bpp;
- this.alpha = alpha;
- this.depth = depth;
- this.stencil = stencil;
-
- this.samples = samples;
-
- this.num_aux_buffers = num_aux_buffers;
-
- this.accum_bpp = accum_bpp;
- this.accum_alpha = accum_alpha;
-
- this.stereo = stereo;
-
- this.floating_point = floating_point;
- this.floating_point_packed = false;
- this.sRGB = false;
- }
-
- private PixelFormat(final PixelFormat pf) {
- this.bpp = pf.bpp;
- this.alpha = pf.alpha;
- this.depth = pf.depth;
- this.stencil = pf.stencil;
-
- this.samples = pf.samples;
-
- this.num_aux_buffers = pf.num_aux_buffers;
-
- this.accum_bpp = pf.accum_bpp;
- this.accum_alpha = pf.accum_alpha;
-
- this.stereo = pf.stereo;
-
- this.floating_point = pf.floating_point;
- this.floating_point_packed = pf.floating_point_packed;
- this.sRGB = pf.sRGB;
- }
-
- public int getBitsPerPixel() {
- return bpp;
- }
-
- /**
- * Returns a new PixelFormat object with the same properties as this PixelFormat and the new bits per pixel value.
- *
- * @param bpp the new bits per pixel value.
- *
- * @return the new PixelFormat
- */
- public PixelFormat withBitsPerPixel(final int bpp) {
- if ( bpp < 0 )
- throw new IllegalArgumentException("Invalid number of bits per pixel specified: " + bpp);
-
- final PixelFormat pf = new PixelFormat(this);
- pf.bpp = bpp;
- return pf;
- }
-
- public int getAlphaBits() {
- return alpha;
- }
-
- /**
- * Returns a new PixelFormat object with the same properties as this PixelFormat and the new alpha bits value.
- *
- * @param alpha the new alpha bits value.
- *
- * @return the new PixelFormat
- */
- public PixelFormat withAlphaBits(final int alpha) {
- if ( alpha < 0 )
- throw new IllegalArgumentException("Invalid number of alpha bits specified: " + alpha);
-
- final PixelFormat pf = new PixelFormat(this);
- pf.alpha = alpha;
- return pf;
- }
-
- public int getDepthBits() {
- return depth;
- }
-
- /**
- * Returns a new PixelFormat object with the same properties as this PixelFormat and the new depth bits value.
- *
- * @param depth the new depth bits value.
- *
- * @return the new PixelFormat
- */
- public PixelFormat withDepthBits(final int depth) {
- if ( depth < 0 )
- throw new IllegalArgumentException("Invalid number of depth bits specified: " + depth);
-
- final PixelFormat pf = new PixelFormat(this);
- pf.depth = depth;
- return pf;
- }
-
- public int getStencilBits() {
- return stencil;
- }
-
- /**
- * Returns a new PixelFormat object with the same properties as this PixelFormat and the new stencil bits value.
- *
- * @param stencil the new stencil bits value.
- *
- * @return the new PixelFormat
- */
- public PixelFormat withStencilBits(final int stencil) {
- if ( stencil < 0 )
- throw new IllegalArgumentException("Invalid number of stencil bits specified: " + stencil);
-
- final PixelFormat pf = new PixelFormat(this);
- pf.stencil = stencil;
- return pf;
- }
-
- public int getSamples() {
- return samples;
- }
-
- /**
- * Returns a new PixelFormat object with the same properties as this PixelFormat and the new samples value.
- *
- * @param samples the new samples value.
- *
- * @return the new PixelFormat
- */
- public PixelFormat withSamples(final int samples) {
- if ( samples < 0 )
- throw new IllegalArgumentException("Invalid number of samples specified: " + samples);
-
- final PixelFormat pf = new PixelFormat(this);
- pf.samples = samples;
- return pf;
- }
-
- public int getAuxBuffers() {
- return num_aux_buffers;
- }
-
- /**
- * Returns a new PixelFormat object with the same properties as this PixelFormat and the new auxiliary buffers value.
- *
- * @param num_aux_buffers the new auxiliary buffers value.
- *
- * @return the new PixelFormat
- */
- public PixelFormat withAuxBuffers(final int num_aux_buffers) {
- if ( num_aux_buffers < 0 )
- throw new IllegalArgumentException("Invalid number of auxiliary buffers specified: " + num_aux_buffers);
-
- final PixelFormat pf = new PixelFormat(this);
- pf.num_aux_buffers = num_aux_buffers;
- return pf;
- }
-
- public int getAccumulationBitsPerPixel() {
- return accum_bpp;
- }
-
- /**
- * Returns a new PixelFormat object with the same properties as this PixelFormat and the new bits per pixel in the accumulation buffer value.
- *
- * @param accum_bpp the new bits per pixel in the accumulation buffer value.
- *
- * @return the new PixelFormat
- */
- public PixelFormat withAccumulationBitsPerPixel(final int accum_bpp) {
- if ( accum_bpp < 0 )
- throw new IllegalArgumentException("Invalid number of bits per pixel in the accumulation buffer specified: " + accum_bpp);
-
- final PixelFormat pf = new PixelFormat(this);
- pf.accum_bpp = accum_bpp;
- return pf;
- }
-
- public int getAccumulationAlpha() {
- return accum_alpha;
- }
-
- /**
- * Returns a new PixelFormat object with the same properties as this PixelFormat and the new alpha bits in the accumulation buffer value.
- *
- * @param accum_alpha the new alpha bits in the accumulation buffer value.
- *
- * @return the new PixelFormat
- */
- public PixelFormat withAccumulationAlpha(final int accum_alpha) {
- if ( accum_alpha < 0 )
- throw new IllegalArgumentException("Invalid number of alpha bits in the accumulation buffer specified: " + accum_alpha);
-
- final PixelFormat pf = new PixelFormat(this);
- pf.accum_alpha = accum_alpha;
- return pf;
- }
-
- public boolean isStereo() {
- return stereo;
- }
-
- /**
- * Returns a new PixelFormat object with the same properties as this PixelFormat and the new stereo value.
- *
- * @param stereo the new stereo value.
- *
- * @return the new PixelFormat
- */
- public PixelFormat withStereo(final boolean stereo) {
- final PixelFormat pf = new PixelFormat(this);
- pf.stereo = stereo;
- return pf;
- }
-
- public boolean isFloatingPoint() {
- return floating_point;
- }
-
- /**
- * Returns a new PixelFormat object with the same properties as this PixelFormat and the new floating point value.
- * If floating_point is true, floating_point_packed will be reset to false.
- *
- * @param floating_point the new floating point value.
- *
- * @return the new PixelFormat
- */
- public PixelFormat withFloatingPoint(final boolean floating_point) {
- final PixelFormat pf = new PixelFormat(this);
- pf.floating_point = floating_point;
- if ( floating_point )
- pf.floating_point_packed = false;
- return pf;
- }
-
- /**
- * Returns a new PixelFormat object with the same properties as this PixelFormat and the new packed floating point value.
- * If floating_point_packed is true, floating_point will be reset to false.
- *
- * @param floating_point_packed the new packed floating point value.
- *
- * @return the new PixelFormat
- */
- public PixelFormat withFloatingPointPacked(final boolean floating_point_packed) {
- final PixelFormat pf = new PixelFormat(this);
- pf.floating_point_packed = floating_point_packed;
- if ( floating_point_packed )
- pf.floating_point = false;
- return pf;
- }
-
- public boolean isSRGB() {
- return sRGB;
- }
-
- /**
- * Returns a new PixelFormat object with the same properties as this PixelFormat and the new sRGB value.
- *
- * @param sRGB the new floating point value.
- *
- * @return the new PixelFormat
- */
- public PixelFormat withSRGB(final boolean sRGB) {
- final PixelFormat pf = new PixelFormat(this);
- pf.sRGB = sRGB;
- return pf;
- }
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+/**
+ * This class describes pixel format properties for an OpenGL context. Instances
+ * of this class is used as arguments to Display.create(), Pbuffer.create() and
+ * AWTGLCanvas, to indicate minimum required properties.
+ * <p/>
+ * Instants of this class are immutable. An example of the expected way to set
+ * the PixelFormat property values is the following:
+ * <code>PixelFormat pf = new PixelFormat().withDepth(24).withSamples(4).withSRGB(true);</code>
+ * <p/>
+ * WARNING: Some pixel formats are known to cause troubles on certain buggy drivers.
+ * Example: Under Windows, specifying samples != 0 will enable the ARB
+ * pixel format selection path, which could trigger a crash.
+ *
+ * @author elias_naur at sourceforge.net
+ * @version $Revision: 3116 $
+ */
+
+public final class PixelFormat {
+
+ /**
+ * The number of bits per pixel, exluding alpha.
+ * This parameter is ignored in Display.create().
+ */
+ private int bpp;
+ /** The number of alpha bits. */
+ private int alpha;
+ /** The number of depth buffer bits */
+ private int depth;
+ /** The number of stencil bits */
+ private int stencil;
+ /**
+ * The number of samples to use in anti-aliasing.
+ * 0 means that anti-aliasing is disabled.
+ */
+ private int samples;
+ /** The number of auxiliary buffers */
+ private int num_aux_buffers;
+ /** The number of bits per pixel in the accumulation buffer */
+ private int accum_bpp;
+ /** The number of alpha bits in the accumulation buffer */
+ private int accum_alpha;
+ /** Whether this format requires a stereo buffer */
+ private boolean stereo;
+ /** Whether this format specifies a floating point format */
+ private boolean floating_point;
+ /** Whether this format specifies a packed floating point format (32 bit unsigned - R11F_G11F_B10F) */
+ private boolean floating_point_packed;
+ /** Whether this format specifies an sRGB format */
+ private boolean sRGB;
+
+ /**
+ * Default pixel format is minimum 8 bits depth, and no alpha
+ * nor stencil requirements.
+ */
+ public PixelFormat() {
+ this(0, 8, 0);
+ }
+
+ public PixelFormat(int alpha, int depth, int stencil) {
+ this(alpha, depth, stencil, 0);
+ }
+
+ public PixelFormat(int alpha, int depth, int stencil, int samples) {
+ this(0, alpha, depth, stencil, samples);
+ }
+
+ public PixelFormat(int bpp, int alpha, int depth, int stencil, int samples) {
+ this(bpp, alpha, depth, stencil, samples, 0, 0, 0, false);
+ }
+
+ public PixelFormat(int bpp, int alpha, int depth, int stencil, int samples, int num_aux_buffers, int accum_bpp, int accum_alpha, boolean stereo) {
+ this(bpp, alpha, depth, stencil, samples, num_aux_buffers, accum_bpp, accum_alpha, stereo, false);
+ }
+
+ public PixelFormat(int bpp, int alpha, int depth, int stencil, int samples, int num_aux_buffers, int accum_bpp, int accum_alpha, boolean stereo, boolean floating_point) {
+ this.bpp = bpp;
+ this.alpha = alpha;
+ this.depth = depth;
+ this.stencil = stencil;
+
+ this.samples = samples;
+
+ this.num_aux_buffers = num_aux_buffers;
+
+ this.accum_bpp = accum_bpp;
+ this.accum_alpha = accum_alpha;
+
+ this.stereo = stereo;
+
+ this.floating_point = floating_point;
+ this.floating_point_packed = false;
+ this.sRGB = false;
+ }
+
+ private PixelFormat(final PixelFormat pf) {
+ this.bpp = pf.bpp;
+ this.alpha = pf.alpha;
+ this.depth = pf.depth;
+ this.stencil = pf.stencil;
+
+ this.samples = pf.samples;
+
+ this.num_aux_buffers = pf.num_aux_buffers;
+
+ this.accum_bpp = pf.accum_bpp;
+ this.accum_alpha = pf.accum_alpha;
+
+ this.stereo = pf.stereo;
+
+ this.floating_point = pf.floating_point;
+ this.floating_point_packed = pf.floating_point_packed;
+ this.sRGB = pf.sRGB;
+ }
+
+ public int getBitsPerPixel() {
+ return bpp;
+ }
+
+ /**
+ * Returns a new PixelFormat object with the same properties as this PixelFormat and the new bits per pixel value.
+ *
+ * @param bpp the new bits per pixel value.
+ *
+ * @return the new PixelFormat
+ */
+ public PixelFormat withBitsPerPixel(final int bpp) {
+ if ( bpp < 0 )
+ throw new IllegalArgumentException("Invalid number of bits per pixel specified: " + bpp);
+
+ final PixelFormat pf = new PixelFormat(this);
+ pf.bpp = bpp;
+ return pf;
+ }
+
+ public int getAlphaBits() {
+ return alpha;
+ }
+
+ /**
+ * Returns a new PixelFormat object with the same properties as this PixelFormat and the new alpha bits value.
+ *
+ * @param alpha the new alpha bits value.
+ *
+ * @return the new PixelFormat
+ */
+ public PixelFormat withAlphaBits(final int alpha) {
+ if ( alpha < 0 )
+ throw new IllegalArgumentException("Invalid number of alpha bits specified: " + alpha);
+
+ final PixelFormat pf = new PixelFormat(this);
+ pf.alpha = alpha;
+ return pf;
+ }
+
+ public int getDepthBits() {
+ return depth;
+ }
+
+ /**
+ * Returns a new PixelFormat object with the same properties as this PixelFormat and the new depth bits value.
+ *
+ * @param depth the new depth bits value.
+ *
+ * @return the new PixelFormat
+ */
+ public PixelFormat withDepthBits(final int depth) {
+ if ( depth < 0 )
+ throw new IllegalArgumentException("Invalid number of depth bits specified: " + depth);
+
+ final PixelFormat pf = new PixelFormat(this);
+ pf.depth = depth;
+ return pf;
+ }
+
+ public int getStencilBits() {
+ return stencil;
+ }
+
+ /**
+ * Returns a new PixelFormat object with the same properties as this PixelFormat and the new stencil bits value.
+ *
+ * @param stencil the new stencil bits value.
+ *
+ * @return the new PixelFormat
+ */
+ public PixelFormat withStencilBits(final int stencil) {
+ if ( stencil < 0 )
+ throw new IllegalArgumentException("Invalid number of stencil bits specified: " + stencil);
+
+ final PixelFormat pf = new PixelFormat(this);
+ pf.stencil = stencil;
+ return pf;
+ }
+
+ public int getSamples() {
+ return samples;
+ }
+
+ /**
+ * Returns a new PixelFormat object with the same properties as this PixelFormat and the new samples value.
+ *
+ * @param samples the new samples value.
+ *
+ * @return the new PixelFormat
+ */
+ public PixelFormat withSamples(final int samples) {
+ if ( samples < 0 )
+ throw new IllegalArgumentException("Invalid number of samples specified: " + samples);
+
+ final PixelFormat pf = new PixelFormat(this);
+ pf.samples = samples;
+ return pf;
+ }
+
+ public int getAuxBuffers() {
+ return num_aux_buffers;
+ }
+
+ /**
+ * Returns a new PixelFormat object with the same properties as this PixelFormat and the new auxiliary buffers value.
+ *
+ * @param num_aux_buffers the new auxiliary buffers value.
+ *
+ * @return the new PixelFormat
+ */
+ public PixelFormat withAuxBuffers(final int num_aux_buffers) {
+ if ( num_aux_buffers < 0 )
+ throw new IllegalArgumentException("Invalid number of auxiliary buffers specified: " + num_aux_buffers);
+
+ final PixelFormat pf = new PixelFormat(this);
+ pf.num_aux_buffers = num_aux_buffers;
+ return pf;
+ }
+
+ public int getAccumulationBitsPerPixel() {
+ return accum_bpp;
+ }
+
+ /**
+ * Returns a new PixelFormat object with the same properties as this PixelFormat and the new bits per pixel in the accumulation buffer value.
+ *
+ * @param accum_bpp the new bits per pixel in the accumulation buffer value.
+ *
+ * @return the new PixelFormat
+ */
+ public PixelFormat withAccumulationBitsPerPixel(final int accum_bpp) {
+ if ( accum_bpp < 0 )
+ throw new IllegalArgumentException("Invalid number of bits per pixel in the accumulation buffer specified: " + accum_bpp);
+
+ final PixelFormat pf = new PixelFormat(this);
+ pf.accum_bpp = accum_bpp;
+ return pf;
+ }
+
+ public int getAccumulationAlpha() {
+ return accum_alpha;
+ }
+
+ /**
+ * Returns a new PixelFormat object with the same properties as this PixelFormat and the new alpha bits in the accumulation buffer value.
+ *
+ * @param accum_alpha the new alpha bits in the accumulation buffer value.
+ *
+ * @return the new PixelFormat
+ */
+ public PixelFormat withAccumulationAlpha(final int accum_alpha) {
+ if ( accum_alpha < 0 )
+ throw new IllegalArgumentException("Invalid number of alpha bits in the accumulation buffer specified: " + accum_alpha);
+
+ final PixelFormat pf = new PixelFormat(this);
+ pf.accum_alpha = accum_alpha;
+ return pf;
+ }
+
+ public boolean isStereo() {
+ return stereo;
+ }
+
+ /**
+ * Returns a new PixelFormat object with the same properties as this PixelFormat and the new stereo value.
+ *
+ * @param stereo the new stereo value.
+ *
+ * @return the new PixelFormat
+ */
+ public PixelFormat withStereo(final boolean stereo) {
+ final PixelFormat pf = new PixelFormat(this);
+ pf.stereo = stereo;
+ return pf;
+ }
+
+ public boolean isFloatingPoint() {
+ return floating_point;
+ }
+
+ /**
+ * Returns a new PixelFormat object with the same properties as this PixelFormat and the new floating point value.
+ * If floating_point is true, floating_point_packed will be reset to false.
+ *
+ * @param floating_point the new floating point value.
+ *
+ * @return the new PixelFormat
+ */
+ public PixelFormat withFloatingPoint(final boolean floating_point) {
+ final PixelFormat pf = new PixelFormat(this);
+ pf.floating_point = floating_point;
+ if ( floating_point )
+ pf.floating_point_packed = false;
+ return pf;
+ }
+
+ /**
+ * Returns a new PixelFormat object with the same properties as this PixelFormat and the new packed floating point value.
+ * If floating_point_packed is true, floating_point will be reset to false.
+ *
+ * @param floating_point_packed the new packed floating point value.
+ *
+ * @return the new PixelFormat
+ */
+ public PixelFormat withFloatingPointPacked(final boolean floating_point_packed) {
+ final PixelFormat pf = new PixelFormat(this);
+ pf.floating_point_packed = floating_point_packed;
+ if ( floating_point_packed )
+ pf.floating_point = false;
+ return pf;
+ }
+
+ public boolean isSRGB() {
+ return sRGB;
+ }
+
+ /**
+ * Returns a new PixelFormat object with the same properties as this PixelFormat and the new sRGB value.
+ *
+ * @param sRGB the new floating point value.
+ *
+ * @return the new PixelFormat
+ */
+ public PixelFormat withSRGB(final boolean sRGB) {
+ final PixelFormat pf = new PixelFormat(this);
+ pf.sRGB = sRGB;
+ return pf;
+ }
+
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/opengl/ReferencesStack.java b/src/java/org/lwjgl/opengl/ReferencesStack.java
index 69936a8..fbb5c7c 100644
--- a/src/java/org/lwjgl/opengl/ReferencesStack.java
+++ b/src/java/org/lwjgl/opengl/ReferencesStack.java
@@ -1,73 +1,73 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-class ReferencesStack {
- private References[] references_stack;
- private int stack_pos;
-
- public References getReferences() {
- return references_stack[stack_pos];
- }
-
- public void pushState() {
- int pos = ++stack_pos;
- if (pos == references_stack.length) {
- growStack();
- }
- references_stack[pos].copy(references_stack[pos - 1], GL11.GL_ALL_CLIENT_ATTRIB_BITS);
- }
-
- public References popState(int mask) {
- References result = references_stack[stack_pos--];
-
- references_stack[stack_pos].copy(result, ~mask);
- result.clear();
-
- return result;
- }
-
- private void growStack() {
- References[] new_references_stack = new References[references_stack.length + 1];
- System.arraycopy(references_stack, 0, new_references_stack, 0, references_stack.length);
- references_stack = new_references_stack;
- references_stack[references_stack.length - 1] = new References(GLContext.getCapabilities());
- }
-
- ReferencesStack() {
- ContextCapabilities caps = GLContext.getCapabilities();
- references_stack = new References[1];
- stack_pos = 0;
- for (int i = 0; i < references_stack.length; i++)
- references_stack[i] = new References(caps);
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+class ReferencesStack {
+ private References[] references_stack;
+ private int stack_pos;
+
+ public References getReferences() {
+ return references_stack[stack_pos];
+ }
+
+ public void pushState() {
+ int pos = ++stack_pos;
+ if (pos == references_stack.length) {
+ growStack();
+ }
+ references_stack[pos].copy(references_stack[pos - 1], GL11.GL_ALL_CLIENT_ATTRIB_BITS);
+ }
+
+ public References popState(int mask) {
+ References result = references_stack[stack_pos--];
+
+ references_stack[stack_pos].copy(result, ~mask);
+ result.clear();
+
+ return result;
+ }
+
+ private void growStack() {
+ References[] new_references_stack = new References[references_stack.length + 1];
+ System.arraycopy(references_stack, 0, new_references_stack, 0, references_stack.length);
+ references_stack = new_references_stack;
+ references_stack[references_stack.length - 1] = new References(GLContext.getCapabilities());
+ }
+
+ ReferencesStack() {
+ ContextCapabilities caps = GLContext.getCapabilities();
+ references_stack = new References[1];
+ stack_pos = 0;
+ for (int i = 0; i < references_stack.length; i++)
+ references_stack[i] = new References(caps);
+ }
+}
diff --git a/src/java/org/lwjgl/opengl/RenderTexture.java b/src/java/org/lwjgl/opengl/RenderTexture.java
index 008439d..212dafb 100644
--- a/src/java/org/lwjgl/opengl/RenderTexture.java
+++ b/src/java/org/lwjgl/opengl/RenderTexture.java
@@ -1,249 +1,249 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import java.nio.IntBuffer;
-
-import org.lwjgl.BufferUtils;
-
-/** This class represents the state necessary for render-to-texture. */
-public final class RenderTexture {
-
- // ----------------------------------------------------------------------------------
- // ----------------------------- WGL_ARB_render_texture -----------------------------
- // ----------------------------------------------------------------------------------
-
- /*
- Accepted by the <piAttributes> parameter of wglGetPixelFormatAttribivARB,
- wglGetPixelFormatAttribfvARB, and the <piAttribIList> and <pfAttribIList>
- parameters of wglChoosePixelFormatARB:
- */
- private static final int WGL_BIND_TO_TEXTURE_RGB_ARB = 0x2070;
- private static final int WGL_BIND_TO_TEXTURE_RGBA_ARB = 0x2071;
-
- /*
- Accepted by the <piAttribList> parameter of wglCreatePbufferARB and
- by the <iAttribute> parameter of wglQueryPbufferARB:
- */
- private static final int WGL_TEXTURE_FORMAT_ARB = 0x2072;
- private static final int WGL_TEXTURE_TARGET_ARB = 0x2073;
- private static final int WGL_MIPMAP_TEXTURE_ARB = 0x2074;
-
- /*
- Accepted as a value in the <piAttribList> parameter of
- wglCreatePbufferARB and returned in the value parameter of
- wglQueryPbufferARB when <iAttribute> is WGL_TEXTURE_FORMAT_ARB:
- */
- private static final int WGL_TEXTURE_RGB_ARB = 0x2075;
- private static final int WGL_TEXTURE_RGBA_ARB = 0x2076;
-
- /*
- Accepted as a value in the <piAttribList> parameter of
- wglCreatePbufferARB and returned in the value parameter of
- wglQueryPbufferARB when <iAttribute> is WGL_TEXTURE_TARGET_ARB:
- */
- private static final int WGL_TEXTURE_CUBE_MAP_ARB = 0x2078;
- private static final int WGL_TEXTURE_1D_ARB = 0x2079;
- private static final int WGL_TEXTURE_2D_ARB = 0x207A;
- private static final int WGL_NO_TEXTURE_ARB = 0x2077;
-
- /*
- Accepted by the <piAttribList> parameter of wglSetPbufferAttribARB and
- by the <iAttribute> parameter of wglQueryPbufferARB:
- */
- static final int WGL_MIPMAP_LEVEL_ARB = 0x207B;
- static final int WGL_CUBE_MAP_FACE_ARB = 0x207C;
-
- /*
- Accepted as a value in the <piAttribList> parameter of
- wglSetPbufferAttribARB and returned in the value parameter of
- wglQueryPbufferARB when <iAttribute> is WGL_CUBE_MAP_FACE_ARB:
- */
- static final int WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB = 0x207D;
- static final int WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB = 0x207E;
- static final int WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB = 0x207F;
- static final int WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB = 0x2080;
- static final int WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB = 0x2081;
- static final int WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB = 0x2082;
-
- /*
- Accepted by the <iBuffer> parameter of wglBindTexImageARB and
- wglReleaseTexImageARB:
- */
- static final int WGL_FRONT_LEFT_ARB = 0x2083;
- static final int WGL_FRONT_RIGHT_ARB = 0x2084;
- static final int WGL_BACK_LEFT_ARB = 0x2085;
- static final int WGL_BACK_RIGHT_ARB = 0x2086;
-
- /*
- private static final int WGL_AUX0_ARB = 0x2087;
- private static final int WGL_AUX1_ARB = 0x2088;
- private static final int WGL_AUX2_ARB = 0x2089;
- private static final int WGL_AUX3_ARB = 0x208A;
- private static final int WGL_AUX4_ARB = 0x208B;
- private static final int WGL_AUX5_ARB = 0x208C;
- private static final int WGL_AUX6_ARB = 0x208D;
- private static final int WGL_AUX7_ARB = 0x208E;
- private static final int WGL_AUX8_ARB = 0x208F;
- private static final int WGL_AUX9_ARB = 0x2090;
- */
-
- // -------------------------------------------------------------------------------------------
- // ----------------------------- WGL_NV_render_texture_rectangle -----------------------------
- // -------------------------------------------------------------------------------------------
-
- /*
- Accepted by the <piAttributes> parameter of wglGetPixelFormatAttribivARB,
- wglGetPixelFormatAttribfvARB, and the <piAttribIList> and <pfAttribIList>
- parameters of wglChoosePixelFormatARB:
- */
- private static final int WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV = 0x20A0;
- private static final int WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV = 0x20A1;
-
- /*
- Accepted as a value in the <piAttribList> parameter of wglCreatePbufferARB
- and returned in the value parameter of wglQueryPbufferARB when
- <iAttribute> is WGL_TEXTURE_TARGET_ARB:
- */
- private static final int WGL_TEXTURE_RECTANGLE_NV = 0x20A2;
-
- // ---------------------------------------------------------------------------------------
- // ----------------------------- WGL_NV_render_depth_texture -----------------------------
- // ---------------------------------------------------------------------------------------
-
- /*
- Accepted by the <piAttributes> parameter of wglGetPixelFormatAttribivARB,
- wglGetPixelFormatAttribfvARB, and the <piAttribIList> and <pfAttribIList>
- parameters of wglChoosePixelFormatARB:
- */
- private static final int WGL_BIND_TO_TEXTURE_DEPTH_NV = 0x20A3;
- private static final int WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV = 0x20A4;
-
- /*
- Accepted by the <piAttribList> parameter of wglCreatePbufferARB and
- by the <iAttribute> parameter of wglQueryPbufferARB:
- */
- private static final int WGL_DEPTH_TEXTURE_FORMAT_NV = 0x20A5;
-
- /*
- Accepted as a value in the <piAttribList> parameter of wglCreatePbufferARB
- and returned in the value parameter of wglQueryPbufferARB when
- <iAttribute> is WGL_DEPTH_TEXTURE_FORMAT_NV:
- */
- private static final int WGL_TEXTURE_DEPTH_COMPONENT_NV = 0x20A6;
-
- /*
- Accepted by the <iBuffer> parameter of wglBindTexImageARB:
- */
- static final int WGL_DEPTH_COMPONENT_NV = 0x20A7;
-
- /** The TEXTURE_1D target. */
- public static final int RENDER_TEXTURE_1D = WGL_TEXTURE_1D_ARB;
-
- /** The TEXTURE_2D target. */
- public static final int RENDER_TEXTURE_2D = WGL_TEXTURE_2D_ARB;
-
- /** The TEXTURE_RECTANGLE target. */
- public static final int RENDER_TEXTURE_RECTANGLE = WGL_TEXTURE_RECTANGLE_NV;
-
- /** The TEXTURE_CUBE_MAP target. */
- public static final int RENDER_TEXTURE_CUBE_MAP = WGL_TEXTURE_CUBE_MAP_ARB;
-
- IntBuffer pixelFormatCaps;
- IntBuffer pBufferAttribs;
-
- /**
- * Creates a RenderTexture object for enabling render-to-texture on a P-buffer.
- * <p/>
- * NOTE: Only one of useRGB and useRGBA can be true at the same time.
- * <p/>
- * NOTE: useRGB(A) and useDepth can be true at the same time, thus allowing two different render textures.
- * <p/>
- * NOTE: The target parameter can be one of the following:
- * <p/>
- * RENDER_TEXTURE_1D RENDER_TEXTURE_2D RENDER_TEXTURE_RECTANGLE RENDER_TEXTURE_CUBE_MAP
- *
- * @param useRGB - When true the P-buffer can be used as an RGB render texture.
- * @param useRGBA - When true the P-buffer can be used as an RGBA render texture.
- * @param useDepth - When true the P-buffer can be used as a depth render texture.
- * @param isRectangle - When true rectangle textures will be allowed on the P-buffer.
- * @param target - The texture target of the render texture.
- * @param mipmaps - How many mipmap levels to allocate on the P-buffer.
- */
- public RenderTexture(boolean useRGB, boolean useRGBA, boolean useDepth, boolean isRectangle, int target, int mipmaps) {
- if ( useRGB && useRGBA )
- throw new IllegalArgumentException("A RenderTexture can't be both RGB and RGBA.");
-
- if ( mipmaps < 0 )
- throw new IllegalArgumentException("The mipmap levels can't be negative.");
-
- if ( isRectangle && target != RENDER_TEXTURE_RECTANGLE )
- throw new IllegalArgumentException("When the RenderTexture is rectangle the target must be RENDER_TEXTURE_RECTANGLE.");
-
- pixelFormatCaps = BufferUtils.createIntBuffer(4);
- pBufferAttribs = BufferUtils.createIntBuffer(8);
-
- if ( useRGB ) {
- pixelFormatCaps.put(isRectangle ? WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV : WGL_BIND_TO_TEXTURE_RGB_ARB);
- pixelFormatCaps.put(GL11.GL_TRUE);
-
- pBufferAttribs.put(WGL_TEXTURE_FORMAT_ARB);
- pBufferAttribs.put(WGL_TEXTURE_RGB_ARB);
- } else if ( useRGBA ) {
- pixelFormatCaps.put(isRectangle ? WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV : WGL_BIND_TO_TEXTURE_RGBA_ARB);
- pixelFormatCaps.put(GL11.GL_TRUE);
-
- pBufferAttribs.put(WGL_TEXTURE_FORMAT_ARB);
- pBufferAttribs.put(WGL_TEXTURE_RGBA_ARB);
- }
-
- if ( useDepth ) {
- pixelFormatCaps.put(isRectangle ? WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV : WGL_BIND_TO_TEXTURE_DEPTH_NV);
- pixelFormatCaps.put(GL11.GL_TRUE);
-
- pBufferAttribs.put(WGL_DEPTH_TEXTURE_FORMAT_NV);
- pBufferAttribs.put(WGL_TEXTURE_DEPTH_COMPONENT_NV);
- }
-
- pBufferAttribs.put(WGL_TEXTURE_TARGET_ARB);
- pBufferAttribs.put(target);
-
- if ( mipmaps != 0 ) {
- pBufferAttribs.put(WGL_MIPMAP_TEXTURE_ARB);
- pBufferAttribs.put(mipmaps);
- }
-
- pixelFormatCaps.flip();
- pBufferAttribs.flip();
- }
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import java.nio.IntBuffer;
+
+import org.lwjgl.BufferUtils;
+
+/** This class represents the state necessary for render-to-texture. */
+public final class RenderTexture {
+
+ // ----------------------------------------------------------------------------------
+ // ----------------------------- WGL_ARB_render_texture -----------------------------
+ // ----------------------------------------------------------------------------------
+
+ /*
+ Accepted by the <piAttributes> parameter of wglGetPixelFormatAttribivARB,
+ wglGetPixelFormatAttribfvARB, and the <piAttribIList> and <pfAttribIList>
+ parameters of wglChoosePixelFormatARB:
+ */
+ private static final int WGL_BIND_TO_TEXTURE_RGB_ARB = 0x2070;
+ private static final int WGL_BIND_TO_TEXTURE_RGBA_ARB = 0x2071;
+
+ /*
+ Accepted by the <piAttribList> parameter of wglCreatePbufferARB and
+ by the <iAttribute> parameter of wglQueryPbufferARB:
+ */
+ private static final int WGL_TEXTURE_FORMAT_ARB = 0x2072;
+ private static final int WGL_TEXTURE_TARGET_ARB = 0x2073;
+ private static final int WGL_MIPMAP_TEXTURE_ARB = 0x2074;
+
+ /*
+ Accepted as a value in the <piAttribList> parameter of
+ wglCreatePbufferARB and returned in the value parameter of
+ wglQueryPbufferARB when <iAttribute> is WGL_TEXTURE_FORMAT_ARB:
+ */
+ private static final int WGL_TEXTURE_RGB_ARB = 0x2075;
+ private static final int WGL_TEXTURE_RGBA_ARB = 0x2076;
+
+ /*
+ Accepted as a value in the <piAttribList> parameter of
+ wglCreatePbufferARB and returned in the value parameter of
+ wglQueryPbufferARB when <iAttribute> is WGL_TEXTURE_TARGET_ARB:
+ */
+ private static final int WGL_TEXTURE_CUBE_MAP_ARB = 0x2078;
+ private static final int WGL_TEXTURE_1D_ARB = 0x2079;
+ private static final int WGL_TEXTURE_2D_ARB = 0x207A;
+ private static final int WGL_NO_TEXTURE_ARB = 0x2077;
+
+ /*
+ Accepted by the <piAttribList> parameter of wglSetPbufferAttribARB and
+ by the <iAttribute> parameter of wglQueryPbufferARB:
+ */
+ static final int WGL_MIPMAP_LEVEL_ARB = 0x207B;
+ static final int WGL_CUBE_MAP_FACE_ARB = 0x207C;
+
+ /*
+ Accepted as a value in the <piAttribList> parameter of
+ wglSetPbufferAttribARB and returned in the value parameter of
+ wglQueryPbufferARB when <iAttribute> is WGL_CUBE_MAP_FACE_ARB:
+ */
+ static final int WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB = 0x207D;
+ static final int WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB = 0x207E;
+ static final int WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB = 0x207F;
+ static final int WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB = 0x2080;
+ static final int WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB = 0x2081;
+ static final int WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB = 0x2082;
+
+ /*
+ Accepted by the <iBuffer> parameter of wglBindTexImageARB and
+ wglReleaseTexImageARB:
+ */
+ static final int WGL_FRONT_LEFT_ARB = 0x2083;
+ static final int WGL_FRONT_RIGHT_ARB = 0x2084;
+ static final int WGL_BACK_LEFT_ARB = 0x2085;
+ static final int WGL_BACK_RIGHT_ARB = 0x2086;
+
+ /*
+ private static final int WGL_AUX0_ARB = 0x2087;
+ private static final int WGL_AUX1_ARB = 0x2088;
+ private static final int WGL_AUX2_ARB = 0x2089;
+ private static final int WGL_AUX3_ARB = 0x208A;
+ private static final int WGL_AUX4_ARB = 0x208B;
+ private static final int WGL_AUX5_ARB = 0x208C;
+ private static final int WGL_AUX6_ARB = 0x208D;
+ private static final int WGL_AUX7_ARB = 0x208E;
+ private static final int WGL_AUX8_ARB = 0x208F;
+ private static final int WGL_AUX9_ARB = 0x2090;
+ */
+
+ // -------------------------------------------------------------------------------------------
+ // ----------------------------- WGL_NV_render_texture_rectangle -----------------------------
+ // -------------------------------------------------------------------------------------------
+
+ /*
+ Accepted by the <piAttributes> parameter of wglGetPixelFormatAttribivARB,
+ wglGetPixelFormatAttribfvARB, and the <piAttribIList> and <pfAttribIList>
+ parameters of wglChoosePixelFormatARB:
+ */
+ private static final int WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV = 0x20A0;
+ private static final int WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV = 0x20A1;
+
+ /*
+ Accepted as a value in the <piAttribList> parameter of wglCreatePbufferARB
+ and returned in the value parameter of wglQueryPbufferARB when
+ <iAttribute> is WGL_TEXTURE_TARGET_ARB:
+ */
+ private static final int WGL_TEXTURE_RECTANGLE_NV = 0x20A2;
+
+ // ---------------------------------------------------------------------------------------
+ // ----------------------------- WGL_NV_render_depth_texture -----------------------------
+ // ---------------------------------------------------------------------------------------
+
+ /*
+ Accepted by the <piAttributes> parameter of wglGetPixelFormatAttribivARB,
+ wglGetPixelFormatAttribfvARB, and the <piAttribIList> and <pfAttribIList>
+ parameters of wglChoosePixelFormatARB:
+ */
+ private static final int WGL_BIND_TO_TEXTURE_DEPTH_NV = 0x20A3;
+ private static final int WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV = 0x20A4;
+
+ /*
+ Accepted by the <piAttribList> parameter of wglCreatePbufferARB and
+ by the <iAttribute> parameter of wglQueryPbufferARB:
+ */
+ private static final int WGL_DEPTH_TEXTURE_FORMAT_NV = 0x20A5;
+
+ /*
+ Accepted as a value in the <piAttribList> parameter of wglCreatePbufferARB
+ and returned in the value parameter of wglQueryPbufferARB when
+ <iAttribute> is WGL_DEPTH_TEXTURE_FORMAT_NV:
+ */
+ private static final int WGL_TEXTURE_DEPTH_COMPONENT_NV = 0x20A6;
+
+ /*
+ Accepted by the <iBuffer> parameter of wglBindTexImageARB:
+ */
+ static final int WGL_DEPTH_COMPONENT_NV = 0x20A7;
+
+ /** The TEXTURE_1D target. */
+ public static final int RENDER_TEXTURE_1D = WGL_TEXTURE_1D_ARB;
+
+ /** The TEXTURE_2D target. */
+ public static final int RENDER_TEXTURE_2D = WGL_TEXTURE_2D_ARB;
+
+ /** The TEXTURE_RECTANGLE target. */
+ public static final int RENDER_TEXTURE_RECTANGLE = WGL_TEXTURE_RECTANGLE_NV;
+
+ /** The TEXTURE_CUBE_MAP target. */
+ public static final int RENDER_TEXTURE_CUBE_MAP = WGL_TEXTURE_CUBE_MAP_ARB;
+
+ IntBuffer pixelFormatCaps;
+ IntBuffer pBufferAttribs;
+
+ /**
+ * Creates a RenderTexture object for enabling render-to-texture on a P-buffer.
+ * <p/>
+ * NOTE: Only one of useRGB and useRGBA can be true at the same time.
+ * <p/>
+ * NOTE: useRGB(A) and useDepth can be true at the same time, thus allowing two different render textures.
+ * <p/>
+ * NOTE: The target parameter can be one of the following:
+ * <p/>
+ * RENDER_TEXTURE_1D RENDER_TEXTURE_2D RENDER_TEXTURE_RECTANGLE RENDER_TEXTURE_CUBE_MAP
+ *
+ * @param useRGB - When true the P-buffer can be used as an RGB render texture.
+ * @param useRGBA - When true the P-buffer can be used as an RGBA render texture.
+ * @param useDepth - When true the P-buffer can be used as a depth render texture.
+ * @param isRectangle - When true rectangle textures will be allowed on the P-buffer.
+ * @param target - The texture target of the render texture.
+ * @param mipmaps - How many mipmap levels to allocate on the P-buffer.
+ */
+ public RenderTexture(boolean useRGB, boolean useRGBA, boolean useDepth, boolean isRectangle, int target, int mipmaps) {
+ if ( useRGB && useRGBA )
+ throw new IllegalArgumentException("A RenderTexture can't be both RGB and RGBA.");
+
+ if ( mipmaps < 0 )
+ throw new IllegalArgumentException("The mipmap levels can't be negative.");
+
+ if ( isRectangle && target != RENDER_TEXTURE_RECTANGLE )
+ throw new IllegalArgumentException("When the RenderTexture is rectangle the target must be RENDER_TEXTURE_RECTANGLE.");
+
+ pixelFormatCaps = BufferUtils.createIntBuffer(4);
+ pBufferAttribs = BufferUtils.createIntBuffer(8);
+
+ if ( useRGB ) {
+ pixelFormatCaps.put(isRectangle ? WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV : WGL_BIND_TO_TEXTURE_RGB_ARB);
+ pixelFormatCaps.put(GL11.GL_TRUE);
+
+ pBufferAttribs.put(WGL_TEXTURE_FORMAT_ARB);
+ pBufferAttribs.put(WGL_TEXTURE_RGB_ARB);
+ } else if ( useRGBA ) {
+ pixelFormatCaps.put(isRectangle ? WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV : WGL_BIND_TO_TEXTURE_RGBA_ARB);
+ pixelFormatCaps.put(GL11.GL_TRUE);
+
+ pBufferAttribs.put(WGL_TEXTURE_FORMAT_ARB);
+ pBufferAttribs.put(WGL_TEXTURE_RGBA_ARB);
+ }
+
+ if ( useDepth ) {
+ pixelFormatCaps.put(isRectangle ? WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV : WGL_BIND_TO_TEXTURE_DEPTH_NV);
+ pixelFormatCaps.put(GL11.GL_TRUE);
+
+ pBufferAttribs.put(WGL_DEPTH_TEXTURE_FORMAT_NV);
+ pBufferAttribs.put(WGL_TEXTURE_DEPTH_COMPONENT_NV);
+ }
+
+ pBufferAttribs.put(WGL_TEXTURE_TARGET_ARB);
+ pBufferAttribs.put(target);
+
+ if ( mipmaps != 0 ) {
+ pBufferAttribs.put(WGL_MIPMAP_TEXTURE_ARB);
+ pBufferAttribs.put(mipmaps);
+ }
+
+ pixelFormatCaps.flip();
+ pBufferAttribs.flip();
+ }
+
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/opengl/StateStack.java b/src/java/org/lwjgl/opengl/StateStack.java
index 9d7755d..2d75c0c 100644
--- a/src/java/org/lwjgl/opengl/StateStack.java
+++ b/src/java/org/lwjgl/opengl/StateStack.java
@@ -1,65 +1,65 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-class StateStack {
- private int[] state_stack;
- private int stack_pos;
-
- public int getState() {
- return state_stack[stack_pos];
- }
-
- public void pushState(int new_state) {
- int pos = ++stack_pos;
- if (pos == state_stack.length) {
- growState();
- }
- state_stack[pos] = new_state;
- }
-
- public int popState() {
- return state_stack[stack_pos--];
- }
-
- public void growState() {
- int[] new_state_stack = new int[state_stack.length + 1];
- System.arraycopy(state_stack, 0, new_state_stack, 0, state_stack.length);
- state_stack = new_state_stack;
- }
-
- StateStack(int initial_value) {
- state_stack = new int[1];
- stack_pos = 0;
- state_stack[stack_pos] = initial_value;
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+class StateStack {
+ private int[] state_stack;
+ private int stack_pos;
+
+ public int getState() {
+ return state_stack[stack_pos];
+ }
+
+ public void pushState(int new_state) {
+ int pos = ++stack_pos;
+ if (pos == state_stack.length) {
+ growState();
+ }
+ state_stack[pos] = new_state;
+ }
+
+ public int popState() {
+ return state_stack[stack_pos--];
+ }
+
+ public void growState() {
+ int[] new_state_stack = new int[state_stack.length + 1];
+ System.arraycopy(state_stack, 0, new_state_stack, 0, state_stack.length);
+ state_stack = new_state_stack;
+ }
+
+ StateStack(int initial_value) {
+ state_stack = new int[1];
+ stack_pos = 0;
+ state_stack[stack_pos] = initial_value;
+ }
+}
diff --git a/src/java/org/lwjgl/opengl/StateTracker.java b/src/java/org/lwjgl/opengl/StateTracker.java
index 8918d27..47a1ed6 100644
--- a/src/java/org/lwjgl/opengl/StateTracker.java
+++ b/src/java/org/lwjgl/opengl/StateTracker.java
@@ -1,99 +1,99 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-final class StateTracker {
- private ReferencesStack references_stack;
- private final StateStack attrib_stack;
-
- private boolean insideBeginEnd;
-
- StateTracker() {
- attrib_stack = new StateStack(0);
- }
-
- /** This is called after getting function addresses. */
- void init() {
- references_stack = new ReferencesStack();
- }
-
- static void setBeginEnd(ContextCapabilities caps, boolean inside) {
- caps.tracker.insideBeginEnd = inside;
- }
-
- boolean isBeginEnd() {
- return insideBeginEnd;
- }
-
- static void popAttrib(ContextCapabilities caps) {
- caps.tracker.doPopAttrib();
- }
-
- private void doPopAttrib() {
- references_stack.popState(attrib_stack.popState());
- }
-
- static void pushAttrib(ContextCapabilities caps, int mask) {
- caps.tracker.doPushAttrib(mask);
- }
-
- private void doPushAttrib(int mask) {
- attrib_stack.pushState(mask);
- references_stack.pushState();
- }
-
- static ReferencesStack getReferencesStack(ContextCapabilities caps) {
- return caps.tracker.references_stack;
- }
-
- static void bindBuffer(ContextCapabilities caps, int target, int buffer) {
- ReferencesStack references_stack = getReferencesStack(caps);
- switch(target) {
- case GL15.GL_ELEMENT_ARRAY_BUFFER:
- references_stack.getReferences().elementArrayBuffer = buffer;
- break;
- case GL15.GL_ARRAY_BUFFER:
- references_stack.getReferences().arrayBuffer = buffer;
- break;
- case GL21.GL_PIXEL_PACK_BUFFER:
- references_stack.getReferences().pixelPackBuffer = buffer;
- break;
- case GL21.GL_PIXEL_UNPACK_BUFFER:
- references_stack.getReferences().pixelUnpackBuffer = buffer;
- break;
- case GL40.GL_DRAW_INDIRECT_BUFFER:
- references_stack.getReferences().indirectBuffer = buffer;
- break;
-
- }
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+final class StateTracker {
+ private ReferencesStack references_stack;
+ private final StateStack attrib_stack;
+
+ private boolean insideBeginEnd;
+
+ StateTracker() {
+ attrib_stack = new StateStack(0);
+ }
+
+ /** This is called after getting function addresses. */
+ void init() {
+ references_stack = new ReferencesStack();
+ }
+
+ static void setBeginEnd(ContextCapabilities caps, boolean inside) {
+ caps.tracker.insideBeginEnd = inside;
+ }
+
+ boolean isBeginEnd() {
+ return insideBeginEnd;
+ }
+
+ static void popAttrib(ContextCapabilities caps) {
+ caps.tracker.doPopAttrib();
+ }
+
+ private void doPopAttrib() {
+ references_stack.popState(attrib_stack.popState());
+ }
+
+ static void pushAttrib(ContextCapabilities caps, int mask) {
+ caps.tracker.doPushAttrib(mask);
+ }
+
+ private void doPushAttrib(int mask) {
+ attrib_stack.pushState(mask);
+ references_stack.pushState();
+ }
+
+ static ReferencesStack getReferencesStack(ContextCapabilities caps) {
+ return caps.tracker.references_stack;
+ }
+
+ static void bindBuffer(ContextCapabilities caps, int target, int buffer) {
+ ReferencesStack references_stack = getReferencesStack(caps);
+ switch(target) {
+ case GL15.GL_ELEMENT_ARRAY_BUFFER:
+ references_stack.getReferences().elementArrayBuffer = buffer;
+ break;
+ case GL15.GL_ARRAY_BUFFER:
+ references_stack.getReferences().arrayBuffer = buffer;
+ break;
+ case GL21.GL_PIXEL_PACK_BUFFER:
+ references_stack.getReferences().pixelPackBuffer = buffer;
+ break;
+ case GL21.GL_PIXEL_UNPACK_BUFFER:
+ references_stack.getReferences().pixelUnpackBuffer = buffer;
+ break;
+ case GL40.GL_DRAW_INDIRECT_BUFFER:
+ references_stack.getReferences().indirectBuffer = buffer;
+ break;
+
+ }
+ }
+}
diff --git a/src/java/org/lwjgl/opengl/Util.java b/src/java/org/lwjgl/opengl/Util.java
index 04b4761..9fc9bd8 100644
--- a/src/java/org/lwjgl/opengl/Util.java
+++ b/src/java/org/lwjgl/opengl/Util.java
@@ -1,87 +1,87 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-
-/**
- * Simple utility class.
- *
- * @author cix_foo <cix_foo at users.sourceforge.net>
- * @version $Revision: 3316 $
- */
-
-public final class Util {
- /** No c'tor */
- private Util() {
- }
-
- /**
- * Throws OpenGLException if GL11.glGetError() returns anything else than GL11.GL_NO_ERROR
- *
- */
- public static void checkGLError() throws OpenGLException {
- if ( ContextCapabilities.DEBUG && GLContext.getCapabilities().tracker.isBeginEnd() ) // Do not call GetError inside a Begin/End pair.
- return;
- int err = GL11.glGetError();
- if ( err != GL11.GL_NO_ERROR ) {
- throw new OpenGLException(err);
- }
- }
-
- /**
- * Translate a GL error code to a String describing the error
- */
- public static String translateGLErrorString(int error_code) {
- switch (error_code) {
- case GL11.GL_NO_ERROR:
- return "No error";
- case GL11.GL_INVALID_ENUM:
- return "Invalid enum";
- case GL11.GL_INVALID_VALUE:
- return "Invalid value";
- case GL11.GL_INVALID_OPERATION:
- return "Invalid operation";
- case GL11.GL_STACK_OVERFLOW:
- return "Stack overflow";
- case GL11.GL_STACK_UNDERFLOW:
- return "Stack underflow";
- case GL11.GL_OUT_OF_MEMORY:
- return "Out of memory";
- case ARBImaging.GL_TABLE_TOO_LARGE:
- return "Table too large";
- case EXTFramebufferObject.GL_INVALID_FRAMEBUFFER_OPERATION_EXT:
- return "Invalid framebuffer operation";
- default:
- return null;
- }
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+
+/**
+ * Simple utility class.
+ *
+ * @author cix_foo <cix_foo at users.sourceforge.net>
+ * @version $Revision: 3316 $
+ */
+
+public final class Util {
+ /** No c'tor */
+ private Util() {
+ }
+
+ /**
+ * Throws OpenGLException if GL11.glGetError() returns anything else than GL11.GL_NO_ERROR
+ *
+ */
+ public static void checkGLError() throws OpenGLException {
+ if ( ContextCapabilities.DEBUG && GLContext.getCapabilities().tracker.isBeginEnd() ) // Do not call GetError inside a Begin/End pair.
+ return;
+ int err = GL11.glGetError();
+ if ( err != GL11.GL_NO_ERROR ) {
+ throw new OpenGLException(err);
+ }
+ }
+
+ /**
+ * Translate a GL error code to a String describing the error
+ */
+ public static String translateGLErrorString(int error_code) {
+ switch (error_code) {
+ case GL11.GL_NO_ERROR:
+ return "No error";
+ case GL11.GL_INVALID_ENUM:
+ return "Invalid enum";
+ case GL11.GL_INVALID_VALUE:
+ return "Invalid value";
+ case GL11.GL_INVALID_OPERATION:
+ return "Invalid operation";
+ case GL11.GL_STACK_OVERFLOW:
+ return "Stack overflow";
+ case GL11.GL_STACK_UNDERFLOW:
+ return "Stack underflow";
+ case GL11.GL_OUT_OF_MEMORY:
+ return "Out of memory";
+ case ARBImaging.GL_TABLE_TOO_LARGE:
+ return "Table too large";
+ case EXTFramebufferObject.GL_INVALID_FRAMEBUFFER_OPERATION_EXT:
+ return "Invalid framebuffer operation";
+ default:
+ return null;
+ }
+ }
+}
diff --git a/src/java/org/lwjgl/opengl/WindowsAWTGLCanvasPeerInfo.java b/src/java/org/lwjgl/opengl/WindowsAWTGLCanvasPeerInfo.java
index c7acf7e..da237ba 100644
--- a/src/java/org/lwjgl/opengl/WindowsAWTGLCanvasPeerInfo.java
+++ b/src/java/org/lwjgl/opengl/WindowsAWTGLCanvasPeerInfo.java
@@ -1,71 +1,71 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import java.nio.ByteBuffer;
-
-import org.lwjgl.LWJGLException;
-
-import java.awt.Canvas;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3116 $
- * $Id: WindowsAWTGLCanvasPeerInfo.java 3116 2008-08-19 16:46:03Z spasi $
- */
-final class WindowsAWTGLCanvasPeerInfo extends WindowsPeerInfo {
- private final Canvas component;
- private final AWTSurfaceLock awt_surface = new AWTSurfaceLock();
- private final PixelFormat pixel_format;
- private boolean has_pixel_format= false;
-
- WindowsAWTGLCanvasPeerInfo(Canvas component, PixelFormat pixel_format) {
- this.component = component;
- this.pixel_format = pixel_format;
- }
-
- protected void doLockAndInitHandle() throws LWJGLException {
- nInitHandle(awt_surface.lockAndGetHandle(component), getHandle());
- if (!has_pixel_format && pixel_format != null) {
- // If we haven't applied a pixel format yet, do it now
- int format = choosePixelFormat(getHdc(), component.getX(), component.getY(), pixel_format, null, true, true, false, true);
- setPixelFormat(getHdc(), format);
- has_pixel_format = true;
- }
- }
- private static native void nInitHandle(ByteBuffer surface_buffer, ByteBuffer peer_info_handle) throws LWJGLException;
-
- protected void doUnlock() throws LWJGLException {
- awt_surface.unlock();
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import java.nio.ByteBuffer;
+
+import org.lwjgl.LWJGLException;
+
+import java.awt.Canvas;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3116 $
+ * $Id: WindowsAWTGLCanvasPeerInfo.java 3116 2008-08-19 16:46:03Z spasi $
+ */
+final class WindowsAWTGLCanvasPeerInfo extends WindowsPeerInfo {
+ private final Canvas component;
+ private final AWTSurfaceLock awt_surface = new AWTSurfaceLock();
+ private final PixelFormat pixel_format;
+ private boolean has_pixel_format= false;
+
+ WindowsAWTGLCanvasPeerInfo(Canvas component, PixelFormat pixel_format) {
+ this.component = component;
+ this.pixel_format = pixel_format;
+ }
+
+ protected void doLockAndInitHandle() throws LWJGLException {
+ nInitHandle(awt_surface.lockAndGetHandle(component), getHandle());
+ if (!has_pixel_format && pixel_format != null) {
+ // If we haven't applied a pixel format yet, do it now
+ int format = choosePixelFormat(getHdc(), component.getX(), component.getY(), pixel_format, null, true, true, false, true);
+ setPixelFormat(getHdc(), format);
+ has_pixel_format = true;
+ }
+ }
+ private static native void nInitHandle(ByteBuffer surface_buffer, ByteBuffer peer_info_handle) throws LWJGLException;
+
+ protected void doUnlock() throws LWJGLException {
+ awt_surface.unlock();
+ }
+}
diff --git a/src/java/org/lwjgl/opengl/WindowsCanvasImplementation.java b/src/java/org/lwjgl/opengl/WindowsCanvasImplementation.java
index 56f2510..50ecc5e 100644
--- a/src/java/org/lwjgl/opengl/WindowsCanvasImplementation.java
+++ b/src/java/org/lwjgl/opengl/WindowsCanvasImplementation.java
@@ -1,85 +1,85 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import java.awt.GraphicsConfiguration;
-import java.awt.GraphicsDevice;
-import java.awt.Toolkit;
-import java.awt.Canvas;
-import java.security.PrivilegedAction;
-import java.security.AccessController;
-
-import org.lwjgl.LWJGLException;
-import org.lwjgl.LWJGLUtil;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3002 $
- * $Id: WindowsCanvasImplementation.java 3002 2008-04-10 20:25:54Z elias_naur $
- */
-final class WindowsCanvasImplementation implements AWTCanvasImplementation {
- static {
- // Make sure the awt stuff is properly initialised (the jawt library in particular)
- Toolkit.getDefaultToolkit();
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- try {
- System.loadLibrary("jawt");
- } catch (UnsatisfiedLinkError e) {
- /* It is probably already loaded, potentially by a different ClassLoader
- * so just log the exception and continue
- */
- LWJGLUtil.log("Failed to load jawt: " + e.getMessage());
- }
- return null;
- }
- });
- }
-
- public PeerInfo createPeerInfo(Canvas component, PixelFormat pixel_format) throws LWJGLException {
- return new WindowsAWTGLCanvasPeerInfo(component, pixel_format);
- }
-
- /**
- * Find a proper GraphicsConfiguration from the given GraphicsDevice and PixelFormat.
- *
- * @return The GraphicsConfiguration corresponding to a visual that matches the pixel format.
- */
- public GraphicsConfiguration findConfiguration(GraphicsDevice device, PixelFormat pixel_format) throws LWJGLException {
- /*
- * It seems like the best way is to simply return null and
- * use SetPixelFormat in JNI later.
- */
- return null;
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+import java.awt.Toolkit;
+import java.awt.Canvas;
+import java.security.PrivilegedAction;
+import java.security.AccessController;
+
+import org.lwjgl.LWJGLException;
+import org.lwjgl.LWJGLUtil;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3002 $
+ * $Id: WindowsCanvasImplementation.java 3002 2008-04-10 20:25:54Z elias_naur $
+ */
+final class WindowsCanvasImplementation implements AWTCanvasImplementation {
+ static {
+ // Make sure the awt stuff is properly initialised (the jawt library in particular)
+ Toolkit.getDefaultToolkit();
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ try {
+ System.loadLibrary("jawt");
+ } catch (UnsatisfiedLinkError e) {
+ /* It is probably already loaded, potentially by a different ClassLoader
+ * so just log the exception and continue
+ */
+ LWJGLUtil.log("Failed to load jawt: " + e.getMessage());
+ }
+ return null;
+ }
+ });
+ }
+
+ public PeerInfo createPeerInfo(Canvas component, PixelFormat pixel_format) throws LWJGLException {
+ return new WindowsAWTGLCanvasPeerInfo(component, pixel_format);
+ }
+
+ /**
+ * Find a proper GraphicsConfiguration from the given GraphicsDevice and PixelFormat.
+ *
+ * @return The GraphicsConfiguration corresponding to a visual that matches the pixel format.
+ */
+ public GraphicsConfiguration findConfiguration(GraphicsDevice device, PixelFormat pixel_format) throws LWJGLException {
+ /*
+ * It seems like the best way is to simply return null and
+ * use SetPixelFormat in JNI later.
+ */
+ return null;
+ }
+}
diff --git a/src/java/org/lwjgl/opengl/WindowsContextImplementation.java b/src/java/org/lwjgl/opengl/WindowsContextImplementation.java
index 33e535e..e49e613 100644
--- a/src/java/org/lwjgl/opengl/WindowsContextImplementation.java
+++ b/src/java/org/lwjgl/opengl/WindowsContextImplementation.java
@@ -1,119 +1,119 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.LWJGLException;
-import org.lwjgl.LWJGLUtil;
-
-import java.nio.ByteBuffer;
-import java.nio.IntBuffer;
-
-/**
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3116 $
- * $Id: WindowsContextImplementation.java 3116 2008-08-19 16:46:03Z spasi $
- */
-final class WindowsContextImplementation implements ContextImplementation {
-
- public ByteBuffer create(PeerInfo peer_info, IntBuffer attribs, ByteBuffer shared_context_handle) throws LWJGLException {
- ByteBuffer peer_handle = peer_info.lockAndGetHandle();
- try {
- return nCreate(peer_handle, attribs, shared_context_handle);
- } finally {
- peer_info.unlock();
- }
- }
-
- private static native ByteBuffer nCreate(ByteBuffer peer_handle, IntBuffer attribs_handle, ByteBuffer shared_context_handle) throws LWJGLException;
-
- public void swapBuffers() throws LWJGLException {
- Context current_context = Context.getCurrentContext();
- if ( current_context == null )
- throw new IllegalStateException("No context is current");
- synchronized ( current_context ) {
- PeerInfo current_peer_info = current_context.getPeerInfo();
- ByteBuffer peer_handle = current_peer_info.lockAndGetHandle();
- try {
- nSwapBuffers(peer_handle);
- } finally {
- current_peer_info.unlock();
- }
- }
- }
-
- private static native void nSwapBuffers(ByteBuffer peer_info_handle) throws LWJGLException;
-
- public void releaseDrawable(ByteBuffer context_handle) throws LWJGLException {
- }
-
- public void update(ByteBuffer context_handle) {
- }
-
- public void releaseCurrentContext() throws LWJGLException {
- nReleaseCurrentContext();
- }
-
- private static native void nReleaseCurrentContext() throws LWJGLException;
-
- public void makeCurrent(PeerInfo peer_info, ByteBuffer handle) throws LWJGLException {
- ByteBuffer peer_handle = peer_info.lockAndGetHandle();
- try {
- nMakeCurrent(peer_handle, handle);
- } finally {
- peer_info.unlock();
- }
- }
-
- private static native void nMakeCurrent(ByteBuffer peer_handle, ByteBuffer context_handle) throws LWJGLException;
-
- public boolean isCurrent(ByteBuffer handle) throws LWJGLException {
- boolean result = nIsCurrent(handle);
- return result;
- }
-
- private static native boolean nIsCurrent(ByteBuffer context_handle) throws LWJGLException;
-
- public void setSwapInterval(int value) {
- boolean success = nSetSwapInterval(value);
- if ( !success )
- LWJGLUtil.log("Failed to set swap interval");
- Util.checkGLError();
- }
-
- private static native boolean nSetSwapInterval(int value);
-
- public void destroy(PeerInfo peer_info, ByteBuffer handle) throws LWJGLException {
- nDestroy(handle);
- }
-
- private static native void nDestroy(ByteBuffer context_handle) throws LWJGLException;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.LWJGLException;
+import org.lwjgl.LWJGLUtil;
+
+import java.nio.ByteBuffer;
+import java.nio.IntBuffer;
+
+/**
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3116 $
+ * $Id: WindowsContextImplementation.java 3116 2008-08-19 16:46:03Z spasi $
+ */
+final class WindowsContextImplementation implements ContextImplementation {
+
+ public ByteBuffer create(PeerInfo peer_info, IntBuffer attribs, ByteBuffer shared_context_handle) throws LWJGLException {
+ ByteBuffer peer_handle = peer_info.lockAndGetHandle();
+ try {
+ return nCreate(peer_handle, attribs, shared_context_handle);
+ } finally {
+ peer_info.unlock();
+ }
+ }
+
+ private static native ByteBuffer nCreate(ByteBuffer peer_handle, IntBuffer attribs_handle, ByteBuffer shared_context_handle) throws LWJGLException;
+
+ public void swapBuffers() throws LWJGLException {
+ Context current_context = Context.getCurrentContext();
+ if ( current_context == null )
+ throw new IllegalStateException("No context is current");
+ synchronized ( current_context ) {
+ PeerInfo current_peer_info = current_context.getPeerInfo();
+ ByteBuffer peer_handle = current_peer_info.lockAndGetHandle();
+ try {
+ nSwapBuffers(peer_handle);
+ } finally {
+ current_peer_info.unlock();
+ }
+ }
+ }
+
+ private static native void nSwapBuffers(ByteBuffer peer_info_handle) throws LWJGLException;
+
+ public void releaseDrawable(ByteBuffer context_handle) throws LWJGLException {
+ }
+
+ public void update(ByteBuffer context_handle) {
+ }
+
+ public void releaseCurrentContext() throws LWJGLException {
+ nReleaseCurrentContext();
+ }
+
+ private static native void nReleaseCurrentContext() throws LWJGLException;
+
+ public void makeCurrent(PeerInfo peer_info, ByteBuffer handle) throws LWJGLException {
+ ByteBuffer peer_handle = peer_info.lockAndGetHandle();
+ try {
+ nMakeCurrent(peer_handle, handle);
+ } finally {
+ peer_info.unlock();
+ }
+ }
+
+ private static native void nMakeCurrent(ByteBuffer peer_handle, ByteBuffer context_handle) throws LWJGLException;
+
+ public boolean isCurrent(ByteBuffer handle) throws LWJGLException {
+ boolean result = nIsCurrent(handle);
+ return result;
+ }
+
+ private static native boolean nIsCurrent(ByteBuffer context_handle) throws LWJGLException;
+
+ public void setSwapInterval(int value) {
+ boolean success = nSetSwapInterval(value);
+ if ( !success )
+ LWJGLUtil.log("Failed to set swap interval");
+ Util.checkGLError();
+ }
+
+ private static native boolean nSetSwapInterval(int value);
+
+ public void destroy(PeerInfo peer_info, ByteBuffer handle) throws LWJGLException {
+ nDestroy(handle);
+ }
+
+ private static native void nDestroy(ByteBuffer context_handle) throws LWJGLException;
+}
diff --git a/src/java/org/lwjgl/opengl/WindowsDisplay.java b/src/java/org/lwjgl/opengl/WindowsDisplay.java
index 694cc28..24b56fb 100644
--- a/src/java/org/lwjgl/opengl/WindowsDisplay.java
+++ b/src/java/org/lwjgl/opengl/WindowsDisplay.java
@@ -1,976 +1,976 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-/**
- * This is the Display implementation interface. Display delegates
- * to implementors of this interface. There is one DisplayImplementation
- * for each supported platform.
- * @author elias_naur
- */
-
-import java.nio.ByteBuffer;
-import java.nio.FloatBuffer;
-import java.nio.IntBuffer;
-import java.awt.Canvas;
-
-import org.lwjgl.LWJGLException;
-import org.lwjgl.LWJGLUtil;
-import org.lwjgl.BufferUtils;
-import org.lwjgl.input.Cursor;
-import org.lwjgl.input.Keyboard;
-import org.lwjgl.input.Mouse;
-
-final class WindowsDisplay implements DisplayImplementation {
- private final static int GAMMA_LENGTH = 256;
-
- private final static int WM_CANCELMODE = 0x001F;
- private final static int WM_MOUSEMOVE = 0x0200;
- private final static int WM_LBUTTONDOWN = 0x0201;
- private final static int WM_LBUTTONUP = 0x0202;
- private final static int WM_LBUTTONDBLCLK = 0x0203;
- private final static int WM_RBUTTONDOWN = 0x0204;
- private final static int WM_RBUTTONUP = 0x0205;
- private final static int WM_RBUTTONDBLCLK = 0x0206;
- private final static int WM_MBUTTONDOWN = 0x0207;
- private final static int WM_MBUTTONUP = 0x0208;
- private final static int WM_MBUTTONDBLCLK = 0x0209;
- private final static int WM_MOUSEWHEEL = 0x020A;
- private final static int WM_CAPTURECHANGED = 0x0215;
- private final static int WM_MOUSELEAVE = 0x02A3;
- private final static int WM_KEYDOWN = 256;
- private final static int WM_KEYUP = 257;
- private final static int WM_SYSKEYUP = 261;
- private final static int WM_SYSKEYDOWN = 260;
- private final static int WM_SYSCHAR = 262;
- private final static int WM_CHAR = 258;
- private final static int WM_SETICON = 0x0080;
-
- private final static int WM_QUIT = 0x0012;
- private final static int WM_SYSCOMMAND = 0x0112;
- private final static int WM_PAINT = 0x000F;
- private final static int WM_KILLFOCUS = 8;
- private final static int WM_SETFOCUS = 7;
-
- private final static int SC_SIZE = 0xF000;
- private final static int SC_MOVE = 0xF010;
- private final static int SC_MINIMIZE = 0xF020;
- private final static int SC_MAXIMIZE = 0xF030;
- private final static int SC_NEXTWINDOW = 0xF040;
- private final static int SC_PREVWINDOW = 0xF050;
- private final static int SC_CLOSE = 0xF060;
- private final static int SC_VSCROLL = 0xF070;
- private final static int SC_HSCROLL = 0xF080;
- private final static int SC_MOUSEMENU = 0xF090;
- private final static int SC_KEYMENU = 0xF100;
- private final static int SC_ARRANGE = 0xF110;
- private final static int SC_RESTORE = 0xF120;
- private final static int SC_TASKLIST = 0xF130;
- private final static int SC_SCREENSAVE = 0xF140;
- private final static int SC_HOTKEY = 0xF150;
- private final static int SC_DEFAULT = 0xF160;
- private final static int SC_MONITORPOWER = 0xF170;
- private final static int SC_CONTEXTHELP = 0xF180;
- private final static int SC_SEPARATOR = 0xF00F;
-
- final static int SM_CXCURSOR = 13;
- final static int SM_CYCURSOR = 14;
- final static int SM_CMOUSEBUTTONS = 43;
- final static int SM_MOUSEWHEELPRESENT = 75;
-
- private final static int SIZE_RESTORED = 0;
- private final static int SIZE_MINIMIZED = 1;
- private final static int SIZE_MAXIMIZED = 2;
- private final static int WM_SIZE = 0x0005;
- private final static int WM_ACTIVATE = 0x0006;
- private final static int WA_INACTIVE = 0;
- private final static int WA_ACTIVE = 1;
- private final static int WA_CLICKACTIVE = 2;
- private final static int SW_SHOWMINNOACTIVE = 7;
- private final static int SW_SHOWDEFAULT = 10;
- private final static int SW_RESTORE = 9;
-
- private final static int ICON_SMALL = 0;
- private final static int ICON_BIG = 1;
-
- private final static IntBuffer rect_buffer = BufferUtils.createIntBuffer(4);
- private final static Rect rect = new Rect();
- private final static Rect rect2 = new Rect();
- private static WindowsDisplay current_display;
-
- private static boolean cursor_clipped;
- private WindowsDisplayPeerInfo peer_info;
- private Object current_cursor;
- private Canvas parent;
- private static boolean hasParent = false;
-
- private WindowsKeyboard keyboard;
- private WindowsMouse mouse;
-
- private boolean close_requested;
- private boolean is_dirty;
-
- private ByteBuffer current_gamma;
- private ByteBuffer saved_gamma;
- private DisplayMode current_mode;
-
- private boolean mode_set;
- private boolean isMinimized;
- private boolean isFocused;
- private boolean did_maximize;
- private boolean inAppActivate;
-
- private long hwnd;
- private long hdc;
-
- private long small_icon;
- private long large_icon;
-
- private int captureMouse = -1;
- private boolean trackingMouse = false;
- private boolean mouseInside = false;
-
- WindowsDisplay() {
- current_display = this;
- }
-
- public void createWindow(DisplayMode mode, Canvas parent, int x, int y) throws LWJGLException {
- close_requested = false;
- is_dirty = false;
- isMinimized = false;
- isFocused = false;
- did_maximize = false;
- this.parent = parent;
- hasParent = parent != null;
- long parent_hwnd = parent != null ? getHwnd(parent) : 0;
- this.hwnd = nCreateWindow(x, y, mode.getWidth(), mode.getHeight(), Display.isFullscreen() || isUndecorated(), parent != null, parent_hwnd);
- if (hwnd == 0) {
- throw new LWJGLException("Failed to create window");
- }
- this.hdc = getDC(hwnd);
- if (hdc == 0) {
- nDestroyWindow(hwnd);
- throw new LWJGLException("Failed to get dc");
- }
- try {
- int format = WindowsPeerInfo.choosePixelFormat(getHdc(), 0, 0, peer_info.getPixelFormat(), null, true, true, false, true);
- WindowsPeerInfo.setPixelFormat(getHdc(), format);
- peer_info.initDC(getHwnd(), getHdc());
- showWindow(getHwnd(), SW_SHOWDEFAULT);
- if (parent == null) {
- setForegroundWindow(getHwnd());
- setFocus(getHwnd());
- }
- } catch (LWJGLException e) {
- nReleaseDC(hwnd, hdc);
- nDestroyWindow(hwnd);
- throw e;
- }
- }
- private static native long nCreateWindow(int x, int y, int width, int height, boolean undecorated, boolean child_window, long parent_hwnd) throws LWJGLException;
-
- private static boolean isUndecorated() {
- return Display.getPrivilegedBoolean("org.lwjgl.opengl.Window.undecorated");
- }
-
- private static long getHwnd(Canvas parent) throws LWJGLException {
- AWTCanvasImplementation awt_impl = AWTGLCanvas.createImplementation();
- WindowsPeerInfo parent_peer_info = (WindowsPeerInfo)awt_impl.createPeerInfo(parent, null);
- ByteBuffer parent_peer_info_handle = parent_peer_info.lockAndGetHandle();
- try {
- return parent_peer_info.getHwnd();
- } finally {
- parent_peer_info.unlock();
- }
- }
-
- public void destroyWindow() {
- nReleaseDC(hwnd, hdc);
- nDestroyWindow(hwnd);
- freeLargeIcon();
- freeSmallIcon();
- resetCursorClipping();
- }
- private static native void nReleaseDC(long hwnd, long hdc);
- private static native void nDestroyWindow(long hwnd);
- static void resetCursorClipping() {
- if (cursor_clipped) {
- try {
- clipCursor(null);
- } catch (LWJGLException e) {
- LWJGLUtil.log("Failed to reset cursor clipping: " + e);
- }
- cursor_clipped = false;
- }
- }
-
- private static void getGlobalClientRect(long hwnd, Rect rect) {
- rect_buffer.put(0, 0).put(1, 0);
- clientToScreen(hwnd, rect_buffer);
- int offset_x = rect_buffer.get(0);
- int offset_y = rect_buffer.get(1);
- getClientRect(hwnd, rect_buffer);
- rect.copyFromBuffer(rect_buffer);
- rect.offset(offset_x, offset_y);
- }
-
- static void setupCursorClipping(long hwnd) throws LWJGLException {
- cursor_clipped = true;
- getGlobalClientRect(hwnd, rect);
- rect.copyToBuffer(rect_buffer);
- clipCursor(rect_buffer);
- }
- private static native void clipCursor(IntBuffer rect) throws LWJGLException;
-
- public void switchDisplayMode(DisplayMode mode) throws LWJGLException {
- nSwitchDisplayMode(mode);
- current_mode = mode;
- mode_set = true;
- }
- private static native void nSwitchDisplayMode(DisplayMode mode) throws LWJGLException;
-
- /*
- * Called when the application is alt-tabbed to or from
- */
- private void appActivate(boolean active) {
- if (inAppActivate) {
- return;
- }
- inAppActivate = true;
- isFocused = active;
- if (active) {
- if (Display.isFullscreen()) {
- restoreDisplayMode();
- }
- if (parent == null) {
- showWindow(getHwnd(), SW_RESTORE);
- setForegroundWindow(getHwnd());
- setFocus(getHwnd());
- }
- did_maximize = true;
- if (Display.isFullscreen())
- updateClipping();
- } else if (Display.isFullscreen()) {
- showWindow(getHwnd(), SW_SHOWMINNOACTIVE);
- resetDisplayMode();
- } else
- updateClipping();
- updateCursor();
- inAppActivate = false;
- }
- private static native void showWindow(long hwnd, int mode);
- private static native void setForegroundWindow(long hwnd);
- private static native void setFocus(long hwnd);
-
- private void restoreDisplayMode() {
- try {
- doSetGammaRamp(current_gamma);
- } catch (LWJGLException e) {
- LWJGLUtil.log("Failed to restore gamma: " + e.getMessage());
- }
-
- if (!mode_set) {
- mode_set = true;
- try {
- nSwitchDisplayMode(current_mode);
- } catch (LWJGLException e) {
- LWJGLUtil.log("Failed to restore display mode: " + e.getMessage());
- }
- }
- }
-
- public void resetDisplayMode() {
- try {
- doSetGammaRamp(saved_gamma);
- } catch (LWJGLException e) {
- LWJGLUtil.log("Failed to reset gamma ramp: " + e.getMessage());
- }
- current_gamma = saved_gamma;
- if (mode_set) {
- mode_set = false;
- nResetDisplayMode();
- }
- resetCursorClipping();
- }
- private static native void nResetDisplayMode();
-
- public int getGammaRampLength() {
- return GAMMA_LENGTH;
- }
-
- public void setGammaRamp(FloatBuffer gammaRamp) throws LWJGLException {
- doSetGammaRamp(convertToNativeRamp(gammaRamp));
- }
- private static native ByteBuffer convertToNativeRamp(FloatBuffer gamma_ramp) throws LWJGLException;
- private static native ByteBuffer getCurrentGammaRamp() throws LWJGLException;
-
- private void doSetGammaRamp(ByteBuffer native_gamma) throws LWJGLException {
- nSetGammaRamp(native_gamma);
- current_gamma = native_gamma;
- }
- private static native void nSetGammaRamp(ByteBuffer native_ramp) throws LWJGLException;
-
- public String getAdapter() {
- try {
- String maxObjNo = WindowsRegistry.queryRegistrationKey(
- WindowsRegistry.HKEY_LOCAL_MACHINE,
- "HARDWARE\\DeviceMap\\Video",
- "MaxObjectNumber");
- int maxObjectNumber = maxObjNo.charAt(0);
- String vga_driver_value = "";
- for(int i=0;i<maxObjectNumber;i++) {
- String adapter_string = WindowsRegistry.queryRegistrationKey(
- WindowsRegistry.HKEY_LOCAL_MACHINE,
- "HARDWARE\\DeviceMap\\Video",
- "\\Device\\Video" + i);
- String root_key = "\\registry\\machine\\";
- if (adapter_string.toLowerCase().startsWith(root_key)) {
- String driver_value = WindowsRegistry.queryRegistrationKey(
- WindowsRegistry.HKEY_LOCAL_MACHINE,
- adapter_string.substring(root_key.length()),
- "InstalledDisplayDrivers");
- if(driver_value.toUpperCase().startsWith("VGA")) {
- vga_driver_value = driver_value;
- } else if(!driver_value.toUpperCase().startsWith("RDP") && !driver_value.toUpperCase().startsWith("NMNDD")) {
- return driver_value;
- }
- }
- }
- if(!vga_driver_value.equals("")) {
- return vga_driver_value;
- }
- } catch (LWJGLException e) {
- LWJGLUtil.log("Exception occurred while querying registry: " + e);
- }
- return null;
- }
-
- public String getVersion() {
- String driver = getAdapter();
- if (driver != null) {
- String[] drivers = driver.split(",");
- if(drivers.length>0) {
- WindowsFileVersion version = nGetVersion(drivers[0] + ".dll");
- if (version != null)
- return version.toString();
- }
- }
- return null;
- }
- private native WindowsFileVersion nGetVersion(String driver);
-
- public DisplayMode init() throws LWJGLException {
- current_gamma = saved_gamma = getCurrentGammaRamp();
- return current_mode = getCurrentDisplayMode();
- }
- private static native DisplayMode getCurrentDisplayMode() throws LWJGLException;
-
- public void setTitle(String title) {
- nSetTitle(hwnd, title);
- }
- private static native void nSetTitle(long hwnd, String title);
-
- public boolean isCloseRequested() {
- boolean saved = close_requested;
- close_requested = false;
- return saved;
- }
-
- public boolean isVisible() {
- return !isMinimized;
- }
-
- public boolean isActive() {
- return isFocused;
- }
-
- public boolean isDirty() {
- boolean saved = is_dirty;
- is_dirty = false;
- return saved;
- }
-
- public PeerInfo createPeerInfo(PixelFormat pixel_format) throws LWJGLException {
- peer_info = new WindowsDisplayPeerInfo(pixel_format);
- return peer_info;
- }
-
- public void update() {
- nUpdate();
- if (parent != null && parent.isFocusOwner()) {
- setFocus(getHwnd());
- }
- if (did_maximize) {
- did_maximize = false;
- /**
- * WORKAROUND:
- * Making the context current (redundantly) when the window
- * is maximized helps some gfx cards recover from fullscreen
- */
- try {
- if (Display.getDrawable().getContext() != null && Display.getDrawable().getContext().isCurrent())
- Display.getDrawable().getContext().makeCurrent();
- } catch (LWJGLException e) {
- LWJGLUtil.log("Exception occurred while trying to make context current: " + e);
- }
- }
- }
- private static native void nUpdate();
-
- public void reshape(int x, int y, int width, int height) {
- nReshape(getHwnd(), x, y, width, height, Display.isFullscreen() || isUndecorated(), parent != null);
- }
- private static native void nReshape(long hwnd, int x, int y, int width, int height, boolean undecorated, boolean child);
- public native DisplayMode[] getAvailableDisplayModes() throws LWJGLException;
-
- /* Mouse */
- public boolean hasWheel() {
- return mouse.hasWheel();
- }
-
- public int getButtonCount() {
- return mouse.getButtonCount();
- }
-
- public void createMouse() throws LWJGLException {
- mouse = new WindowsMouse(getHwnd());
- }
-
- public void destroyMouse() {
- if (mouse != null)
- mouse.destroy();
- mouse = null;
- }
-
- public void pollMouse(IntBuffer coord_buffer, ByteBuffer buttons) {
- mouse.poll(coord_buffer, buttons);
- }
-
- public void readMouse(ByteBuffer buffer) {
- mouse.read(buffer);
- }
-
- public void grabMouse(boolean grab) {
- mouse.grab(grab, shouldGrab());
- updateCursor();
- }
-
- public int getNativeCursorCapabilities() {
- return Cursor.CURSOR_ONE_BIT_TRANSPARENCY;
- }
-
- public void setCursorPosition(int x, int y) {
- getGlobalClientRect(getHwnd(), rect);
- int transformed_x = rect.left + x;
- int transformed_y = rect.bottom - 1 - y;
- nSetCursorPosition(transformed_x, transformed_y);
- setMousePosition(x, y);
- }
- private static native void nSetCursorPosition(int x, int y);
-
- public void setNativeCursor(Object handle) throws LWJGLException {
- current_cursor = handle;
- updateCursor();
- }
-
- private void updateCursor() {
- try {
- if (mouse != null && shouldGrab())
- nSetNativeCursor(getHwnd(), mouse.getBlankCursor());
- else
- nSetNativeCursor(getHwnd(), current_cursor);
- } catch (LWJGLException e) {
- LWJGLUtil.log("Failed to update cursor: " + e);
- }
- }
- static native void nSetNativeCursor(long hwnd, Object handle) throws LWJGLException;
-
- public int getMinCursorSize() {
- return getSystemMetrics(SM_CXCURSOR);
- }
-
- public int getMaxCursorSize() {
- return getSystemMetrics(SM_CXCURSOR);
- }
-
- static native int getSystemMetrics(int index);
-
- private static native long getDllInstance();
-
- private long getHwnd() {
- return hwnd;
- }
-
- private long getHdc() {
- return hdc;
- }
-
- private static native long getDC(long hwnd);
- private static native long getDesktopWindow();
- private static native long getForegroundWindow();
-
- static void centerCursor(long hwnd) {
- if (getForegroundWindow() != hwnd && !hasParent)
- return;
- getGlobalClientRect(hwnd, rect);
- int local_offset_x = rect.left;
- int local_offset_y = rect.top;
- /* -- This is wrong on multi-monitor setups
- getGlobalClientRect(getDesktopWindow(), rect2);
- Rect.intersect(rect, rect2, rect);
- */
- int center_x = (rect.left + rect.right)/2;
- int center_y = (rect.top + rect.bottom)/2;
- nSetCursorPosition(center_x, center_y);
- int local_x = center_x - local_offset_x;
- int local_y = center_y - local_offset_y;
- if (current_display != null)
- current_display.setMousePosition(local_x, transformY(hwnd, local_y));
- }
-
- private void setMousePosition(int x, int y) {
- if (mouse != null)
- mouse.setPosition(x, y);
- }
-
- /* Keyboard */
- public void createKeyboard() throws LWJGLException {
- keyboard = new WindowsKeyboard(getHwnd());
- }
-
- public void destroyKeyboard() {
- keyboard.destroy();
- keyboard = null;
- }
-
- public void pollKeyboard(ByteBuffer keyDownBuffer) {
- keyboard.poll(keyDownBuffer);
- }
-
- public void readKeyboard(ByteBuffer buffer) {
- keyboard.read(buffer);
- }
-
-// public native int isStateKeySet(int key);
-
- public static native ByteBuffer nCreateCursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, int images_offset, IntBuffer delays, int delays_offset) throws LWJGLException;
-
- public Object createCursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws LWJGLException {
- return doCreateCursor(width, height, xHotspot, yHotspot, numImages, images, delays);
- }
-
- static Object doCreateCursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws LWJGLException {
- return nCreateCursor(width, height, xHotspot, yHotspot, numImages, images, images.position(), delays, delays != null ? delays.position() : -1);
- }
-
- public void destroyCursor(Object cursorHandle) {
- doDestroyCursor(cursorHandle);
- }
- static native void doDestroyCursor(Object cursorHandle);
-
- public int getPbufferCapabilities() {
- try {
- // Return the capabilities of a minimum pixel format
- return nGetPbufferCapabilities(new PixelFormat(0, 0, 0, 0, 0, 0, 0, 0, false));
- } catch (LWJGLException e) {
- LWJGLUtil.log("Exception occurred while determining pbuffer capabilities: " + e);
- return 0;
- }
- }
- private native int nGetPbufferCapabilities(PixelFormat format) throws LWJGLException;
-
- public boolean isBufferLost(PeerInfo handle) {
- return ((WindowsPbufferPeerInfo)handle).isBufferLost();
- }
-
- public PeerInfo createPbuffer(int width, int height, PixelFormat pixel_format,
- IntBuffer pixelFormatCaps,
- IntBuffer pBufferAttribs) throws LWJGLException {
- return new WindowsPbufferPeerInfo(width, height, pixel_format, pixelFormatCaps, pBufferAttribs);
- }
-
- public void setPbufferAttrib(PeerInfo handle, int attrib, int value) {
- ((WindowsPbufferPeerInfo)handle).setPbufferAttrib(attrib, value);
- }
-
- public void bindTexImageToPbuffer(PeerInfo handle, int buffer) {
- ((WindowsPbufferPeerInfo)handle).bindTexImageToPbuffer(buffer);
- }
-
- public void releaseTexImageFromPbuffer(PeerInfo handle, int buffer) {
- ((WindowsPbufferPeerInfo)handle).releaseTexImageFromPbuffer(buffer);
- }
-
- private void freeSmallIcon() {
- if (small_icon != 0) {
- destroyIcon(small_icon);
- small_icon = 0;
- }
- }
-
- private void freeLargeIcon() {
- if (large_icon != 0) {
- destroyIcon(large_icon);
- large_icon = 0;
- }
- }
-
- /**
- * Sets one or more icons for the Display.
- * <ul>
- * <li>On Windows you should supply at least one 16x16 icon and one 32x32.</li>
- * <li>Linux (and similar platforms) expect one 32x32 icon.</li>
- * <li>Mac OS X should be supplied one 128x128 icon</li>
- * </ul>
- * The implementation will use the supplied ByteBuffers with image data in RGBA and perform any conversions nescesarry for the specific platform.
- *
- * @param icons Array of icons in RGBA mode
- * @return number of icons used.
- */
- public int setIcon(ByteBuffer[] icons) {
- boolean done_small = false;
- boolean done_large = false;
- int used = 0;
-
- int small_icon_size = 16;
- int large_icon_size = 32;
- for (int i=0;i<icons.length;i++) {
- int size = icons[i].limit() / 4;
-
- if ((((int) Math.sqrt(size)) == small_icon_size) && (!done_small)) {
- freeSmallIcon();
- small_icon = createIcon(small_icon_size, small_icon_size, icons[i].asIntBuffer());
- sendMessage(hwnd, WM_SETICON, ICON_SMALL, small_icon);
- used++;
- done_small = true;
- }
- if ((((int) Math.sqrt(size)) == large_icon_size) && (!done_large)) {
- freeLargeIcon();
- large_icon = createIcon(large_icon_size, large_icon_size, icons[i].asIntBuffer());
- sendMessage(hwnd, WM_SETICON, ICON_BIG, large_icon);
- used++;
- done_large = true;
- }
- }
-
- return used;
- }
- private static native long createIcon(int width, int height, IntBuffer icon);
- private static native void destroyIcon(long handle);
- private static native long sendMessage(long hwnd, long msg, long wparam, long lparam);
-
- private void handleMouseButton(int button, int state, long millis) {
- if (mouse != null) {
- mouse.handleMouseButton((byte)button, (byte)state, millis);
-
- // need to capture?
- if (captureMouse == -1 && button != -1 && state == 1) {
- captureMouse = button;
- nSetCapture(hwnd);
- }
-
- // done with capture?
- if(captureMouse != -1 && button == captureMouse && state == 0) {
- captureMouse = -1;
- nReleaseCapture();
- }
- }
-
- if (parent != null && !isFocused) {
- setFocus(getHwnd());
- }
- }
-
- private boolean shouldGrab() {
- return !isMinimized && isFocused && Mouse.isGrabbed();
- }
-
- private void handleMouseMoved(int x, int y, long millis) {
- if (mouse != null) {
- mouse.handleMouseMoved(x, y, millis, shouldGrab());
- }
- }
-
- private static native long nSetCapture(long hwnd);
- private static native boolean nReleaseCapture();
-
- private void handleMouseScrolled(int amount, long millis) {
- if (mouse != null)
- mouse.handleMouseScrolled(amount, millis);
- }
-
- private static native void getClientRect(long hwnd, IntBuffer rect);
-
- private void handleChar(long wParam, long lParam, long millis) {
- byte previous_state = (byte)((lParam >>> 30) & 0x1);
- byte state = (byte)(1 - ((lParam >>> 31) & 0x1));
- boolean repeat = state == previous_state;
- if (keyboard != null)
- keyboard.handleChar((int)(wParam & 0xFF), millis, repeat);
- }
-
- private void handleKeyButton(long wParam, long lParam, long millis) {
- byte previous_state = (byte)((lParam >>> 30) & 0x1);
- byte state = (byte)(1 - ((lParam >>> 31) & 0x1));
- boolean repeat = state == previous_state; // Repeat message
- byte extended = (byte)((lParam >>> 24) & 0x1);
- int scan_code = (int)((lParam >>> 16) & 0xFF);
- if (keyboard != null) {
- keyboard.handleKey((int)wParam, scan_code, extended != 0, state, millis, repeat);
-
- if(captureMouse != -1 && keyboard.isKeyDown(Keyboard.KEY_ESCAPE)) {
- nReleaseCapture();
- captureMouse = -1;
- }
- }
- }
-
- private static int transformY(long hwnd, int y) {
- getClientRect(hwnd, rect_buffer);
- rect.copyFromBuffer(rect_buffer);
- return (rect.bottom - rect.top) - 1 - y;
- }
-
- private static native void clientToScreen(long hwnd, IntBuffer point);
-
- private static int handleMessage(long hwnd, int msg, long wParam, long lParam, long millis) {
- if (current_display != null)
- return current_display.doHandleMessage(hwnd, msg, wParam, lParam, millis);
- else
- return defWindowProc(hwnd, msg, wParam, lParam);
- }
-
- private static native int defWindowProc(long hwnd, int msg, long wParam, long lParam);
-
- private void checkCursorState() {
- updateClipping();
- }
-
- private void updateClipping() {
- if ((Display.isFullscreen() || (mouse != null && mouse.isGrabbed())) && !isMinimized && isFocused && (getForegroundWindow() == getHwnd() || hasParent)) {
- try {
- setupCursorClipping(getHwnd());
- } catch (LWJGLException e) {
- LWJGLUtil.log("setupCursorClipping failed: " + e.getMessage());
- }
- } else {
- resetCursorClipping();
- }
- }
-
- private void setMinimized(boolean m) {
- isMinimized = m;
- checkCursorState();
- }
-
- private int doHandleMessage(long hwnd, int msg, long wParam, long lParam, long millis) {
- switch (msg) {
- // disable screen saver and monitor power down messages which wreak havoc
- case WM_ACTIVATE:
- switch ((int)wParam) {
- case WA_ACTIVE:
- case WA_CLICKACTIVE:
- appActivate(true);
- break;
- case WA_INACTIVE:
- appActivate(false);
- break;
- }
- return 0;
- case WM_SIZE:
- switch ((int)wParam) {
- case SIZE_RESTORED:
- case SIZE_MAXIMIZED:
- setMinimized(false);
- break;
- case SIZE_MINIMIZED:
- setMinimized(true);
- break;
- }
- return defWindowProc(hwnd, msg, wParam, lParam);
- case WM_KILLFOCUS:
- appActivate(false);
- return 0;
- case WM_SETFOCUS:
- appActivate(true);
- return 0;
- case WM_MOUSEMOVE:
- int xPos = (int)(short)(lParam & 0xFFFF);
- int yPos = transformY(getHwnd(), (int)(short)((lParam >> 16) & 0xFFFF));
- handleMouseMoved(xPos, yPos, millis);
- checkCursorState();
- mouseInside = true;
- if(!trackingMouse) {
- trackingMouse = nTrackMouseEvent(hwnd);
- }
- return 0;
- case WM_MOUSEWHEEL:
- int dwheel = (int)(short)((wParam >> 16) & 0xFFFF);
- handleMouseScrolled(dwheel, millis);
- return 0;
- case WM_LBUTTONDOWN:
- handleMouseButton(0, 1, millis);
- return 0;
- case WM_LBUTTONUP:
- handleMouseButton(0, 0, millis);
- return 0;
- case WM_RBUTTONDOWN:
- handleMouseButton(1, 1, millis);
- return 0;
- case WM_RBUTTONUP:
- handleMouseButton(1, 0, millis);
- return 0;
- case WM_MBUTTONDOWN:
- handleMouseButton(2, 1, millis);
- return 0;
- case WM_MBUTTONUP:
- handleMouseButton(2, 0, millis);
- return 0;
- case WM_SYSCHAR:
- case WM_CHAR:
- handleChar(wParam, lParam, millis);
- return 0;
- case WM_SYSKEYUP:
- /* Fall through */
- case WM_KEYUP:
- // SysRq apparently only generates WM_KEYUP, so we'll fake a WM_KEYDOWN
- if (wParam == WindowsKeycodes.VK_SNAPSHOT && keyboard != null &&
- !keyboard.isKeyDown(org.lwjgl.input.Keyboard.KEY_SYSRQ)) {
- // Set key state to pressed
- long fake_lparam = lParam & ~(1 << 31);
- // Set key previous state to released
- fake_lparam = fake_lparam & ~(1 << 30);
- handleKeyButton(wParam, fake_lparam, millis);
- }
- /* Fall through */
- case WM_SYSKEYDOWN:
- /* Fall through */
- case WM_KEYDOWN:
- handleKeyButton(wParam, lParam, millis);
- return defWindowProc(hwnd, msg, wParam, lParam);
- case WM_QUIT:
- close_requested = true;
- return 0;
- case WM_SYSCOMMAND:
- switch ((int)(wParam & 0xfff0)) {
- case SC_KEYMENU:
- case SC_MOUSEMENU:
- case SC_SCREENSAVE:
- case SC_MONITORPOWER:
- return 0;
- case SC_CLOSE:
- close_requested = true;
- return 0;
- default:
- break;
- }
- return defWindowProc(hwnd, msg, wParam, lParam);
- case WM_PAINT:
- is_dirty = true;
- return defWindowProc(hwnd, msg, wParam, lParam);
- case WM_MOUSELEAVE:
- mouseInside = false;
- trackingMouse = false;
- return defWindowProc(hwnd, msg, wParam, lParam);
- case WM_CANCELMODE:
- nReleaseCapture();
- /* fall through */
- case WM_CAPTURECHANGED:
- if(captureMouse != -1) {
- handleMouseButton(captureMouse, 0, millis);
- captureMouse = -1;
- }
- return 0;
- default:
- return defWindowProc(hwnd, msg, wParam, lParam);
- }
- }
-
- public int getWidth() {
- return Display.getDisplayMode().getWidth();
- }
-
- public int getHeight() {
- return Display.getDisplayMode().getHeight();
- }
-
- private int firstMouseButtonDown() {
- for(int i=0; i<Mouse.getButtonCount(); i++) {
- if(Mouse.isButtonDown(i)) {
- return i;
- }
- }
- return -1;
- }
-
- private native boolean nTrackMouseEvent(long hwnd);
-
- public boolean isInsideWindow() {
- return mouseInside;
- }
-
- private static final class Rect {
- public int top;
- public int bottom;
- public int left;
- public int right;
-
- public void copyToBuffer(IntBuffer buffer) {
- buffer.put(0, top).put(1, bottom).put(2, left).put(3, right);
- }
-
- public void copyFromBuffer(IntBuffer buffer) {
- top = buffer.get(0);
- bottom = buffer.get(1);
- left = buffer.get(2);
- right = buffer.get(3);
- }
-
- public void offset(int offset_x, int offset_y) {
- left += offset_x;
- right += offset_x;
- top += offset_y;
- bottom += offset_y;
- }
-
- public static void intersect(Rect r1, Rect r2, Rect dst) {
- dst.top = Math.max(r1.top, r2.top);
- dst.bottom = Math.min(r1.bottom, r2.bottom);
- dst.left = Math.max(r1.left, r2.left);
- dst.right = Math.min(r1.right, r2.right);
- }
-
- public String toString() {
- return "Rect: top = " + top + " bottom = " + bottom + " left = " + left + " right = " + right;
- }
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+/**
+ * This is the Display implementation interface. Display delegates
+ * to implementors of this interface. There is one DisplayImplementation
+ * for each supported platform.
+ * @author elias_naur
+ */
+
+import java.nio.ByteBuffer;
+import java.nio.FloatBuffer;
+import java.nio.IntBuffer;
+import java.awt.Canvas;
+
+import org.lwjgl.LWJGLException;
+import org.lwjgl.LWJGLUtil;
+import org.lwjgl.BufferUtils;
+import org.lwjgl.input.Cursor;
+import org.lwjgl.input.Keyboard;
+import org.lwjgl.input.Mouse;
+
+final class WindowsDisplay implements DisplayImplementation {
+ private final static int GAMMA_LENGTH = 256;
+
+ private final static int WM_CANCELMODE = 0x001F;
+ private final static int WM_MOUSEMOVE = 0x0200;
+ private final static int WM_LBUTTONDOWN = 0x0201;
+ private final static int WM_LBUTTONUP = 0x0202;
+ private final static int WM_LBUTTONDBLCLK = 0x0203;
+ private final static int WM_RBUTTONDOWN = 0x0204;
+ private final static int WM_RBUTTONUP = 0x0205;
+ private final static int WM_RBUTTONDBLCLK = 0x0206;
+ private final static int WM_MBUTTONDOWN = 0x0207;
+ private final static int WM_MBUTTONUP = 0x0208;
+ private final static int WM_MBUTTONDBLCLK = 0x0209;
+ private final static int WM_MOUSEWHEEL = 0x020A;
+ private final static int WM_CAPTURECHANGED = 0x0215;
+ private final static int WM_MOUSELEAVE = 0x02A3;
+ private final static int WM_KEYDOWN = 256;
+ private final static int WM_KEYUP = 257;
+ private final static int WM_SYSKEYUP = 261;
+ private final static int WM_SYSKEYDOWN = 260;
+ private final static int WM_SYSCHAR = 262;
+ private final static int WM_CHAR = 258;
+ private final static int WM_SETICON = 0x0080;
+
+ private final static int WM_QUIT = 0x0012;
+ private final static int WM_SYSCOMMAND = 0x0112;
+ private final static int WM_PAINT = 0x000F;
+ private final static int WM_KILLFOCUS = 8;
+ private final static int WM_SETFOCUS = 7;
+
+ private final static int SC_SIZE = 0xF000;
+ private final static int SC_MOVE = 0xF010;
+ private final static int SC_MINIMIZE = 0xF020;
+ private final static int SC_MAXIMIZE = 0xF030;
+ private final static int SC_NEXTWINDOW = 0xF040;
+ private final static int SC_PREVWINDOW = 0xF050;
+ private final static int SC_CLOSE = 0xF060;
+ private final static int SC_VSCROLL = 0xF070;
+ private final static int SC_HSCROLL = 0xF080;
+ private final static int SC_MOUSEMENU = 0xF090;
+ private final static int SC_KEYMENU = 0xF100;
+ private final static int SC_ARRANGE = 0xF110;
+ private final static int SC_RESTORE = 0xF120;
+ private final static int SC_TASKLIST = 0xF130;
+ private final static int SC_SCREENSAVE = 0xF140;
+ private final static int SC_HOTKEY = 0xF150;
+ private final static int SC_DEFAULT = 0xF160;
+ private final static int SC_MONITORPOWER = 0xF170;
+ private final static int SC_CONTEXTHELP = 0xF180;
+ private final static int SC_SEPARATOR = 0xF00F;
+
+ final static int SM_CXCURSOR = 13;
+ final static int SM_CYCURSOR = 14;
+ final static int SM_CMOUSEBUTTONS = 43;
+ final static int SM_MOUSEWHEELPRESENT = 75;
+
+ private final static int SIZE_RESTORED = 0;
+ private final static int SIZE_MINIMIZED = 1;
+ private final static int SIZE_MAXIMIZED = 2;
+ private final static int WM_SIZE = 0x0005;
+ private final static int WM_ACTIVATE = 0x0006;
+ private final static int WA_INACTIVE = 0;
+ private final static int WA_ACTIVE = 1;
+ private final static int WA_CLICKACTIVE = 2;
+ private final static int SW_SHOWMINNOACTIVE = 7;
+ private final static int SW_SHOWDEFAULT = 10;
+ private final static int SW_RESTORE = 9;
+
+ private final static int ICON_SMALL = 0;
+ private final static int ICON_BIG = 1;
+
+ private final static IntBuffer rect_buffer = BufferUtils.createIntBuffer(4);
+ private final static Rect rect = new Rect();
+ private final static Rect rect2 = new Rect();
+ private static WindowsDisplay current_display;
+
+ private static boolean cursor_clipped;
+ private WindowsDisplayPeerInfo peer_info;
+ private Object current_cursor;
+ private Canvas parent;
+ private static boolean hasParent = false;
+
+ private WindowsKeyboard keyboard;
+ private WindowsMouse mouse;
+
+ private boolean close_requested;
+ private boolean is_dirty;
+
+ private ByteBuffer current_gamma;
+ private ByteBuffer saved_gamma;
+ private DisplayMode current_mode;
+
+ private boolean mode_set;
+ private boolean isMinimized;
+ private boolean isFocused;
+ private boolean did_maximize;
+ private boolean inAppActivate;
+
+ private long hwnd;
+ private long hdc;
+
+ private long small_icon;
+ private long large_icon;
+
+ private int captureMouse = -1;
+ private boolean trackingMouse = false;
+ private boolean mouseInside = false;
+
+ WindowsDisplay() {
+ current_display = this;
+ }
+
+ public void createWindow(DisplayMode mode, Canvas parent, int x, int y) throws LWJGLException {
+ close_requested = false;
+ is_dirty = false;
+ isMinimized = false;
+ isFocused = false;
+ did_maximize = false;
+ this.parent = parent;
+ hasParent = parent != null;
+ long parent_hwnd = parent != null ? getHwnd(parent) : 0;
+ this.hwnd = nCreateWindow(x, y, mode.getWidth(), mode.getHeight(), Display.isFullscreen() || isUndecorated(), parent != null, parent_hwnd);
+ if (hwnd == 0) {
+ throw new LWJGLException("Failed to create window");
+ }
+ this.hdc = getDC(hwnd);
+ if (hdc == 0) {
+ nDestroyWindow(hwnd);
+ throw new LWJGLException("Failed to get dc");
+ }
+ try {
+ int format = WindowsPeerInfo.choosePixelFormat(getHdc(), 0, 0, peer_info.getPixelFormat(), null, true, true, false, true);
+ WindowsPeerInfo.setPixelFormat(getHdc(), format);
+ peer_info.initDC(getHwnd(), getHdc());
+ showWindow(getHwnd(), SW_SHOWDEFAULT);
+ if (parent == null) {
+ setForegroundWindow(getHwnd());
+ setFocus(getHwnd());
+ }
+ } catch (LWJGLException e) {
+ nReleaseDC(hwnd, hdc);
+ nDestroyWindow(hwnd);
+ throw e;
+ }
+ }
+ private static native long nCreateWindow(int x, int y, int width, int height, boolean undecorated, boolean child_window, long parent_hwnd) throws LWJGLException;
+
+ private static boolean isUndecorated() {
+ return Display.getPrivilegedBoolean("org.lwjgl.opengl.Window.undecorated");
+ }
+
+ private static long getHwnd(Canvas parent) throws LWJGLException {
+ AWTCanvasImplementation awt_impl = AWTGLCanvas.createImplementation();
+ WindowsPeerInfo parent_peer_info = (WindowsPeerInfo)awt_impl.createPeerInfo(parent, null);
+ ByteBuffer parent_peer_info_handle = parent_peer_info.lockAndGetHandle();
+ try {
+ return parent_peer_info.getHwnd();
+ } finally {
+ parent_peer_info.unlock();
+ }
+ }
+
+ public void destroyWindow() {
+ nReleaseDC(hwnd, hdc);
+ nDestroyWindow(hwnd);
+ freeLargeIcon();
+ freeSmallIcon();
+ resetCursorClipping();
+ }
+ private static native void nReleaseDC(long hwnd, long hdc);
+ private static native void nDestroyWindow(long hwnd);
+ static void resetCursorClipping() {
+ if (cursor_clipped) {
+ try {
+ clipCursor(null);
+ } catch (LWJGLException e) {
+ LWJGLUtil.log("Failed to reset cursor clipping: " + e);
+ }
+ cursor_clipped = false;
+ }
+ }
+
+ private static void getGlobalClientRect(long hwnd, Rect rect) {
+ rect_buffer.put(0, 0).put(1, 0);
+ clientToScreen(hwnd, rect_buffer);
+ int offset_x = rect_buffer.get(0);
+ int offset_y = rect_buffer.get(1);
+ getClientRect(hwnd, rect_buffer);
+ rect.copyFromBuffer(rect_buffer);
+ rect.offset(offset_x, offset_y);
+ }
+
+ static void setupCursorClipping(long hwnd) throws LWJGLException {
+ cursor_clipped = true;
+ getGlobalClientRect(hwnd, rect);
+ rect.copyToBuffer(rect_buffer);
+ clipCursor(rect_buffer);
+ }
+ private static native void clipCursor(IntBuffer rect) throws LWJGLException;
+
+ public void switchDisplayMode(DisplayMode mode) throws LWJGLException {
+ nSwitchDisplayMode(mode);
+ current_mode = mode;
+ mode_set = true;
+ }
+ private static native void nSwitchDisplayMode(DisplayMode mode) throws LWJGLException;
+
+ /*
+ * Called when the application is alt-tabbed to or from
+ */
+ private void appActivate(boolean active) {
+ if (inAppActivate) {
+ return;
+ }
+ inAppActivate = true;
+ isFocused = active;
+ if (active) {
+ if (Display.isFullscreen()) {
+ restoreDisplayMode();
+ }
+ if (parent == null) {
+ showWindow(getHwnd(), SW_RESTORE);
+ setForegroundWindow(getHwnd());
+ setFocus(getHwnd());
+ }
+ did_maximize = true;
+ if (Display.isFullscreen())
+ updateClipping();
+ } else if (Display.isFullscreen()) {
+ showWindow(getHwnd(), SW_SHOWMINNOACTIVE);
+ resetDisplayMode();
+ } else
+ updateClipping();
+ updateCursor();
+ inAppActivate = false;
+ }
+ private static native void showWindow(long hwnd, int mode);
+ private static native void setForegroundWindow(long hwnd);
+ private static native void setFocus(long hwnd);
+
+ private void restoreDisplayMode() {
+ try {
+ doSetGammaRamp(current_gamma);
+ } catch (LWJGLException e) {
+ LWJGLUtil.log("Failed to restore gamma: " + e.getMessage());
+ }
+
+ if (!mode_set) {
+ mode_set = true;
+ try {
+ nSwitchDisplayMode(current_mode);
+ } catch (LWJGLException e) {
+ LWJGLUtil.log("Failed to restore display mode: " + e.getMessage());
+ }
+ }
+ }
+
+ public void resetDisplayMode() {
+ try {
+ doSetGammaRamp(saved_gamma);
+ } catch (LWJGLException e) {
+ LWJGLUtil.log("Failed to reset gamma ramp: " + e.getMessage());
+ }
+ current_gamma = saved_gamma;
+ if (mode_set) {
+ mode_set = false;
+ nResetDisplayMode();
+ }
+ resetCursorClipping();
+ }
+ private static native void nResetDisplayMode();
+
+ public int getGammaRampLength() {
+ return GAMMA_LENGTH;
+ }
+
+ public void setGammaRamp(FloatBuffer gammaRamp) throws LWJGLException {
+ doSetGammaRamp(convertToNativeRamp(gammaRamp));
+ }
+ private static native ByteBuffer convertToNativeRamp(FloatBuffer gamma_ramp) throws LWJGLException;
+ private static native ByteBuffer getCurrentGammaRamp() throws LWJGLException;
+
+ private void doSetGammaRamp(ByteBuffer native_gamma) throws LWJGLException {
+ nSetGammaRamp(native_gamma);
+ current_gamma = native_gamma;
+ }
+ private static native void nSetGammaRamp(ByteBuffer native_ramp) throws LWJGLException;
+
+ public String getAdapter() {
+ try {
+ String maxObjNo = WindowsRegistry.queryRegistrationKey(
+ WindowsRegistry.HKEY_LOCAL_MACHINE,
+ "HARDWARE\\DeviceMap\\Video",
+ "MaxObjectNumber");
+ int maxObjectNumber = maxObjNo.charAt(0);
+ String vga_driver_value = "";
+ for(int i=0;i<maxObjectNumber;i++) {
+ String adapter_string = WindowsRegistry.queryRegistrationKey(
+ WindowsRegistry.HKEY_LOCAL_MACHINE,
+ "HARDWARE\\DeviceMap\\Video",
+ "\\Device\\Video" + i);
+ String root_key = "\\registry\\machine\\";
+ if (adapter_string.toLowerCase().startsWith(root_key)) {
+ String driver_value = WindowsRegistry.queryRegistrationKey(
+ WindowsRegistry.HKEY_LOCAL_MACHINE,
+ adapter_string.substring(root_key.length()),
+ "InstalledDisplayDrivers");
+ if(driver_value.toUpperCase().startsWith("VGA")) {
+ vga_driver_value = driver_value;
+ } else if(!driver_value.toUpperCase().startsWith("RDP") && !driver_value.toUpperCase().startsWith("NMNDD")) {
+ return driver_value;
+ }
+ }
+ }
+ if(!vga_driver_value.equals("")) {
+ return vga_driver_value;
+ }
+ } catch (LWJGLException e) {
+ LWJGLUtil.log("Exception occurred while querying registry: " + e);
+ }
+ return null;
+ }
+
+ public String getVersion() {
+ String driver = getAdapter();
+ if (driver != null) {
+ String[] drivers = driver.split(",");
+ if(drivers.length>0) {
+ WindowsFileVersion version = nGetVersion(drivers[0] + ".dll");
+ if (version != null)
+ return version.toString();
+ }
+ }
+ return null;
+ }
+ private native WindowsFileVersion nGetVersion(String driver);
+
+ public DisplayMode init() throws LWJGLException {
+ current_gamma = saved_gamma = getCurrentGammaRamp();
+ return current_mode = getCurrentDisplayMode();
+ }
+ private static native DisplayMode getCurrentDisplayMode() throws LWJGLException;
+
+ public void setTitle(String title) {
+ nSetTitle(hwnd, title);
+ }
+ private static native void nSetTitle(long hwnd, String title);
+
+ public boolean isCloseRequested() {
+ boolean saved = close_requested;
+ close_requested = false;
+ return saved;
+ }
+
+ public boolean isVisible() {
+ return !isMinimized;
+ }
+
+ public boolean isActive() {
+ return isFocused;
+ }
+
+ public boolean isDirty() {
+ boolean saved = is_dirty;
+ is_dirty = false;
+ return saved;
+ }
+
+ public PeerInfo createPeerInfo(PixelFormat pixel_format) throws LWJGLException {
+ peer_info = new WindowsDisplayPeerInfo(pixel_format);
+ return peer_info;
+ }
+
+ public void update() {
+ nUpdate();
+ if (parent != null && parent.isFocusOwner()) {
+ setFocus(getHwnd());
+ }
+ if (did_maximize) {
+ did_maximize = false;
+ /**
+ * WORKAROUND:
+ * Making the context current (redundantly) when the window
+ * is maximized helps some gfx cards recover from fullscreen
+ */
+ try {
+ if (Display.getDrawable().getContext() != null && Display.getDrawable().getContext().isCurrent())
+ Display.getDrawable().getContext().makeCurrent();
+ } catch (LWJGLException e) {
+ LWJGLUtil.log("Exception occurred while trying to make context current: " + e);
+ }
+ }
+ }
+ private static native void nUpdate();
+
+ public void reshape(int x, int y, int width, int height) {
+ nReshape(getHwnd(), x, y, width, height, Display.isFullscreen() || isUndecorated(), parent != null);
+ }
+ private static native void nReshape(long hwnd, int x, int y, int width, int height, boolean undecorated, boolean child);
+ public native DisplayMode[] getAvailableDisplayModes() throws LWJGLException;
+
+ /* Mouse */
+ public boolean hasWheel() {
+ return mouse.hasWheel();
+ }
+
+ public int getButtonCount() {
+ return mouse.getButtonCount();
+ }
+
+ public void createMouse() throws LWJGLException {
+ mouse = new WindowsMouse(getHwnd());
+ }
+
+ public void destroyMouse() {
+ if (mouse != null)
+ mouse.destroy();
+ mouse = null;
+ }
+
+ public void pollMouse(IntBuffer coord_buffer, ByteBuffer buttons) {
+ mouse.poll(coord_buffer, buttons);
+ }
+
+ public void readMouse(ByteBuffer buffer) {
+ mouse.read(buffer);
+ }
+
+ public void grabMouse(boolean grab) {
+ mouse.grab(grab, shouldGrab());
+ updateCursor();
+ }
+
+ public int getNativeCursorCapabilities() {
+ return Cursor.CURSOR_ONE_BIT_TRANSPARENCY;
+ }
+
+ public void setCursorPosition(int x, int y) {
+ getGlobalClientRect(getHwnd(), rect);
+ int transformed_x = rect.left + x;
+ int transformed_y = rect.bottom - 1 - y;
+ nSetCursorPosition(transformed_x, transformed_y);
+ setMousePosition(x, y);
+ }
+ private static native void nSetCursorPosition(int x, int y);
+
+ public void setNativeCursor(Object handle) throws LWJGLException {
+ current_cursor = handle;
+ updateCursor();
+ }
+
+ private void updateCursor() {
+ try {
+ if (mouse != null && shouldGrab())
+ nSetNativeCursor(getHwnd(), mouse.getBlankCursor());
+ else
+ nSetNativeCursor(getHwnd(), current_cursor);
+ } catch (LWJGLException e) {
+ LWJGLUtil.log("Failed to update cursor: " + e);
+ }
+ }
+ static native void nSetNativeCursor(long hwnd, Object handle) throws LWJGLException;
+
+ public int getMinCursorSize() {
+ return getSystemMetrics(SM_CXCURSOR);
+ }
+
+ public int getMaxCursorSize() {
+ return getSystemMetrics(SM_CXCURSOR);
+ }
+
+ static native int getSystemMetrics(int index);
+
+ private static native long getDllInstance();
+
+ private long getHwnd() {
+ return hwnd;
+ }
+
+ private long getHdc() {
+ return hdc;
+ }
+
+ private static native long getDC(long hwnd);
+ private static native long getDesktopWindow();
+ private static native long getForegroundWindow();
+
+ static void centerCursor(long hwnd) {
+ if (getForegroundWindow() != hwnd && !hasParent)
+ return;
+ getGlobalClientRect(hwnd, rect);
+ int local_offset_x = rect.left;
+ int local_offset_y = rect.top;
+ /* -- This is wrong on multi-monitor setups
+ getGlobalClientRect(getDesktopWindow(), rect2);
+ Rect.intersect(rect, rect2, rect);
+ */
+ int center_x = (rect.left + rect.right)/2;
+ int center_y = (rect.top + rect.bottom)/2;
+ nSetCursorPosition(center_x, center_y);
+ int local_x = center_x - local_offset_x;
+ int local_y = center_y - local_offset_y;
+ if (current_display != null)
+ current_display.setMousePosition(local_x, transformY(hwnd, local_y));
+ }
+
+ private void setMousePosition(int x, int y) {
+ if (mouse != null)
+ mouse.setPosition(x, y);
+ }
+
+ /* Keyboard */
+ public void createKeyboard() throws LWJGLException {
+ keyboard = new WindowsKeyboard(getHwnd());
+ }
+
+ public void destroyKeyboard() {
+ keyboard.destroy();
+ keyboard = null;
+ }
+
+ public void pollKeyboard(ByteBuffer keyDownBuffer) {
+ keyboard.poll(keyDownBuffer);
+ }
+
+ public void readKeyboard(ByteBuffer buffer) {
+ keyboard.read(buffer);
+ }
+
+// public native int isStateKeySet(int key);
+
+ public static native ByteBuffer nCreateCursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, int images_offset, IntBuffer delays, int delays_offset) throws LWJGLException;
+
+ public Object createCursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws LWJGLException {
+ return doCreateCursor(width, height, xHotspot, yHotspot, numImages, images, delays);
+ }
+
+ static Object doCreateCursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws LWJGLException {
+ return nCreateCursor(width, height, xHotspot, yHotspot, numImages, images, images.position(), delays, delays != null ? delays.position() : -1);
+ }
+
+ public void destroyCursor(Object cursorHandle) {
+ doDestroyCursor(cursorHandle);
+ }
+ static native void doDestroyCursor(Object cursorHandle);
+
+ public int getPbufferCapabilities() {
+ try {
+ // Return the capabilities of a minimum pixel format
+ return nGetPbufferCapabilities(new PixelFormat(0, 0, 0, 0, 0, 0, 0, 0, false));
+ } catch (LWJGLException e) {
+ LWJGLUtil.log("Exception occurred while determining pbuffer capabilities: " + e);
+ return 0;
+ }
+ }
+ private native int nGetPbufferCapabilities(PixelFormat format) throws LWJGLException;
+
+ public boolean isBufferLost(PeerInfo handle) {
+ return ((WindowsPbufferPeerInfo)handle).isBufferLost();
+ }
+
+ public PeerInfo createPbuffer(int width, int height, PixelFormat pixel_format,
+ IntBuffer pixelFormatCaps,
+ IntBuffer pBufferAttribs) throws LWJGLException {
+ return new WindowsPbufferPeerInfo(width, height, pixel_format, pixelFormatCaps, pBufferAttribs);
+ }
+
+ public void setPbufferAttrib(PeerInfo handle, int attrib, int value) {
+ ((WindowsPbufferPeerInfo)handle).setPbufferAttrib(attrib, value);
+ }
+
+ public void bindTexImageToPbuffer(PeerInfo handle, int buffer) {
+ ((WindowsPbufferPeerInfo)handle).bindTexImageToPbuffer(buffer);
+ }
+
+ public void releaseTexImageFromPbuffer(PeerInfo handle, int buffer) {
+ ((WindowsPbufferPeerInfo)handle).releaseTexImageFromPbuffer(buffer);
+ }
+
+ private void freeSmallIcon() {
+ if (small_icon != 0) {
+ destroyIcon(small_icon);
+ small_icon = 0;
+ }
+ }
+
+ private void freeLargeIcon() {
+ if (large_icon != 0) {
+ destroyIcon(large_icon);
+ large_icon = 0;
+ }
+ }
+
+ /**
+ * Sets one or more icons for the Display.
+ * <ul>
+ * <li>On Windows you should supply at least one 16x16 icon and one 32x32.</li>
+ * <li>Linux (and similar platforms) expect one 32x32 icon.</li>
+ * <li>Mac OS X should be supplied one 128x128 icon</li>
+ * </ul>
+ * The implementation will use the supplied ByteBuffers with image data in RGBA and perform any conversions nescesarry for the specific platform.
+ *
+ * @param icons Array of icons in RGBA mode
+ * @return number of icons used.
+ */
+ public int setIcon(ByteBuffer[] icons) {
+ boolean done_small = false;
+ boolean done_large = false;
+ int used = 0;
+
+ int small_icon_size = 16;
+ int large_icon_size = 32;
+ for (int i=0;i<icons.length;i++) {
+ int size = icons[i].limit() / 4;
+
+ if ((((int) Math.sqrt(size)) == small_icon_size) && (!done_small)) {
+ freeSmallIcon();
+ small_icon = createIcon(small_icon_size, small_icon_size, icons[i].asIntBuffer());
+ sendMessage(hwnd, WM_SETICON, ICON_SMALL, small_icon);
+ used++;
+ done_small = true;
+ }
+ if ((((int) Math.sqrt(size)) == large_icon_size) && (!done_large)) {
+ freeLargeIcon();
+ large_icon = createIcon(large_icon_size, large_icon_size, icons[i].asIntBuffer());
+ sendMessage(hwnd, WM_SETICON, ICON_BIG, large_icon);
+ used++;
+ done_large = true;
+ }
+ }
+
+ return used;
+ }
+ private static native long createIcon(int width, int height, IntBuffer icon);
+ private static native void destroyIcon(long handle);
+ private static native long sendMessage(long hwnd, long msg, long wparam, long lparam);
+
+ private void handleMouseButton(int button, int state, long millis) {
+ if (mouse != null) {
+ mouse.handleMouseButton((byte)button, (byte)state, millis);
+
+ // need to capture?
+ if (captureMouse == -1 && button != -1 && state == 1) {
+ captureMouse = button;
+ nSetCapture(hwnd);
+ }
+
+ // done with capture?
+ if(captureMouse != -1 && button == captureMouse && state == 0) {
+ captureMouse = -1;
+ nReleaseCapture();
+ }
+ }
+
+ if (parent != null && !isFocused) {
+ setFocus(getHwnd());
+ }
+ }
+
+ private boolean shouldGrab() {
+ return !isMinimized && isFocused && Mouse.isGrabbed();
+ }
+
+ private void handleMouseMoved(int x, int y, long millis) {
+ if (mouse != null) {
+ mouse.handleMouseMoved(x, y, millis, shouldGrab());
+ }
+ }
+
+ private static native long nSetCapture(long hwnd);
+ private static native boolean nReleaseCapture();
+
+ private void handleMouseScrolled(int amount, long millis) {
+ if (mouse != null)
+ mouse.handleMouseScrolled(amount, millis);
+ }
+
+ private static native void getClientRect(long hwnd, IntBuffer rect);
+
+ private void handleChar(long wParam, long lParam, long millis) {
+ byte previous_state = (byte)((lParam >>> 30) & 0x1);
+ byte state = (byte)(1 - ((lParam >>> 31) & 0x1));
+ boolean repeat = state == previous_state;
+ if (keyboard != null)
+ keyboard.handleChar((int)(wParam & 0xFF), millis, repeat);
+ }
+
+ private void handleKeyButton(long wParam, long lParam, long millis) {
+ byte previous_state = (byte)((lParam >>> 30) & 0x1);
+ byte state = (byte)(1 - ((lParam >>> 31) & 0x1));
+ boolean repeat = state == previous_state; // Repeat message
+ byte extended = (byte)((lParam >>> 24) & 0x1);
+ int scan_code = (int)((lParam >>> 16) & 0xFF);
+ if (keyboard != null) {
+ keyboard.handleKey((int)wParam, scan_code, extended != 0, state, millis, repeat);
+
+ if(captureMouse != -1 && keyboard.isKeyDown(Keyboard.KEY_ESCAPE)) {
+ nReleaseCapture();
+ captureMouse = -1;
+ }
+ }
+ }
+
+ private static int transformY(long hwnd, int y) {
+ getClientRect(hwnd, rect_buffer);
+ rect.copyFromBuffer(rect_buffer);
+ return (rect.bottom - rect.top) - 1 - y;
+ }
+
+ private static native void clientToScreen(long hwnd, IntBuffer point);
+
+ private static int handleMessage(long hwnd, int msg, long wParam, long lParam, long millis) {
+ if (current_display != null)
+ return current_display.doHandleMessage(hwnd, msg, wParam, lParam, millis);
+ else
+ return defWindowProc(hwnd, msg, wParam, lParam);
+ }
+
+ private static native int defWindowProc(long hwnd, int msg, long wParam, long lParam);
+
+ private void checkCursorState() {
+ updateClipping();
+ }
+
+ private void updateClipping() {
+ if ((Display.isFullscreen() || (mouse != null && mouse.isGrabbed())) && !isMinimized && isFocused && (getForegroundWindow() == getHwnd() || hasParent)) {
+ try {
+ setupCursorClipping(getHwnd());
+ } catch (LWJGLException e) {
+ LWJGLUtil.log("setupCursorClipping failed: " + e.getMessage());
+ }
+ } else {
+ resetCursorClipping();
+ }
+ }
+
+ private void setMinimized(boolean m) {
+ isMinimized = m;
+ checkCursorState();
+ }
+
+ private int doHandleMessage(long hwnd, int msg, long wParam, long lParam, long millis) {
+ switch (msg) {
+ // disable screen saver and monitor power down messages which wreak havoc
+ case WM_ACTIVATE:
+ switch ((int)wParam) {
+ case WA_ACTIVE:
+ case WA_CLICKACTIVE:
+ appActivate(true);
+ break;
+ case WA_INACTIVE:
+ appActivate(false);
+ break;
+ }
+ return 0;
+ case WM_SIZE:
+ switch ((int)wParam) {
+ case SIZE_RESTORED:
+ case SIZE_MAXIMIZED:
+ setMinimized(false);
+ break;
+ case SIZE_MINIMIZED:
+ setMinimized(true);
+ break;
+ }
+ return defWindowProc(hwnd, msg, wParam, lParam);
+ case WM_KILLFOCUS:
+ appActivate(false);
+ return 0;
+ case WM_SETFOCUS:
+ appActivate(true);
+ return 0;
+ case WM_MOUSEMOVE:
+ int xPos = (int)(short)(lParam & 0xFFFF);
+ int yPos = transformY(getHwnd(), (int)(short)((lParam >> 16) & 0xFFFF));
+ handleMouseMoved(xPos, yPos, millis);
+ checkCursorState();
+ mouseInside = true;
+ if(!trackingMouse) {
+ trackingMouse = nTrackMouseEvent(hwnd);
+ }
+ return 0;
+ case WM_MOUSEWHEEL:
+ int dwheel = (int)(short)((wParam >> 16) & 0xFFFF);
+ handleMouseScrolled(dwheel, millis);
+ return 0;
+ case WM_LBUTTONDOWN:
+ handleMouseButton(0, 1, millis);
+ return 0;
+ case WM_LBUTTONUP:
+ handleMouseButton(0, 0, millis);
+ return 0;
+ case WM_RBUTTONDOWN:
+ handleMouseButton(1, 1, millis);
+ return 0;
+ case WM_RBUTTONUP:
+ handleMouseButton(1, 0, millis);
+ return 0;
+ case WM_MBUTTONDOWN:
+ handleMouseButton(2, 1, millis);
+ return 0;
+ case WM_MBUTTONUP:
+ handleMouseButton(2, 0, millis);
+ return 0;
+ case WM_SYSCHAR:
+ case WM_CHAR:
+ handleChar(wParam, lParam, millis);
+ return 0;
+ case WM_SYSKEYUP:
+ /* Fall through */
+ case WM_KEYUP:
+ // SysRq apparently only generates WM_KEYUP, so we'll fake a WM_KEYDOWN
+ if (wParam == WindowsKeycodes.VK_SNAPSHOT && keyboard != null &&
+ !keyboard.isKeyDown(org.lwjgl.input.Keyboard.KEY_SYSRQ)) {
+ // Set key state to pressed
+ long fake_lparam = lParam & ~(1 << 31);
+ // Set key previous state to released
+ fake_lparam = fake_lparam & ~(1 << 30);
+ handleKeyButton(wParam, fake_lparam, millis);
+ }
+ /* Fall through */
+ case WM_SYSKEYDOWN:
+ /* Fall through */
+ case WM_KEYDOWN:
+ handleKeyButton(wParam, lParam, millis);
+ return defWindowProc(hwnd, msg, wParam, lParam);
+ case WM_QUIT:
+ close_requested = true;
+ return 0;
+ case WM_SYSCOMMAND:
+ switch ((int)(wParam & 0xfff0)) {
+ case SC_KEYMENU:
+ case SC_MOUSEMENU:
+ case SC_SCREENSAVE:
+ case SC_MONITORPOWER:
+ return 0;
+ case SC_CLOSE:
+ close_requested = true;
+ return 0;
+ default:
+ break;
+ }
+ return defWindowProc(hwnd, msg, wParam, lParam);
+ case WM_PAINT:
+ is_dirty = true;
+ return defWindowProc(hwnd, msg, wParam, lParam);
+ case WM_MOUSELEAVE:
+ mouseInside = false;
+ trackingMouse = false;
+ return defWindowProc(hwnd, msg, wParam, lParam);
+ case WM_CANCELMODE:
+ nReleaseCapture();
+ /* fall through */
+ case WM_CAPTURECHANGED:
+ if(captureMouse != -1) {
+ handleMouseButton(captureMouse, 0, millis);
+ captureMouse = -1;
+ }
+ return 0;
+ default:
+ return defWindowProc(hwnd, msg, wParam, lParam);
+ }
+ }
+
+ public int getWidth() {
+ return Display.getDisplayMode().getWidth();
+ }
+
+ public int getHeight() {
+ return Display.getDisplayMode().getHeight();
+ }
+
+ private int firstMouseButtonDown() {
+ for(int i=0; i<Mouse.getButtonCount(); i++) {
+ if(Mouse.isButtonDown(i)) {
+ return i;
+ }
+ }
+ return -1;
+ }
+
+ private native boolean nTrackMouseEvent(long hwnd);
+
+ public boolean isInsideWindow() {
+ return mouseInside;
+ }
+
+ private static final class Rect {
+ public int top;
+ public int bottom;
+ public int left;
+ public int right;
+
+ public void copyToBuffer(IntBuffer buffer) {
+ buffer.put(0, top).put(1, bottom).put(2, left).put(3, right);
+ }
+
+ public void copyFromBuffer(IntBuffer buffer) {
+ top = buffer.get(0);
+ bottom = buffer.get(1);
+ left = buffer.get(2);
+ right = buffer.get(3);
+ }
+
+ public void offset(int offset_x, int offset_y) {
+ left += offset_x;
+ right += offset_x;
+ top += offset_y;
+ bottom += offset_y;
+ }
+
+ public static void intersect(Rect r1, Rect r2, Rect dst) {
+ dst.top = Math.max(r1.top, r2.top);
+ dst.bottom = Math.min(r1.bottom, r2.bottom);
+ dst.left = Math.max(r1.left, r2.left);
+ dst.right = Math.min(r1.right, r2.right);
+ }
+
+ public String toString() {
+ return "Rect: top = " + top + " bottom = " + bottom + " left = " + left + " right = " + right;
+ }
+ }
+}
diff --git a/src/java/org/lwjgl/opengl/WindowsDisplayPeerInfo.java b/src/java/org/lwjgl/opengl/WindowsDisplayPeerInfo.java
index bdf2421..24b56ae 100644
--- a/src/java/org/lwjgl/opengl/WindowsDisplayPeerInfo.java
+++ b/src/java/org/lwjgl/opengl/WindowsDisplayPeerInfo.java
@@ -1,73 +1,73 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import java.nio.ByteBuffer;
-
-import org.lwjgl.LWJGLException;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3116 $
- * $Id: WindowsDisplayPeerInfo.java 3116 2008-08-19 16:46:03Z spasi $
- */
-final class WindowsDisplayPeerInfo extends WindowsPeerInfo {
- private final PixelFormat pixel_format;
-
- WindowsDisplayPeerInfo(PixelFormat pixel_format) throws LWJGLException {
- this.pixel_format = pixel_format;
- GLContext.loadOpenGLLibrary();
- }
-
- PixelFormat getPixelFormat() {
- return pixel_format;
- }
-
- void initDC(long hwnd, long hdc) throws LWJGLException {
- nInitDC(getHandle(), hwnd, hdc);
- }
- private static native void nInitDC(ByteBuffer peer_info_handle, long hwnd, long hdc);
-
- protected void doLockAndInitHandle() throws LWJGLException {
- // NO-OP
- }
-
- protected void doUnlock() throws LWJGLException {
- // NO-OP
- }
-
- public void destroy() {
- super.destroy();
- GLContext.unloadOpenGLLibrary();
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import java.nio.ByteBuffer;
+
+import org.lwjgl.LWJGLException;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3116 $
+ * $Id: WindowsDisplayPeerInfo.java 3116 2008-08-19 16:46:03Z spasi $
+ */
+final class WindowsDisplayPeerInfo extends WindowsPeerInfo {
+ private final PixelFormat pixel_format;
+
+ WindowsDisplayPeerInfo(PixelFormat pixel_format) throws LWJGLException {
+ this.pixel_format = pixel_format;
+ GLContext.loadOpenGLLibrary();
+ }
+
+ PixelFormat getPixelFormat() {
+ return pixel_format;
+ }
+
+ void initDC(long hwnd, long hdc) throws LWJGLException {
+ nInitDC(getHandle(), hwnd, hdc);
+ }
+ private static native void nInitDC(ByteBuffer peer_info_handle, long hwnd, long hdc);
+
+ protected void doLockAndInitHandle() throws LWJGLException {
+ // NO-OP
+ }
+
+ protected void doUnlock() throws LWJGLException {
+ // NO-OP
+ }
+
+ public void destroy() {
+ super.destroy();
+ GLContext.unloadOpenGLLibrary();
+ }
+}
diff --git a/src/java/org/lwjgl/opengl/WindowsFileVersion.java b/src/java/org/lwjgl/opengl/WindowsFileVersion.java
index 8ed5cc4..f626104 100644
--- a/src/java/org/lwjgl/opengl/WindowsFileVersion.java
+++ b/src/java/org/lwjgl/opengl/WindowsFileVersion.java
@@ -1,54 +1,54 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-/**
- * @author elias_naur
- */
-
-final class WindowsFileVersion {
- private final int product_version_ms;
- private final int product_version_ls;
-
- WindowsFileVersion(int product_version_ms, int product_version_ls) {
- this.product_version_ms = product_version_ms;
- this.product_version_ls = product_version_ls;
- }
-
- public String toString() {
- int f1 = (product_version_ms >> 16) & 0xFFFF;
- int f2 = product_version_ms & 0xFFFF;
- int f3 = (product_version_ls >> 16) & 0xFFFF;
- int f4 = product_version_ls & 0xFFFF;
- return f1 + "." + f2 + "." + f3 + "." + f4;
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+/**
+ * @author elias_naur
+ */
+
+final class WindowsFileVersion {
+ private final int product_version_ms;
+ private final int product_version_ls;
+
+ WindowsFileVersion(int product_version_ms, int product_version_ls) {
+ this.product_version_ms = product_version_ms;
+ this.product_version_ls = product_version_ls;
+ }
+
+ public String toString() {
+ int f1 = (product_version_ms >> 16) & 0xFFFF;
+ int f2 = product_version_ms & 0xFFFF;
+ int f3 = (product_version_ls >> 16) & 0xFFFF;
+ int f4 = product_version_ls & 0xFFFF;
+ return f1 + "." + f2 + "." + f3 + "." + f4;
+ }
+}
diff --git a/src/java/org/lwjgl/opengl/WindowsKeyboard.java b/src/java/org/lwjgl/opengl/WindowsKeyboard.java
index 6820f91..753069f 100644
--- a/src/java/org/lwjgl/opengl/WindowsKeyboard.java
+++ b/src/java/org/lwjgl/opengl/WindowsKeyboard.java
@@ -1,180 +1,180 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-/**
- * This is the Windows implementation of the Keyboard.
- * @author elias_naur
- */
-
-import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
-
-import org.lwjgl.BufferUtils;
-import org.lwjgl.LWJGLException;
-import org.lwjgl.input.Keyboard;
-
-final class WindowsKeyboard {
- private final static int MAPVK_VK_TO_VSC = 0;
-
- private final static int BUFFER_SIZE = 50;
-
- private final long hwnd;
- private final ByteBuffer keyboard_state;
- private final byte[] key_down_buffer = new byte[Keyboard.KEYBOARD_SIZE];
- private final EventQueue event_queue = new EventQueue(Keyboard.EVENT_SIZE);
- private final ByteBuffer tmp_event = ByteBuffer.allocate(Keyboard.EVENT_SIZE);
-
- private boolean grabbed;
-
- private boolean has_retained_event; // Indicates if we're waiting for a WM_CHAR
- private int retained_key_code;
- private byte retained_state;
- private int retained_char;
- private long retained_millis;
- private boolean retained_repeat;
-
- WindowsKeyboard(long hwnd) throws LWJGLException {
- this.hwnd = hwnd;
- keyboard_state = BufferUtils.createByteBuffer(256);
- }
- private static native boolean isWindowsNT();
-
- public void destroy() {
- }
-
- boolean isKeyDown(int lwjgl_keycode) {
- return key_down_buffer[lwjgl_keycode] == 1;
- }
-
- public void grab(boolean grab) {
- if(grab) {
- if (!grabbed) {
- grabbed = true;
- }
- } else {
- if (grabbed) {
- grabbed = false;
- }
- }
- }
-
- public void poll(ByteBuffer keyDownBuffer) {
- int old_position = keyDownBuffer.position();
- keyDownBuffer.put(key_down_buffer);
- keyDownBuffer.position(old_position);
- }
-
- private static native int MapVirtualKey(int uCode, int uMapType);
- private static native int ToUnicode(int wVirtKey, int wScanCode, ByteBuffer lpKeyState, CharBuffer pwszBuff, int cchBuff, int flags);
- private static native int ToAscii(int wVirtKey, int wScanCode, ByteBuffer lpKeyState, ByteBuffer lpChar, int flags);
- private static native int GetKeyboardState(ByteBuffer lpKeyState);
- private static native int GetKeyState(int virt_key);
-
- private void putEvent(int keycode, byte state, int ch, long millis, boolean repeat) {
- tmp_event.clear();
- tmp_event.putInt(keycode).put(state).putInt(ch).putLong(millis*1000000).put(repeat ? (byte)1 : (byte)0);
- tmp_event.flip();
- event_queue.putEvent(tmp_event);
- }
-
- private boolean checkShiftKey(int virt_key, byte state) {
- int key_state = (GetKeyState(virt_key) >>> 15) & 0x1;
- int lwjgl_code = WindowsKeycodes.mapVirtualKeyToLWJGLCode(virt_key);
- return (key_down_buffer[lwjgl_code] == 1 - state) && (key_state == state);
- }
-
- private int translateShift(int scan_code, byte state) {
- if (checkShiftKey(WindowsKeycodes.VK_LSHIFT, state)) {
- return WindowsKeycodes.VK_LSHIFT;
- } else if (checkShiftKey(WindowsKeycodes.VK_RSHIFT, state)) {
- return WindowsKeycodes.VK_RSHIFT;
- } else {
- if (scan_code== 0x2A)
- return WindowsKeycodes.VK_LSHIFT;
- else {
- if (scan_code == 0x36)
- return WindowsKeycodes.VK_RSHIFT;
- else
- return WindowsKeycodes.VK_LSHIFT;
- }
- }
- }
-
- private int translateExtended(int virt_key, int scan_code, byte state, boolean extended) {
- switch (virt_key) {
- case WindowsKeycodes.VK_SHIFT:
- return translateShift(scan_code, state);
- case WindowsKeycodes.VK_CONTROL:
- return extended ? WindowsKeycodes.VK_RCONTROL : WindowsKeycodes.VK_LCONTROL;
- case WindowsKeycodes.VK_MENU:
- return extended ? WindowsKeycodes.VK_RMENU : WindowsKeycodes.VK_LMENU;
- default:
- return virt_key;
- }
- }
-
- private void flushRetained() {
- if (has_retained_event) {
- has_retained_event = false;
- putEvent(retained_key_code, retained_state, retained_char, retained_millis, retained_repeat);
- }
- }
-
- public void handleKey(int virt_key, int scan_code, boolean extended, byte event_state, long millis, boolean repeat) {
- virt_key = translateExtended(virt_key, scan_code, event_state, extended);
- flushRetained();
- has_retained_event = true;
- int keycode = WindowsKeycodes.mapVirtualKeyToLWJGLCode(virt_key);
- if (keycode < key_down_buffer.length)
- key_down_buffer[keycode] = event_state;
- retained_key_code = keycode;
- retained_state = event_state;
- retained_millis = millis;
- retained_char = 0;
- retained_repeat = repeat;
- }
-
- public void handleChar(int event_char, long millis, boolean repeat) {
- if (has_retained_event && retained_char != 0)
- flushRetained();
- if (!has_retained_event) {
- putEvent(0, (byte)0, event_char, millis, repeat);
- } else
- retained_char = event_char;
- }
-
- public void read(ByteBuffer buffer) {
- flushRetained();
- event_queue.copyEvents(buffer);
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+/**
+ * This is the Windows implementation of the Keyboard.
+ * @author elias_naur
+ */
+
+import java.nio.ByteBuffer;
+import java.nio.CharBuffer;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.LWJGLException;
+import org.lwjgl.input.Keyboard;
+
+final class WindowsKeyboard {
+ private final static int MAPVK_VK_TO_VSC = 0;
+
+ private final static int BUFFER_SIZE = 50;
+
+ private final long hwnd;
+ private final ByteBuffer keyboard_state;
+ private final byte[] key_down_buffer = new byte[Keyboard.KEYBOARD_SIZE];
+ private final EventQueue event_queue = new EventQueue(Keyboard.EVENT_SIZE);
+ private final ByteBuffer tmp_event = ByteBuffer.allocate(Keyboard.EVENT_SIZE);
+
+ private boolean grabbed;
+
+ private boolean has_retained_event; // Indicates if we're waiting for a WM_CHAR
+ private int retained_key_code;
+ private byte retained_state;
+ private int retained_char;
+ private long retained_millis;
+ private boolean retained_repeat;
+
+ WindowsKeyboard(long hwnd) throws LWJGLException {
+ this.hwnd = hwnd;
+ keyboard_state = BufferUtils.createByteBuffer(256);
+ }
+ private static native boolean isWindowsNT();
+
+ public void destroy() {
+ }
+
+ boolean isKeyDown(int lwjgl_keycode) {
+ return key_down_buffer[lwjgl_keycode] == 1;
+ }
+
+ public void grab(boolean grab) {
+ if(grab) {
+ if (!grabbed) {
+ grabbed = true;
+ }
+ } else {
+ if (grabbed) {
+ grabbed = false;
+ }
+ }
+ }
+
+ public void poll(ByteBuffer keyDownBuffer) {
+ int old_position = keyDownBuffer.position();
+ keyDownBuffer.put(key_down_buffer);
+ keyDownBuffer.position(old_position);
+ }
+
+ private static native int MapVirtualKey(int uCode, int uMapType);
+ private static native int ToUnicode(int wVirtKey, int wScanCode, ByteBuffer lpKeyState, CharBuffer pwszBuff, int cchBuff, int flags);
+ private static native int ToAscii(int wVirtKey, int wScanCode, ByteBuffer lpKeyState, ByteBuffer lpChar, int flags);
+ private static native int GetKeyboardState(ByteBuffer lpKeyState);
+ private static native int GetKeyState(int virt_key);
+
+ private void putEvent(int keycode, byte state, int ch, long millis, boolean repeat) {
+ tmp_event.clear();
+ tmp_event.putInt(keycode).put(state).putInt(ch).putLong(millis*1000000).put(repeat ? (byte)1 : (byte)0);
+ tmp_event.flip();
+ event_queue.putEvent(tmp_event);
+ }
+
+ private boolean checkShiftKey(int virt_key, byte state) {
+ int key_state = (GetKeyState(virt_key) >>> 15) & 0x1;
+ int lwjgl_code = WindowsKeycodes.mapVirtualKeyToLWJGLCode(virt_key);
+ return (key_down_buffer[lwjgl_code] == 1 - state) && (key_state == state);
+ }
+
+ private int translateShift(int scan_code, byte state) {
+ if (checkShiftKey(WindowsKeycodes.VK_LSHIFT, state)) {
+ return WindowsKeycodes.VK_LSHIFT;
+ } else if (checkShiftKey(WindowsKeycodes.VK_RSHIFT, state)) {
+ return WindowsKeycodes.VK_RSHIFT;
+ } else {
+ if (scan_code== 0x2A)
+ return WindowsKeycodes.VK_LSHIFT;
+ else {
+ if (scan_code == 0x36)
+ return WindowsKeycodes.VK_RSHIFT;
+ else
+ return WindowsKeycodes.VK_LSHIFT;
+ }
+ }
+ }
+
+ private int translateExtended(int virt_key, int scan_code, byte state, boolean extended) {
+ switch (virt_key) {
+ case WindowsKeycodes.VK_SHIFT:
+ return translateShift(scan_code, state);
+ case WindowsKeycodes.VK_CONTROL:
+ return extended ? WindowsKeycodes.VK_RCONTROL : WindowsKeycodes.VK_LCONTROL;
+ case WindowsKeycodes.VK_MENU:
+ return extended ? WindowsKeycodes.VK_RMENU : WindowsKeycodes.VK_LMENU;
+ default:
+ return virt_key;
+ }
+ }
+
+ private void flushRetained() {
+ if (has_retained_event) {
+ has_retained_event = false;
+ putEvent(retained_key_code, retained_state, retained_char, retained_millis, retained_repeat);
+ }
+ }
+
+ public void handleKey(int virt_key, int scan_code, boolean extended, byte event_state, long millis, boolean repeat) {
+ virt_key = translateExtended(virt_key, scan_code, event_state, extended);
+ flushRetained();
+ has_retained_event = true;
+ int keycode = WindowsKeycodes.mapVirtualKeyToLWJGLCode(virt_key);
+ if (keycode < key_down_buffer.length)
+ key_down_buffer[keycode] = event_state;
+ retained_key_code = keycode;
+ retained_state = event_state;
+ retained_millis = millis;
+ retained_char = 0;
+ retained_repeat = repeat;
+ }
+
+ public void handleChar(int event_char, long millis, boolean repeat) {
+ if (has_retained_event && retained_char != 0)
+ flushRetained();
+ if (!has_retained_event) {
+ putEvent(0, (byte)0, event_char, millis, repeat);
+ } else
+ retained_char = event_char;
+ }
+
+ public void read(ByteBuffer buffer) {
+ flushRetained();
+ event_queue.copyEvents(buffer);
+ }
+}
diff --git a/src/java/org/lwjgl/opengl/WindowsKeycodes.java b/src/java/org/lwjgl/opengl/WindowsKeycodes.java
index fb4f057..b9c6021 100644
--- a/src/java/org/lwjgl/opengl/WindowsKeycodes.java
+++ b/src/java/org/lwjgl/opengl/WindowsKeycodes.java
@@ -1,578 +1,578 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-/**
- * @author elias_naur
- */
-
-import org.lwjgl.input.Keyboard;
-
-final class WindowsKeycodes {
- public final static int VK_LBUTTON = 0x01;
- public final static int VK_RBUTTON = 0x02;
- public final static int VK_CANCEL = 0x03;
- public final static int VK_MBUTTON = 0x04; /* NOT contiguous with L & RBUTTON */
-
- public final static int VK_XBUTTON1 = 0x05; /* NOT contiguous with L & RBUTTON */
- public final static int VK_XBUTTON2 = 0x06; /* NOT contiguous with L & RBUTTON */
-
-/*
- * 0x07 : unassigned
- */
-
- public final static int VK_BACK = 0x08;
- public final static int VK_TAB = 0x09;
-
-/*
- * 0x0A - 0x0B : reserved
- */
-
- public final static int VK_CLEAR = 0x0C;
- public final static int VK_RETURN = 0x0D;
-
- public final static int VK_SHIFT = 0x10;
- public final static int VK_CONTROL = 0x11;
- public final static int VK_MENU = 0x12;
- public final static int VK_PAUSE = 0x13;
- public final static int VK_CAPITAL = 0x14;
-
- public final static int VK_KANA = 0x15;
- public final static int VK_HANGEUL = 0x15; /* old name - should be here for compatibility */
- public final static int VK_HANGUL = 0x15;
- public final static int VK_JUNJA = 0x17;
- public final static int VK_FINAL = 0x18;
- public final static int VK_HANJA = 0x19;
- public final static int VK_KANJI = 0x19;
-
- public final static int VK_ESCAPE = 0x1B;
-
- public final static int VK_CONVERT = 0x1C;
- public final static int VK_NONCONVERT = 0x1D;
- public final static int VK_ACCEPT = 0x1E;
- public final static int VK_MODECHANGE = 0x1F;
-
- public final static int VK_SPACE = 0x20;
- public final static int VK_PRIOR = 0x21;
- public final static int VK_NEXT = 0x22;
- public final static int VK_END = 0x23;
- public final static int VK_HOME = 0x24;
- public final static int VK_LEFT = 0x25;
- public final static int VK_UP = 0x26;
- public final static int VK_RIGHT = 0x27;
- public final static int VK_DOWN = 0x28;
- public final static int VK_SELECT = 0x29;
- public final static int VK_PRINT = 0x2A;
- public final static int VK_EXECUTE = 0x2B;
- public final static int VK_SNAPSHOT = 0x2C;
- public final static int VK_INSERT = 0x2D;
- public final static int VK_DELETE = 0x2E;
- public final static int VK_HELP = 0x2F;
-/*
- * VK_0 - VK_9 are the same as ASCII '0' - '9' (0x30 - 0x39)
- * 0x40 : unassigned
- * VK_A - VK_Z are the same as ASCII 'A' - 'Z' (0x41 - 0x5A)
- */
- public final static int VK_0 = 0x30;
- public final static int VK_1 = 0x31;
- public final static int VK_2 = 0x32;
- public final static int VK_3 = 0x33;
- public final static int VK_4 = 0x34;
- public final static int VK_5 = 0x35;
- public final static int VK_6 = 0x36;
- public final static int VK_7 = 0x37;
- public final static int VK_8 = 0x38;
- public final static int VK_9 = 0x39;
-
- public final static int VK_A = 0x41;
- public final static int VK_B = 0x42;
- public final static int VK_C = 0x43;
- public final static int VK_D = 0x44;
- public final static int VK_E = 0x45;
- public final static int VK_F = 0x46;
- public final static int VK_G = 0x47;
- public final static int VK_H = 0x48;
- public final static int VK_I = 0x49;
- public final static int VK_J = 0x4A;
- public final static int VK_K = 0x4B;
- public final static int VK_L = 0x4C;
- public final static int VK_M = 0x4D;
- public final static int VK_N = 0x4E;
- public final static int VK_O = 0x4F;
- public final static int VK_P = 0x50;
- public final static int VK_Q = 0x51;
- public final static int VK_R = 0x52;
- public final static int VK_S = 0x53;
- public final static int VK_T = 0x54;
- public final static int VK_U = 0x55;
- public final static int VK_V = 0x56;
- public final static int VK_W = 0x57;
- public final static int VK_X = 0x58;
- public final static int VK_Y = 0x59;
- public final static int VK_Z = 0x5A;
-
- public final static int VK_LWIN = 0x5B;
- public final static int VK_RWIN = 0x5C;
- public final static int VK_APPS = 0x5D;
-/*
- * 0x5E : reserved;
- */
-
- public final static int VK_SLEEP = 0x5F;
-
- public final static int VK_NUMPAD0 = 0x60;
- public final static int VK_NUMPAD1 = 0x61;
- public final static int VK_NUMPAD2 = 0x62;
- public final static int VK_NUMPAD3 = 0x63;
- public final static int VK_NUMPAD4 = 0x64;
- public final static int VK_NUMPAD5 = 0x65;
- public final static int VK_NUMPAD6 = 0x66;
- public final static int VK_NUMPAD7 = 0x67;
- public final static int VK_NUMPAD8 = 0x68;
- public final static int VK_NUMPAD9 = 0x69;
- public final static int VK_MULTIPLY = 0x6A;
- public final static int VK_ADD = 0x6B;
- public final static int VK_SEPARATOR = 0x6C;
- public final static int VK_SUBTRACT = 0x6D;
- public final static int VK_DECIMAL = 0x6E;
- public final static int VK_DIVIDE = 0x6F;
- public final static int VK_F1 = 0x70;
- public final static int VK_F2 = 0x71;
- public final static int VK_F3 = 0x72;
- public final static int VK_F4 = 0x73;
- public final static int VK_F5 = 0x74;
- public final static int VK_F6 = 0x75;
- public final static int VK_F7 = 0x76;
- public final static int VK_F8 = 0x77;
- public final static int VK_F9 = 0x78;
- public final static int VK_F10 = 0x79;
- public final static int VK_F11 = 0x7A;
- public final static int VK_F12 = 0x7B;
- public final static int VK_F13 = 0x7C;
- public final static int VK_F14 = 0x7D;
- public final static int VK_F15 = 0x7E;
- public final static int VK_F16 = 0x7F;
- public final static int VK_F17 = 0x80;
- public final static int VK_F18 = 0x81;
- public final static int VK_F19 = 0x82;
- public final static int VK_F20 = 0x83;
- public final static int VK_F21 = 0x84;
- public final static int VK_F22 = 0x85;
- public final static int VK_F23 = 0x86;
- public final static int VK_F24 = 0x87;
-
-/*
- * 0x88 - 0x8F : unassigned;
- */
-
- public final static int VK_NUMLOCK = 0x90;
- public final static int VK_SCROLL = 0x91;
-
-/*
- * NEC PC-9800 kbd definitions
- */
- public final static int VK_OEM_NEC_EQUAL = 0x92; // '=' key on numpad
-/*
- * Fujitsu/OASYS kbd definitions
- */
- public final static int VK_OEM_FJ_JISHO = 0x92; // 'Dictionary' key
- public final static int VK_OEM_FJ_MASSHOU = 0x93; // 'Unregister word' key
- public final static int VK_OEM_FJ_TOUROKU = 0x94; // 'Register word' key
- public final static int VK_OEM_FJ_LOYA = 0x95; // 'Left OYAYUBI' key
- public final static int VK_OEM_FJ_ROYA = 0x96; // 'Right OYAYUBI' key
-
-/*
- * 0x97 - 0x9F : unassigned
- */
-
-/*
- * VK_L* & VK_R* - left and right Alt, Ctrl and Shift virtual keys.
- * Used only as parameters to GetAsyncKeyState() and GetKeyState().
- * No other API or message will distinguish left and right keys in this way.
- */
- public final static int VK_LSHIFT = 0xA0;
- public final static int VK_RSHIFT = 0xA1;
- public final static int VK_LCONTROL = 0xA2;
- public final static int VK_RCONTROL = 0xA3;
- public final static int VK_LMENU = 0xA4;
- public final static int VK_RMENU = 0xA5;
-
- public final static int VK_BROWSER_BACK = 0xA6;
- public final static int VK_BROWSER_FORWARD = 0xA7;
- public final static int VK_BROWSER_REFRESH = 0xA8;
- public final static int VK_BROWSER_STOP = 0xA9;
- public final static int VK_BROWSER_SEARCH = 0xAA;
- public final static int VK_BROWSER_FAVORITES = 0xAB;
- public final static int VK_BROWSER_HOME = 0xAC;
-
- public final static int VK_VOLUME_MUTE = 0xAD;
- public final static int VK_VOLUME_DOWN = 0xAE;
- public final static int VK_VOLUME_UP = 0xAF;
- public final static int VK_MEDIA_NEXT_TRACK = 0xB0;
- public final static int VK_MEDIA_PREV_TRACK = 0xB1;
- public final static int VK_MEDIA_STOP = 0xB2;
- public final static int VK_MEDIA_PLAY_PAUSE = 0xB3;
- public final static int VK_LAUNCH_MAIL = 0xB4;
- public final static int VK_LAUNCH_MEDIA_SELECT = 0xB5;
- public final static int VK_LAUNCH_APP1 = 0xB6;
- public final static int VK_LAUNCH_APP2 = 0xB7;
-
-/*
- * 0xB8 - 0xB9 : reserved
- */
-
- public final static int VK_OEM_1 = 0xBA; // ';:' for US
- public final static int VK_OEM_PLUS = 0xBB; // '+' any country
- public final static int VK_OEM_COMMA = 0xBC; // ',' any country
- public final static int VK_OEM_MINUS = 0xBD; // '-' any country
- public final static int VK_OEM_PERIOD = 0xBE; // '.' any country
- public final static int VK_OEM_2 = 0xBF; // '/?' for US
- public final static int VK_OEM_3 = 0xC0; // '`~' for US
-
-/*
- * 0xC1 - 0xD7 : reserved
- */
-
-/*
- * 0xD8 - 0xDA : unassigned
- */
-
- public final static int VK_OEM_4 = 0xDB; // '[{' for US
- public final static int VK_OEM_5 = 0xDC; // '\|' for US
- public final static int VK_OEM_6 = 0xDD; // ']}' for US
- public final static int VK_OEM_7 = 0xDE; // ''"' for US
- public final static int VK_OEM_8 = 0xDF;
-
-/*
- * 0xE0 : reserved
- */
-
-/*
- * Various extended or enhanced keyboards
- */
- public final static int VK_OEM_AX = 0xE1; // 'AX' key on Japanese AX kbd
- public final static int VK_OEM_102 = 0xE2; // "<>" or "\|" on RT 102-key kbd.
- public final static int VK_ICO_HELP = 0xE3; // Help key on ICO
- public final static int VK_ICO_00 = 0xE4; // 00 key on ICO
-
- public final static int VK_PROCESSKEY = 0xE5;
-
- public final static int VK_ICO_CLEAR = 0xE6;
-
-
- public final static int VK_PACKET = 0xE7;
-
-/*
- * 0xE8 : unassigned
- */
-
-/*
- * Nokia/Ericsson definitions
- */
- public final static int VK_OEM_RESET = 0xE9;
- public final static int VK_OEM_JUMP = 0xEA;
- public final static int VK_OEM_PA1 = 0xEB;
- public final static int VK_OEM_PA2 = 0xEC;
- public final static int VK_OEM_PA3 = 0xED;
- public final static int VK_OEM_WSCTRL = 0xEE;
- public final static int VK_OEM_CUSEL = 0xEF;
- public final static int VK_OEM_ATTN = 0xF0;
- public final static int VK_OEM_FINISH = 0xF1;
- public final static int VK_OEM_COPY = 0xF2;
- public final static int VK_OEM_AUTO = 0xF3;
- public final static int VK_OEM_ENLW = 0xF4;
- public final static int VK_OEM_BACKTAB = 0xF5;
-
- public final static int VK_ATTN = 0xF6;
- public final static int VK_CRSEL = 0xF7;
- public final static int VK_EXSEL = 0xF8;
- public final static int VK_EREOF = 0xF9;
- public final static int VK_PLAY = 0xFA;
- public final static int VK_ZOOM = 0xFB;
- public final static int VK_NONAME = 0xFC;
- public final static int VK_PA1 = 0xFD;
- public final static int VK_OEM_CLEAR = 0xFE;
-
- public static int mapVirtualKeyToLWJGLCode(int virt_key) {
- switch (virt_key) {
- case VK_ESCAPE:
- return Keyboard.KEY_ESCAPE;
- case VK_1:
- return Keyboard.KEY_1;
- case VK_2:
- return Keyboard.KEY_2;
- case VK_3:
- return Keyboard.KEY_3;
- case VK_4:
- return Keyboard.KEY_4;
- case VK_5:
- return Keyboard.KEY_5;
- case VK_6:
- return Keyboard.KEY_6;
- case VK_7:
- return Keyboard.KEY_7;
- case VK_8:
- return Keyboard.KEY_8;
- case VK_9:
- return Keyboard.KEY_9;
- case VK_0:
- return Keyboard.KEY_0;
- case VK_OEM_MINUS:
- return Keyboard.KEY_MINUS;
- case VK_OEM_PLUS:
- return Keyboard.KEY_EQUALS;
- case VK_BACK:
- return Keyboard.KEY_BACK;
- case VK_TAB:
- return Keyboard.KEY_TAB;
- case VK_Q:
- return Keyboard.KEY_Q;
- case VK_W:
- return Keyboard.KEY_W;
- case VK_E:
- return Keyboard.KEY_E;
- case VK_R:
- return Keyboard.KEY_R;
- case VK_T:
- return Keyboard.KEY_T;
- case VK_Y:
- return Keyboard.KEY_Y;
- case VK_U:
- return Keyboard.KEY_U;
- case VK_I:
- return Keyboard.KEY_I;
- case VK_O:
- return Keyboard.KEY_O;
- case VK_P:
- return Keyboard.KEY_P;
- case VK_OEM_4:
- return Keyboard.KEY_LBRACKET;
- case VK_OEM_6:
- return Keyboard.KEY_RBRACKET;
- case VK_RETURN:
- return Keyboard.KEY_RETURN;
- case VK_LCONTROL:
- return Keyboard.KEY_LCONTROL;
- case VK_A:
- return Keyboard.KEY_A;
- case VK_S:
- return Keyboard.KEY_S;
- case VK_D:
- return Keyboard.KEY_D;
- case VK_F:
- return Keyboard.KEY_F;
- case VK_G:
- return Keyboard.KEY_G;
- case VK_H:
- return Keyboard.KEY_H;
- case VK_J:
- return Keyboard.KEY_J;
- case VK_K:
- return Keyboard.KEY_K;
- case VK_L:
- return Keyboard.KEY_L;
- case VK_OEM_1:
- return Keyboard.KEY_SEMICOLON;
- case VK_OEM_7:
- return Keyboard.KEY_APOSTROPHE;
- case VK_OEM_3:
- case VK_OEM_8:
- return Keyboard.KEY_GRAVE;
- case VK_LSHIFT:
- return Keyboard.KEY_LSHIFT;
- case VK_OEM_5:
- return Keyboard.KEY_BACKSLASH;
- case VK_Z:
- return Keyboard.KEY_Z;
- case VK_X:
- return Keyboard.KEY_X;
- case VK_C:
- return Keyboard.KEY_C;
- case VK_V:
- return Keyboard.KEY_V;
- case VK_B:
- return Keyboard.KEY_B;
- case VK_N:
- return Keyboard.KEY_N;
- case VK_M:
- return Keyboard.KEY_M;
- case VK_OEM_COMMA:
- return Keyboard.KEY_COMMA;
- case VK_OEM_PERIOD:
- return Keyboard.KEY_PERIOD;
- case VK_OEM_2:
- return Keyboard.KEY_SLASH;
- case VK_RSHIFT:
- return Keyboard.KEY_RSHIFT;
- case VK_MULTIPLY:
- return Keyboard.KEY_MULTIPLY;
- case VK_LMENU:
- return Keyboard.KEY_LMENU;
- case VK_SPACE:
- return Keyboard.KEY_SPACE;
- case VK_CAPITAL:
- return Keyboard.KEY_CAPITAL;
- case VK_F1:
- return Keyboard.KEY_F1;
- case VK_F2:
- return Keyboard.KEY_F2;
- case VK_F3:
- return Keyboard.KEY_F3;
- case VK_F4:
- return Keyboard.KEY_F4;
- case VK_F5:
- return Keyboard.KEY_F5;
- case VK_F6:
- return Keyboard.KEY_F6;
- case VK_F7:
- return Keyboard.KEY_F7;
- case VK_F8:
- return Keyboard.KEY_F8;
- case VK_F9:
- return Keyboard.KEY_F9;
- case VK_F10:
- return Keyboard.KEY_F10;
- case VK_NUMLOCK:
- return Keyboard.KEY_NUMLOCK;
- case VK_SCROLL:
- return Keyboard.KEY_SCROLL;
- case VK_NUMPAD7:
- return Keyboard.KEY_NUMPAD7;
- case VK_NUMPAD8:
- return Keyboard.KEY_NUMPAD8;
- case VK_NUMPAD9:
- return Keyboard.KEY_NUMPAD9;
- case VK_SUBTRACT:
- return Keyboard.KEY_SUBTRACT;
- case VK_NUMPAD4:
- return Keyboard.KEY_NUMPAD4;
- case VK_NUMPAD5:
- return Keyboard.KEY_NUMPAD5;
- case VK_NUMPAD6:
- return Keyboard.KEY_NUMPAD6;
- case VK_ADD:
- return Keyboard.KEY_ADD;
- case VK_NUMPAD1:
- return Keyboard.KEY_NUMPAD1;
- case VK_NUMPAD2:
- return Keyboard.KEY_NUMPAD2;
- case VK_NUMPAD3:
- return Keyboard.KEY_NUMPAD3;
- case VK_NUMPAD0:
- return Keyboard.KEY_NUMPAD0;
- case VK_DECIMAL:
- return Keyboard.KEY_DECIMAL;
- case VK_F11:
- return Keyboard.KEY_F11;
- case VK_F12:
- return Keyboard.KEY_F12;
- case VK_F13:
- return Keyboard.KEY_F13;
- case VK_F14:
- return Keyboard.KEY_F14;
- case VK_F15:
- return Keyboard.KEY_F15;
- case VK_KANA:
- return Keyboard.KEY_KANA;
- case VK_CONVERT:
- return Keyboard.KEY_CONVERT;
- case VK_NONCONVERT:
- return Keyboard.KEY_NOCONVERT;
-/* case VK_YEN:
- return Keyboard.KEY_YEN;
- case VK_NUMPADEQUALS:
- return Keyboard.KEY_NUMPADEQUALS;
- case VK_CIRCUMFLEX:
- return Keyboard.KEY_CIRCUMFLEX;
- case VK_AT:
- return Keyboard.KEY_AT;
- case VK_COLON:
- return Keyboard.KEY_COLON;
- case VK_UNDERLINE:
- return Keyboard.KEY_UNDERLINE;*/
- case VK_KANJI:
- return Keyboard.KEY_KANJI;
-/* case VK_STOP:
- return Keyboard.KEY_STOP;
- case VK_AX:
- return Keyboard.KEY_AX;
- case VK_UNLABELED:
- return Keyboard.KEY_UNLABELED;
- case VK_NUMPADENTER:
- return Keyboard.KEY_NUMPADENTER;*/
- case VK_RCONTROL:
- return Keyboard.KEY_RCONTROL;
- case VK_SEPARATOR:
- return Keyboard.KEY_NUMPADCOMMA;
- case VK_DIVIDE:
- return Keyboard.KEY_DIVIDE;
- case VK_SNAPSHOT:
- return Keyboard.KEY_SYSRQ;
- case VK_RMENU:
- return Keyboard.KEY_RMENU;
- case VK_PAUSE:
- return Keyboard.KEY_PAUSE;
- case VK_HOME:
- return Keyboard.KEY_HOME;
- case VK_UP:
- return Keyboard.KEY_UP;
- case VK_PRIOR:
- return Keyboard.KEY_PRIOR;
- case VK_LEFT:
- return Keyboard.KEY_LEFT;
- case VK_RIGHT:
- return Keyboard.KEY_RIGHT;
- case VK_END:
- return Keyboard.KEY_END;
- case VK_DOWN:
- return Keyboard.KEY_DOWN;
- case VK_NEXT:
- return Keyboard.KEY_NEXT;
- case VK_INSERT:
- return Keyboard.KEY_INSERT;
- case VK_DELETE:
- return Keyboard.KEY_DELETE;
- case VK_LWIN:
- return Keyboard.KEY_LMETA;
- case VK_RWIN:
- return Keyboard.KEY_RMETA;
- case VK_APPS:
- return Keyboard.KEY_APPS;
-/* case VK_POWER:
- return Keyboard.KEY_POWER;*/
- case VK_SLEEP:
- return Keyboard.KEY_SLEEP;
- default:
- return Keyboard.KEY_NONE;
- }
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+/**
+ * @author elias_naur
+ */
+
+import org.lwjgl.input.Keyboard;
+
+final class WindowsKeycodes {
+ public final static int VK_LBUTTON = 0x01;
+ public final static int VK_RBUTTON = 0x02;
+ public final static int VK_CANCEL = 0x03;
+ public final static int VK_MBUTTON = 0x04; /* NOT contiguous with L & RBUTTON */
+
+ public final static int VK_XBUTTON1 = 0x05; /* NOT contiguous with L & RBUTTON */
+ public final static int VK_XBUTTON2 = 0x06; /* NOT contiguous with L & RBUTTON */
+
+/*
+ * 0x07 : unassigned
+ */
+
+ public final static int VK_BACK = 0x08;
+ public final static int VK_TAB = 0x09;
+
+/*
+ * 0x0A - 0x0B : reserved
+ */
+
+ public final static int VK_CLEAR = 0x0C;
+ public final static int VK_RETURN = 0x0D;
+
+ public final static int VK_SHIFT = 0x10;
+ public final static int VK_CONTROL = 0x11;
+ public final static int VK_MENU = 0x12;
+ public final static int VK_PAUSE = 0x13;
+ public final static int VK_CAPITAL = 0x14;
+
+ public final static int VK_KANA = 0x15;
+ public final static int VK_HANGEUL = 0x15; /* old name - should be here for compatibility */
+ public final static int VK_HANGUL = 0x15;
+ public final static int VK_JUNJA = 0x17;
+ public final static int VK_FINAL = 0x18;
+ public final static int VK_HANJA = 0x19;
+ public final static int VK_KANJI = 0x19;
+
+ public final static int VK_ESCAPE = 0x1B;
+
+ public final static int VK_CONVERT = 0x1C;
+ public final static int VK_NONCONVERT = 0x1D;
+ public final static int VK_ACCEPT = 0x1E;
+ public final static int VK_MODECHANGE = 0x1F;
+
+ public final static int VK_SPACE = 0x20;
+ public final static int VK_PRIOR = 0x21;
+ public final static int VK_NEXT = 0x22;
+ public final static int VK_END = 0x23;
+ public final static int VK_HOME = 0x24;
+ public final static int VK_LEFT = 0x25;
+ public final static int VK_UP = 0x26;
+ public final static int VK_RIGHT = 0x27;
+ public final static int VK_DOWN = 0x28;
+ public final static int VK_SELECT = 0x29;
+ public final static int VK_PRINT = 0x2A;
+ public final static int VK_EXECUTE = 0x2B;
+ public final static int VK_SNAPSHOT = 0x2C;
+ public final static int VK_INSERT = 0x2D;
+ public final static int VK_DELETE = 0x2E;
+ public final static int VK_HELP = 0x2F;
+/*
+ * VK_0 - VK_9 are the same as ASCII '0' - '9' (0x30 - 0x39)
+ * 0x40 : unassigned
+ * VK_A - VK_Z are the same as ASCII 'A' - 'Z' (0x41 - 0x5A)
+ */
+ public final static int VK_0 = 0x30;
+ public final static int VK_1 = 0x31;
+ public final static int VK_2 = 0x32;
+ public final static int VK_3 = 0x33;
+ public final static int VK_4 = 0x34;
+ public final static int VK_5 = 0x35;
+ public final static int VK_6 = 0x36;
+ public final static int VK_7 = 0x37;
+ public final static int VK_8 = 0x38;
+ public final static int VK_9 = 0x39;
+
+ public final static int VK_A = 0x41;
+ public final static int VK_B = 0x42;
+ public final static int VK_C = 0x43;
+ public final static int VK_D = 0x44;
+ public final static int VK_E = 0x45;
+ public final static int VK_F = 0x46;
+ public final static int VK_G = 0x47;
+ public final static int VK_H = 0x48;
+ public final static int VK_I = 0x49;
+ public final static int VK_J = 0x4A;
+ public final static int VK_K = 0x4B;
+ public final static int VK_L = 0x4C;
+ public final static int VK_M = 0x4D;
+ public final static int VK_N = 0x4E;
+ public final static int VK_O = 0x4F;
+ public final static int VK_P = 0x50;
+ public final static int VK_Q = 0x51;
+ public final static int VK_R = 0x52;
+ public final static int VK_S = 0x53;
+ public final static int VK_T = 0x54;
+ public final static int VK_U = 0x55;
+ public final static int VK_V = 0x56;
+ public final static int VK_W = 0x57;
+ public final static int VK_X = 0x58;
+ public final static int VK_Y = 0x59;
+ public final static int VK_Z = 0x5A;
+
+ public final static int VK_LWIN = 0x5B;
+ public final static int VK_RWIN = 0x5C;
+ public final static int VK_APPS = 0x5D;
+/*
+ * 0x5E : reserved;
+ */
+
+ public final static int VK_SLEEP = 0x5F;
+
+ public final static int VK_NUMPAD0 = 0x60;
+ public final static int VK_NUMPAD1 = 0x61;
+ public final static int VK_NUMPAD2 = 0x62;
+ public final static int VK_NUMPAD3 = 0x63;
+ public final static int VK_NUMPAD4 = 0x64;
+ public final static int VK_NUMPAD5 = 0x65;
+ public final static int VK_NUMPAD6 = 0x66;
+ public final static int VK_NUMPAD7 = 0x67;
+ public final static int VK_NUMPAD8 = 0x68;
+ public final static int VK_NUMPAD9 = 0x69;
+ public final static int VK_MULTIPLY = 0x6A;
+ public final static int VK_ADD = 0x6B;
+ public final static int VK_SEPARATOR = 0x6C;
+ public final static int VK_SUBTRACT = 0x6D;
+ public final static int VK_DECIMAL = 0x6E;
+ public final static int VK_DIVIDE = 0x6F;
+ public final static int VK_F1 = 0x70;
+ public final static int VK_F2 = 0x71;
+ public final static int VK_F3 = 0x72;
+ public final static int VK_F4 = 0x73;
+ public final static int VK_F5 = 0x74;
+ public final static int VK_F6 = 0x75;
+ public final static int VK_F7 = 0x76;
+ public final static int VK_F8 = 0x77;
+ public final static int VK_F9 = 0x78;
+ public final static int VK_F10 = 0x79;
+ public final static int VK_F11 = 0x7A;
+ public final static int VK_F12 = 0x7B;
+ public final static int VK_F13 = 0x7C;
+ public final static int VK_F14 = 0x7D;
+ public final static int VK_F15 = 0x7E;
+ public final static int VK_F16 = 0x7F;
+ public final static int VK_F17 = 0x80;
+ public final static int VK_F18 = 0x81;
+ public final static int VK_F19 = 0x82;
+ public final static int VK_F20 = 0x83;
+ public final static int VK_F21 = 0x84;
+ public final static int VK_F22 = 0x85;
+ public final static int VK_F23 = 0x86;
+ public final static int VK_F24 = 0x87;
+
+/*
+ * 0x88 - 0x8F : unassigned;
+ */
+
+ public final static int VK_NUMLOCK = 0x90;
+ public final static int VK_SCROLL = 0x91;
+
+/*
+ * NEC PC-9800 kbd definitions
+ */
+ public final static int VK_OEM_NEC_EQUAL = 0x92; // '=' key on numpad
+/*
+ * Fujitsu/OASYS kbd definitions
+ */
+ public final static int VK_OEM_FJ_JISHO = 0x92; // 'Dictionary' key
+ public final static int VK_OEM_FJ_MASSHOU = 0x93; // 'Unregister word' key
+ public final static int VK_OEM_FJ_TOUROKU = 0x94; // 'Register word' key
+ public final static int VK_OEM_FJ_LOYA = 0x95; // 'Left OYAYUBI' key
+ public final static int VK_OEM_FJ_ROYA = 0x96; // 'Right OYAYUBI' key
+
+/*
+ * 0x97 - 0x9F : unassigned
+ */
+
+/*
+ * VK_L* & VK_R* - left and right Alt, Ctrl and Shift virtual keys.
+ * Used only as parameters to GetAsyncKeyState() and GetKeyState().
+ * No other API or message will distinguish left and right keys in this way.
+ */
+ public final static int VK_LSHIFT = 0xA0;
+ public final static int VK_RSHIFT = 0xA1;
+ public final static int VK_LCONTROL = 0xA2;
+ public final static int VK_RCONTROL = 0xA3;
+ public final static int VK_LMENU = 0xA4;
+ public final static int VK_RMENU = 0xA5;
+
+ public final static int VK_BROWSER_BACK = 0xA6;
+ public final static int VK_BROWSER_FORWARD = 0xA7;
+ public final static int VK_BROWSER_REFRESH = 0xA8;
+ public final static int VK_BROWSER_STOP = 0xA9;
+ public final static int VK_BROWSER_SEARCH = 0xAA;
+ public final static int VK_BROWSER_FAVORITES = 0xAB;
+ public final static int VK_BROWSER_HOME = 0xAC;
+
+ public final static int VK_VOLUME_MUTE = 0xAD;
+ public final static int VK_VOLUME_DOWN = 0xAE;
+ public final static int VK_VOLUME_UP = 0xAF;
+ public final static int VK_MEDIA_NEXT_TRACK = 0xB0;
+ public final static int VK_MEDIA_PREV_TRACK = 0xB1;
+ public final static int VK_MEDIA_STOP = 0xB2;
+ public final static int VK_MEDIA_PLAY_PAUSE = 0xB3;
+ public final static int VK_LAUNCH_MAIL = 0xB4;
+ public final static int VK_LAUNCH_MEDIA_SELECT = 0xB5;
+ public final static int VK_LAUNCH_APP1 = 0xB6;
+ public final static int VK_LAUNCH_APP2 = 0xB7;
+
+/*
+ * 0xB8 - 0xB9 : reserved
+ */
+
+ public final static int VK_OEM_1 = 0xBA; // ';:' for US
+ public final static int VK_OEM_PLUS = 0xBB; // '+' any country
+ public final static int VK_OEM_COMMA = 0xBC; // ',' any country
+ public final static int VK_OEM_MINUS = 0xBD; // '-' any country
+ public final static int VK_OEM_PERIOD = 0xBE; // '.' any country
+ public final static int VK_OEM_2 = 0xBF; // '/?' for US
+ public final static int VK_OEM_3 = 0xC0; // '`~' for US
+
+/*
+ * 0xC1 - 0xD7 : reserved
+ */
+
+/*
+ * 0xD8 - 0xDA : unassigned
+ */
+
+ public final static int VK_OEM_4 = 0xDB; // '[{' for US
+ public final static int VK_OEM_5 = 0xDC; // '\|' for US
+ public final static int VK_OEM_6 = 0xDD; // ']}' for US
+ public final static int VK_OEM_7 = 0xDE; // ''"' for US
+ public final static int VK_OEM_8 = 0xDF;
+
+/*
+ * 0xE0 : reserved
+ */
+
+/*
+ * Various extended or enhanced keyboards
+ */
+ public final static int VK_OEM_AX = 0xE1; // 'AX' key on Japanese AX kbd
+ public final static int VK_OEM_102 = 0xE2; // "<>" or "\|" on RT 102-key kbd.
+ public final static int VK_ICO_HELP = 0xE3; // Help key on ICO
+ public final static int VK_ICO_00 = 0xE4; // 00 key on ICO
+
+ public final static int VK_PROCESSKEY = 0xE5;
+
+ public final static int VK_ICO_CLEAR = 0xE6;
+
+
+ public final static int VK_PACKET = 0xE7;
+
+/*
+ * 0xE8 : unassigned
+ */
+
+/*
+ * Nokia/Ericsson definitions
+ */
+ public final static int VK_OEM_RESET = 0xE9;
+ public final static int VK_OEM_JUMP = 0xEA;
+ public final static int VK_OEM_PA1 = 0xEB;
+ public final static int VK_OEM_PA2 = 0xEC;
+ public final static int VK_OEM_PA3 = 0xED;
+ public final static int VK_OEM_WSCTRL = 0xEE;
+ public final static int VK_OEM_CUSEL = 0xEF;
+ public final static int VK_OEM_ATTN = 0xF0;
+ public final static int VK_OEM_FINISH = 0xF1;
+ public final static int VK_OEM_COPY = 0xF2;
+ public final static int VK_OEM_AUTO = 0xF3;
+ public final static int VK_OEM_ENLW = 0xF4;
+ public final static int VK_OEM_BACKTAB = 0xF5;
+
+ public final static int VK_ATTN = 0xF6;
+ public final static int VK_CRSEL = 0xF7;
+ public final static int VK_EXSEL = 0xF8;
+ public final static int VK_EREOF = 0xF9;
+ public final static int VK_PLAY = 0xFA;
+ public final static int VK_ZOOM = 0xFB;
+ public final static int VK_NONAME = 0xFC;
+ public final static int VK_PA1 = 0xFD;
+ public final static int VK_OEM_CLEAR = 0xFE;
+
+ public static int mapVirtualKeyToLWJGLCode(int virt_key) {
+ switch (virt_key) {
+ case VK_ESCAPE:
+ return Keyboard.KEY_ESCAPE;
+ case VK_1:
+ return Keyboard.KEY_1;
+ case VK_2:
+ return Keyboard.KEY_2;
+ case VK_3:
+ return Keyboard.KEY_3;
+ case VK_4:
+ return Keyboard.KEY_4;
+ case VK_5:
+ return Keyboard.KEY_5;
+ case VK_6:
+ return Keyboard.KEY_6;
+ case VK_7:
+ return Keyboard.KEY_7;
+ case VK_8:
+ return Keyboard.KEY_8;
+ case VK_9:
+ return Keyboard.KEY_9;
+ case VK_0:
+ return Keyboard.KEY_0;
+ case VK_OEM_MINUS:
+ return Keyboard.KEY_MINUS;
+ case VK_OEM_PLUS:
+ return Keyboard.KEY_EQUALS;
+ case VK_BACK:
+ return Keyboard.KEY_BACK;
+ case VK_TAB:
+ return Keyboard.KEY_TAB;
+ case VK_Q:
+ return Keyboard.KEY_Q;
+ case VK_W:
+ return Keyboard.KEY_W;
+ case VK_E:
+ return Keyboard.KEY_E;
+ case VK_R:
+ return Keyboard.KEY_R;
+ case VK_T:
+ return Keyboard.KEY_T;
+ case VK_Y:
+ return Keyboard.KEY_Y;
+ case VK_U:
+ return Keyboard.KEY_U;
+ case VK_I:
+ return Keyboard.KEY_I;
+ case VK_O:
+ return Keyboard.KEY_O;
+ case VK_P:
+ return Keyboard.KEY_P;
+ case VK_OEM_4:
+ return Keyboard.KEY_LBRACKET;
+ case VK_OEM_6:
+ return Keyboard.KEY_RBRACKET;
+ case VK_RETURN:
+ return Keyboard.KEY_RETURN;
+ case VK_LCONTROL:
+ return Keyboard.KEY_LCONTROL;
+ case VK_A:
+ return Keyboard.KEY_A;
+ case VK_S:
+ return Keyboard.KEY_S;
+ case VK_D:
+ return Keyboard.KEY_D;
+ case VK_F:
+ return Keyboard.KEY_F;
+ case VK_G:
+ return Keyboard.KEY_G;
+ case VK_H:
+ return Keyboard.KEY_H;
+ case VK_J:
+ return Keyboard.KEY_J;
+ case VK_K:
+ return Keyboard.KEY_K;
+ case VK_L:
+ return Keyboard.KEY_L;
+ case VK_OEM_1:
+ return Keyboard.KEY_SEMICOLON;
+ case VK_OEM_7:
+ return Keyboard.KEY_APOSTROPHE;
+ case VK_OEM_3:
+ case VK_OEM_8:
+ return Keyboard.KEY_GRAVE;
+ case VK_LSHIFT:
+ return Keyboard.KEY_LSHIFT;
+ case VK_OEM_5:
+ return Keyboard.KEY_BACKSLASH;
+ case VK_Z:
+ return Keyboard.KEY_Z;
+ case VK_X:
+ return Keyboard.KEY_X;
+ case VK_C:
+ return Keyboard.KEY_C;
+ case VK_V:
+ return Keyboard.KEY_V;
+ case VK_B:
+ return Keyboard.KEY_B;
+ case VK_N:
+ return Keyboard.KEY_N;
+ case VK_M:
+ return Keyboard.KEY_M;
+ case VK_OEM_COMMA:
+ return Keyboard.KEY_COMMA;
+ case VK_OEM_PERIOD:
+ return Keyboard.KEY_PERIOD;
+ case VK_OEM_2:
+ return Keyboard.KEY_SLASH;
+ case VK_RSHIFT:
+ return Keyboard.KEY_RSHIFT;
+ case VK_MULTIPLY:
+ return Keyboard.KEY_MULTIPLY;
+ case VK_LMENU:
+ return Keyboard.KEY_LMENU;
+ case VK_SPACE:
+ return Keyboard.KEY_SPACE;
+ case VK_CAPITAL:
+ return Keyboard.KEY_CAPITAL;
+ case VK_F1:
+ return Keyboard.KEY_F1;
+ case VK_F2:
+ return Keyboard.KEY_F2;
+ case VK_F3:
+ return Keyboard.KEY_F3;
+ case VK_F4:
+ return Keyboard.KEY_F4;
+ case VK_F5:
+ return Keyboard.KEY_F5;
+ case VK_F6:
+ return Keyboard.KEY_F6;
+ case VK_F7:
+ return Keyboard.KEY_F7;
+ case VK_F8:
+ return Keyboard.KEY_F8;
+ case VK_F9:
+ return Keyboard.KEY_F9;
+ case VK_F10:
+ return Keyboard.KEY_F10;
+ case VK_NUMLOCK:
+ return Keyboard.KEY_NUMLOCK;
+ case VK_SCROLL:
+ return Keyboard.KEY_SCROLL;
+ case VK_NUMPAD7:
+ return Keyboard.KEY_NUMPAD7;
+ case VK_NUMPAD8:
+ return Keyboard.KEY_NUMPAD8;
+ case VK_NUMPAD9:
+ return Keyboard.KEY_NUMPAD9;
+ case VK_SUBTRACT:
+ return Keyboard.KEY_SUBTRACT;
+ case VK_NUMPAD4:
+ return Keyboard.KEY_NUMPAD4;
+ case VK_NUMPAD5:
+ return Keyboard.KEY_NUMPAD5;
+ case VK_NUMPAD6:
+ return Keyboard.KEY_NUMPAD6;
+ case VK_ADD:
+ return Keyboard.KEY_ADD;
+ case VK_NUMPAD1:
+ return Keyboard.KEY_NUMPAD1;
+ case VK_NUMPAD2:
+ return Keyboard.KEY_NUMPAD2;
+ case VK_NUMPAD3:
+ return Keyboard.KEY_NUMPAD3;
+ case VK_NUMPAD0:
+ return Keyboard.KEY_NUMPAD0;
+ case VK_DECIMAL:
+ return Keyboard.KEY_DECIMAL;
+ case VK_F11:
+ return Keyboard.KEY_F11;
+ case VK_F12:
+ return Keyboard.KEY_F12;
+ case VK_F13:
+ return Keyboard.KEY_F13;
+ case VK_F14:
+ return Keyboard.KEY_F14;
+ case VK_F15:
+ return Keyboard.KEY_F15;
+ case VK_KANA:
+ return Keyboard.KEY_KANA;
+ case VK_CONVERT:
+ return Keyboard.KEY_CONVERT;
+ case VK_NONCONVERT:
+ return Keyboard.KEY_NOCONVERT;
+/* case VK_YEN:
+ return Keyboard.KEY_YEN;
+ case VK_NUMPADEQUALS:
+ return Keyboard.KEY_NUMPADEQUALS;
+ case VK_CIRCUMFLEX:
+ return Keyboard.KEY_CIRCUMFLEX;
+ case VK_AT:
+ return Keyboard.KEY_AT;
+ case VK_COLON:
+ return Keyboard.KEY_COLON;
+ case VK_UNDERLINE:
+ return Keyboard.KEY_UNDERLINE;*/
+ case VK_KANJI:
+ return Keyboard.KEY_KANJI;
+/* case VK_STOP:
+ return Keyboard.KEY_STOP;
+ case VK_AX:
+ return Keyboard.KEY_AX;
+ case VK_UNLABELED:
+ return Keyboard.KEY_UNLABELED;
+ case VK_NUMPADENTER:
+ return Keyboard.KEY_NUMPADENTER;*/
+ case VK_RCONTROL:
+ return Keyboard.KEY_RCONTROL;
+ case VK_SEPARATOR:
+ return Keyboard.KEY_NUMPADCOMMA;
+ case VK_DIVIDE:
+ return Keyboard.KEY_DIVIDE;
+ case VK_SNAPSHOT:
+ return Keyboard.KEY_SYSRQ;
+ case VK_RMENU:
+ return Keyboard.KEY_RMENU;
+ case VK_PAUSE:
+ return Keyboard.KEY_PAUSE;
+ case VK_HOME:
+ return Keyboard.KEY_HOME;
+ case VK_UP:
+ return Keyboard.KEY_UP;
+ case VK_PRIOR:
+ return Keyboard.KEY_PRIOR;
+ case VK_LEFT:
+ return Keyboard.KEY_LEFT;
+ case VK_RIGHT:
+ return Keyboard.KEY_RIGHT;
+ case VK_END:
+ return Keyboard.KEY_END;
+ case VK_DOWN:
+ return Keyboard.KEY_DOWN;
+ case VK_NEXT:
+ return Keyboard.KEY_NEXT;
+ case VK_INSERT:
+ return Keyboard.KEY_INSERT;
+ case VK_DELETE:
+ return Keyboard.KEY_DELETE;
+ case VK_LWIN:
+ return Keyboard.KEY_LMETA;
+ case VK_RWIN:
+ return Keyboard.KEY_RMETA;
+ case VK_APPS:
+ return Keyboard.KEY_APPS;
+/* case VK_POWER:
+ return Keyboard.KEY_POWER;*/
+ case VK_SLEEP:
+ return Keyboard.KEY_SLEEP;
+ default:
+ return Keyboard.KEY_NONE;
+ }
+ }
+}
diff --git a/src/java/org/lwjgl/opengl/WindowsMouse.java b/src/java/org/lwjgl/opengl/WindowsMouse.java
index 6aa3354..50d556a 100644
--- a/src/java/org/lwjgl/opengl/WindowsMouse.java
+++ b/src/java/org/lwjgl/opengl/WindowsMouse.java
@@ -1,199 +1,199 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-/**
- * This is the Windows implementation of the Mouse.
- * @author elias_naur
- */
-
-import java.nio.ByteBuffer;
-import java.nio.IntBuffer;
-
-import org.lwjgl.BufferUtils;
-import org.lwjgl.LWJGLException;
-import org.lwjgl.LWJGLUtil;
-import org.lwjgl.input.Mouse;
-
-final class WindowsMouse {
- private final long hwnd;
-
- private final int mouse_button_count;
- private final boolean has_wheel;
-
- private final EventQueue event_queue = new EventQueue(Mouse.EVENT_SIZE);
-
- private final ByteBuffer mouse_event = ByteBuffer.allocate(Mouse.EVENT_SIZE);
- private final Object blank_cursor;
-
- private boolean mouse_grabbed;
- private byte[] button_states;
- private int accum_dx;
- private int accum_dy;
- private int accum_dwheel;
- private int last_x;
- private int last_y;
-
- WindowsMouse(long hwnd) throws LWJGLException {
- this.hwnd = hwnd;
- this.mouse_button_count = WindowsDisplay.getSystemMetrics(WindowsDisplay.SM_CMOUSEBUTTONS);
- this.has_wheel = WindowsDisplay.getSystemMetrics(WindowsDisplay.SM_MOUSEWHEELPRESENT) != 0;
- this.blank_cursor = createBlankCursor();
- this.button_states = new byte[mouse_button_count];
- }
-
- private Object createBlankCursor() throws LWJGLException {
- int width = WindowsDisplay.getSystemMetrics(WindowsDisplay.SM_CXCURSOR);
- int height = WindowsDisplay.getSystemMetrics(WindowsDisplay.SM_CYCURSOR);
- IntBuffer pixels = BufferUtils.createIntBuffer(width*height);
- return WindowsDisplay.doCreateCursor(width, height, 0, 0, 1, pixels, null);
- }
-
- public boolean isGrabbed() {
- return mouse_grabbed;
- }
-
- public boolean hasWheel() {
- return has_wheel;
- }
-
- public int getButtonCount() {
- return mouse_button_count;
- }
-
- public void poll(IntBuffer coord_buffer, ByteBuffer buttons) {
- for (int i = 0; i < coord_buffer.remaining(); i++)
- coord_buffer.put(coord_buffer.position() + i, 0);
- int num_buttons = mouse_button_count;
- coord_buffer.put(coord_buffer.position() + 2, accum_dwheel);
- if (num_buttons > button_states.length)
- num_buttons = button_states.length;
- for (int j = 0; j < num_buttons; j++) {
- buttons.put(buttons.position() + j, button_states[j]);
- }
- if (isGrabbed()) {
- coord_buffer.put(coord_buffer.position() + 0, accum_dx);
- coord_buffer.put(coord_buffer.position() + 1, accum_dy);
- } else {
- coord_buffer.put(coord_buffer.position() + 0, last_x);
- coord_buffer.put(coord_buffer.position() + 1, last_y);
- }
- accum_dx = accum_dy = accum_dwheel = 0;
- }
-
- private void putMouseEventWithCoords(byte button, byte state, int coord1, int coord2, int dz, long nanos) {
- mouse_event.clear();
- mouse_event.put(button).put(state).putInt(coord1).putInt(coord2).putInt(dz).putLong(nanos);
- mouse_event.flip();
- event_queue.putEvent(mouse_event);
- }
-
- private void putMouseEvent(byte button, byte state, int dz, long nanos) {
- if (mouse_grabbed)
- putMouseEventWithCoords(button, state, 0, 0, dz, nanos);
- else
- putMouseEventWithCoords(button, state, last_x, last_y, dz, nanos);
- }
-
- public void read(ByteBuffer buffer) {
- event_queue.copyEvents(buffer);
- }
-
- public Object getBlankCursor() {
- return blank_cursor;
- }
-
- public void grab(boolean grab, boolean should_center) {
- if (grab) {
- if (!mouse_grabbed) {
- mouse_grabbed = true;
- if (should_center) {
- try {
- WindowsDisplay.setupCursorClipping(hwnd);
- } catch (LWJGLException e) {
- LWJGLUtil.log("Failed to setup cursor clipping: " + e);
- }
- centerCursor();
- }
- }
- } else {
- if (mouse_grabbed) {
- mouse_grabbed = false;
- WindowsDisplay.resetCursorClipping();
- }
- }
- event_queue.clearEvents();
- }
-
- public void handleMouseScrolled(int event_dwheel, long millis) {
- accum_dwheel += event_dwheel;
- putMouseEvent((byte)-1, (byte)0, event_dwheel, millis*1000000);
- }
-
- private void centerCursor() {
- WindowsDisplay.centerCursor(hwnd);
- }
-
- public void setPosition(int x, int y) {
- this.last_x = x;
- this.last_y = y;
- }
-
- public void destroy() {
- WindowsDisplay.doDestroyCursor(blank_cursor);
- }
-
- public void handleMouseMoved(int x, int y, long millis, boolean should_center) {
- int dx = x - last_x;
- int dy = y - last_y;
- if (dx != 0 || dy != 0) {
- accum_dx += dx;
- accum_dy += dy;
- last_x = x;
- last_y = y;
- long nanos = millis*1000000;
- if (mouse_grabbed) {
- putMouseEventWithCoords((byte)-1, (byte)0, dx, dy, 0, nanos);
- if (should_center)
- centerCursor();
- } else {
- putMouseEventWithCoords((byte)-1, (byte)0, x, y, 0, nanos);
- }
- }
- }
-
- public void handleMouseButton(byte button, byte state, long millis) {
- putMouseEvent(button, state, 0, millis*1000000);
- if (button < button_states.length)
- button_states[button] = state != 0 ? (byte)1 : (byte)0;
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+/**
+ * This is the Windows implementation of the Mouse.
+ * @author elias_naur
+ */
+
+import java.nio.ByteBuffer;
+import java.nio.IntBuffer;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.LWJGLException;
+import org.lwjgl.LWJGLUtil;
+import org.lwjgl.input.Mouse;
+
+final class WindowsMouse {
+ private final long hwnd;
+
+ private final int mouse_button_count;
+ private final boolean has_wheel;
+
+ private final EventQueue event_queue = new EventQueue(Mouse.EVENT_SIZE);
+
+ private final ByteBuffer mouse_event = ByteBuffer.allocate(Mouse.EVENT_SIZE);
+ private final Object blank_cursor;
+
+ private boolean mouse_grabbed;
+ private byte[] button_states;
+ private int accum_dx;
+ private int accum_dy;
+ private int accum_dwheel;
+ private int last_x;
+ private int last_y;
+
+ WindowsMouse(long hwnd) throws LWJGLException {
+ this.hwnd = hwnd;
+ this.mouse_button_count = WindowsDisplay.getSystemMetrics(WindowsDisplay.SM_CMOUSEBUTTONS);
+ this.has_wheel = WindowsDisplay.getSystemMetrics(WindowsDisplay.SM_MOUSEWHEELPRESENT) != 0;
+ this.blank_cursor = createBlankCursor();
+ this.button_states = new byte[mouse_button_count];
+ }
+
+ private Object createBlankCursor() throws LWJGLException {
+ int width = WindowsDisplay.getSystemMetrics(WindowsDisplay.SM_CXCURSOR);
+ int height = WindowsDisplay.getSystemMetrics(WindowsDisplay.SM_CYCURSOR);
+ IntBuffer pixels = BufferUtils.createIntBuffer(width*height);
+ return WindowsDisplay.doCreateCursor(width, height, 0, 0, 1, pixels, null);
+ }
+
+ public boolean isGrabbed() {
+ return mouse_grabbed;
+ }
+
+ public boolean hasWheel() {
+ return has_wheel;
+ }
+
+ public int getButtonCount() {
+ return mouse_button_count;
+ }
+
+ public void poll(IntBuffer coord_buffer, ByteBuffer buttons) {
+ for (int i = 0; i < coord_buffer.remaining(); i++)
+ coord_buffer.put(coord_buffer.position() + i, 0);
+ int num_buttons = mouse_button_count;
+ coord_buffer.put(coord_buffer.position() + 2, accum_dwheel);
+ if (num_buttons > button_states.length)
+ num_buttons = button_states.length;
+ for (int j = 0; j < num_buttons; j++) {
+ buttons.put(buttons.position() + j, button_states[j]);
+ }
+ if (isGrabbed()) {
+ coord_buffer.put(coord_buffer.position() + 0, accum_dx);
+ coord_buffer.put(coord_buffer.position() + 1, accum_dy);
+ } else {
+ coord_buffer.put(coord_buffer.position() + 0, last_x);
+ coord_buffer.put(coord_buffer.position() + 1, last_y);
+ }
+ accum_dx = accum_dy = accum_dwheel = 0;
+ }
+
+ private void putMouseEventWithCoords(byte button, byte state, int coord1, int coord2, int dz, long nanos) {
+ mouse_event.clear();
+ mouse_event.put(button).put(state).putInt(coord1).putInt(coord2).putInt(dz).putLong(nanos);
+ mouse_event.flip();
+ event_queue.putEvent(mouse_event);
+ }
+
+ private void putMouseEvent(byte button, byte state, int dz, long nanos) {
+ if (mouse_grabbed)
+ putMouseEventWithCoords(button, state, 0, 0, dz, nanos);
+ else
+ putMouseEventWithCoords(button, state, last_x, last_y, dz, nanos);
+ }
+
+ public void read(ByteBuffer buffer) {
+ event_queue.copyEvents(buffer);
+ }
+
+ public Object getBlankCursor() {
+ return blank_cursor;
+ }
+
+ public void grab(boolean grab, boolean should_center) {
+ if (grab) {
+ if (!mouse_grabbed) {
+ mouse_grabbed = true;
+ if (should_center) {
+ try {
+ WindowsDisplay.setupCursorClipping(hwnd);
+ } catch (LWJGLException e) {
+ LWJGLUtil.log("Failed to setup cursor clipping: " + e);
+ }
+ centerCursor();
+ }
+ }
+ } else {
+ if (mouse_grabbed) {
+ mouse_grabbed = false;
+ WindowsDisplay.resetCursorClipping();
+ }
+ }
+ event_queue.clearEvents();
+ }
+
+ public void handleMouseScrolled(int event_dwheel, long millis) {
+ accum_dwheel += event_dwheel;
+ putMouseEvent((byte)-1, (byte)0, event_dwheel, millis*1000000);
+ }
+
+ private void centerCursor() {
+ WindowsDisplay.centerCursor(hwnd);
+ }
+
+ public void setPosition(int x, int y) {
+ this.last_x = x;
+ this.last_y = y;
+ }
+
+ public void destroy() {
+ WindowsDisplay.doDestroyCursor(blank_cursor);
+ }
+
+ public void handleMouseMoved(int x, int y, long millis, boolean should_center) {
+ int dx = x - last_x;
+ int dy = y - last_y;
+ if (dx != 0 || dy != 0) {
+ accum_dx += dx;
+ accum_dy += dy;
+ last_x = x;
+ last_y = y;
+ long nanos = millis*1000000;
+ if (mouse_grabbed) {
+ putMouseEventWithCoords((byte)-1, (byte)0, dx, dy, 0, nanos);
+ if (should_center)
+ centerCursor();
+ } else {
+ putMouseEventWithCoords((byte)-1, (byte)0, x, y, 0, nanos);
+ }
+ }
+ }
+
+ public void handleMouseButton(byte button, byte state, long millis) {
+ putMouseEvent(button, state, 0, millis*1000000);
+ if (button < button_states.length)
+ button_states[button] = state != 0 ? (byte)1 : (byte)0;
+ }
+}
diff --git a/src/java/org/lwjgl/opengl/WindowsPbufferPeerInfo.java b/src/java/org/lwjgl/opengl/WindowsPbufferPeerInfo.java
index 967dd84..944094e 100644
--- a/src/java/org/lwjgl/opengl/WindowsPbufferPeerInfo.java
+++ b/src/java/org/lwjgl/opengl/WindowsPbufferPeerInfo.java
@@ -1,83 +1,83 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import java.nio.ByteBuffer;
-import java.nio.IntBuffer;
-
-import org.lwjgl.LWJGLException;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3116 $
- * $Id: WindowsPbufferPeerInfo.java 3116 2008-08-19 16:46:03Z spasi $
- */
-final class WindowsPbufferPeerInfo extends WindowsPeerInfo {
- WindowsPbufferPeerInfo(int width, int height, PixelFormat pixel_format, IntBuffer pixelFormatCaps, IntBuffer pBufferAttribs) throws LWJGLException {
- nCreate(getHandle(), width, height, pixel_format, pixelFormatCaps, pBufferAttribs);
- }
- private static native void nCreate(ByteBuffer handle, int width, int height, PixelFormat pixel_format, IntBuffer pixelFormatCaps, IntBuffer pBufferAttribs) throws LWJGLException;
-
- public boolean isBufferLost() {
- return nIsBufferLost(getHandle());
- }
- private static native boolean nIsBufferLost(ByteBuffer handle);
-
- public void setPbufferAttrib(int attrib, int value) {
- nSetPbufferAttrib(getHandle(), attrib, value);
- }
- private static native void nSetPbufferAttrib(ByteBuffer handle, int attrib, int value);
-
- public void bindTexImageToPbuffer(int buffer) {
- nBindTexImageToPbuffer(getHandle(), buffer);
- }
- private static native void nBindTexImageToPbuffer(ByteBuffer handle, int buffer);
-
- public void releaseTexImageFromPbuffer(int buffer) {
- nReleaseTexImageFromPbuffer(getHandle(), buffer);
- }
- private static native void nReleaseTexImageFromPbuffer(ByteBuffer handle, int buffer);
-
- public void destroy() {
- nDestroy(getHandle());
- }
- private static native void nDestroy(ByteBuffer handle);
-
- protected void doLockAndInitHandle() throws LWJGLException {
- // NO-OP
- }
-
- protected void doUnlock() throws LWJGLException {
- // NO-OP
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import java.nio.ByteBuffer;
+import java.nio.IntBuffer;
+
+import org.lwjgl.LWJGLException;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3116 $
+ * $Id: WindowsPbufferPeerInfo.java 3116 2008-08-19 16:46:03Z spasi $
+ */
+final class WindowsPbufferPeerInfo extends WindowsPeerInfo {
+ WindowsPbufferPeerInfo(int width, int height, PixelFormat pixel_format, IntBuffer pixelFormatCaps, IntBuffer pBufferAttribs) throws LWJGLException {
+ nCreate(getHandle(), width, height, pixel_format, pixelFormatCaps, pBufferAttribs);
+ }
+ private static native void nCreate(ByteBuffer handle, int width, int height, PixelFormat pixel_format, IntBuffer pixelFormatCaps, IntBuffer pBufferAttribs) throws LWJGLException;
+
+ public boolean isBufferLost() {
+ return nIsBufferLost(getHandle());
+ }
+ private static native boolean nIsBufferLost(ByteBuffer handle);
+
+ public void setPbufferAttrib(int attrib, int value) {
+ nSetPbufferAttrib(getHandle(), attrib, value);
+ }
+ private static native void nSetPbufferAttrib(ByteBuffer handle, int attrib, int value);
+
+ public void bindTexImageToPbuffer(int buffer) {
+ nBindTexImageToPbuffer(getHandle(), buffer);
+ }
+ private static native void nBindTexImageToPbuffer(ByteBuffer handle, int buffer);
+
+ public void releaseTexImageFromPbuffer(int buffer) {
+ nReleaseTexImageFromPbuffer(getHandle(), buffer);
+ }
+ private static native void nReleaseTexImageFromPbuffer(ByteBuffer handle, int buffer);
+
+ public void destroy() {
+ nDestroy(getHandle());
+ }
+ private static native void nDestroy(ByteBuffer handle);
+
+ protected void doLockAndInitHandle() throws LWJGLException {
+ // NO-OP
+ }
+
+ protected void doUnlock() throws LWJGLException {
+ // NO-OP
+ }
+}
diff --git a/src/java/org/lwjgl/opengl/WindowsPeerInfo.java b/src/java/org/lwjgl/opengl/WindowsPeerInfo.java
index d3533c5..83c04a6 100644
--- a/src/java/org/lwjgl/opengl/WindowsPeerInfo.java
+++ b/src/java/org/lwjgl/opengl/WindowsPeerInfo.java
@@ -1,66 +1,66 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import java.nio.ByteBuffer;
-import java.nio.IntBuffer;
-
-import org.lwjgl.LWJGLException;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3116 $
- * $Id: WindowsPeerInfo.java 3116 2008-08-19 16:46:03Z spasi $
- */
-abstract class WindowsPeerInfo extends PeerInfo {
- protected WindowsPeerInfo() {
- super(createHandle());
- }
- private static native ByteBuffer createHandle();
-
- protected static int choosePixelFormat(long hdc, int origin_x, int origin_y, PixelFormat pixel_format, IntBuffer pixel_format_caps, boolean use_hdc_bpp, boolean support_window, boolean support_pbuffer, boolean double_buffered) throws LWJGLException {
- return nChoosePixelFormat(hdc, origin_x, origin_y, pixel_format, pixel_format_caps, use_hdc_bpp, support_window, support_pbuffer, double_buffered);
- }
- private static native int nChoosePixelFormat(long hdc, int origin_x, int origin_y, PixelFormat pixel_format, IntBuffer pixel_format_caps, boolean use_hdc_bpp, boolean support_window, boolean support_pbuffer, boolean double_buffered) throws LWJGLException;
- protected static native void setPixelFormat(long hdc, int pixel_format) throws LWJGLException;
-
- public final long getHdc() {
- return nGetHdc(getHandle());
- }
- private static native long nGetHdc(ByteBuffer handle);
-
- public final long getHwnd() {
- return nGetHwnd(getHandle());
- }
- private static native long nGetHwnd(ByteBuffer handle);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import java.nio.ByteBuffer;
+import java.nio.IntBuffer;
+
+import org.lwjgl.LWJGLException;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3116 $
+ * $Id: WindowsPeerInfo.java 3116 2008-08-19 16:46:03Z spasi $
+ */
+abstract class WindowsPeerInfo extends PeerInfo {
+ protected WindowsPeerInfo() {
+ super(createHandle());
+ }
+ private static native ByteBuffer createHandle();
+
+ protected static int choosePixelFormat(long hdc, int origin_x, int origin_y, PixelFormat pixel_format, IntBuffer pixel_format_caps, boolean use_hdc_bpp, boolean support_window, boolean support_pbuffer, boolean double_buffered) throws LWJGLException {
+ return nChoosePixelFormat(hdc, origin_x, origin_y, pixel_format, pixel_format_caps, use_hdc_bpp, support_window, support_pbuffer, double_buffered);
+ }
+ private static native int nChoosePixelFormat(long hdc, int origin_x, int origin_y, PixelFormat pixel_format, IntBuffer pixel_format_caps, boolean use_hdc_bpp, boolean support_window, boolean support_pbuffer, boolean double_buffered) throws LWJGLException;
+ protected static native void setPixelFormat(long hdc, int pixel_format) throws LWJGLException;
+
+ public final long getHdc() {
+ return nGetHdc(getHandle());
+ }
+ private static native long nGetHdc(ByteBuffer handle);
+
+ public final long getHwnd() {
+ return nGetHwnd(getHandle());
+ }
+ private static native long nGetHwnd(ByteBuffer handle);
+}
diff --git a/src/java/org/lwjgl/opengl/WindowsRegistry.java b/src/java/org/lwjgl/opengl/WindowsRegistry.java
index f39c3a3..f84e682 100644
--- a/src/java/org/lwjgl/opengl/WindowsRegistry.java
+++ b/src/java/org/lwjgl/opengl/WindowsRegistry.java
@@ -1,69 +1,69 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-/**
- * This is an interface to the windows registry
- * @author elias_naur
- */
-
-import org.lwjgl.LWJGLException;
-import org.lwjgl.Sys;
-
-final class WindowsRegistry {
- final static int HKEY_CLASSES_ROOT = 1;
- final static int HKEY_CURRENT_USER = 2;
- final static int HKEY_LOCAL_MACHINE = 3;
- final static int HKEY_USERS = 4;
-
- static {
- Sys.initialize();
- }
-
- /**
- * Query the registry value specified by the root key, subkey, value tuple
- */
- static String queryRegistrationKey(int root_key, String subkey, String value) throws LWJGLException {
- switch (root_key) {
- case HKEY_CLASSES_ROOT:
- case HKEY_CURRENT_USER:
- case HKEY_LOCAL_MACHINE:
- case HKEY_USERS:
- break;
- default:
- throw new IllegalArgumentException("Invalid enum: " + root_key);
- }
- return nQueryRegistrationKey(root_key, subkey, value);
- }
-
- private static native String nQueryRegistrationKey(int root_key, String subkey, String value) throws LWJGLException;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+/**
+ * This is an interface to the windows registry
+ * @author elias_naur
+ */
+
+import org.lwjgl.LWJGLException;
+import org.lwjgl.Sys;
+
+final class WindowsRegistry {
+ final static int HKEY_CLASSES_ROOT = 1;
+ final static int HKEY_CURRENT_USER = 2;
+ final static int HKEY_LOCAL_MACHINE = 3;
+ final static int HKEY_USERS = 4;
+
+ static {
+ Sys.initialize();
+ }
+
+ /**
+ * Query the registry value specified by the root key, subkey, value tuple
+ */
+ static String queryRegistrationKey(int root_key, String subkey, String value) throws LWJGLException {
+ switch (root_key) {
+ case HKEY_CLASSES_ROOT:
+ case HKEY_CURRENT_USER:
+ case HKEY_LOCAL_MACHINE:
+ case HKEY_USERS:
+ break;
+ default:
+ throw new IllegalArgumentException("Invalid enum: " + root_key);
+ }
+ return nQueryRegistrationKey(root_key, subkey, value);
+ }
+
+ private static native String nQueryRegistrationKey(int root_key, String subkey, String value) throws LWJGLException;
+}
diff --git a/src/java/org/lwjgl/opengl/XRandR.java b/src/java/org/lwjgl/opengl/XRandR.java
index d9876b9..4a6fd85 100644
--- a/src/java/org/lwjgl/opengl/XRandR.java
+++ b/src/java/org/lwjgl/opengl/XRandR.java
@@ -1,257 +1,257 @@
-/*
- * Copyright (c) 2002-2010 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.
- */
-
-package org.lwjgl.opengl;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Pattern;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-/**
- * Utility for working with the xrandr commmand-line utility. Assumes
- * xrandr v1.2 or higher.
- *
- * @author ryanm
- */
-public class XRandR {
-
- private static Screen[] current;
-
- private static Map /* <String, Screen[]> */screens;
-
- private static void populate() {
- if (screens == null) {
- screens = new HashMap/* <String, Screen[]> */();
-
- // ProcessBuilder pb = new ProcessBuilder( "xrandr", "-q" );
- // pb.redirectErrorStream();
- try {
- // Process p= pb.start();
- Process p = Runtime.getRuntime().exec(new String[] { "xrandr", "-q"});
-
- List/* <Screen> */currentList = new ArrayList/* <Screen> */();
- List/* <Screen> */possibles = new ArrayList/* <Screen> */();
- String name = null;
-
- BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
- String line;
- while ((line = br.readLine()) != null) {
- line = line.trim();
- String[] sa = line.split("\\s+");
-
- if (sa[1].equals("connected")) {
- // found a new screen block
- if (name != null) {
- screens.put(name, possibles.toArray(new Screen[possibles.size()]));
- possibles.clear();
- }
- name = sa[0];
-
- // record the current config
- currentList.add(new Screen(name, sa[2]));
- } else if (Pattern.matches("\\d*x\\d*", sa[0])) {
- // found a new mode line
- possibles.add(new Screen(name, sa[0]));
- }
- }
-
- screens.put(name, possibles.toArray(new Screen[possibles.size()]));
-
- current = (Screen[]) currentList.toArray(new Screen[currentList.size()]);
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
-
- /**
- * @return The current screen configuration, or an empty array if
- * xrandr is not supported
- */
- public static Screen[] getConfiguration() {
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- populate();
- return null;
- }
- });
-
- return (Screen[]) current.clone();
- }
-
- /**
- * @param screens
- * The desired screen set, may not be <code>null</code>
- */
- public static void setConfiguration(Screen[]/* ... */screens) {
- if (screens.length == 0) {
- throw new IllegalArgumentException("Must specify at least one screen");
- }
-
- List/* <String> */cmd = new ArrayList/* <String> */();
- cmd.add("xrandr");
-
- // switch off those in the current set not in the new set
- for (int i = 0; i < current.length; i++) {
- boolean found = false;
- for (int j = 0; j < screens.length; j++) {
- if (screens[j].name.equals(current[i].name)) {
- found = true;
- break;
- }
- }
-
- if (!found) {
- cmd.add("--output");
- cmd.add(current[i].name);
- cmd.add("--off");
- }
- }
-
- // set up new set
- for (int i = 0; i < screens.length; i++) {
- screens[i].getArgs(cmd);
- }
-
- try {
- // ProcessBuilder pb = new ProcessBuilder( cmd );
- // pb.redirectErrorStream();
- // Process p = pb.start();
- Process p = Runtime.getRuntime().exec((String[]) cmd.toArray(new String[cmd.size()]));
- // no output is expected, but check anyway
- BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
- String line;
- while ((line = br.readLine()) != null) {
- System.out.println(line);
- }
- current = screens;
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- }
-
- /**
- * @return the name of connected screens, or an empty array if
- * xrandr is not supported
- */
- public static String[] getScreenNames() {
- populate();
- return (String[]) screens.keySet().toArray(new String[screens.size()]);
- }
-
- /**
- * @param name
- * @return the possible resolutions of the named screen, or
- * <code>null</code> if there is no such screen
- */
- public static Screen[] getResolutions(String name) {
- populate();
- // clone the array to prevent held copies being altered
- return (Screen[]) ((Screen[]) screens.get(name)).clone();
- }
-
- /**
- * Encapsulates the configuration of a monitor. Resolution is
- * fixed, position is mutable
- *
- * @author ryanm
- */
- public static class Screen implements Cloneable {
-
- /**
- * Name for this output
- */
- public final String name;
-
- /**
- * Width in pixels
- */
- public final int width;
-
- /**
- * Height in pixels
- */
- public final int height;
-
- /**
- * Position on the x-axis, in pixels
- */
- public int xPos = 0;
-
- /**
- * Position on the y-axis, in pixels
- */
- public int yPos = 0;
-
- /**
- * @param name
- * name of the screen
- * @param conf
- * config string, format either widthxheight or
- * widthxheight+xPos+yPos
- */
- private Screen(String name, String conf) {
- this.name = name;
-
- String[] sa = conf.split("\\D");
- width = Integer.parseInt(sa[0]);
- height = Integer.parseInt(sa[1]);
-
- if (sa.length > 2) {
- xPos = Integer.parseInt(sa[2]);
- yPos = Integer.parseInt(sa[3]);
- }
- }
-
- private void getArgs(List/* <String> */argList) {
- argList.add("--output");
- argList.add(name);
- argList.add("--mode");
- argList.add(width + "x" + height);
- argList.add("--pos");
- argList.add(xPos + "x" + yPos);
- }
-
- // @Override
- public String toString() {
- return name + " " + width + "x" + height + " @ " + xPos + "x" + yPos;
- }
- }
-}
+/*
+ * Copyright (c) 2002-2010 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.
+ */
+
+package org.lwjgl.opengl;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Pattern;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+/**
+ * Utility for working with the xrandr commmand-line utility. Assumes
+ * xrandr v1.2 or higher.
+ *
+ * @author ryanm
+ */
+public class XRandR {
+
+ private static Screen[] current;
+
+ private static Map /* <String, Screen[]> */screens;
+
+ private static void populate() {
+ if (screens == null) {
+ screens = new HashMap/* <String, Screen[]> */();
+
+ // ProcessBuilder pb = new ProcessBuilder( "xrandr", "-q" );
+ // pb.redirectErrorStream();
+ try {
+ // Process p= pb.start();
+ Process p = Runtime.getRuntime().exec(new String[] { "xrandr", "-q"});
+
+ List/* <Screen> */currentList = new ArrayList/* <Screen> */();
+ List/* <Screen> */possibles = new ArrayList/* <Screen> */();
+ String name = null;
+
+ BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
+ String line;
+ while ((line = br.readLine()) != null) {
+ line = line.trim();
+ String[] sa = line.split("\\s+");
+
+ if (sa[1].equals("connected")) {
+ // found a new screen block
+ if (name != null) {
+ screens.put(name, possibles.toArray(new Screen[possibles.size()]));
+ possibles.clear();
+ }
+ name = sa[0];
+
+ // record the current config
+ currentList.add(new Screen(name, sa[2]));
+ } else if (Pattern.matches("\\d*x\\d*", sa[0])) {
+ // found a new mode line
+ possibles.add(new Screen(name, sa[0]));
+ }
+ }
+
+ screens.put(name, possibles.toArray(new Screen[possibles.size()]));
+
+ current = (Screen[]) currentList.toArray(new Screen[currentList.size()]);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ /**
+ * @return The current screen configuration, or an empty array if
+ * xrandr is not supported
+ */
+ public static Screen[] getConfiguration() {
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ populate();
+ return null;
+ }
+ });
+
+ return (Screen[]) current.clone();
+ }
+
+ /**
+ * @param screens
+ * The desired screen set, may not be <code>null</code>
+ */
+ public static void setConfiguration(Screen[]/* ... */screens) {
+ if (screens.length == 0) {
+ throw new IllegalArgumentException("Must specify at least one screen");
+ }
+
+ List/* <String> */cmd = new ArrayList/* <String> */();
+ cmd.add("xrandr");
+
+ // switch off those in the current set not in the new set
+ for (int i = 0; i < current.length; i++) {
+ boolean found = false;
+ for (int j = 0; j < screens.length; j++) {
+ if (screens[j].name.equals(current[i].name)) {
+ found = true;
+ break;
+ }
+ }
+
+ if (!found) {
+ cmd.add("--output");
+ cmd.add(current[i].name);
+ cmd.add("--off");
+ }
+ }
+
+ // set up new set
+ for (int i = 0; i < screens.length; i++) {
+ screens[i].getArgs(cmd);
+ }
+
+ try {
+ // ProcessBuilder pb = new ProcessBuilder( cmd );
+ // pb.redirectErrorStream();
+ // Process p = pb.start();
+ Process p = Runtime.getRuntime().exec((String[]) cmd.toArray(new String[cmd.size()]));
+ // no output is expected, but check anyway
+ BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
+ String line;
+ while ((line = br.readLine()) != null) {
+ System.out.println(line);
+ }
+ current = screens;
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ /**
+ * @return the name of connected screens, or an empty array if
+ * xrandr is not supported
+ */
+ public static String[] getScreenNames() {
+ populate();
+ return (String[]) screens.keySet().toArray(new String[screens.size()]);
+ }
+
+ /**
+ * @param name
+ * @return the possible resolutions of the named screen, or
+ * <code>null</code> if there is no such screen
+ */
+ public static Screen[] getResolutions(String name) {
+ populate();
+ // clone the array to prevent held copies being altered
+ return (Screen[]) ((Screen[]) screens.get(name)).clone();
+ }
+
+ /**
+ * Encapsulates the configuration of a monitor. Resolution is
+ * fixed, position is mutable
+ *
+ * @author ryanm
+ */
+ public static class Screen implements Cloneable {
+
+ /**
+ * Name for this output
+ */
+ public final String name;
+
+ /**
+ * Width in pixels
+ */
+ public final int width;
+
+ /**
+ * Height in pixels
+ */
+ public final int height;
+
+ /**
+ * Position on the x-axis, in pixels
+ */
+ public int xPos = 0;
+
+ /**
+ * Position on the y-axis, in pixels
+ */
+ public int yPos = 0;
+
+ /**
+ * @param name
+ * name of the screen
+ * @param conf
+ * config string, format either widthxheight or
+ * widthxheight+xPos+yPos
+ */
+ private Screen(String name, String conf) {
+ this.name = name;
+
+ String[] sa = conf.split("\\D");
+ width = Integer.parseInt(sa[0]);
+ height = Integer.parseInt(sa[1]);
+
+ if (sa.length > 2) {
+ xPos = Integer.parseInt(sa[2]);
+ yPos = Integer.parseInt(sa[3]);
+ }
+ }
+
+ private void getArgs(List/* <String> */argList) {
+ argList.add("--output");
+ argList.add(name);
+ argList.add("--mode");
+ argList.add(width + "x" + height);
+ argList.add("--pos");
+ argList.add(xPos + "x" + yPos);
+ }
+
+ // @Override
+ public String toString() {
+ return name + " " + width + "x" + height + " @ " + xPos + "x" + yPos;
+ }
+ }
+}
diff --git a/src/java/org/lwjgl/test/DisplayTest.java b/src/java/org/lwjgl/test/DisplayTest.java
index 7d6abf7..5bac454 100644
--- a/src/java/org/lwjgl/test/DisplayTest.java
+++ b/src/java/org/lwjgl/test/DisplayTest.java
@@ -1,252 +1,252 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test;
-
-import org.lwjgl.LWJGLException;
-import org.lwjgl.opengl.Display;
-import org.lwjgl.opengl.DisplayMode;
-
-/**
- * <br>
- * Test class for Display & DisplayMode
- *
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 2983 $
- * $Id: DisplayTest.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public class DisplayTest {
-
- /**
- * Creates a new DisplayTest
- */
- public DisplayTest() {
- }
-
- /**
- * Runs the tests
- */
- public void executeTest() throws LWJGLException {
- currentTest();
- queryModesTest();
- setDisplayModeTest();
- setDisplayConfigurationTest();
- }
-
- /**
- * Prints some info about the current mode
- */
- private void currentTest() {
- System.out.println("==== Test Current ====");
-
- System.out.println("Info about current:");
- System.out.println("Graphics card: " + Display.getAdapter() + ", version: " + Display.getVersion());
- System.out.println("Resolution: " +
- Display.getDisplayMode().getWidth() + "x" +
- Display.getDisplayMode().getHeight() + "x" +
- Display.getDisplayMode().getBitsPerPixel() + "@" +
- Display.getDisplayMode().getFrequency() + "Hz");
- System.out.println("---- Test Current ----");
- }
-
- /**
- * Tests querying for modes
- */
- private void queryModesTest() throws LWJGLException {
- DisplayMode[] modes = null;
-
- System.out.println("==== Test query ====");
- System.out.println("Retrieving available displaymodes");
- modes = Display.getAvailableDisplayModes();
-
- // no modes check
- if (modes == null) {
- System.out.println("FATAL: unable to find any modes!");
- System.exit(-1);
- }
-
- // write some info
- System.out.println("Found " + modes.length + " modes");
- System.out.println("The first 5 are:");
- for(int i=0;i<modes.length; i++) {
- System.out.println(modes[i]);
- if (i == 5) {
- break;
- }
- }
- System.out.println("---- Test query ----");
- }
-
-
- /**
- * Tests setting display modes
- */
- private void setDisplayModeTest() throws LWJGLException {
- DisplayMode mode = null;
- DisplayMode[] modes = null;
-
- System.out.println("==== Test setDisplayMode ====");
- System.out.println("Retrieving available displaymodes");
- modes = Display.getAvailableDisplayModes();
-
- // no modes check
- if (modes == null) {
- System.out.println("FATAL: unable to find any modes!");
- System.exit(-1);
- }
-
- // find a mode
- System.out.print("Looking for 640x480...");
- for(int i=0; i<modes.length;i++) {
- if (modes[i].getWidth() == 640 &&
- modes[i].getHeight() == 480) {
- mode = modes[i];
- System.out.println("found!");
- break;
- }
- }
-
- // no mode check
- if (mode == null) {
- System.out.println("error\nFATAL: Unable to find basic mode.");
- System.exit(-1);
- }
-
- // change to mode, and wait a bit
- System.out.print("Changing to mode...");
- try {
- Display.setDisplayMode(mode);
- Display.setFullscreen(true);
- Display.create();
- } catch (Exception e) {
- System.out.println("error\nFATAL: Error setting mode");
- System.exit(-1);
- }
- System.out.println("done");
-
- System.out.println("Resolution: " +
- Display.getDisplayMode().getWidth() + "x" +
- Display.getDisplayMode().getHeight() + "x" +
- Display.getDisplayMode().getBitsPerPixel() + "@" +
- Display.getDisplayMode().getFrequency() + "Hz");
-
- pause(5000);
-
- // reset
- System.out.print("Resetting mode...");
- try {
- Display.setFullscreen(false);
- } catch (LWJGLException e) {
- e.printStackTrace();
- }
- System.out.println("done");
-
- System.out.println("---- Test setDisplayMode ----");
- }
-
- /**
- * Tests the DisplayConfiguration
- */
- private void setDisplayConfigurationTest() {
- System.out.println("==== Test setDisplayConfigurationTest ====");
-
- System.out.println("Testing normal setting");
- changeConfig(1.0f, 0f, 1f);
-
- System.out.println("Testing gamma settings");
- changeConfig(5.0f, 0f, 1f);
- changeConfig(0.5f, 0f, 1f);
-
- System.out.println("Testing brightness settings");
- changeConfig(1.0f, -1.0f, 1f);
- changeConfig(1.0f, -0.5f, 1f);
- changeConfig(1.0f, 0.5f, 1f);
- changeConfig(1.0f, 1.0f, 1f);
-
- System.out.println("Testing contrast settings");
- changeConfig(1.0f, 0f, 0f);
- changeConfig(1.0f, 0f, 0.5f);
- changeConfig(1.0f, 0f, 10000.0f);
-
- System.out.print("resetting...");
- try {
- Display.setFullscreen(false);
- } catch (LWJGLException e) {
- e.printStackTrace();
- }
- System.out.println("done");
-
- System.out.println("---- Test setDisplayConfigurationTest ----");
- }
-
- /**
- * Changes the Displat configuration
- *
- * @param gamma gamma value to change to
- * @param brightness brightness value to change to
- * @param contrast contrast value to change to
- */
- private void changeConfig(float gamma, float brightness, float contrast) {
- try {
- Display.setDisplayConfiguration(gamma, brightness, contrast);
- System.out.println("Configuration changed, gamma = " + gamma + " brightness = " + brightness + " contrast = " + contrast);
- } catch (Exception e) {
- System.out.println("Failed on: gamma = " + gamma + " brightness = " + brightness + " contrast = " + contrast);
- }
- pause(3000);
- }
-
- /**
- * Pause current thread for a specified time
- *
- * @param time milliseconds to sleep
- */
- private void pause(long time) {
- int SLEEP_DELAY = 100;
- for (int i = 0; i < time; i += SLEEP_DELAY) {
- try {
- Display.processMessages();
- Thread.sleep(SLEEP_DELAY);
- } catch (InterruptedException inte) {
- }
- }
- }
-
- /**
- * Tests the Sys class, and serves as basic usage test
- *
- * @param args ignored
- */
- public static void main(String[] args) throws LWJGLException {
- new DisplayTest().executeTest();
- System.exit(0);
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test;
+
+import org.lwjgl.LWJGLException;
+import org.lwjgl.opengl.Display;
+import org.lwjgl.opengl.DisplayMode;
+
+/**
+ * <br>
+ * Test class for Display & DisplayMode
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 2983 $
+ * $Id: DisplayTest.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public class DisplayTest {
+
+ /**
+ * Creates a new DisplayTest
+ */
+ public DisplayTest() {
+ }
+
+ /**
+ * Runs the tests
+ */
+ public void executeTest() throws LWJGLException {
+ currentTest();
+ queryModesTest();
+ setDisplayModeTest();
+ setDisplayConfigurationTest();
+ }
+
+ /**
+ * Prints some info about the current mode
+ */
+ private void currentTest() {
+ System.out.println("==== Test Current ====");
+
+ System.out.println("Info about current:");
+ System.out.println("Graphics card: " + Display.getAdapter() + ", version: " + Display.getVersion());
+ System.out.println("Resolution: " +
+ Display.getDisplayMode().getWidth() + "x" +
+ Display.getDisplayMode().getHeight() + "x" +
+ Display.getDisplayMode().getBitsPerPixel() + "@" +
+ Display.getDisplayMode().getFrequency() + "Hz");
+ System.out.println("---- Test Current ----");
+ }
+
+ /**
+ * Tests querying for modes
+ */
+ private void queryModesTest() throws LWJGLException {
+ DisplayMode[] modes = null;
+
+ System.out.println("==== Test query ====");
+ System.out.println("Retrieving available displaymodes");
+ modes = Display.getAvailableDisplayModes();
+
+ // no modes check
+ if (modes == null) {
+ System.out.println("FATAL: unable to find any modes!");
+ System.exit(-1);
+ }
+
+ // write some info
+ System.out.println("Found " + modes.length + " modes");
+ System.out.println("The first 5 are:");
+ for(int i=0;i<modes.length; i++) {
+ System.out.println(modes[i]);
+ if (i == 5) {
+ break;
+ }
+ }
+ System.out.println("---- Test query ----");
+ }
+
+
+ /**
+ * Tests setting display modes
+ */
+ private void setDisplayModeTest() throws LWJGLException {
+ DisplayMode mode = null;
+ DisplayMode[] modes = null;
+
+ System.out.println("==== Test setDisplayMode ====");
+ System.out.println("Retrieving available displaymodes");
+ modes = Display.getAvailableDisplayModes();
+
+ // no modes check
+ if (modes == null) {
+ System.out.println("FATAL: unable to find any modes!");
+ System.exit(-1);
+ }
+
+ // find a mode
+ System.out.print("Looking for 640x480...");
+ for(int i=0; i<modes.length;i++) {
+ if (modes[i].getWidth() == 640 &&
+ modes[i].getHeight() == 480) {
+ mode = modes[i];
+ System.out.println("found!");
+ break;
+ }
+ }
+
+ // no mode check
+ if (mode == null) {
+ System.out.println("error\nFATAL: Unable to find basic mode.");
+ System.exit(-1);
+ }
+
+ // change to mode, and wait a bit
+ System.out.print("Changing to mode...");
+ try {
+ Display.setDisplayMode(mode);
+ Display.setFullscreen(true);
+ Display.create();
+ } catch (Exception e) {
+ System.out.println("error\nFATAL: Error setting mode");
+ System.exit(-1);
+ }
+ System.out.println("done");
+
+ System.out.println("Resolution: " +
+ Display.getDisplayMode().getWidth() + "x" +
+ Display.getDisplayMode().getHeight() + "x" +
+ Display.getDisplayMode().getBitsPerPixel() + "@" +
+ Display.getDisplayMode().getFrequency() + "Hz");
+
+ pause(5000);
+
+ // reset
+ System.out.print("Resetting mode...");
+ try {
+ Display.setFullscreen(false);
+ } catch (LWJGLException e) {
+ e.printStackTrace();
+ }
+ System.out.println("done");
+
+ System.out.println("---- Test setDisplayMode ----");
+ }
+
+ /**
+ * Tests the DisplayConfiguration
+ */
+ private void setDisplayConfigurationTest() {
+ System.out.println("==== Test setDisplayConfigurationTest ====");
+
+ System.out.println("Testing normal setting");
+ changeConfig(1.0f, 0f, 1f);
+
+ System.out.println("Testing gamma settings");
+ changeConfig(5.0f, 0f, 1f);
+ changeConfig(0.5f, 0f, 1f);
+
+ System.out.println("Testing brightness settings");
+ changeConfig(1.0f, -1.0f, 1f);
+ changeConfig(1.0f, -0.5f, 1f);
+ changeConfig(1.0f, 0.5f, 1f);
+ changeConfig(1.0f, 1.0f, 1f);
+
+ System.out.println("Testing contrast settings");
+ changeConfig(1.0f, 0f, 0f);
+ changeConfig(1.0f, 0f, 0.5f);
+ changeConfig(1.0f, 0f, 10000.0f);
+
+ System.out.print("resetting...");
+ try {
+ Display.setFullscreen(false);
+ } catch (LWJGLException e) {
+ e.printStackTrace();
+ }
+ System.out.println("done");
+
+ System.out.println("---- Test setDisplayConfigurationTest ----");
+ }
+
+ /**
+ * Changes the Displat configuration
+ *
+ * @param gamma gamma value to change to
+ * @param brightness brightness value to change to
+ * @param contrast contrast value to change to
+ */
+ private void changeConfig(float gamma, float brightness, float contrast) {
+ try {
+ Display.setDisplayConfiguration(gamma, brightness, contrast);
+ System.out.println("Configuration changed, gamma = " + gamma + " brightness = " + brightness + " contrast = " + contrast);
+ } catch (Exception e) {
+ System.out.println("Failed on: gamma = " + gamma + " brightness = " + brightness + " contrast = " + contrast);
+ }
+ pause(3000);
+ }
+
+ /**
+ * Pause current thread for a specified time
+ *
+ * @param time milliseconds to sleep
+ */
+ private void pause(long time) {
+ int SLEEP_DELAY = 100;
+ for (int i = 0; i < time; i += SLEEP_DELAY) {
+ try {
+ Display.processMessages();
+ Thread.sleep(SLEEP_DELAY);
+ } catch (InterruptedException inte) {
+ }
+ }
+ }
+
+ /**
+ * Tests the Sys class, and serves as basic usage test
+ *
+ * @param args ignored
+ */
+ public static void main(String[] args) throws LWJGLException {
+ new DisplayTest().executeTest();
+ System.exit(0);
+ }
+}
diff --git a/src/java/org/lwjgl/test/NativeTest.java b/src/java/org/lwjgl/test/NativeTest.java
index c9ff73f..15e0434 100644
--- a/src/java/org/lwjgl/test/NativeTest.java
+++ b/src/java/org/lwjgl/test/NativeTest.java
@@ -1,62 +1,62 @@
-/*
- * Copyright (c) 2002-2010 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.
- */
-package org.lwjgl.test;
-
-import org.lwjgl.Sys;
-import java.awt.Toolkit;
-
-/**
- * <br>
- * Simple test that just checks that the native library loads
- *
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 2983 $
- * $Id: SysTest.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public class NativeTest {
-
- public void invokeSys() {
- Sys.getVersion();
- }
-
- /**
- * Entry point for test
- *
- * @param args ignored
- */
- public static void main(String[] args) {
- // try to "load" awt - work around for headless issue on linux
- Toolkit.getDefaultToolkit();
- new NativeTest().invokeSys();
- System.out.println("OK");
- }
-}
+/*
+ * Copyright (c) 2002-2010 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.
+ */
+package org.lwjgl.test;
+
+import org.lwjgl.Sys;
+import java.awt.Toolkit;
+
+/**
+ * <br>
+ * Simple test that just checks that the native library loads
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 2983 $
+ * $Id: SysTest.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public class NativeTest {
+
+ public void invokeSys() {
+ Sys.getVersion();
+ }
+
+ /**
+ * Entry point for test
+ *
+ * @param args ignored
+ */
+ public static void main(String[] args) {
+ // try to "load" awt - work around for headless issue on linux
+ Toolkit.getDefaultToolkit();
+ new NativeTest().invokeSys();
+ System.out.println("OK");
+ }
+}
diff --git a/src/java/org/lwjgl/test/SysTest.java b/src/java/org/lwjgl/test/SysTest.java
index 97fe6a4..0f5fccd 100644
--- a/src/java/org/lwjgl/test/SysTest.java
+++ b/src/java/org/lwjgl/test/SysTest.java
@@ -1,180 +1,180 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test;
-
-import org.lwjgl.LWJGLException;
-import org.lwjgl.LWJGLUtil;
-import org.lwjgl.Sys;
-import org.lwjgl.opengl.Display;
-
-/**
- * <br>
- * Test class for Sys
- *
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 2983 $
- * $Id: SysTest.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public class SysTest {
-
- /**
- * Creates a new SysTest
- */
- public SysTest() {
- }
-
- /**
- * Runs the tests
- */
- public void executeTest() {
- testAlert();
- testDebug();
- testTimer();
- testUrl();
- testClipboard();
- }
-
- /**
- * Tests debug mode
- */
- private void testDebug() {
- System.out.println("==== Test Debug ====");
- if (LWJGLUtil.DEBUG) {
- LWJGLUtil.log("Debug is enabled, you should now see output from LWJGL during the following tests.");
- } else {
- System.out.println("Debug is not enabled. Please set the org.lwjgl.Sys.debug property to true to enable debugging");
- System.out.println("Example:\n java -Dorg.lwjgl.util.Debug=true ...");
- System.out.println("You will not see any debug output in the following tests.");
- }
-
- // get some display modes, to force some debug info
- try {
- Display.getAvailableDisplayModes();
- } catch (LWJGLException e) {
- throw new RuntimeException(e);
- }
-
- System.out.println("---- Test Debug ----\n");
- }
-
- /**
- * Tests the timer
- */
- private void testTimer() {
- long resolution = Sys.getTimerResolution();
- long time = Sys.getTime();
-
- System.out.println("==== Test Timer ====");
- System.out.println("Resolution of timer (ticks per second): " + resolution);
- System.out.println("Current time: " + time);
- System.out.println("Sleeping for 2 seconds, using Thread.sleep()");
-
- pause(2000);
-
- long time2 = Sys.getTime();
- System.out.println("Current time: " + time2);
- System.out.println("Actually slept for: " + ((time2 - time) / (float) resolution) + " seconds");
- System.out.println("---- Test Timer ----\n");
- }
-
- /**
- * Tests the alert
- */
- private void testAlert() {
- System.out.println("==== Test Alert ====");
-
- System.out.println("Opening native alert window");
- Sys.alert("SysTest", "Hello World!");
-
- System.out.println("---- Test Alert ----\n");
- }
-
- /**
- * Tests the openUrl
- */
- private void testUrl() {
- System.out.println("==== Test URL ====");
-
- System.out.println("Opening a browser window to http://www.lwjgl.org");
- Sys.openURL("http://www.lwjgl.org");
-
- System.out.println("---- Test URL ----\n");
- }
-
- /**
- * Busy waits for a specified number of seconds
- *
- * @param priority Priority to busy wait in
- * @param seconds Number of seconds to busy wait
- * @param message Message to print to user
- */
- private void busyWait(int priority, int seconds, String message) {
- long future = Sys.getTime() + (Sys.getTimerResolution() * seconds);
-
- System.out.print(message);
-
- // waste some cycles
- while (Sys.getTime() < future) {
- }
-
- System.out.println("done");
- }
-
- /**
- * Pause current thread for a specified time
- *
- * @param time milliseconds to sleep
- */
- private void pause(long time) {
- try {
- Thread.sleep(time);
- } catch (InterruptedException inte) {
- }
- }
-
- /**
- * Tests the clipboard. Helps to have something in it first...
- */
- private void testClipboard() {
- System.out.println("Contents of clipboard: '"+Sys.getClipboard()+"'");
- }
-
- /**
- * Tests the Sys class, and serves as basic usage test
- *
- * @param args ignored
- */
- public static void main(String[] args) {
- new SysTest().executeTest();
- System.exit(0);
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test;
+
+import org.lwjgl.LWJGLException;
+import org.lwjgl.LWJGLUtil;
+import org.lwjgl.Sys;
+import org.lwjgl.opengl.Display;
+
+/**
+ * <br>
+ * Test class for Sys
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 2983 $
+ * $Id: SysTest.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public class SysTest {
+
+ /**
+ * Creates a new SysTest
+ */
+ public SysTest() {
+ }
+
+ /**
+ * Runs the tests
+ */
+ public void executeTest() {
+ testAlert();
+ testDebug();
+ testTimer();
+ testUrl();
+ testClipboard();
+ }
+
+ /**
+ * Tests debug mode
+ */
+ private void testDebug() {
+ System.out.println("==== Test Debug ====");
+ if (LWJGLUtil.DEBUG) {
+ LWJGLUtil.log("Debug is enabled, you should now see output from LWJGL during the following tests.");
+ } else {
+ System.out.println("Debug is not enabled. Please set the org.lwjgl.Sys.debug property to true to enable debugging");
+ System.out.println("Example:\n java -Dorg.lwjgl.util.Debug=true ...");
+ System.out.println("You will not see any debug output in the following tests.");
+ }
+
+ // get some display modes, to force some debug info
+ try {
+ Display.getAvailableDisplayModes();
+ } catch (LWJGLException e) {
+ throw new RuntimeException(e);
+ }
+
+ System.out.println("---- Test Debug ----\n");
+ }
+
+ /**
+ * Tests the timer
+ */
+ private void testTimer() {
+ long resolution = Sys.getTimerResolution();
+ long time = Sys.getTime();
+
+ System.out.println("==== Test Timer ====");
+ System.out.println("Resolution of timer (ticks per second): " + resolution);
+ System.out.println("Current time: " + time);
+ System.out.println("Sleeping for 2 seconds, using Thread.sleep()");
+
+ pause(2000);
+
+ long time2 = Sys.getTime();
+ System.out.println("Current time: " + time2);
+ System.out.println("Actually slept for: " + ((time2 - time) / (float) resolution) + " seconds");
+ System.out.println("---- Test Timer ----\n");
+ }
+
+ /**
+ * Tests the alert
+ */
+ private void testAlert() {
+ System.out.println("==== Test Alert ====");
+
+ System.out.println("Opening native alert window");
+ Sys.alert("SysTest", "Hello World!");
+
+ System.out.println("---- Test Alert ----\n");
+ }
+
+ /**
+ * Tests the openUrl
+ */
+ private void testUrl() {
+ System.out.println("==== Test URL ====");
+
+ System.out.println("Opening a browser window to http://www.lwjgl.org");
+ Sys.openURL("http://www.lwjgl.org");
+
+ System.out.println("---- Test URL ----\n");
+ }
+
+ /**
+ * Busy waits for a specified number of seconds
+ *
+ * @param priority Priority to busy wait in
+ * @param seconds Number of seconds to busy wait
+ * @param message Message to print to user
+ */
+ private void busyWait(int priority, int seconds, String message) {
+ long future = Sys.getTime() + (Sys.getTimerResolution() * seconds);
+
+ System.out.print(message);
+
+ // waste some cycles
+ while (Sys.getTime() < future) {
+ }
+
+ System.out.println("done");
+ }
+
+ /**
+ * Pause current thread for a specified time
+ *
+ * @param time milliseconds to sleep
+ */
+ private void pause(long time) {
+ try {
+ Thread.sleep(time);
+ } catch (InterruptedException inte) {
+ }
+ }
+
+ /**
+ * Tests the clipboard. Helps to have something in it first...
+ */
+ private void testClipboard() {
+ System.out.println("Contents of clipboard: '"+Sys.getClipboard()+"'");
+ }
+
+ /**
+ * Tests the Sys class, and serves as basic usage test
+ *
+ * @param args ignored
+ */
+ public static void main(String[] args) {
+ new SysTest().executeTest();
+ System.exit(0);
+ }
+}
diff --git a/src/java/org/lwjgl/test/WaveDataTest.java b/src/java/org/lwjgl/test/WaveDataTest.java
index 43abc99..2fbfcd1 100644
--- a/src/java/org/lwjgl/test/WaveDataTest.java
+++ b/src/java/org/lwjgl/test/WaveDataTest.java
@@ -1,135 +1,135 @@
-/*
- * Copyright (c) 2002-2010 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.
- */
-package org.lwjgl.test;
-
-import java.io.File;
-
-import javax.sound.sampled.AudioInputStream;
-import javax.sound.sampled.AudioSystem;
-
-import org.lwjgl.LWJGLException;
-import org.lwjgl.util.WaveData;
-
-/**
- * <br>
- * Test class WaveDataTest
- *
- * @author Brian Matzon <brian at matzon.dk>
- */
-public class WaveDataTest {
-
- String filePath = "Footsteps.wav";
-
- /**
- * Creates a new DisplayTest
- */
- public WaveDataTest() {
- }
-
- /**
- * Runs the tests
- */
- public void executeTest() throws LWJGLException {
- executeCreationTest();
- executeBrokenCreationTest();
- executeMidStreamCreationTest();
- }
-
-
- private void executeCreationTest() {
- WaveData wd = WaveData.create(filePath);
- if(wd != null) {
- System.out.println("executeCreationTest::success");
- }
- }
-
- private void executeBrokenCreationTest() {
- WaveData wd = WaveData.create("");
- if(wd == null) {
- System.out.println("executeBrokenCreationTest::success");
- }
- }
-
- private void executeStreamCreationTest() {
- try {
- AudioInputStream ais = AudioSystem.getAudioInputStream(new File(filePath));
- WaveData wd = WaveData.create(ais);
- if(wd == null) {
- System.out.println("executeMidStreamCreationTest::success");
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- private void executeMidStreamCreationTest() {
- try {
-
- AudioInputStream ais = AudioSystem.getAudioInputStream(WaveDataTest.class.getClassLoader().getResource(filePath));
- int totalSize = ais.getFormat().getChannels() * (int) ais.getFrameLength() * ais.getFormat().getSampleSizeInBits() / 8;
-
- // skip 1/4 of the stream
- int skip = totalSize / 4;
- long skipped = ais.skip(skip);
-
- WaveData wd = WaveData.create(ais);
- if(wd == null) {
- System.out.println("executeMidStreamCreationTest::success");
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- /**
- * Pause current thread for a specified time
- *
- * @param time milliseconds to sleep
- */
- private void pause(long time) {
- try {
- Thread.sleep(time);
- } catch (InterruptedException inte) {
- /* ignored */
- }
- }
-
- /**
- * Tests the Sys class, and serves as basic usage test
- *
- * @param args ignored
- */
- public static void main(String[] args) throws LWJGLException {
- new WaveDataTest().executeTest();
- System.exit(0);
- }
-}
+/*
+ * Copyright (c) 2002-2010 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.
+ */
+package org.lwjgl.test;
+
+import java.io.File;
+
+import javax.sound.sampled.AudioInputStream;
+import javax.sound.sampled.AudioSystem;
+
+import org.lwjgl.LWJGLException;
+import org.lwjgl.util.WaveData;
+
+/**
+ * <br>
+ * Test class WaveDataTest
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ */
+public class WaveDataTest {
+
+ String filePath = "Footsteps.wav";
+
+ /**
+ * Creates a new DisplayTest
+ */
+ public WaveDataTest() {
+ }
+
+ /**
+ * Runs the tests
+ */
+ public void executeTest() throws LWJGLException {
+ executeCreationTest();
+ executeBrokenCreationTest();
+ executeMidStreamCreationTest();
+ }
+
+
+ private void executeCreationTest() {
+ WaveData wd = WaveData.create(filePath);
+ if(wd != null) {
+ System.out.println("executeCreationTest::success");
+ }
+ }
+
+ private void executeBrokenCreationTest() {
+ WaveData wd = WaveData.create("");
+ if(wd == null) {
+ System.out.println("executeBrokenCreationTest::success");
+ }
+ }
+
+ private void executeStreamCreationTest() {
+ try {
+ AudioInputStream ais = AudioSystem.getAudioInputStream(new File(filePath));
+ WaveData wd = WaveData.create(ais);
+ if(wd == null) {
+ System.out.println("executeMidStreamCreationTest::success");
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ private void executeMidStreamCreationTest() {
+ try {
+
+ AudioInputStream ais = AudioSystem.getAudioInputStream(WaveDataTest.class.getClassLoader().getResource(filePath));
+ int totalSize = ais.getFormat().getChannels() * (int) ais.getFrameLength() * ais.getFormat().getSampleSizeInBits() / 8;
+
+ // skip 1/4 of the stream
+ int skip = totalSize / 4;
+ long skipped = ais.skip(skip);
+
+ WaveData wd = WaveData.create(ais);
+ if(wd == null) {
+ System.out.println("executeMidStreamCreationTest::success");
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Pause current thread for a specified time
+ *
+ * @param time milliseconds to sleep
+ */
+ private void pause(long time) {
+ try {
+ Thread.sleep(time);
+ } catch (InterruptedException inte) {
+ /* ignored */
+ }
+ }
+
+ /**
+ * Tests the Sys class, and serves as basic usage test
+ *
+ * @param args ignored
+ */
+ public static void main(String[] args) throws LWJGLException {
+ new WaveDataTest().executeTest();
+ System.exit(0);
+ }
+}
diff --git a/src/java/org/lwjgl/test/WindowCreationTest.java b/src/java/org/lwjgl/test/WindowCreationTest.java
index 7fb9a90..1ef1603 100644
--- a/src/java/org/lwjgl/test/WindowCreationTest.java
+++ b/src/java/org/lwjgl/test/WindowCreationTest.java
@@ -1,324 +1,324 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test;
-
-import org.lwjgl.LWJGLException;
-import org.lwjgl.input.Keyboard;
-import org.lwjgl.opengl.Display;
-import org.lwjgl.opengl.DisplayMode;
-import org.lwjgl.opengl.GL11;
-
-/**
- * Small class for testing that the Window is creatable
- * If this class can't run, LWJGL wont work!
- *
- * @author Brian Matzon <brian at matzon.dk>
- */
-public class WindowCreationTest {
-
- /** Locatable modes */
- private DisplayMode[] located_modes;
-
- /** Fixed selectable modes */
- private DisplayMode[] fixed_modes = new DisplayMode[10];
-
-
- /** Window position x */
- private int window_x = 0;
-
- /** Window position y */
- private int window_y = 0;
-
- /** Color being cleared to */
- private float color = 0f;
-
- /** Direction moving clearing color */
- private int direction = 1;
-
- /** Whether we're running */
- private boolean running = false;
-
- /** Whether we're in fullscreen mode */
- private boolean fullscreen = false;
-
- /**
- * Initializes the test
- * @return true if initialization was successfull
- */
- public boolean initialize() {
- try {
- // get available modes, and print out
- located_modes = Display.getAvailableDisplayModes();
- System.out.println("Found " + located_modes.length + " display modes");
-
- // get 640x480, 800x600, 1024x768 modes
- findFixedModes();
-
- // create default windowed display 640*480 @ 100, 100
- setDefaultDisplayMode();
-
- window_x = window_y = 100;
- Display.setLocation(window_x, window_y);
-
- Display.create();
- return true;
- } catch (LWJGLException le) {
- le.printStackTrace();
- }
- return false;
- }
-
- /** Locate fixed modes */
- private void findFixedModes() {
- // get 640*480 modes
- fixed_modes[0] = getDisplayMode(640, 480, 16, -1);
- fixed_modes[1] = getDisplayMode(640, 480, 24, -1);
- fixed_modes[2] = getDisplayMode(640, 480, 32, -1);
-
- // get 800*600*16*60
- fixed_modes[3] = getDisplayMode(800, 600, 16, -1);
- fixed_modes[4] = getDisplayMode(800, 600, 24, -1);
- fixed_modes[5] = getDisplayMode(800, 600, 32, -1);
-
- // get 1024*768*16*60
- fixed_modes[6] = getDisplayMode(1024, 768, 16, -1);
- fixed_modes[7] = getDisplayMode(1024, 768, 24, -1);
- fixed_modes[8] = getDisplayMode(1024, 768, 32, -1);
- }
-
- /**
- * Executes the test
- */
- private void execute() {
- running = true;
-
- // wait for user to close window
- while (!Display.isCloseRequested() && running) {
-
- // handle input accordingly
- handleInput();
-
- // render something
- render();
-
- // update display as needed
- Display.update();
-
- // no need to run at full speed
- try {
- Thread.sleep(100);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
- /**
- * Destroys any resources used while running test
- */
- public void destroy() {
- // nuke window and get out
- Display.destroy();
- }
-
- /**
- * Handles the input
- */
- private void handleInput() {
- while (Keyboard.next()) {
-
- // we only want key down events
- if (!Keyboard.getEventKeyState()) {
- continue;
- }
-
- // check for exit
- if (Keyboard.getEventKey() == Keyboard.KEY_ESCAPE) {
- running = false;
- }
-
- // check for listing of modes
- if (Keyboard.getEventKey() == Keyboard.KEY_L) {
- for(int i=0;i<fixed_modes.length; i++) {
- System.out.println("[" + i + "]: " + fixed_modes[i]);
- }
- }
-
- // check for display mode
- // ================================
- if (Keyboard.getEventKey() == Keyboard.KEY_0) { setMode(0); }
- if (Keyboard.getEventKey() == Keyboard.KEY_1) { setMode(1); }
- if (Keyboard.getEventKey() == Keyboard.KEY_2) { setMode(2); }
- if (Keyboard.getEventKey() == Keyboard.KEY_3) { setMode(3); }
- if (Keyboard.getEventKey() == Keyboard.KEY_4) { setMode(4); }
- if (Keyboard.getEventKey() == Keyboard.KEY_5) { setMode(5); }
- if (Keyboard.getEventKey() == Keyboard.KEY_6) { setMode(6); }
- if (Keyboard.getEventKey() == Keyboard.KEY_7) { setMode(7); }
- if (Keyboard.getEventKey() == Keyboard.KEY_8) { setMode(8); }
- // --------------------------------
-
- // check for window move
- // ================================
- if (Keyboard.getEventKey() == Keyboard.KEY_LEFT) {
- if (!Display.isFullscreen()) {
- Display.setLocation(window_x -= 10, window_y);
- }
- }
-
- if (Keyboard.getEventKey() == Keyboard.KEY_RIGHT) {
- if (!Display.isFullscreen()) {
- Display.setLocation(window_x += 10, window_y);
- }
- }
-
- if (Keyboard.getEventKey() == Keyboard.KEY_UP) {
- if (!Display.isFullscreen()) {
- Display.setLocation(window_x, window_y -= 10);
- }
- }
-
- if (Keyboard.getEventKey() == Keyboard.KEY_DOWN) {
- if (!Display.isFullscreen()) {
- Display.setLocation(window_x, window_y += 10);
- }
- }
- // --------------------------------
-
- // check for fullscreen
- if (Keyboard.getEventKey() == Keyboard.KEY_F) {
- try {
- if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) ||
- Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) {
- System.out.println("Performing Display.destroy()/create() cycle");
- DisplayMode saved_mode = Display.getDisplayMode();
- Display.destroy();
- Display.setDisplayMode(saved_mode);
- Display.setFullscreen(fullscreen = !fullscreen);
- Display.create();
- } else
- Display.setFullscreen(fullscreen = !fullscreen);
- } catch (LWJGLException lwjgle) {
- lwjgle.printStackTrace();
- }
- }
- }
- }
-
- private void setMode(int mode) {
- if(fixed_modes[mode] == null) {
- System.out.println("Unable to set mode. Not valid: " + mode);
- return;
- }
-
- try {
- Display.setDisplayMode(fixed_modes[mode]);
- } catch (LWJGLException le) {
- le.printStackTrace();
- System.out.println("Exception while setting mode: " + fixed_modes[mode]);
- }
- }
-
- /**
- *
- */
- private void render() {
- GL11.glClearColor(color, color, color, 1f);
- GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
-
- color += direction * .05f;
-
- if (color > 1f) {
- color = 1f;
- direction = -1 * direction;
- } else if (color < 0f) {
- direction = -1 * direction;
- color = 0f;
- }
- }
-
- /**
- * Main entry point
- *
- * @param args ignored params to app
- */
- public static void main(String[] args) throws LWJGLException {
-
- System.out.println("The following keys are available:\n" +
- "ESCAPE:\t\tExit test\n" +
- "ARROW Keys:\tMove window when in non-fullscreen mode\n" +
- "L:\t\tList selectable display modes\n" +
- "0-8:\t\tSelection of display modes\n" +
- "F:\t\tToggle fullscreen\n" +
- "SHIFT-F:\tToggle fullscreen with Display.destroy()/create() cycle");
-
- WindowCreationTest wct = new WindowCreationTest();
- if (wct.initialize()) {
- wct.execute();
- wct.destroy();
- }
- System.exit(0);
- }
-
- /**
- * Sets the display mode for fullscreen mode
- */
- protected boolean setDefaultDisplayMode() {
- try {
- // get modes
- DisplayMode[] dm = org.lwjgl.util.Display.getAvailableDisplayModes(640, 480, -1, -1, -1, -1, -1, -1);
-
- org.lwjgl.util.Display.setDisplayMode(dm, new String[] { "width=" + 640, "height=" + 480, "freq=" + 60,
- "bpp=" + org.lwjgl.opengl.Display.getDisplayMode().getBitsPerPixel()});
- return true;
- } catch (Exception e) {
- e.printStackTrace();
- }
- return false;
- }
-
- /**
- * Gets a specific display mode
- */
- private DisplayMode getDisplayMode(int width, int height, int bpp, int freq) {
- DisplayMode[] dm = null;
- try {
- dm = org.lwjgl.util.Display.getAvailableDisplayModes(width, height, width, height, bpp, bpp, freq, freq);
- if(dm == null || dm.length == 0) {
- System.out.println("Problem retrieving mode with " + width + "x" + height + "x" + bpp + "@" + freq);
- }
- } catch (LWJGLException le) {
- le.printStackTrace();
- System.out.println("Problem retrieving mode with " + width + "x" + height + "x" + bpp + "@" + freq);
- }
- return (dm != null && dm.length != 0) ? dm[0] : null;
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test;
+
+import org.lwjgl.LWJGLException;
+import org.lwjgl.input.Keyboard;
+import org.lwjgl.opengl.Display;
+import org.lwjgl.opengl.DisplayMode;
+import org.lwjgl.opengl.GL11;
+
+/**
+ * Small class for testing that the Window is creatable
+ * If this class can't run, LWJGL wont work!
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ */
+public class WindowCreationTest {
+
+ /** Locatable modes */
+ private DisplayMode[] located_modes;
+
+ /** Fixed selectable modes */
+ private DisplayMode[] fixed_modes = new DisplayMode[10];
+
+
+ /** Window position x */
+ private int window_x = 0;
+
+ /** Window position y */
+ private int window_y = 0;
+
+ /** Color being cleared to */
+ private float color = 0f;
+
+ /** Direction moving clearing color */
+ private int direction = 1;
+
+ /** Whether we're running */
+ private boolean running = false;
+
+ /** Whether we're in fullscreen mode */
+ private boolean fullscreen = false;
+
+ /**
+ * Initializes the test
+ * @return true if initialization was successfull
+ */
+ public boolean initialize() {
+ try {
+ // get available modes, and print out
+ located_modes = Display.getAvailableDisplayModes();
+ System.out.println("Found " + located_modes.length + " display modes");
+
+ // get 640x480, 800x600, 1024x768 modes
+ findFixedModes();
+
+ // create default windowed display 640*480 @ 100, 100
+ setDefaultDisplayMode();
+
+ window_x = window_y = 100;
+ Display.setLocation(window_x, window_y);
+
+ Display.create();
+ return true;
+ } catch (LWJGLException le) {
+ le.printStackTrace();
+ }
+ return false;
+ }
+
+ /** Locate fixed modes */
+ private void findFixedModes() {
+ // get 640*480 modes
+ fixed_modes[0] = getDisplayMode(640, 480, 16, -1);
+ fixed_modes[1] = getDisplayMode(640, 480, 24, -1);
+ fixed_modes[2] = getDisplayMode(640, 480, 32, -1);
+
+ // get 800*600*16*60
+ fixed_modes[3] = getDisplayMode(800, 600, 16, -1);
+ fixed_modes[4] = getDisplayMode(800, 600, 24, -1);
+ fixed_modes[5] = getDisplayMode(800, 600, 32, -1);
+
+ // get 1024*768*16*60
+ fixed_modes[6] = getDisplayMode(1024, 768, 16, -1);
+ fixed_modes[7] = getDisplayMode(1024, 768, 24, -1);
+ fixed_modes[8] = getDisplayMode(1024, 768, 32, -1);
+ }
+
+ /**
+ * Executes the test
+ */
+ private void execute() {
+ running = true;
+
+ // wait for user to close window
+ while (!Display.isCloseRequested() && running) {
+
+ // handle input accordingly
+ handleInput();
+
+ // render something
+ render();
+
+ // update display as needed
+ Display.update();
+
+ // no need to run at full speed
+ try {
+ Thread.sleep(100);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ /**
+ * Destroys any resources used while running test
+ */
+ public void destroy() {
+ // nuke window and get out
+ Display.destroy();
+ }
+
+ /**
+ * Handles the input
+ */
+ private void handleInput() {
+ while (Keyboard.next()) {
+
+ // we only want key down events
+ if (!Keyboard.getEventKeyState()) {
+ continue;
+ }
+
+ // check for exit
+ if (Keyboard.getEventKey() == Keyboard.KEY_ESCAPE) {
+ running = false;
+ }
+
+ // check for listing of modes
+ if (Keyboard.getEventKey() == Keyboard.KEY_L) {
+ for(int i=0;i<fixed_modes.length; i++) {
+ System.out.println("[" + i + "]: " + fixed_modes[i]);
+ }
+ }
+
+ // check for display mode
+ // ================================
+ if (Keyboard.getEventKey() == Keyboard.KEY_0) { setMode(0); }
+ if (Keyboard.getEventKey() == Keyboard.KEY_1) { setMode(1); }
+ if (Keyboard.getEventKey() == Keyboard.KEY_2) { setMode(2); }
+ if (Keyboard.getEventKey() == Keyboard.KEY_3) { setMode(3); }
+ if (Keyboard.getEventKey() == Keyboard.KEY_4) { setMode(4); }
+ if (Keyboard.getEventKey() == Keyboard.KEY_5) { setMode(5); }
+ if (Keyboard.getEventKey() == Keyboard.KEY_6) { setMode(6); }
+ if (Keyboard.getEventKey() == Keyboard.KEY_7) { setMode(7); }
+ if (Keyboard.getEventKey() == Keyboard.KEY_8) { setMode(8); }
+ // --------------------------------
+
+ // check for window move
+ // ================================
+ if (Keyboard.getEventKey() == Keyboard.KEY_LEFT) {
+ if (!Display.isFullscreen()) {
+ Display.setLocation(window_x -= 10, window_y);
+ }
+ }
+
+ if (Keyboard.getEventKey() == Keyboard.KEY_RIGHT) {
+ if (!Display.isFullscreen()) {
+ Display.setLocation(window_x += 10, window_y);
+ }
+ }
+
+ if (Keyboard.getEventKey() == Keyboard.KEY_UP) {
+ if (!Display.isFullscreen()) {
+ Display.setLocation(window_x, window_y -= 10);
+ }
+ }
+
+ if (Keyboard.getEventKey() == Keyboard.KEY_DOWN) {
+ if (!Display.isFullscreen()) {
+ Display.setLocation(window_x, window_y += 10);
+ }
+ }
+ // --------------------------------
+
+ // check for fullscreen
+ if (Keyboard.getEventKey() == Keyboard.KEY_F) {
+ try {
+ if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) ||
+ Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) {
+ System.out.println("Performing Display.destroy()/create() cycle");
+ DisplayMode saved_mode = Display.getDisplayMode();
+ Display.destroy();
+ Display.setDisplayMode(saved_mode);
+ Display.setFullscreen(fullscreen = !fullscreen);
+ Display.create();
+ } else
+ Display.setFullscreen(fullscreen = !fullscreen);
+ } catch (LWJGLException lwjgle) {
+ lwjgle.printStackTrace();
+ }
+ }
+ }
+ }
+
+ private void setMode(int mode) {
+ if(fixed_modes[mode] == null) {
+ System.out.println("Unable to set mode. Not valid: " + mode);
+ return;
+ }
+
+ try {
+ Display.setDisplayMode(fixed_modes[mode]);
+ } catch (LWJGLException le) {
+ le.printStackTrace();
+ System.out.println("Exception while setting mode: " + fixed_modes[mode]);
+ }
+ }
+
+ /**
+ *
+ */
+ private void render() {
+ GL11.glClearColor(color, color, color, 1f);
+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
+
+ color += direction * .05f;
+
+ if (color > 1f) {
+ color = 1f;
+ direction = -1 * direction;
+ } else if (color < 0f) {
+ direction = -1 * direction;
+ color = 0f;
+ }
+ }
+
+ /**
+ * Main entry point
+ *
+ * @param args ignored params to app
+ */
+ public static void main(String[] args) throws LWJGLException {
+
+ System.out.println("The following keys are available:\n" +
+ "ESCAPE:\t\tExit test\n" +
+ "ARROW Keys:\tMove window when in non-fullscreen mode\n" +
+ "L:\t\tList selectable display modes\n" +
+ "0-8:\t\tSelection of display modes\n" +
+ "F:\t\tToggle fullscreen\n" +
+ "SHIFT-F:\tToggle fullscreen with Display.destroy()/create() cycle");
+
+ WindowCreationTest wct = new WindowCreationTest();
+ if (wct.initialize()) {
+ wct.execute();
+ wct.destroy();
+ }
+ System.exit(0);
+ }
+
+ /**
+ * Sets the display mode for fullscreen mode
+ */
+ protected boolean setDefaultDisplayMode() {
+ try {
+ // get modes
+ DisplayMode[] dm = org.lwjgl.util.Display.getAvailableDisplayModes(640, 480, -1, -1, -1, -1, -1, -1);
+
+ org.lwjgl.util.Display.setDisplayMode(dm, new String[] { "width=" + 640, "height=" + 480, "freq=" + 60,
+ "bpp=" + org.lwjgl.opengl.Display.getDisplayMode().getBitsPerPixel()});
+ return true;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return false;
+ }
+
+ /**
+ * Gets a specific display mode
+ */
+ private DisplayMode getDisplayMode(int width, int height, int bpp, int freq) {
+ DisplayMode[] dm = null;
+ try {
+ dm = org.lwjgl.util.Display.getAvailableDisplayModes(width, height, width, height, bpp, bpp, freq, freq);
+ if(dm == null || dm.length == 0) {
+ System.out.println("Problem retrieving mode with " + width + "x" + height + "x" + bpp + "@" + freq);
+ }
+ } catch (LWJGLException le) {
+ le.printStackTrace();
+ System.out.println("Problem retrieving mode with " + width + "x" + height + "x" + bpp + "@" + freq);
+ }
+ return (dm != null && dm.length != 0) ? dm[0] : null;
+ }
+}
diff --git a/src/java/org/lwjgl/test/applet/AppletLoaderTest.java b/src/java/org/lwjgl/test/applet/AppletLoaderTest.java
index 60b847b..453c6a9 100644
--- a/src/java/org/lwjgl/test/applet/AppletLoaderTest.java
+++ b/src/java/org/lwjgl/test/applet/AppletLoaderTest.java
@@ -1,72 +1,72 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.applet;
-
-import java.applet.Applet;
-import java.awt.BorderLayout;
-import java.awt.Canvas;
-
-public class AppletLoaderTest extends Applet {
-
- Test test = null;
-
- public void destroy() {
- super.destroy();
- System.out.println("*** destroy ***");
- }
-
- public void start() {
- super.start();
- System.out.println("*** start ***");
- }
-
- public void stop() {
- super.stop();
- System.out.println("*** stop ***");
- test.stop();
- }
-
- public void init() {
- System.out.println("*** init ***");
-
- setLayout(new BorderLayout());
- try {
- test = (Test) Class.forName(getParameter("test")).newInstance();
- Canvas canvas = (Canvas) test;
- canvas.setSize(getWidth(), getHeight());
- add(canvas);
- } catch (Exception e) {
- e.printStackTrace();
- }
- test.start();
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.applet;
+
+import java.applet.Applet;
+import java.awt.BorderLayout;
+import java.awt.Canvas;
+
+public class AppletLoaderTest extends Applet {
+
+ Test test = null;
+
+ public void destroy() {
+ super.destroy();
+ System.out.println("*** destroy ***");
+ }
+
+ public void start() {
+ super.start();
+ System.out.println("*** start ***");
+ }
+
+ public void stop() {
+ super.stop();
+ System.out.println("*** stop ***");
+ test.stop();
+ }
+
+ public void init() {
+ System.out.println("*** init ***");
+
+ setLayout(new BorderLayout());
+ try {
+ test = (Test) Class.forName(getParameter("test")).newInstance();
+ Canvas canvas = (Canvas) test;
+ canvas.setSize(getWidth(), getHeight());
+ add(canvas);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ test.start();
+ }
+}
diff --git a/src/java/org/lwjgl/test/applet/ControllersTest.java b/src/java/org/lwjgl/test/applet/ControllersTest.java
index 7f39ad6..44ee1bd 100644
--- a/src/java/org/lwjgl/test/applet/ControllersTest.java
+++ b/src/java/org/lwjgl/test/applet/ControllersTest.java
@@ -1,52 +1,52 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.applet;
-
-import java.awt.Canvas;
-
-import org.lwjgl.LWJGLException;
-import org.lwjgl.input.Controllers;
-
-public class ControllersTest extends Canvas implements Test {
- public void start() {
- try {
- Controllers.create();
- } catch (LWJGLException e) {
- e.printStackTrace();
- return;
- }
- System.out.println("Controllers.getControllerCount() = " + Controllers.getControllerCount());
- }
-
- public void stop() {
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.applet;
+
+import java.awt.Canvas;
+
+import org.lwjgl.LWJGLException;
+import org.lwjgl.input.Controllers;
+
+public class ControllersTest extends Canvas implements Test {
+ public void start() {
+ try {
+ Controllers.create();
+ } catch (LWJGLException e) {
+ e.printStackTrace();
+ return;
+ }
+ System.out.println("Controllers.getControllerCount() = " + Controllers.getControllerCount());
+ }
+
+ public void stop() {
+ }
+}
diff --git a/src/java/org/lwjgl/test/applet/GearsApplet.java b/src/java/org/lwjgl/test/applet/GearsApplet.java
index 95fb7d3..a8c01d4 100644
--- a/src/java/org/lwjgl/test/applet/GearsApplet.java
+++ b/src/java/org/lwjgl/test/applet/GearsApplet.java
@@ -1,401 +1,401 @@
-package org.lwjgl.test.applet;
-
-import java.applet.Applet;
-import java.awt.BorderLayout;
-import java.awt.Canvas;
-import java.nio.FloatBuffer;
-import org.lwjgl.BufferUtils;
-import org.lwjgl.LWJGLException;
-import org.lwjgl.opengl.ARBTransposeMatrix;
-import org.lwjgl.opengl.Display;
-import org.lwjgl.input.Keyboard;
-import org.lwjgl.input.Mouse;
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.opengl.GLContext;
-
-public class GearsApplet extends Applet {
-
- /** The Canvas where the LWJGL Display is added */
- Canvas display_parent;
-
- /** Thread which runs the main game loop */
- Thread gameThread;
-
- /** is the game loop running */
- boolean running = false;
-
- /** variables used to rotate the view */
- private float view_rotx = 20.0f;
- private float view_roty = 30.0f;
- private float view_rotz = 0.0f;
-
- private int gear1;
- private int gear2;
- private int gear3;
- private float angle;
-
- boolean keyDown = false;
-
- private int prevMouseX, prevMouseY;
- private boolean mouseButtonDown = false;
-
-
- /**
- * Once the Canvas is created its add notify method will call this method to
- * start the LWJGL Display and game loop in another thread.
- */
- public void startLWJGL() {
- gameThread = new Thread() {
- public void run() {
- running = true;
- try {
- Display.setParent(display_parent);
- //Display.setVSyncEnabled(true);
- Display.create();
- initGL();
- } catch (LWJGLException e) {
- e.printStackTrace();
- }
- gameLoop();
- }
- };
- gameThread.start();
- }
-
-
- /**
- * Tell game loop to stop running, after which the LWJGL Display will be destoryed.
- * The main thread will wait for the Display.destroy() to complete
- */
- private void stopLWJGL() {
- running = false;
- try {
- gameThread.join();
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
- public void start() {
-
- }
-
- public void stop() {
-
- }
-
- /**
- * Applet Destroy method will remove the canvas, before canvas is destroyed it will notify
- * stopLWJGL() to stop main game loop and to destroy the Display
- */
- public void destroy() {
- remove(display_parent);
- super.destroy();
- System.out.println("Clear up");
- }
-
- /**
- * initialise applet by adding a canvas to it, this canvas will start the LWJGL Display and game loop
- * in another thread. It will also stop the game loop and destroy the display on canvas removal when
- * applet is destroyed.
- */
- public void init() {
- setLayout(new BorderLayout());
- try {
- display_parent = new Canvas() {
- public final void addNotify() {
- super.addNotify();
- startLWJGL();
- }
- public final void removeNotify() {
- stopLWJGL();
- super.removeNotify();
- }
- };
- display_parent.setSize(getWidth(),getHeight());
- add(display_parent);
- display_parent.setFocusable(true);
- display_parent.requestFocus();
- display_parent.setIgnoreRepaint(true);
- //setResizable(true);
- setVisible(true);
- } catch (Exception e) {
- System.err.println(e);
- throw new RuntimeException("Unable to create display");
- }
- }
-
- public void gameLoop() {
- long startTime = System.currentTimeMillis() + 5000;
- long fps = 0;
-
- while(running) {
- angle += 2.0f;
-
- // draw the gears
- drawLoop();
-
- Display.update();
-
- if (startTime > System.currentTimeMillis()) {
- fps++;
- } else {
- long timeUsed = 5000 + (startTime - System.currentTimeMillis());
- startTime = System.currentTimeMillis() + 5000;
- System.out.println(fps + " frames 2 in " + (float) (timeUsed / 1000f) + " seconds = "
- + (fps / (timeUsed / 1000f)));
- fps = 0;
- }
-
- if (Mouse.isButtonDown(0)) {
- if (!mouseButtonDown) {
- prevMouseX = Mouse.getX();
- prevMouseY= Mouse.getY();
- }
- mouseButtonDown = true;
- }
- else {
- mouseButtonDown = false;
- }
-
- if (mouseButtonDown) {
- int x = Mouse.getX();
- int y = Mouse.getY();
-
- float thetaY = 360.0f * ( (float)(x-prevMouseX)/(float)display_parent.getWidth());
- float thetaX = 360.0f * ( (float)(prevMouseY-y)/(float)display_parent.getHeight());
-
- prevMouseX = x;
- prevMouseY = y;
-
- view_rotx += thetaX;
- view_roty += thetaY;
- }
-
- // F Key Pressed (i.e. released)
- if (keyDown && !Keyboard.isKeyDown(Keyboard.KEY_F)) {
- keyDown = false;
-
- try {
- if (Display.isFullscreen()) {
- Display.setFullscreen(false);
- }
- else {
- Display.setFullscreen(true);
- }
- } catch (LWJGLException e) {
- e.printStackTrace();
- }
- }
- }
-
- Display.destroy();
- }
-
- public void drawLoop() {
- GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
-
- GL11.glPushMatrix();
-
- GL11.glRotatef(view_rotx, 1.0f, 0.0f, 0.0f);
- GL11.glRotatef(view_roty, 0.0f, 1.0f, 0.0f);
- GL11.glRotatef(view_rotz, 0.0f, 0.0f, 1.0f);
-
- GL11.glPushMatrix();
- GL11.glTranslatef(-3.0f, -2.0f, 0.0f);
- GL11.glRotatef(angle, 0.0f, 0.0f, 1.0f);
- GL11.glCallList(gear1);
- GL11.glPopMatrix();
-
- GL11.glPushMatrix();
- GL11.glTranslatef(3.1f, -2.0f, 0.0f);
- GL11.glRotatef(-2.0f * angle - 9.0f, 0.0f, 0.0f, 1.0f);
- GL11.glCallList(gear2);
- GL11.glPopMatrix();
-
- GL11.glPushMatrix();
- GL11.glTranslatef(-3.1f, 4.2f, 0.0f);
- GL11.glRotatef(-2.0f * angle - 25.0f, 0.0f, 0.0f, 1.0f);
- GL11.glCallList(gear3);
- GL11.glPopMatrix();
-
- GL11.glPopMatrix();
- }
-
- protected void initGL() {
- try {
- // setup ogl
- FloatBuffer pos = BufferUtils.createFloatBuffer(4).put(new float[] { 5.0f, 5.0f, 10.0f, 0.0f});
- FloatBuffer red = BufferUtils.createFloatBuffer(4).put(new float[] { 0.8f, 0.1f, 0.0f, 1.0f});
- FloatBuffer green = BufferUtils.createFloatBuffer(4).put(new float[] { 0.0f, 0.8f, 0.2f, 1.0f});
- FloatBuffer blue = BufferUtils.createFloatBuffer(4).put(new float[] { 0.2f, 0.2f, 1.0f, 1.0f});
-
- pos.flip();
- red.flip();
- green.flip();
- blue.flip();
-
- GL11.glLight(GL11.GL_LIGHT0, GL11.GL_POSITION, pos);
- GL11.glEnable(GL11.GL_CULL_FACE);
- GL11.glEnable(GL11.GL_LIGHTING);
- GL11.glEnable(GL11.GL_LIGHT0);
- GL11.glEnable(GL11.GL_DEPTH_TEST);
-
- /* make the gears */
- gear1 = GL11.glGenLists(1);
- GL11.glNewList(gear1, GL11.GL_COMPILE);
- GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, red);
- gear(1.0f, 4.0f, 1.0f, 20, 0.7f);
- GL11.glEndList();
-
- gear2 = GL11.glGenLists(1);
- GL11.glNewList(gear2, GL11.GL_COMPILE);
- GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, green);
- gear(0.5f, 2.0f, 2.0f, 10, 0.7f);
- GL11.glEndList();
-
- gear3 = GL11.glGenLists(1);
- GL11.glNewList(gear3, GL11.GL_COMPILE);
- GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, blue);
- gear(1.3f, 2.0f, 0.5f, 10, 0.7f);
- GL11.glEndList();
- GL11.glEnable(GL11.GL_NORMALIZE);
- GL11.glMatrixMode(GL11.GL_PROJECTION);
-
- System.err.println("GL_VENDOR: " + GL11.glGetString(GL11.GL_VENDOR));
- System.err.println("GL_RENDERER: " + GL11.glGetString(GL11.GL_RENDERER));
- System.err.println("GL_VERSION: " + GL11.glGetString(GL11.GL_VERSION));
- System.err.println();
- System.err.println("glLoadTransposeMatrixfARB() supported: " + GLContext.getCapabilities().GL_ARB_transpose_matrix);
-
- if (!GLContext.getCapabilities().GL_ARB_transpose_matrix) {
- // --- not using extensions
- GL11.glLoadIdentity();
- } else {
- // --- using extensions
- final FloatBuffer identityTranspose = BufferUtils.createFloatBuffer(16).put(
- new float[] { 1, 0, 0, 0, 0, 1, 0, 0,
- 0, 0, 1, 0, 0, 0, 0, 1});
- identityTranspose.flip();
- ARBTransposeMatrix.glLoadTransposeMatrixARB(identityTranspose);
- }
- float h = (float) display_parent.getHeight() / (float) display_parent.getWidth();
- GL11.glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f);
- GL11.glMatrixMode(GL11.GL_MODELVIEW);
- GL11.glLoadIdentity();
- GL11.glTranslatef(0.0f, 0.0f, -40.0f);
- } catch (Exception e) {
- System.err.println(e);
- running = false;
- }
- }
-
- /**
- * Draw a gear wheel. You'll probably want to call this function when
- * building a display list since we do a lot of trig here.
- *
- * @param inner_radius radius of hole at center
- * @param outer_radius radius at center of teeth
- * @param width width of gear
- * @param teeth number of teeth
- * @param tooth_depth depth of tooth
- */
- private void gear(float inner_radius, float outer_radius, float width, int teeth, float tooth_depth) {
- int i;
- float r0, r1, r2;
- float angle, da;
- float u, v, len;
-
- r0 = inner_radius;
- r1 = outer_radius - tooth_depth / 2.0f;
- r2 = outer_radius + tooth_depth / 2.0f;
- da = 2.0f * (float) Math.PI / teeth / 4.0f;
- GL11.glShadeModel(GL11.GL_FLAT);
- GL11.glNormal3f(0.0f, 0.0f, 1.0f);
- /* draw front face */
- GL11.glBegin(GL11.GL_QUAD_STRIP);
- for (i = 0; i <= teeth; i++) {
- angle = i * 2.0f * (float) Math.PI / teeth;
- GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f);
- if (i < teeth) {
- GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle + 3.0f * da), r1 * (float) Math.sin(angle + 3.0f * da),
- width * 0.5f);
- }
- }
- GL11.glEnd();
-
- /* draw front sides of teeth */
- GL11.glBegin(GL11.GL_QUADS);
- for (i = 0; i < teeth; i++) {
- angle = i * 2.0f * (float) Math.PI / teeth;
- GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), width * 0.5f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + 2.0f * da), r2 * (float) Math.sin(angle + 2.0f * da), width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle + 3.0f * da), r1 * (float) Math.sin(angle + 3.0f * da), width * 0.5f);
- }
- GL11.glEnd();
-
- /* draw back face */
- GL11.glBegin(GL11.GL_QUAD_STRIP);
- for (i = 0; i <= teeth; i++) {
- angle = i * 2.0f * (float) Math.PI / teeth;
- GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f);
- GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f);
- GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f);
- }
- GL11.glEnd();
-
- /* draw back sides of teeth */
- GL11.glBegin(GL11.GL_QUADS);
- for (i = 0; i < teeth; i++) {
- angle = i * 2.0f * (float) Math.PI / teeth;
- GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), -width * 0.5f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), -width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f);
- }
- GL11.glEnd();
-
- /* draw outward faces of teeth */
- GL11.glBegin(GL11.GL_QUAD_STRIP);
- for (i = 0; i < teeth; i++) {
- angle = i * 2.0f * (float) Math.PI / teeth;
- GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f);
- u = r2 * (float) Math.cos(angle + da) - r1 * (float) Math.cos(angle);
- v = r2 * (float) Math.sin(angle + da) - r1 * (float) Math.sin(angle);
- len = (float) Math.sqrt(u * u + v * v);
- u /= len;
- v /= len;
- GL11.glNormal3f(v, -u, 0.0f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), width * 0.5f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), -width * 0.5f);
- GL11.glNormal3f((float) Math.cos(angle), (float) Math.sin(angle), 0.0f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), width * 0.5f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), -width * 0.5f);
- u = r1 * (float) Math.cos(angle + 3 * da) - r2 * (float) Math.cos(angle + 2 * da);
- v = r1 * (float) Math.sin(angle + 3 * da) - r2 * (float) Math.sin(angle + 2 * da);
- GL11.glNormal3f(v, -u, 0.0f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f);
- GL11.glNormal3f((float) Math.cos(angle), (float) Math.sin(angle), 0.0f);
- }
- GL11.glVertex3f(r1 * (float) Math.cos(0), r1 * (float) Math.sin(0), width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(0), r1 * (float) Math.sin(0), -width * 0.5f);
- GL11.glEnd();
-
- GL11.glShadeModel(GL11.GL_SMOOTH);
- /* draw inside radius cylinder */
- GL11.glBegin(GL11.GL_QUAD_STRIP);
- for (i = 0; i <= teeth; i++) {
- angle = i * 2.0f * (float) Math.PI / teeth;
- GL11.glNormal3f(-(float) Math.cos(angle), -(float) Math.sin(angle), 0.0f);
- GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f);
- GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f);
- }
- GL11.glEnd();
- }
+package org.lwjgl.test.applet;
+
+import java.applet.Applet;
+import java.awt.BorderLayout;
+import java.awt.Canvas;
+import java.nio.FloatBuffer;
+import org.lwjgl.BufferUtils;
+import org.lwjgl.LWJGLException;
+import org.lwjgl.opengl.ARBTransposeMatrix;
+import org.lwjgl.opengl.Display;
+import org.lwjgl.input.Keyboard;
+import org.lwjgl.input.Mouse;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GLContext;
+
+public class GearsApplet extends Applet {
+
+ /** The Canvas where the LWJGL Display is added */
+ Canvas display_parent;
+
+ /** Thread which runs the main game loop */
+ Thread gameThread;
+
+ /** is the game loop running */
+ boolean running = false;
+
+ /** variables used to rotate the view */
+ private float view_rotx = 20.0f;
+ private float view_roty = 30.0f;
+ private float view_rotz = 0.0f;
+
+ private int gear1;
+ private int gear2;
+ private int gear3;
+ private float angle;
+
+ boolean keyDown = false;
+
+ private int prevMouseX, prevMouseY;
+ private boolean mouseButtonDown = false;
+
+
+ /**
+ * Once the Canvas is created its add notify method will call this method to
+ * start the LWJGL Display and game loop in another thread.
+ */
+ public void startLWJGL() {
+ gameThread = new Thread() {
+ public void run() {
+ running = true;
+ try {
+ Display.setParent(display_parent);
+ //Display.setVSyncEnabled(true);
+ Display.create();
+ initGL();
+ } catch (LWJGLException e) {
+ e.printStackTrace();
+ }
+ gameLoop();
+ }
+ };
+ gameThread.start();
+ }
+
+
+ /**
+ * Tell game loop to stop running, after which the LWJGL Display will be destoryed.
+ * The main thread will wait for the Display.destroy() to complete
+ */
+ private void stopLWJGL() {
+ running = false;
+ try {
+ gameThread.join();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void start() {
+
+ }
+
+ public void stop() {
+
+ }
+
+ /**
+ * Applet Destroy method will remove the canvas, before canvas is destroyed it will notify
+ * stopLWJGL() to stop main game loop and to destroy the Display
+ */
+ public void destroy() {
+ remove(display_parent);
+ super.destroy();
+ System.out.println("Clear up");
+ }
+
+ /**
+ * initialise applet by adding a canvas to it, this canvas will start the LWJGL Display and game loop
+ * in another thread. It will also stop the game loop and destroy the display on canvas removal when
+ * applet is destroyed.
+ */
+ public void init() {
+ setLayout(new BorderLayout());
+ try {
+ display_parent = new Canvas() {
+ public final void addNotify() {
+ super.addNotify();
+ startLWJGL();
+ }
+ public final void removeNotify() {
+ stopLWJGL();
+ super.removeNotify();
+ }
+ };
+ display_parent.setSize(getWidth(),getHeight());
+ add(display_parent);
+ display_parent.setFocusable(true);
+ display_parent.requestFocus();
+ display_parent.setIgnoreRepaint(true);
+ //setResizable(true);
+ setVisible(true);
+ } catch (Exception e) {
+ System.err.println(e);
+ throw new RuntimeException("Unable to create display");
+ }
+ }
+
+ public void gameLoop() {
+ long startTime = System.currentTimeMillis() + 5000;
+ long fps = 0;
+
+ while(running) {
+ angle += 2.0f;
+
+ // draw the gears
+ drawLoop();
+
+ Display.update();
+
+ if (startTime > System.currentTimeMillis()) {
+ fps++;
+ } else {
+ long timeUsed = 5000 + (startTime - System.currentTimeMillis());
+ startTime = System.currentTimeMillis() + 5000;
+ System.out.println(fps + " frames 2 in " + (float) (timeUsed / 1000f) + " seconds = "
+ + (fps / (timeUsed / 1000f)));
+ fps = 0;
+ }
+
+ if (Mouse.isButtonDown(0)) {
+ if (!mouseButtonDown) {
+ prevMouseX = Mouse.getX();
+ prevMouseY= Mouse.getY();
+ }
+ mouseButtonDown = true;
+ }
+ else {
+ mouseButtonDown = false;
+ }
+
+ if (mouseButtonDown) {
+ int x = Mouse.getX();
+ int y = Mouse.getY();
+
+ float thetaY = 360.0f * ( (float)(x-prevMouseX)/(float)display_parent.getWidth());
+ float thetaX = 360.0f * ( (float)(prevMouseY-y)/(float)display_parent.getHeight());
+
+ prevMouseX = x;
+ prevMouseY = y;
+
+ view_rotx += thetaX;
+ view_roty += thetaY;
+ }
+
+ // F Key Pressed (i.e. released)
+ if (keyDown && !Keyboard.isKeyDown(Keyboard.KEY_F)) {
+ keyDown = false;
+
+ try {
+ if (Display.isFullscreen()) {
+ Display.setFullscreen(false);
+ }
+ else {
+ Display.setFullscreen(true);
+ }
+ } catch (LWJGLException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ Display.destroy();
+ }
+
+ public void drawLoop() {
+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
+
+ GL11.glPushMatrix();
+
+ GL11.glRotatef(view_rotx, 1.0f, 0.0f, 0.0f);
+ GL11.glRotatef(view_roty, 0.0f, 1.0f, 0.0f);
+ GL11.glRotatef(view_rotz, 0.0f, 0.0f, 1.0f);
+
+ GL11.glPushMatrix();
+ GL11.glTranslatef(-3.0f, -2.0f, 0.0f);
+ GL11.glRotatef(angle, 0.0f, 0.0f, 1.0f);
+ GL11.glCallList(gear1);
+ GL11.glPopMatrix();
+
+ GL11.glPushMatrix();
+ GL11.glTranslatef(3.1f, -2.0f, 0.0f);
+ GL11.glRotatef(-2.0f * angle - 9.0f, 0.0f, 0.0f, 1.0f);
+ GL11.glCallList(gear2);
+ GL11.glPopMatrix();
+
+ GL11.glPushMatrix();
+ GL11.glTranslatef(-3.1f, 4.2f, 0.0f);
+ GL11.glRotatef(-2.0f * angle - 25.0f, 0.0f, 0.0f, 1.0f);
+ GL11.glCallList(gear3);
+ GL11.glPopMatrix();
+
+ GL11.glPopMatrix();
+ }
+
+ protected void initGL() {
+ try {
+ // setup ogl
+ FloatBuffer pos = BufferUtils.createFloatBuffer(4).put(new float[] { 5.0f, 5.0f, 10.0f, 0.0f});
+ FloatBuffer red = BufferUtils.createFloatBuffer(4).put(new float[] { 0.8f, 0.1f, 0.0f, 1.0f});
+ FloatBuffer green = BufferUtils.createFloatBuffer(4).put(new float[] { 0.0f, 0.8f, 0.2f, 1.0f});
+ FloatBuffer blue = BufferUtils.createFloatBuffer(4).put(new float[] { 0.2f, 0.2f, 1.0f, 1.0f});
+
+ pos.flip();
+ red.flip();
+ green.flip();
+ blue.flip();
+
+ GL11.glLight(GL11.GL_LIGHT0, GL11.GL_POSITION, pos);
+ GL11.glEnable(GL11.GL_CULL_FACE);
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glEnable(GL11.GL_LIGHT0);
+ GL11.glEnable(GL11.GL_DEPTH_TEST);
+
+ /* make the gears */
+ gear1 = GL11.glGenLists(1);
+ GL11.glNewList(gear1, GL11.GL_COMPILE);
+ GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, red);
+ gear(1.0f, 4.0f, 1.0f, 20, 0.7f);
+ GL11.glEndList();
+
+ gear2 = GL11.glGenLists(1);
+ GL11.glNewList(gear2, GL11.GL_COMPILE);
+ GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, green);
+ gear(0.5f, 2.0f, 2.0f, 10, 0.7f);
+ GL11.glEndList();
+
+ gear3 = GL11.glGenLists(1);
+ GL11.glNewList(gear3, GL11.GL_COMPILE);
+ GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, blue);
+ gear(1.3f, 2.0f, 0.5f, 10, 0.7f);
+ GL11.glEndList();
+ GL11.glEnable(GL11.GL_NORMALIZE);
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+
+ System.err.println("GL_VENDOR: " + GL11.glGetString(GL11.GL_VENDOR));
+ System.err.println("GL_RENDERER: " + GL11.glGetString(GL11.GL_RENDERER));
+ System.err.println("GL_VERSION: " + GL11.glGetString(GL11.GL_VERSION));
+ System.err.println();
+ System.err.println("glLoadTransposeMatrixfARB() supported: " + GLContext.getCapabilities().GL_ARB_transpose_matrix);
+
+ if (!GLContext.getCapabilities().GL_ARB_transpose_matrix) {
+ // --- not using extensions
+ GL11.glLoadIdentity();
+ } else {
+ // --- using extensions
+ final FloatBuffer identityTranspose = BufferUtils.createFloatBuffer(16).put(
+ new float[] { 1, 0, 0, 0, 0, 1, 0, 0,
+ 0, 0, 1, 0, 0, 0, 0, 1});
+ identityTranspose.flip();
+ ARBTransposeMatrix.glLoadTransposeMatrixARB(identityTranspose);
+ }
+ float h = (float) display_parent.getHeight() / (float) display_parent.getWidth();
+ GL11.glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f);
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ GL11.glLoadIdentity();
+ GL11.glTranslatef(0.0f, 0.0f, -40.0f);
+ } catch (Exception e) {
+ System.err.println(e);
+ running = false;
+ }
+ }
+
+ /**
+ * Draw a gear wheel. You'll probably want to call this function when
+ * building a display list since we do a lot of trig here.
+ *
+ * @param inner_radius radius of hole at center
+ * @param outer_radius radius at center of teeth
+ * @param width width of gear
+ * @param teeth number of teeth
+ * @param tooth_depth depth of tooth
+ */
+ private void gear(float inner_radius, float outer_radius, float width, int teeth, float tooth_depth) {
+ int i;
+ float r0, r1, r2;
+ float angle, da;
+ float u, v, len;
+
+ r0 = inner_radius;
+ r1 = outer_radius - tooth_depth / 2.0f;
+ r2 = outer_radius + tooth_depth / 2.0f;
+ da = 2.0f * (float) Math.PI / teeth / 4.0f;
+ GL11.glShadeModel(GL11.GL_FLAT);
+ GL11.glNormal3f(0.0f, 0.0f, 1.0f);
+ /* draw front face */
+ GL11.glBegin(GL11.GL_QUAD_STRIP);
+ for (i = 0; i <= teeth; i++) {
+ angle = i * 2.0f * (float) Math.PI / teeth;
+ GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f);
+ if (i < teeth) {
+ GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle + 3.0f * da), r1 * (float) Math.sin(angle + 3.0f * da),
+ width * 0.5f);
+ }
+ }
+ GL11.glEnd();
+
+ /* draw front sides of teeth */
+ GL11.glBegin(GL11.GL_QUADS);
+ for (i = 0; i < teeth; i++) {
+ angle = i * 2.0f * (float) Math.PI / teeth;
+ GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), width * 0.5f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + 2.0f * da), r2 * (float) Math.sin(angle + 2.0f * da), width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle + 3.0f * da), r1 * (float) Math.sin(angle + 3.0f * da), width * 0.5f);
+ }
+ GL11.glEnd();
+
+ /* draw back face */
+ GL11.glBegin(GL11.GL_QUAD_STRIP);
+ for (i = 0; i <= teeth; i++) {
+ angle = i * 2.0f * (float) Math.PI / teeth;
+ GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f);
+ GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f);
+ GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f);
+ }
+ GL11.glEnd();
+
+ /* draw back sides of teeth */
+ GL11.glBegin(GL11.GL_QUADS);
+ for (i = 0; i < teeth; i++) {
+ angle = i * 2.0f * (float) Math.PI / teeth;
+ GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), -width * 0.5f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), -width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f);
+ }
+ GL11.glEnd();
+
+ /* draw outward faces of teeth */
+ GL11.glBegin(GL11.GL_QUAD_STRIP);
+ for (i = 0; i < teeth; i++) {
+ angle = i * 2.0f * (float) Math.PI / teeth;
+ GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f);
+ u = r2 * (float) Math.cos(angle + da) - r1 * (float) Math.cos(angle);
+ v = r2 * (float) Math.sin(angle + da) - r1 * (float) Math.sin(angle);
+ len = (float) Math.sqrt(u * u + v * v);
+ u /= len;
+ v /= len;
+ GL11.glNormal3f(v, -u, 0.0f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), width * 0.5f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), -width * 0.5f);
+ GL11.glNormal3f((float) Math.cos(angle), (float) Math.sin(angle), 0.0f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), width * 0.5f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), -width * 0.5f);
+ u = r1 * (float) Math.cos(angle + 3 * da) - r2 * (float) Math.cos(angle + 2 * da);
+ v = r1 * (float) Math.sin(angle + 3 * da) - r2 * (float) Math.sin(angle + 2 * da);
+ GL11.glNormal3f(v, -u, 0.0f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f);
+ GL11.glNormal3f((float) Math.cos(angle), (float) Math.sin(angle), 0.0f);
+ }
+ GL11.glVertex3f(r1 * (float) Math.cos(0), r1 * (float) Math.sin(0), width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(0), r1 * (float) Math.sin(0), -width * 0.5f);
+ GL11.glEnd();
+
+ GL11.glShadeModel(GL11.GL_SMOOTH);
+ /* draw inside radius cylinder */
+ GL11.glBegin(GL11.GL_QUAD_STRIP);
+ for (i = 0; i <= teeth; i++) {
+ angle = i * 2.0f * (float) Math.PI / teeth;
+ GL11.glNormal3f(-(float) Math.cos(angle), -(float) Math.sin(angle), 0.0f);
+ GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f);
+ GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f);
+ }
+ GL11.glEnd();
+ }
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/test/applet/OpenAL.java b/src/java/org/lwjgl/test/applet/OpenAL.java
index 778900c..4dc943d 100644
--- a/src/java/org/lwjgl/test/applet/OpenAL.java
+++ b/src/java/org/lwjgl/test/applet/OpenAL.java
@@ -1,182 +1,182 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.applet;
-
-import java.nio.IntBuffer;
-
-import org.lwjgl.BufferUtils;
-import org.lwjgl.LWJGLException;
-import org.lwjgl.openal.AL;
-import org.lwjgl.openal.AL10;
-import org.lwjgl.opengl.AWTGLCanvas;
-import org.lwjgl.opengl.Display;
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.util.WaveData;
-
-public class OpenAL extends AWTGLCanvas implements Test {
-
- float angle = 0;
-
- // create 1 buffer and 1 source
- IntBuffer buffers = BufferUtils.createIntBuffer(1);
- IntBuffer sources = BufferUtils.createIntBuffer(1);
-
- public OpenAL() throws LWJGLException {
-
- try {
- AL.create();
- } catch (Exception e) {
- System.out.println("Unable to create OpenAL.\nPlease make sure that OpenAL is available on this system. Exception: " + e);
- return;
- }
-
- Thread t = new Thread() {
-
- public void run() {
- while (true) {
- if (isVisible())
- repaint();
- Display.sync(60);
- }
- }
- };
- t.setDaemon(true);
- t.start();
- }
-
- private void playOpenAL() {
- int lastError;
-
- // al generate buffers and sources
- buffers.position(0).limit(1);
- AL10.alGenBuffers(buffers);
- if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- sources.position(0).limit(1);
- AL10.alGenSources(sources);
- if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- // load wave data from buffer
- WaveData wavefile = WaveData.create(getClass().getClassLoader().getResourceAsStream("Footsteps.wav"));
-
- //copy to buffers
- AL10.alBufferData(buffers.get(0), wavefile.format, wavefile.data, wavefile.samplerate);
-
- //unload file again
- wavefile.dispose();
-
- if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- //set up source input
- AL10.alSourcei(sources.get(0), AL10.AL_BUFFER, buffers.get(0));
- if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- //lets loop the sound
- AL10.alSourcei(sources.get(0), AL10.AL_LOOPING, AL10.AL_TRUE);
- if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- //play source 0
- AL10.alSourcePlay(sources.get(0));
- if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
- }
-
- private void exit(int error) {
- System.out.println("OpenAL Error: " + AL10.alGetString(error));
- }
-
- public void paintGL() {
- GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
- GL11.glMatrixMode(GL11.GL_PROJECTION_MATRIX);
- GL11.glLoadIdentity();
- GL11.glOrtho(0, 640, 0, 480, 1, -1);
- GL11.glMatrixMode(GL11.GL_MODELVIEW_MATRIX);
-
- GL11.glPushMatrix();
- GL11.glTranslatef(320, 240, 0.0f);
- GL11.glRotatef(angle, 0, 0, 1.0f);
- GL11.glBegin(GL11.GL_QUADS);
- GL11.glVertex2i(-50, -50);
- GL11.glVertex2i(50, -50);
- GL11.glVertex2i(50, 50);
- GL11.glVertex2i(-50, 50);
- GL11.glEnd();
- GL11.glPopMatrix();
-
- angle += 1;
-
- try {
- swapBuffers();
- } catch (Exception e) {/*OK*/
- }
- }
-
- public void start() {
- playOpenAL();
- }
-
- public void stop() {
- int lastError;
-
- //stop source 0
- AL10.alSourceStop(sources.get(0));
- if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- //delete buffers and sources
- sources.position(0).limit(1);
- AL10.alDeleteSources(sources);
- if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- buffers.position(0).limit(1);
- AL10.alDeleteBuffers(buffers);
- if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- AL.destroy();
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.applet;
+
+import java.nio.IntBuffer;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.LWJGLException;
+import org.lwjgl.openal.AL;
+import org.lwjgl.openal.AL10;
+import org.lwjgl.opengl.AWTGLCanvas;
+import org.lwjgl.opengl.Display;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.util.WaveData;
+
+public class OpenAL extends AWTGLCanvas implements Test {
+
+ float angle = 0;
+
+ // create 1 buffer and 1 source
+ IntBuffer buffers = BufferUtils.createIntBuffer(1);
+ IntBuffer sources = BufferUtils.createIntBuffer(1);
+
+ public OpenAL() throws LWJGLException {
+
+ try {
+ AL.create();
+ } catch (Exception e) {
+ System.out.println("Unable to create OpenAL.\nPlease make sure that OpenAL is available on this system. Exception: " + e);
+ return;
+ }
+
+ Thread t = new Thread() {
+
+ public void run() {
+ while (true) {
+ if (isVisible())
+ repaint();
+ Display.sync(60);
+ }
+ }
+ };
+ t.setDaemon(true);
+ t.start();
+ }
+
+ private void playOpenAL() {
+ int lastError;
+
+ // al generate buffers and sources
+ buffers.position(0).limit(1);
+ AL10.alGenBuffers(buffers);
+ if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ sources.position(0).limit(1);
+ AL10.alGenSources(sources);
+ if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ // load wave data from buffer
+ WaveData wavefile = WaveData.create(getClass().getClassLoader().getResourceAsStream("Footsteps.wav"));
+
+ //copy to buffers
+ AL10.alBufferData(buffers.get(0), wavefile.format, wavefile.data, wavefile.samplerate);
+
+ //unload file again
+ wavefile.dispose();
+
+ if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ //set up source input
+ AL10.alSourcei(sources.get(0), AL10.AL_BUFFER, buffers.get(0));
+ if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ //lets loop the sound
+ AL10.alSourcei(sources.get(0), AL10.AL_LOOPING, AL10.AL_TRUE);
+ if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ //play source 0
+ AL10.alSourcePlay(sources.get(0));
+ if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+ }
+
+ private void exit(int error) {
+ System.out.println("OpenAL Error: " + AL10.alGetString(error));
+ }
+
+ public void paintGL() {
+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
+ GL11.glMatrixMode(GL11.GL_PROJECTION_MATRIX);
+ GL11.glLoadIdentity();
+ GL11.glOrtho(0, 640, 0, 480, 1, -1);
+ GL11.glMatrixMode(GL11.GL_MODELVIEW_MATRIX);
+
+ GL11.glPushMatrix();
+ GL11.glTranslatef(320, 240, 0.0f);
+ GL11.glRotatef(angle, 0, 0, 1.0f);
+ GL11.glBegin(GL11.GL_QUADS);
+ GL11.glVertex2i(-50, -50);
+ GL11.glVertex2i(50, -50);
+ GL11.glVertex2i(50, 50);
+ GL11.glVertex2i(-50, 50);
+ GL11.glEnd();
+ GL11.glPopMatrix();
+
+ angle += 1;
+
+ try {
+ swapBuffers();
+ } catch (Exception e) {/*OK*/
+ }
+ }
+
+ public void start() {
+ playOpenAL();
+ }
+
+ public void stop() {
+ int lastError;
+
+ //stop source 0
+ AL10.alSourceStop(sources.get(0));
+ if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ //delete buffers and sources
+ sources.position(0).limit(1);
+ AL10.alDeleteSources(sources);
+ if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ buffers.position(0).limit(1);
+ AL10.alDeleteBuffers(buffers);
+ if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ AL.destroy();
+ }
+}
diff --git a/src/java/org/lwjgl/test/applet/OpenGL.java b/src/java/org/lwjgl/test/applet/OpenGL.java
index 88284c2..10d1c4a 100644
--- a/src/java/org/lwjgl/test/applet/OpenGL.java
+++ b/src/java/org/lwjgl/test/applet/OpenGL.java
@@ -1,128 +1,128 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.applet;
-
-import org.lwjgl.LWJGLException;
-import org.lwjgl.input.Keyboard;
-import org.lwjgl.input.Mouse;
-import org.lwjgl.opengl.AWTGLCanvas;
-import org.lwjgl.opengl.GL11;
-
-public class OpenGL extends AWTGLCanvas implements Test {
-
- float angle = 0;
- float x;
- float y;
-
- public OpenGL() throws LWJGLException {
- }
-
- public void initGL() {
- GL11.glMatrixMode(GL11.GL_PROJECTION_MATRIX);
- GL11.glLoadIdentity();
- GL11.glOrtho(0, 640, 0, 480, 1, -1);
- x = 320;
- y = 240;
- GL11.glMatrixMode(GL11.GL_MODELVIEW_MATRIX);
- setVSyncEnabled(true);
- }
-
- public void paintGL() {
- GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
-
- GL11.glPushMatrix();
- GL11.glTranslatef(x, y, 0.0f);
- GL11.glRotatef(angle, 0, 0, 1.0f);
- GL11.glBegin(GL11.GL_QUADS);
- GL11.glVertex2i(-50, -50);
- GL11.glVertex2i(50, -50);
- GL11.glVertex2i(50, 50);
- GL11.glVertex2i(-50, 50);
- GL11.glEnd();
- GL11.glPopMatrix();
-
- angle += 1;
-
- if (Mouse.isCreated()) {
- Mouse.poll();
- while (Mouse.next()) {
- x += Mouse.getEventDX();
- y += Mouse.getEventDY();
- }
- }
- if (Keyboard.isCreated()) {
- Keyboard.poll();
- }
- while (Keyboard.isCreated() && Keyboard.next()) {
- if (Keyboard.getEventKey() != Keyboard.KEY_NONE) {
- String key_name = Keyboard.getKeyName(Keyboard.getEventKey());
- if (Keyboard.getEventKeyState()) {
- switch (Keyboard.getEventKey()) {
- case Keyboard.KEY_G:
- Mouse.setGrabbed(!Mouse.isGrabbed());
- break;
- default:
- break;
- }
- System.out.println("Pressed: " + key_name);
- } else
- System.out.println("Released: " + key_name);
- }
- if (Keyboard.getEventCharacter() != Keyboard.CHAR_NONE)
- System.out.println("Typed: " + Keyboard.getEventCharacter());
- }
- if (Keyboard.isCreated()) {
- if (Keyboard.isKeyDown(Keyboard.KEY_UP))
- y += 5;
- else if (Keyboard.isKeyDown(Keyboard.KEY_DOWN))
- y -= 5;
- if (Keyboard.isKeyDown(Keyboard.KEY_LEFT))
- x -= 5;
- else if (Keyboard.isKeyDown(Keyboard.KEY_RIGHT))
- x += 5;
- }
- try {
- swapBuffers();
- if (isVisible()) {
- Thread.yield(); // Helps input responsiveness on linux
- repaint();
- }
- } catch (Exception e) {/*OK*/
- }
- }
-
- public void start() {
- }
-
- public void stop() {
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.applet;
+
+import org.lwjgl.LWJGLException;
+import org.lwjgl.input.Keyboard;
+import org.lwjgl.input.Mouse;
+import org.lwjgl.opengl.AWTGLCanvas;
+import org.lwjgl.opengl.GL11;
+
+public class OpenGL extends AWTGLCanvas implements Test {
+
+ float angle = 0;
+ float x;
+ float y;
+
+ public OpenGL() throws LWJGLException {
+ }
+
+ public void initGL() {
+ GL11.glMatrixMode(GL11.GL_PROJECTION_MATRIX);
+ GL11.glLoadIdentity();
+ GL11.glOrtho(0, 640, 0, 480, 1, -1);
+ x = 320;
+ y = 240;
+ GL11.glMatrixMode(GL11.GL_MODELVIEW_MATRIX);
+ setVSyncEnabled(true);
+ }
+
+ public void paintGL() {
+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
+
+ GL11.glPushMatrix();
+ GL11.glTranslatef(x, y, 0.0f);
+ GL11.glRotatef(angle, 0, 0, 1.0f);
+ GL11.glBegin(GL11.GL_QUADS);
+ GL11.glVertex2i(-50, -50);
+ GL11.glVertex2i(50, -50);
+ GL11.glVertex2i(50, 50);
+ GL11.glVertex2i(-50, 50);
+ GL11.glEnd();
+ GL11.glPopMatrix();
+
+ angle += 1;
+
+ if (Mouse.isCreated()) {
+ Mouse.poll();
+ while (Mouse.next()) {
+ x += Mouse.getEventDX();
+ y += Mouse.getEventDY();
+ }
+ }
+ if (Keyboard.isCreated()) {
+ Keyboard.poll();
+ }
+ while (Keyboard.isCreated() && Keyboard.next()) {
+ if (Keyboard.getEventKey() != Keyboard.KEY_NONE) {
+ String key_name = Keyboard.getKeyName(Keyboard.getEventKey());
+ if (Keyboard.getEventKeyState()) {
+ switch (Keyboard.getEventKey()) {
+ case Keyboard.KEY_G:
+ Mouse.setGrabbed(!Mouse.isGrabbed());
+ break;
+ default:
+ break;
+ }
+ System.out.println("Pressed: " + key_name);
+ } else
+ System.out.println("Released: " + key_name);
+ }
+ if (Keyboard.getEventCharacter() != Keyboard.CHAR_NONE)
+ System.out.println("Typed: " + Keyboard.getEventCharacter());
+ }
+ if (Keyboard.isCreated()) {
+ if (Keyboard.isKeyDown(Keyboard.KEY_UP))
+ y += 5;
+ else if (Keyboard.isKeyDown(Keyboard.KEY_DOWN))
+ y -= 5;
+ if (Keyboard.isKeyDown(Keyboard.KEY_LEFT))
+ x -= 5;
+ else if (Keyboard.isKeyDown(Keyboard.KEY_RIGHT))
+ x += 5;
+ }
+ try {
+ swapBuffers();
+ if (isVisible()) {
+ Thread.yield(); // Helps input responsiveness on linux
+ repaint();
+ }
+ } catch (Exception e) {/*OK*/
+ }
+ }
+
+ public void start() {
+ }
+
+ public void stop() {
+ }
+}
diff --git a/src/java/org/lwjgl/test/applet/Speed.java b/src/java/org/lwjgl/test/applet/Speed.java
index 3c42ed7..e6e4767 100644
--- a/src/java/org/lwjgl/test/applet/Speed.java
+++ b/src/java/org/lwjgl/test/applet/Speed.java
@@ -1,91 +1,91 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.applet;
-
-import org.lwjgl.LWJGLException;
-import org.lwjgl.opengl.AWTGLCanvas;
-import org.lwjgl.opengl.GL11;
-
-public class Speed extends AWTGLCanvas implements Test {
-
- private float angle = 0;
- private long startTime = System.currentTimeMillis() + 5000;
- private long fps = 0;
-
- public Speed() throws LWJGLException {
- }
-
- public void paintGL() {
- GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
- GL11.glMatrixMode(GL11.GL_PROJECTION_MATRIX);
- GL11.glLoadIdentity();
- GL11.glOrtho(0, 640, 0, 480, 1, -1);
- GL11.glMatrixMode(GL11.GL_MODELVIEW_MATRIX);
-
- GL11.glPushMatrix();
- GL11.glTranslatef(320, 240, 0.0f);
- GL11.glRotatef(angle, 0, 0, 1.0f);
- GL11.glBegin(GL11.GL_QUADS);
- GL11.glVertex2i(-50, -50);
- GL11.glVertex2i(50, -50);
- GL11.glVertex2i(50, 50);
- GL11.glVertex2i(-50, 50);
- GL11.glEnd();
- GL11.glPopMatrix();
-
- angle += 1;
-
- try {
- swapBuffers();
- if (isVisible()) {
- Thread.yield(); // Helps input responsiveness on linux
- repaint();
- }
- } catch (Exception e) {/*OK*/
- }
- if (startTime > System.currentTimeMillis()) {
- fps++;
- } else {
- long timeUsed = 5000 + (startTime - System.currentTimeMillis());
- startTime = System.currentTimeMillis() + 5000;
- System.out.println(fps + " frames in " + (float) (timeUsed / 1000f) + " seconds = "
- + (fps / (timeUsed / 1000f)));
- fps = 0;
- }
- }
-
- public void start() {
- }
-
- public void stop() {
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.applet;
+
+import org.lwjgl.LWJGLException;
+import org.lwjgl.opengl.AWTGLCanvas;
+import org.lwjgl.opengl.GL11;
+
+public class Speed extends AWTGLCanvas implements Test {
+
+ private float angle = 0;
+ private long startTime = System.currentTimeMillis() + 5000;
+ private long fps = 0;
+
+ public Speed() throws LWJGLException {
+ }
+
+ public void paintGL() {
+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
+ GL11.glMatrixMode(GL11.GL_PROJECTION_MATRIX);
+ GL11.glLoadIdentity();
+ GL11.glOrtho(0, 640, 0, 480, 1, -1);
+ GL11.glMatrixMode(GL11.GL_MODELVIEW_MATRIX);
+
+ GL11.glPushMatrix();
+ GL11.glTranslatef(320, 240, 0.0f);
+ GL11.glRotatef(angle, 0, 0, 1.0f);
+ GL11.glBegin(GL11.GL_QUADS);
+ GL11.glVertex2i(-50, -50);
+ GL11.glVertex2i(50, -50);
+ GL11.glVertex2i(50, 50);
+ GL11.glVertex2i(-50, 50);
+ GL11.glEnd();
+ GL11.glPopMatrix();
+
+ angle += 1;
+
+ try {
+ swapBuffers();
+ if (isVisible()) {
+ Thread.yield(); // Helps input responsiveness on linux
+ repaint();
+ }
+ } catch (Exception e) {/*OK*/
+ }
+ if (startTime > System.currentTimeMillis()) {
+ fps++;
+ } else {
+ long timeUsed = 5000 + (startTime - System.currentTimeMillis());
+ startTime = System.currentTimeMillis() + 5000;
+ System.out.println(fps + " frames in " + (float) (timeUsed / 1000f) + " seconds = "
+ + (fps / (timeUsed / 1000f)));
+ fps = 0;
+ }
+ }
+
+ public void start() {
+ }
+
+ public void stop() {
+ }
+}
diff --git a/src/java/org/lwjgl/test/applet/Test.java b/src/java/org/lwjgl/test/applet/Test.java
index 35a79f1..22bb583 100644
--- a/src/java/org/lwjgl/test/applet/Test.java
+++ b/src/java/org/lwjgl/test/applet/Test.java
@@ -1,38 +1,38 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.applet;
-
-
-public interface Test {
- public void start();
- public void stop();
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.applet;
+
+
+public interface Test {
+ public void start();
+ public void stop();
+}
diff --git a/src/java/org/lwjgl/test/glu/tessellation/TessCallback.java b/src/java/org/lwjgl/test/glu/tessellation/TessCallback.java
index 15253d3..0a58cc6 100644
--- a/src/java/org/lwjgl/test/glu/tessellation/TessCallback.java
+++ b/src/java/org/lwjgl/test/glu/tessellation/TessCallback.java
@@ -1,80 +1,80 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.glu.tessellation;
-
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.util.glu.GLUtessellatorCallbackAdapter;
-
-public class TessCallback extends GLUtessellatorCallbackAdapter {
-
- public void begin(int type) {
- GL11.glBegin(type);
- }
-
- public void combine(double[] coords, Object[] data, float[] weight, Object[] outData) {
- for (int i=0;i<outData.length;i++) {
- double[] combined = new double[6];
- combined[0] = coords[0];
- combined[1] = coords[1];
- combined[2] = coords[2];
- combined[3] = 1;
- combined[4] = 1;
- combined[5] = 1;
-
- outData[i] = new VertexData(combined);
- }
-// vertex[0] = coords[0];
-// vertex[1] = coords[1];
-// vertex[2] = coords[2];
-//
-// for (int i = 3; i < 6; i++)
-// {
-// vertex[i] = weight[0] * vertex_data[0][i] +
-// indent indweight[1] * vertex_data[1][i] +
-// indent indweight[2] * vertex_data[2][i] +
-// indent indweight[3] * vertex_data[3][i];
-// }
-//
-// *dataOut = vertex;
- }
-
- public void end() {
- GL11.glEnd();
- }
-
- public void vertex(Object vertexData) {
- VertexData vertex = (VertexData) vertexData;
-
- GL11.glVertex3d(vertex.data[0], vertex.data[1], vertex.data[2]);
- GL11.glColor3d(vertex.data[3], vertex.data[4], vertex.data[5]);
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.glu.tessellation;
+
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.util.glu.GLUtessellatorCallbackAdapter;
+
+public class TessCallback extends GLUtessellatorCallbackAdapter {
+
+ public void begin(int type) {
+ GL11.glBegin(type);
+ }
+
+ public void combine(double[] coords, Object[] data, float[] weight, Object[] outData) {
+ for (int i=0;i<outData.length;i++) {
+ double[] combined = new double[6];
+ combined[0] = coords[0];
+ combined[1] = coords[1];
+ combined[2] = coords[2];
+ combined[3] = 1;
+ combined[4] = 1;
+ combined[5] = 1;
+
+ outData[i] = new VertexData(combined);
+ }
+// vertex[0] = coords[0];
+// vertex[1] = coords[1];
+// vertex[2] = coords[2];
+//
+// for (int i = 3; i < 6; i++)
+// {
+// vertex[i] = weight[0] * vertex_data[0][i] +
+// indent indweight[1] * vertex_data[1][i] +
+// indent indweight[2] * vertex_data[2][i] +
+// indent indweight[3] * vertex_data[3][i];
+// }
+//
+// *dataOut = vertex;
+ }
+
+ public void end() {
+ GL11.glEnd();
+ }
+
+ public void vertex(Object vertexData) {
+ VertexData vertex = (VertexData) vertexData;
+
+ GL11.glVertex3d(vertex.data[0], vertex.data[1], vertex.data[2]);
+ GL11.glColor3d(vertex.data[3], vertex.data[4], vertex.data[5]);
+ }
+}
diff --git a/src/java/org/lwjgl/test/glu/tessellation/TessellationTest.java b/src/java/org/lwjgl/test/glu/tessellation/TessellationTest.java
index c3b5700..f38dfe4 100644
--- a/src/java/org/lwjgl/test/glu/tessellation/TessellationTest.java
+++ b/src/java/org/lwjgl/test/glu/tessellation/TessellationTest.java
@@ -1,195 +1,195 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.glu.tessellation;
-import org.lwjgl.LWJGLException;
-import org.lwjgl.opengl.Display;
-import org.lwjgl.opengl.DisplayMode;
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.util.glu.GLU;
-import org.lwjgl.util.glu.GLUtessellator;
-
-public class TessellationTest {
- private GLUtessellator tesselator;
-
- void init()
- {
- // Create a new tessellation object
- tesselator = GLU.gluNewTess();
-
- // Set callback functions
- TessCallback callback = new TessCallback();
- tesselator.gluTessCallback(GLU.GLU_TESS_VERTEX, callback);
- tesselator.gluTessCallback(GLU.GLU_TESS_BEGIN, callback);
- tesselator.gluTessCallback(GLU.GLU_TESS_END, callback);
- tesselator.gluTessCallback(GLU.GLU_TESS_COMBINE, callback);
- }
-
- void setWindingRule(int windingRule)
- {
- // Set the winding rule
- tesselator.gluTessProperty(GLU.GLU_TESS_WINDING_RULE, windingRule);
- }
-
- void renderContour(double obj_data[][], int num_vertices)
- {
- for (int x = 0; x < num_vertices; x++) //loop through the vertices
- {
- tesselator.gluTessVertex(obj_data[x], 0, new VertexData(obj_data[x])); //store the vertex
- }
- }
-
- void beginPolygon()
- {
- tesselator.gluTessBeginPolygon(null);
- }
-
- void endPolygon()
- {
- tesselator.gluTessEndPolygon();
- }
-
- void beginContour()
- {
- tesselator.gluTessBeginContour();
- }
-
- void endContour()
- {
- tesselator.gluTessEndContour();
- }
-
- void end()
- {
- tesselator.gluDeleteTess();
- }
-
- private void createDisplay() throws LWJGLException {
- int width = 300;
- int height = 300;
-
- Display.setDisplayMode(new DisplayMode(width,height));
- Display.create();
- Display.setVSyncEnabled(true);
-
- GL11.glEnable(GL11.GL_TEXTURE_2D);
- GL11.glShadeModel(GL11.GL_SMOOTH);
- GL11.glDisable(GL11.GL_DEPTH_TEST);
- GL11.glDisable(GL11.GL_LIGHTING);
-
- GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
- GL11.glClearDepth(1);
-
- GL11.glEnable(GL11.GL_BLEND);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
-
- GL11.glViewport(0,0,width,height);
- GL11.glMatrixMode(GL11.GL_MODELVIEW);
-
- GL11.glMatrixMode(GL11.GL_PROJECTION);
- GL11.glLoadIdentity();
- GL11.glOrtho(0, width, height, 0, 1, -1);
- GL11.glMatrixMode(GL11.GL_MODELVIEW);
- }
-
- private void loop() {
- while (true) {
- render();
- Display.update();
- Display.sync(100);
-
- if (Display.isCloseRequested()) {
- System.exit(0);
- }
- }
- }
-
- private void render() {
- GL11.glTranslatef(150,125,0);
-
- GL11.glScalef(50,50,1);
- // first polygon: a star-5 vertices and color information
- double star[][] = { {0.6f, -0.1f, 0f, 1.0f, 1.0f, 1.0f},
- {1.35f, 1.4f, 0f, 1.0f, 1.0f, 1.0f},
- {2.1f, -0.1f, 0f, 1.0f, 1.0f, 1.0f},
- {0.6f, 0.9f, 0f, 1.0f, 1.0f, 1.0f},
- {2.1f, 0.9f, 0f, 1.0f, 1.0f, 1.0f} };
-
- //second polygon: a quad-4 vertices; first contour
- double quad[][] = { {0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f},
- {1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f},
- {1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f},
- {0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f} };
-
- //second polygon: a triangle-3 vertices; second contour
- double tri[][] = {{0.3f, 0.3f, 0.0f, 0.0f, 0.0f, 0.0f},
- {0.7f, 0.3f, 0.0f, 0.0f, 0.0f, 0.0f},
- {0.5f, 0.7f, 0.0f, 0.0f, 0.0f, 0.0f} };
-
- // render the first polygon: the textured star
-
- // set winding rule to positive
- setWindingRule(GLU.GLU_TESS_WINDING_POSITIVE);
- beginPolygon();
- beginContour();
- renderContour(star, 5);
- endContour();
- endPolygon();
-
- // render the second polygon: triangle cut out of a quad
-
- GL11.glTranslatef(-2,0,0);
- // set winding rule to odd
- setWindingRule(GLU.GLU_TESS_WINDING_ODD);
- // begin the new polygon
- beginPolygon();
- beginContour();
- renderContour(quad, 4);
- endContour();
- beginContour();
- renderContour(tri, 3);
- endContour();
- endPolygon();
- // delete the tess object
- end();
- }
-
- private void start() throws LWJGLException {
- createDisplay();
- init();
- loop();
- }
-
- public static void main(String[] argv) throws LWJGLException {
- TessellationTest test = new TessellationTest();
- test.start();
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.glu.tessellation;
+import org.lwjgl.LWJGLException;
+import org.lwjgl.opengl.Display;
+import org.lwjgl.opengl.DisplayMode;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.util.glu.GLU;
+import org.lwjgl.util.glu.GLUtessellator;
+
+public class TessellationTest {
+ private GLUtessellator tesselator;
+
+ void init()
+ {
+ // Create a new tessellation object
+ tesselator = GLU.gluNewTess();
+
+ // Set callback functions
+ TessCallback callback = new TessCallback();
+ tesselator.gluTessCallback(GLU.GLU_TESS_VERTEX, callback);
+ tesselator.gluTessCallback(GLU.GLU_TESS_BEGIN, callback);
+ tesselator.gluTessCallback(GLU.GLU_TESS_END, callback);
+ tesselator.gluTessCallback(GLU.GLU_TESS_COMBINE, callback);
+ }
+
+ void setWindingRule(int windingRule)
+ {
+ // Set the winding rule
+ tesselator.gluTessProperty(GLU.GLU_TESS_WINDING_RULE, windingRule);
+ }
+
+ void renderContour(double obj_data[][], int num_vertices)
+ {
+ for (int x = 0; x < num_vertices; x++) //loop through the vertices
+ {
+ tesselator.gluTessVertex(obj_data[x], 0, new VertexData(obj_data[x])); //store the vertex
+ }
+ }
+
+ void beginPolygon()
+ {
+ tesselator.gluTessBeginPolygon(null);
+ }
+
+ void endPolygon()
+ {
+ tesselator.gluTessEndPolygon();
+ }
+
+ void beginContour()
+ {
+ tesselator.gluTessBeginContour();
+ }
+
+ void endContour()
+ {
+ tesselator.gluTessEndContour();
+ }
+
+ void end()
+ {
+ tesselator.gluDeleteTess();
+ }
+
+ private void createDisplay() throws LWJGLException {
+ int width = 300;
+ int height = 300;
+
+ Display.setDisplayMode(new DisplayMode(width,height));
+ Display.create();
+ Display.setVSyncEnabled(true);
+
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ GL11.glShadeModel(GL11.GL_SMOOTH);
+ GL11.glDisable(GL11.GL_DEPTH_TEST);
+ GL11.glDisable(GL11.GL_LIGHTING);
+
+ GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+ GL11.glClearDepth(1);
+
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+
+ GL11.glViewport(0,0,width,height);
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+ GL11.glLoadIdentity();
+ GL11.glOrtho(0, width, height, 0, 1, -1);
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ }
+
+ private void loop() {
+ while (true) {
+ render();
+ Display.update();
+ Display.sync(100);
+
+ if (Display.isCloseRequested()) {
+ System.exit(0);
+ }
+ }
+ }
+
+ private void render() {
+ GL11.glTranslatef(150,125,0);
+
+ GL11.glScalef(50,50,1);
+ // first polygon: a star-5 vertices and color information
+ double star[][] = { {0.6f, -0.1f, 0f, 1.0f, 1.0f, 1.0f},
+ {1.35f, 1.4f, 0f, 1.0f, 1.0f, 1.0f},
+ {2.1f, -0.1f, 0f, 1.0f, 1.0f, 1.0f},
+ {0.6f, 0.9f, 0f, 1.0f, 1.0f, 1.0f},
+ {2.1f, 0.9f, 0f, 1.0f, 1.0f, 1.0f} };
+
+ //second polygon: a quad-4 vertices; first contour
+ double quad[][] = { {0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f},
+ {1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f},
+ {1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f},
+ {0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f} };
+
+ //second polygon: a triangle-3 vertices; second contour
+ double tri[][] = {{0.3f, 0.3f, 0.0f, 0.0f, 0.0f, 0.0f},
+ {0.7f, 0.3f, 0.0f, 0.0f, 0.0f, 0.0f},
+ {0.5f, 0.7f, 0.0f, 0.0f, 0.0f, 0.0f} };
+
+ // render the first polygon: the textured star
+
+ // set winding rule to positive
+ setWindingRule(GLU.GLU_TESS_WINDING_POSITIVE);
+ beginPolygon();
+ beginContour();
+ renderContour(star, 5);
+ endContour();
+ endPolygon();
+
+ // render the second polygon: triangle cut out of a quad
+
+ GL11.glTranslatef(-2,0,0);
+ // set winding rule to odd
+ setWindingRule(GLU.GLU_TESS_WINDING_ODD);
+ // begin the new polygon
+ beginPolygon();
+ beginContour();
+ renderContour(quad, 4);
+ endContour();
+ beginContour();
+ renderContour(tri, 3);
+ endContour();
+ endPolygon();
+ // delete the tess object
+ end();
+ }
+
+ private void start() throws LWJGLException {
+ createDisplay();
+ init();
+ loop();
+ }
+
+ public static void main(String[] argv) throws LWJGLException {
+ TessellationTest test = new TessellationTest();
+ test.start();
+ }
+}
diff --git a/src/java/org/lwjgl/test/glu/tessellation/VertexData.java b/src/java/org/lwjgl/test/glu/tessellation/VertexData.java
index fbd84d9..d48c814 100644
--- a/src/java/org/lwjgl/test/glu/tessellation/VertexData.java
+++ b/src/java/org/lwjgl/test/glu/tessellation/VertexData.java
@@ -1,40 +1,40 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.glu.tessellation;
-
-class VertexData {
- public double[] data;
-
- VertexData(double[] data) {
- this.data = data;
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.glu.tessellation;
+
+class VertexData {
+ public double[] data;
+
+ VertexData(double[] data) {
+ this.data = data;
+ }
+}
diff --git a/src/java/org/lwjgl/test/input/HWCursorTest.java b/src/java/org/lwjgl/test/input/HWCursorTest.java
index 34c9565..3ce1bcb 100644
--- a/src/java/org/lwjgl/test/input/HWCursorTest.java
+++ b/src/java/org/lwjgl/test/input/HWCursorTest.java
@@ -1,403 +1,403 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.input;
-
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.nio.IntBuffer;
-
-import org.lwjgl.input.Cursor;
-import org.lwjgl.input.Keyboard;
-import org.lwjgl.input.Mouse;
-import org.lwjgl.opengl.Display;
-import org.lwjgl.opengl.DisplayMode;
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.util.glu.GLU;
-
-/**
- *
- * Tests switching between windowed and fullscreen - including hardware cursor test
- *
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 2983 $
- * $Id: HWCursorTest.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public class HWCursorTest {
-
- /** The native cursor */
- private static Cursor[] cursor = null;
-
- /** The mouse cursor position */
- private static int mouse_x;
- private static int mouse_y;
- private static int mouse_btn = 0;
-
- /**
- * Executes the test
- */
- public void execute() {
- initialize();
-
- mainLoop();
-
- cleanup();
- }
-
- /**
- * Sets the display mode for fullscreen mode
- */
- protected boolean setDisplayMode() {
- try {
- // get modes
- DisplayMode[] dm = org.lwjgl.util.Display.getAvailableDisplayModes(640, 480, -1, -1, -1, -1, 60, 60);
-
- org.lwjgl.util.Display.setDisplayMode(dm, new String[] {
- "width=" + 640,
- "height=" + 480,
- "freq=" + 60,
- "bpp=" + org.lwjgl.opengl.Display.getDisplayMode().getBitsPerPixel()
- });
- return true;
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- return false;
- }
-
- /**
- * Initializes the test
- */
- private void initialize() {
- try {
- // start of in windowed mode
- setDisplayMode();
- Display.create();
-
- glInit();
-
- initNativeCursors();
-
- } catch (Exception e) {
- e.printStackTrace();
- System.exit(-1);
- }
- }
-
- private static void initNativeCursors() throws Exception {
- if ((Cursor.getCapabilities() & Cursor.CURSOR_ONE_BIT_TRANSPARENCY) == 0) {
- System.out.println("No HW cursor support!");
- System.exit(0);
- }
-
- cursor = new Cursor[3];
-
- int cursorImageCount = 1;
- int cursorWidth = Math.min(64, Cursor.getMaxCursorSize());
- int cursorHeight = cursorWidth;
- IntBuffer cursorImages;
- IntBuffer cursorDelays;
-
-
- // Create a single cursor
- // ==================================
- cursorImages = ByteBuffer.allocateDirect(cursorWidth*cursorHeight*cursorImageCount*4).order(ByteOrder.nativeOrder()).asIntBuffer();
- cursorDelays = null;
- for(int j=0; j<cursorWidth; j++) {
- for(int l=0; l<cursorHeight; l++) {
- cursorImages.put(0xffffffff);
- }
- }
- cursorImages.flip();
- cursor[0] = new Cursor(cursorWidth, cursorHeight, cursorWidth/2, cursorHeight/2, cursorImageCount, cursorImages, cursorDelays);
- // ----------------------------------
-
- // Create 3 piece animation
- // ==================================
- cursorImageCount = 3;
- cursorImages = ByteBuffer.allocateDirect(cursorWidth*cursorHeight*cursorImageCount*4).order(ByteOrder.nativeOrder()).asIntBuffer();
- cursorDelays = ByteBuffer.allocateDirect(cursorImageCount*4).order(ByteOrder.nativeOrder()).asIntBuffer();
- for(int i=0; i<cursorImageCount; i++) {
-
- // make a colored square with a chocolate center
- int offColor = 0x00000000;
- int onColor = 0xffff0000;
-
- // change color according to cursor
- if(i == 1) {
- onColor = 0xff00ff00;
- } else if (i == 2) {
- onColor = 0xff0000ff;
- }
-
- // calculate size of center
- int centerSize = (cursorWidth / 5) * (i + 1);
- int centerLeft = cursorWidth / 2 - centerSize / 2;
- int centerRight = cursorWidth / 2 + centerSize / 2;
-
- // go!
- for(int j=0; j<cursorWidth; j++) {
- for(int l=0; l<cursorHeight; l++) {
- if(j >= centerLeft && j < centerRight && l >= centerLeft && l < centerRight) {
- cursorImages.put(offColor);
- } else {
- cursorImages.put(onColor);
- }
- }
- }
- }
- cursorDelays.put(2000).put(2000).put(2000);
- cursorDelays.flip();
- cursorImages.flip();
-
- cursor[1] = new Cursor(cursorWidth, cursorHeight, cursorWidth/2, cursorHeight/2, cursorImageCount, cursorImages, cursorDelays);
- // ----------------------------------
-
-
- // Create a 20 piece animation
- // ==================================
- cursorImageCount = 20;
- cursorImages = ByteBuffer.allocateDirect(cursorWidth*cursorHeight*cursorImageCount*4).order(ByteOrder.nativeOrder()).asIntBuffer();
- cursorDelays = ByteBuffer.allocateDirect(cursorImageCount*4).order(ByteOrder.nativeOrder()).asIntBuffer();
- cursorDelays.put(
- new int[] {
- 100, 100, 100, 100, 100,
- 100, 100, 100, 100, 100,
- 100, 100, 100, 100, 100,
- 100, 100, 100, 100, 100
- });
-
- float step = 0xffffffff / 20.0f;
- for(int i=0; i<cursorImageCount; i++) {
- for(int j=0; j<cursorWidth; j++) {
- for(int l=0; l<cursorHeight; l++) {
- cursorImages.put((int)step);
- }
- }
- step += step;
- }
- cursorImages.flip();
- cursorDelays.flip();
- cursor[2] = new Cursor(cursorWidth, cursorHeight, cursorWidth/2, cursorHeight/2, cursorImageCount, cursorImages, cursorDelays);
- // ----------------------------------
-
- Mouse.setNativeCursor(cursor[0]);
- }
-
- /**
- * Runs the main loop of the "test"
- */
- private void mainLoop() {
- while (!Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)
- && !Display.isCloseRequested()) {
- // allow subsystem to get a chance to run too
- Display.update();
-
- if (Display.isVisible()) {
- // check keyboard input
- processKeyboard();
- processMouse();
-
- render();
- } else {
-
- // no need to render/paint if nothing has changed (ie. window dragged over)
- if (Display.isDirty()) {
- render();
- }
-
- // don't waste cpu time, sleep more
- try {
- Thread.sleep(100);
- } catch (InterruptedException inte) {
- }
- }
- }
- }
-
- /**
- * Performs the logic
- */
- private void render() {
- //clear background
- GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
-
- // draw white quad
- GL11.glPushMatrix();
- {
- GL11.glTranslatef(mouse_x, mouse_y, 0);
- GL11.glColor3f(1.0f, 1.0f, 1.0f);
- GL11.glBegin(GL11.GL_QUADS);
- {
- GL11.glColor3f(1.0f, 0.0f, 0.0f); GL11.glVertex2i(-50, -50);
- GL11.glColor3f(0.0f, 1.0f, 0.0f); GL11.glVertex2i(50, -50);
- GL11.glColor3f(0.0f, 0.0f, 1.0f); GL11.glVertex2i(50, 50);
- GL11.glColor3f(1.0f, 0.0f, 1.0f); GL11.glVertex2i(-50, 50);
- }
- GL11.glEnd();
- }
- GL11.glPopMatrix();
- }
-
- private void processMouse() {
- mouse_x = Mouse.getX();
- mouse_y = Mouse.getY();
-
- while(Mouse.next()) {
- int button = Mouse.getEventButton();
- if(button >= 0 && button < 3 && Mouse.getEventButtonState()) {
- mouse_btn = Mouse.getEventButton();
- switchCursor();
- }
- }
- }
-
- /**
- * Processes keyboard input
- */
- private void processKeyboard() {
- //check for fullscreen key
- if (Keyboard.isKeyDown(Keyboard.KEY_F)) {
-
- try {
- try {
- Mouse.setNativeCursor(null);
- } catch (Exception e) {
- e.printStackTrace();
- System.exit(1);
- }
- for(int i=0; i<cursor.length; i++) {
- cursor[i].destroy();
- }
- Display.setFullscreen(true);
-
- glInit();
-
- initNativeCursors();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- //check for window key
- if (Keyboard.isKeyDown(Keyboard.KEY_W)) {
- try {
- try {
- Mouse.setNativeCursor(null);
- } catch (Exception e) {
- e.printStackTrace();
- System.exit(1);
- }
- for(int i=0; i<cursor.length; i++) {
- cursor[i].destroy();
- }
- Display.setFullscreen(false);
- glInit();
-
- initNativeCursors();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- if (Keyboard.isKeyDown(Keyboard.KEY_M)) {
- try {
- Mouse.setNativeCursor(null);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- if (Keyboard.isKeyDown(Keyboard.KEY_N)) {
- switchCursor();
- }
-
- while(Keyboard.next()) {
- if(Keyboard.getEventKey() == Keyboard.KEY_SPACE && Keyboard.getEventKeyState()) {
- Mouse.setGrabbed(!Mouse.isGrabbed());
- }
- }
- }
-
- private void switchCursor() {
- try {
- Mouse.setNativeCursor(cursor[mouse_btn]);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- /**
- * Cleans up the test
- */
- private void cleanup() {
- try {
- Mouse.setNativeCursor(null);
- } catch (Exception e) {
- e.printStackTrace();
- System.exit(1);
- }
- for(int i=0; i<cursor.length; i++) {
- cursor[i].destroy();
- }
- Display.destroy();
- }
-
- /**
- * Initializes OGL
- */
- private void glInit() {
- // Go into orthographic projection mode.
- GL11.glMatrixMode(GL11.GL_PROJECTION);
- GL11.glLoadIdentity();
- GLU.gluOrtho2D(0, Display.getDisplayMode().getWidth(), 0, Display.getDisplayMode().getHeight());
- GL11.glMatrixMode(GL11.GL_MODELVIEW);
- GL11.glLoadIdentity();
- GL11.glViewport(0, 0, Display.getDisplayMode().getWidth(), Display.getDisplayMode().getHeight());
-
- //set clear color to black
- GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
-
- //sync frame (only works on windows)
- Display.setVSyncEnabled(true);
- }
-
- /**
- * Test entry point
- */
- public static void main(String[] args) {
- System.out.println("Change between fullscreen and windowed mode, by pressing F and W respectively. Enable hw cursor with N and disable it with M.");
- HWCursorTest cursorTest = new HWCursorTest();
- cursorTest.execute();
- System.exit(0);
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.input;
+
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.IntBuffer;
+
+import org.lwjgl.input.Cursor;
+import org.lwjgl.input.Keyboard;
+import org.lwjgl.input.Mouse;
+import org.lwjgl.opengl.Display;
+import org.lwjgl.opengl.DisplayMode;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.util.glu.GLU;
+
+/**
+ *
+ * Tests switching between windowed and fullscreen - including hardware cursor test
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 2983 $
+ * $Id: HWCursorTest.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public class HWCursorTest {
+
+ /** The native cursor */
+ private static Cursor[] cursor = null;
+
+ /** The mouse cursor position */
+ private static int mouse_x;
+ private static int mouse_y;
+ private static int mouse_btn = 0;
+
+ /**
+ * Executes the test
+ */
+ public void execute() {
+ initialize();
+
+ mainLoop();
+
+ cleanup();
+ }
+
+ /**
+ * Sets the display mode for fullscreen mode
+ */
+ protected boolean setDisplayMode() {
+ try {
+ // get modes
+ DisplayMode[] dm = org.lwjgl.util.Display.getAvailableDisplayModes(640, 480, -1, -1, -1, -1, 60, 60);
+
+ org.lwjgl.util.Display.setDisplayMode(dm, new String[] {
+ "width=" + 640,
+ "height=" + 480,
+ "freq=" + 60,
+ "bpp=" + org.lwjgl.opengl.Display.getDisplayMode().getBitsPerPixel()
+ });
+ return true;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ return false;
+ }
+
+ /**
+ * Initializes the test
+ */
+ private void initialize() {
+ try {
+ // start of in windowed mode
+ setDisplayMode();
+ Display.create();
+
+ glInit();
+
+ initNativeCursors();
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.exit(-1);
+ }
+ }
+
+ private static void initNativeCursors() throws Exception {
+ if ((Cursor.getCapabilities() & Cursor.CURSOR_ONE_BIT_TRANSPARENCY) == 0) {
+ System.out.println("No HW cursor support!");
+ System.exit(0);
+ }
+
+ cursor = new Cursor[3];
+
+ int cursorImageCount = 1;
+ int cursorWidth = Math.min(64, Cursor.getMaxCursorSize());
+ int cursorHeight = cursorWidth;
+ IntBuffer cursorImages;
+ IntBuffer cursorDelays;
+
+
+ // Create a single cursor
+ // ==================================
+ cursorImages = ByteBuffer.allocateDirect(cursorWidth*cursorHeight*cursorImageCount*4).order(ByteOrder.nativeOrder()).asIntBuffer();
+ cursorDelays = null;
+ for(int j=0; j<cursorWidth; j++) {
+ for(int l=0; l<cursorHeight; l++) {
+ cursorImages.put(0xffffffff);
+ }
+ }
+ cursorImages.flip();
+ cursor[0] = new Cursor(cursorWidth, cursorHeight, cursorWidth/2, cursorHeight/2, cursorImageCount, cursorImages, cursorDelays);
+ // ----------------------------------
+
+ // Create 3 piece animation
+ // ==================================
+ cursorImageCount = 3;
+ cursorImages = ByteBuffer.allocateDirect(cursorWidth*cursorHeight*cursorImageCount*4).order(ByteOrder.nativeOrder()).asIntBuffer();
+ cursorDelays = ByteBuffer.allocateDirect(cursorImageCount*4).order(ByteOrder.nativeOrder()).asIntBuffer();
+ for(int i=0; i<cursorImageCount; i++) {
+
+ // make a colored square with a chocolate center
+ int offColor = 0x00000000;
+ int onColor = 0xffff0000;
+
+ // change color according to cursor
+ if(i == 1) {
+ onColor = 0xff00ff00;
+ } else if (i == 2) {
+ onColor = 0xff0000ff;
+ }
+
+ // calculate size of center
+ int centerSize = (cursorWidth / 5) * (i + 1);
+ int centerLeft = cursorWidth / 2 - centerSize / 2;
+ int centerRight = cursorWidth / 2 + centerSize / 2;
+
+ // go!
+ for(int j=0; j<cursorWidth; j++) {
+ for(int l=0; l<cursorHeight; l++) {
+ if(j >= centerLeft && j < centerRight && l >= centerLeft && l < centerRight) {
+ cursorImages.put(offColor);
+ } else {
+ cursorImages.put(onColor);
+ }
+ }
+ }
+ }
+ cursorDelays.put(2000).put(2000).put(2000);
+ cursorDelays.flip();
+ cursorImages.flip();
+
+ cursor[1] = new Cursor(cursorWidth, cursorHeight, cursorWidth/2, cursorHeight/2, cursorImageCount, cursorImages, cursorDelays);
+ // ----------------------------------
+
+
+ // Create a 20 piece animation
+ // ==================================
+ cursorImageCount = 20;
+ cursorImages = ByteBuffer.allocateDirect(cursorWidth*cursorHeight*cursorImageCount*4).order(ByteOrder.nativeOrder()).asIntBuffer();
+ cursorDelays = ByteBuffer.allocateDirect(cursorImageCount*4).order(ByteOrder.nativeOrder()).asIntBuffer();
+ cursorDelays.put(
+ new int[] {
+ 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100
+ });
+
+ float step = 0xffffffff / 20.0f;
+ for(int i=0; i<cursorImageCount; i++) {
+ for(int j=0; j<cursorWidth; j++) {
+ for(int l=0; l<cursorHeight; l++) {
+ cursorImages.put((int)step);
+ }
+ }
+ step += step;
+ }
+ cursorImages.flip();
+ cursorDelays.flip();
+ cursor[2] = new Cursor(cursorWidth, cursorHeight, cursorWidth/2, cursorHeight/2, cursorImageCount, cursorImages, cursorDelays);
+ // ----------------------------------
+
+ Mouse.setNativeCursor(cursor[0]);
+ }
+
+ /**
+ * Runs the main loop of the "test"
+ */
+ private void mainLoop() {
+ while (!Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)
+ && !Display.isCloseRequested()) {
+ // allow subsystem to get a chance to run too
+ Display.update();
+
+ if (Display.isVisible()) {
+ // check keyboard input
+ processKeyboard();
+ processMouse();
+
+ render();
+ } else {
+
+ // no need to render/paint if nothing has changed (ie. window dragged over)
+ if (Display.isDirty()) {
+ render();
+ }
+
+ // don't waste cpu time, sleep more
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException inte) {
+ }
+ }
+ }
+ }
+
+ /**
+ * Performs the logic
+ */
+ private void render() {
+ //clear background
+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
+
+ // draw white quad
+ GL11.glPushMatrix();
+ {
+ GL11.glTranslatef(mouse_x, mouse_y, 0);
+ GL11.glColor3f(1.0f, 1.0f, 1.0f);
+ GL11.glBegin(GL11.GL_QUADS);
+ {
+ GL11.glColor3f(1.0f, 0.0f, 0.0f); GL11.glVertex2i(-50, -50);
+ GL11.glColor3f(0.0f, 1.0f, 0.0f); GL11.glVertex2i(50, -50);
+ GL11.glColor3f(0.0f, 0.0f, 1.0f); GL11.glVertex2i(50, 50);
+ GL11.glColor3f(1.0f, 0.0f, 1.0f); GL11.glVertex2i(-50, 50);
+ }
+ GL11.glEnd();
+ }
+ GL11.glPopMatrix();
+ }
+
+ private void processMouse() {
+ mouse_x = Mouse.getX();
+ mouse_y = Mouse.getY();
+
+ while(Mouse.next()) {
+ int button = Mouse.getEventButton();
+ if(button >= 0 && button < 3 && Mouse.getEventButtonState()) {
+ mouse_btn = Mouse.getEventButton();
+ switchCursor();
+ }
+ }
+ }
+
+ /**
+ * Processes keyboard input
+ */
+ private void processKeyboard() {
+ //check for fullscreen key
+ if (Keyboard.isKeyDown(Keyboard.KEY_F)) {
+
+ try {
+ try {
+ Mouse.setNativeCursor(null);
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.exit(1);
+ }
+ for(int i=0; i<cursor.length; i++) {
+ cursor[i].destroy();
+ }
+ Display.setFullscreen(true);
+
+ glInit();
+
+ initNativeCursors();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ //check for window key
+ if (Keyboard.isKeyDown(Keyboard.KEY_W)) {
+ try {
+ try {
+ Mouse.setNativeCursor(null);
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.exit(1);
+ }
+ for(int i=0; i<cursor.length; i++) {
+ cursor[i].destroy();
+ }
+ Display.setFullscreen(false);
+ glInit();
+
+ initNativeCursors();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ if (Keyboard.isKeyDown(Keyboard.KEY_M)) {
+ try {
+ Mouse.setNativeCursor(null);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ if (Keyboard.isKeyDown(Keyboard.KEY_N)) {
+ switchCursor();
+ }
+
+ while(Keyboard.next()) {
+ if(Keyboard.getEventKey() == Keyboard.KEY_SPACE && Keyboard.getEventKeyState()) {
+ Mouse.setGrabbed(!Mouse.isGrabbed());
+ }
+ }
+ }
+
+ private void switchCursor() {
+ try {
+ Mouse.setNativeCursor(cursor[mouse_btn]);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Cleans up the test
+ */
+ private void cleanup() {
+ try {
+ Mouse.setNativeCursor(null);
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.exit(1);
+ }
+ for(int i=0; i<cursor.length; i++) {
+ cursor[i].destroy();
+ }
+ Display.destroy();
+ }
+
+ /**
+ * Initializes OGL
+ */
+ private void glInit() {
+ // Go into orthographic projection mode.
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+ GL11.glLoadIdentity();
+ GLU.gluOrtho2D(0, Display.getDisplayMode().getWidth(), 0, Display.getDisplayMode().getHeight());
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ GL11.glLoadIdentity();
+ GL11.glViewport(0, 0, Display.getDisplayMode().getWidth(), Display.getDisplayMode().getHeight());
+
+ //set clear color to black
+ GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+
+ //sync frame (only works on windows)
+ Display.setVSyncEnabled(true);
+ }
+
+ /**
+ * Test entry point
+ */
+ public static void main(String[] args) {
+ System.out.println("Change between fullscreen and windowed mode, by pressing F and W respectively. Enable hw cursor with N and disable it with M.");
+ HWCursorTest cursorTest = new HWCursorTest();
+ cursorTest.execute();
+ System.exit(0);
+ }
+}
diff --git a/src/java/org/lwjgl/test/input/KeyboardTest.java b/src/java/org/lwjgl/test/input/KeyboardTest.java
index 5eed8ab..1dbf57e 100644
--- a/src/java/org/lwjgl/test/input/KeyboardTest.java
+++ b/src/java/org/lwjgl/test/input/KeyboardTest.java
@@ -1,236 +1,236 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.input;
-
-import org.lwjgl.input.Keyboard;
-import org.lwjgl.opengl.Display;
-import org.lwjgl.opengl.DisplayMode;
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.util.vector.Vector2f;
-import org.lwjgl.util.glu.GLU;
-
-/**
- * <br>
- * Keyboard test
- *
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 3042 $
- * $Id: KeyboardTest.java 3042 2008-04-22 21:26:39Z elias_naur $
- */
-public class KeyboardTest {
-
- /** position of quad to draw */
- private Vector2f position = new Vector2f(320.0f, 240.0f);
-
- /** Display mode selected */
- private DisplayMode displayMode;
-
- /** Creates a new instance of MouseTest */
- public KeyboardTest() {
- }
-
- private void initialize() {
- // create display and opengl
- setupDisplay(false);
-
- try {
- Keyboard.create();
- } catch (Exception e) {
- e.printStackTrace();
- System.exit(-1);
- }
- }
-
- /**
- * Sets the display mode for fullscreen mode
- */
- protected boolean setDisplayMode() {
- try {
- // get modes
- DisplayMode[] dm = org.lwjgl.util.Display.getAvailableDisplayModes(640, 480, -1, -1, -1, -1, 60, 60);
-
- org.lwjgl.util.Display.setDisplayMode(dm, new String[] {
- "width=" + 640,
- "height=" + 480,
- "freq=" + 60,
- "bpp=" + org.lwjgl.opengl.Display.getDisplayMode().getBitsPerPixel()
- });
- return true;
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- return false;
- }
-
- private void setupDisplay(boolean fullscreen) {
- try {
- setDisplayMode();
- Display.create();
- } catch (Exception e) {
- e.printStackTrace();
- System.exit(-1);
- }
-
- initializeOpenGL();
- }
-
- private void initializeOpenGL() {
- GL11.glMatrixMode(GL11.GL_PROJECTION);
- GL11.glLoadIdentity();
- GLU.gluOrtho2D(0, Display.getDisplayMode().getWidth(), 0, Display.getDisplayMode().getHeight());
- GL11.glMatrixMode(GL11.GL_MODELVIEW);
- GL11.glLoadIdentity();
- GL11.glViewport(0, 0, Display.getDisplayMode().getWidth(), Display.getDisplayMode().getHeight());
- GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
- }
-
- public void executeTest() {
- initialize();
-
- createKeyboard();
-
- wiggleKeyboard();
-
- Keyboard.destroy();
- Display.destroy();
- }
-
- private void createKeyboard() {
- try {
- Keyboard.create();
- } catch (Exception e) {
- e.printStackTrace();
- System.exit(-1);
- }
- }
-
- private void wiggleKeyboard() {
-
- while (!Display.isCloseRequested()) {
- Display.update();
-
- if (!Display.isVisible()) {
- try {
- Thread.sleep(100);
- } catch (InterruptedException inte) {
- inte.printStackTrace();
- }
- continue;
- }
-
- //check keys, buffered
- Keyboard.poll();
-
- int count = Keyboard.getNumKeyboardEvents();
- while (Keyboard.next()) {
- int character_code = ((int)Keyboard.getEventCharacter()) & 0xffff;
- System.out.println("Checking key:" + Keyboard.getKeyName(Keyboard.getEventKey()));
- System.out.println("Pressed:" + Keyboard.getEventKeyState());
- System.out.println("Key character code: 0x" + Integer.toHexString(character_code));
- System.out.println("Key character: " + Keyboard.getEventCharacter());
- System.out.println("Repeat event: " + Keyboard.isRepeatEvent());
-
- if (Keyboard.getEventKey() == Keyboard.KEY_R && Keyboard.getEventKeyState()) {
- Keyboard.enableRepeatEvents(!Keyboard.areRepeatEventsEnabled());
- }
- if (Keyboard.getEventKey() == Keyboard.KEY_ESCAPE) {
- return;
- }
- }
- if (Keyboard.isKeyDown(Keyboard.KEY_RIGHT)) {
- position.x += 1;
- }
-
- if (Keyboard.isKeyDown(Keyboard.KEY_LEFT)) {
- position.x -= 1;
- }
-
- if (Keyboard.isKeyDown(Keyboard.KEY_UP)) {
- position.y += 1;
- }
-
- if (Keyboard.isKeyDown(Keyboard.KEY_DOWN)) {
- position.y -= 1;
- }
-
- if (count > 0) {
- System.out.println();
- }
-
- if (position.x < 0) {
- position.x = 0;
- } else if (position.x > 640 - 60) {
- position.x = 640 - 60;
- }
-
- if (position.y < 0) {
- position.y = 0;
- } else if (position.y > 480 - 30) {
- position.y = 480 - 30;
- }
-
- render();
-
- try {
- Thread.sleep(0);
- } catch (Exception e) {
- }
- }
- }
-
- private void render() {
- GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
-
- GL11.glBegin(GL11.GL_POLYGON);
- {
- float color = 1.0f;
- GL11.glColor3f(color, color, color);
-
- GL11.glVertex2f(position.x + 0.0f, position.y + 0.0f);
- GL11.glVertex2f(position.x + 0.0f, position.y + 30.0f);
- GL11.glVertex2f(position.x + 40.0f, position.y + 30.0f);
- GL11.glVertex2f(position.x + 60.0f, position.y + 15.f);
- GL11.glVertex2f(position.x + 40.0f, position.y + 0.0f);
- }
- GL11.glEnd();
- }
-
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- KeyboardTest kt = new KeyboardTest();
- kt.executeTest();
- System.exit(0);
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.input;
+
+import org.lwjgl.input.Keyboard;
+import org.lwjgl.opengl.Display;
+import org.lwjgl.opengl.DisplayMode;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.util.vector.Vector2f;
+import org.lwjgl.util.glu.GLU;
+
+/**
+ * <br>
+ * Keyboard test
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 3042 $
+ * $Id: KeyboardTest.java 3042 2008-04-22 21:26:39Z elias_naur $
+ */
+public class KeyboardTest {
+
+ /** position of quad to draw */
+ private Vector2f position = new Vector2f(320.0f, 240.0f);
+
+ /** Display mode selected */
+ private DisplayMode displayMode;
+
+ /** Creates a new instance of MouseTest */
+ public KeyboardTest() {
+ }
+
+ private void initialize() {
+ // create display and opengl
+ setupDisplay(false);
+
+ try {
+ Keyboard.create();
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.exit(-1);
+ }
+ }
+
+ /**
+ * Sets the display mode for fullscreen mode
+ */
+ protected boolean setDisplayMode() {
+ try {
+ // get modes
+ DisplayMode[] dm = org.lwjgl.util.Display.getAvailableDisplayModes(640, 480, -1, -1, -1, -1, 60, 60);
+
+ org.lwjgl.util.Display.setDisplayMode(dm, new String[] {
+ "width=" + 640,
+ "height=" + 480,
+ "freq=" + 60,
+ "bpp=" + org.lwjgl.opengl.Display.getDisplayMode().getBitsPerPixel()
+ });
+ return true;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ return false;
+ }
+
+ private void setupDisplay(boolean fullscreen) {
+ try {
+ setDisplayMode();
+ Display.create();
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.exit(-1);
+ }
+
+ initializeOpenGL();
+ }
+
+ private void initializeOpenGL() {
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+ GL11.glLoadIdentity();
+ GLU.gluOrtho2D(0, Display.getDisplayMode().getWidth(), 0, Display.getDisplayMode().getHeight());
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ GL11.glLoadIdentity();
+ GL11.glViewport(0, 0, Display.getDisplayMode().getWidth(), Display.getDisplayMode().getHeight());
+ GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+ }
+
+ public void executeTest() {
+ initialize();
+
+ createKeyboard();
+
+ wiggleKeyboard();
+
+ Keyboard.destroy();
+ Display.destroy();
+ }
+
+ private void createKeyboard() {
+ try {
+ Keyboard.create();
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.exit(-1);
+ }
+ }
+
+ private void wiggleKeyboard() {
+
+ while (!Display.isCloseRequested()) {
+ Display.update();
+
+ if (!Display.isVisible()) {
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException inte) {
+ inte.printStackTrace();
+ }
+ continue;
+ }
+
+ //check keys, buffered
+ Keyboard.poll();
+
+ int count = Keyboard.getNumKeyboardEvents();
+ while (Keyboard.next()) {
+ int character_code = ((int)Keyboard.getEventCharacter()) & 0xffff;
+ System.out.println("Checking key:" + Keyboard.getKeyName(Keyboard.getEventKey()));
+ System.out.println("Pressed:" + Keyboard.getEventKeyState());
+ System.out.println("Key character code: 0x" + Integer.toHexString(character_code));
+ System.out.println("Key character: " + Keyboard.getEventCharacter());
+ System.out.println("Repeat event: " + Keyboard.isRepeatEvent());
+
+ if (Keyboard.getEventKey() == Keyboard.KEY_R && Keyboard.getEventKeyState()) {
+ Keyboard.enableRepeatEvents(!Keyboard.areRepeatEventsEnabled());
+ }
+ if (Keyboard.getEventKey() == Keyboard.KEY_ESCAPE) {
+ return;
+ }
+ }
+ if (Keyboard.isKeyDown(Keyboard.KEY_RIGHT)) {
+ position.x += 1;
+ }
+
+ if (Keyboard.isKeyDown(Keyboard.KEY_LEFT)) {
+ position.x -= 1;
+ }
+
+ if (Keyboard.isKeyDown(Keyboard.KEY_UP)) {
+ position.y += 1;
+ }
+
+ if (Keyboard.isKeyDown(Keyboard.KEY_DOWN)) {
+ position.y -= 1;
+ }
+
+ if (count > 0) {
+ System.out.println();
+ }
+
+ if (position.x < 0) {
+ position.x = 0;
+ } else if (position.x > 640 - 60) {
+ position.x = 640 - 60;
+ }
+
+ if (position.y < 0) {
+ position.y = 0;
+ } else if (position.y > 480 - 30) {
+ position.y = 480 - 30;
+ }
+
+ render();
+
+ try {
+ Thread.sleep(0);
+ } catch (Exception e) {
+ }
+ }
+ }
+
+ private void render() {
+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
+
+ GL11.glBegin(GL11.GL_POLYGON);
+ {
+ float color = 1.0f;
+ GL11.glColor3f(color, color, color);
+
+ GL11.glVertex2f(position.x + 0.0f, position.y + 0.0f);
+ GL11.glVertex2f(position.x + 0.0f, position.y + 30.0f);
+ GL11.glVertex2f(position.x + 40.0f, position.y + 30.0f);
+ GL11.glVertex2f(position.x + 60.0f, position.y + 15.f);
+ GL11.glVertex2f(position.x + 40.0f, position.y + 0.0f);
+ }
+ GL11.glEnd();
+ }
+
+ /**
+ * @param args the command line arguments
+ */
+ public static void main(String[] args) {
+ KeyboardTest kt = new KeyboardTest();
+ kt.executeTest();
+ System.exit(0);
+ }
+}
diff --git a/src/java/org/lwjgl/test/input/MouseCreationTest.java b/src/java/org/lwjgl/test/input/MouseCreationTest.java
index 8e3553b..1b42b37 100644
--- a/src/java/org/lwjgl/test/input/MouseCreationTest.java
+++ b/src/java/org/lwjgl/test/input/MouseCreationTest.java
@@ -1,217 +1,217 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.input;
-
-import org.lwjgl.Sys;
-import org.lwjgl.input.Mouse;
-import org.lwjgl.opengl.Display;
-import org.lwjgl.opengl.DisplayMode;
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.util.vector.Vector2f;
-
-/**
- * <br>
- * Mouse test
- *
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 3108 $
- * $Id: MouseCreationTest.java 3108 2008-07-02 20:00:49Z matzon $
- */
-public class MouseCreationTest {
- /** position of quad to draw */
- private Vector2f position = new Vector2f(320.0f, 240.0f);
-
- /** Creates a new instance of MouseTest */
- public MouseCreationTest() {
- }
-
- private void initialize(boolean fullscreen) {
- try {
- setDisplayMode();
- Display.setFullscreen(fullscreen);
- Display.create();
- Mouse.setGrabbed(true);
- } catch (Exception e) {
- e.printStackTrace();
- System.exit(-1);
- }
-
- initializeOpenGL();
- }
-
- /**
- * Sets the display mode for fullscreen mode
- */
- protected boolean setDisplayMode() {
- try {
- // get modes
- DisplayMode[] dm = org.lwjgl.util.Display.getAvailableDisplayModes(640, 480, -1, -1, -1, -1, 60, 60);
-
- org.lwjgl.util.Display.setDisplayMode(dm, new String[] {
- "width=" + 640,
- "height=" + 480,
- "freq=" + 60,
- "bpp=" + org.lwjgl.opengl.Display.getDisplayMode().getBitsPerPixel()
- });
- return true;
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- return false;
- }
-
- private void initializeOpenGL() {
- GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
- // Put the window into orthographic projection mode with 1:1 pixel ratio.
- // We haven't used GLU here to do this to avoid an unnecessary dependency.
- GL11.glMatrixMode(GL11.GL_PROJECTION);
- GL11.glLoadIdentity();
- GL11.glOrtho(0.0, Display.getDisplayMode().getWidth(), 0.0, Display.getDisplayMode().getHeight(), -1.0, 1.0);
- GL11.glMatrixMode(GL11.GL_MODELVIEW);
- GL11.glLoadIdentity();
- GL11.glViewport(0, 0, Display.getDisplayMode().getWidth(), Display.getDisplayMode().getHeight());
- }
-
- public void executeTest() {
- initialize(false);
-
- System.out.println("Test ready:\n");
-
- // windowed mode
- System.out.println("=========== WINDOWED MODE ==============");
- for(int i=0; i<2; i++) {
- System.out.println("Test " + (i+1) + ":");
- wiggleMouse();
- System.out.println("");
- }
-
- // recreate display in fullscreen mode
- System.out.print("Destroying display...");
-
- System.out.println("success");
-
- System.out.print("Entering fullscreen mode...");
- try {
- Display.destroy();
- initialize(true);
- } catch (Exception e) {
- e.printStackTrace();
- }
- System.out.println("success");
-
-
- // fullscreen mode
- System.out.println("=========== FULLSCREEN MODE ==============");
- for(int i=0; i<2; i++) {
- System.out.println("Test " + (i+3) + ":");
- wiggleMouse();
- System.out.println("");
- }
-
- System.out.println("Test completed successfully!");
- System.out.print("Shutting down...");
- Display.destroy();
- System.out.println("shutdown complete");
- }
-
- private void wiggleMouse() {
- System.out.print("Please move the mouse around");
-
- long statustime = Sys.getTime();
- long endtime = Sys.getTime() + Sys.getTimerResolution() * 5;
-
- while (Sys.getTime() < endtime) {
- Display.update();
-
- // empty mouse buffer
- while(Mouse.next());
-
- position.x += Mouse.getDX();
- position.y += Mouse.getDY();
-
- if(position.x<0) {
- position.x = 0;
- } else if (position.x>640-60) {
- position.x = 640-60;
- }
-
- if(position.y < 0) {
- position.y = 0;
- } else if (position.y>480-30) {
- position.y = 480-30;
- }
-
- render();
-
- if (Sys.getTime() - statustime > Sys.getTimerResolution()) {
- System.out.print(".");
- statustime = Sys.getTime();
- }
- }
- System.out.println("thank you");
- }
-
- private void render() {
- GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
-
- GL11.glBegin(GL11.GL_POLYGON);
- {
- float color = 1.0f;
- int buttonDown = 0;
-
- for(int i=0;i<Mouse.getButtonCount(); i++) {
- if(Mouse.isButtonDown(i)) {
- color = (1.0f / Mouse.getButtonCount()) * (i+1);
- break;
- }
- }
- GL11.glColor3f(color, color, color);
-
- GL11.glVertex2f(position.x + 0.0f, position.y + 0.0f);
- GL11.glVertex2f(position.x + 0.0f, position.y + 30.0f);
- GL11.glVertex2f(position.x + 40.0f, position.y + 30.0f);
- GL11.glVertex2f(position.x + 60.0f, position.y + 15.f);
- GL11.glVertex2f(position.x + 40.0f, position.y + 0.0f);
- }
- GL11.glEnd();
- }
-
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- MouseCreationTest mt = new MouseCreationTest();
- mt.executeTest();
- System.exit(0);
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.input;
+
+import org.lwjgl.Sys;
+import org.lwjgl.input.Mouse;
+import org.lwjgl.opengl.Display;
+import org.lwjgl.opengl.DisplayMode;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.util.vector.Vector2f;
+
+/**
+ * <br>
+ * Mouse test
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 3108 $
+ * $Id: MouseCreationTest.java 3108 2008-07-02 20:00:49Z matzon $
+ */
+public class MouseCreationTest {
+ /** position of quad to draw */
+ private Vector2f position = new Vector2f(320.0f, 240.0f);
+
+ /** Creates a new instance of MouseTest */
+ public MouseCreationTest() {
+ }
+
+ private void initialize(boolean fullscreen) {
+ try {
+ setDisplayMode();
+ Display.setFullscreen(fullscreen);
+ Display.create();
+ Mouse.setGrabbed(true);
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.exit(-1);
+ }
+
+ initializeOpenGL();
+ }
+
+ /**
+ * Sets the display mode for fullscreen mode
+ */
+ protected boolean setDisplayMode() {
+ try {
+ // get modes
+ DisplayMode[] dm = org.lwjgl.util.Display.getAvailableDisplayModes(640, 480, -1, -1, -1, -1, 60, 60);
+
+ org.lwjgl.util.Display.setDisplayMode(dm, new String[] {
+ "width=" + 640,
+ "height=" + 480,
+ "freq=" + 60,
+ "bpp=" + org.lwjgl.opengl.Display.getDisplayMode().getBitsPerPixel()
+ });
+ return true;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ return false;
+ }
+
+ private void initializeOpenGL() {
+ GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+ // Put the window into orthographic projection mode with 1:1 pixel ratio.
+ // We haven't used GLU here to do this to avoid an unnecessary dependency.
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+ GL11.glLoadIdentity();
+ GL11.glOrtho(0.0, Display.getDisplayMode().getWidth(), 0.0, Display.getDisplayMode().getHeight(), -1.0, 1.0);
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ GL11.glLoadIdentity();
+ GL11.glViewport(0, 0, Display.getDisplayMode().getWidth(), Display.getDisplayMode().getHeight());
+ }
+
+ public void executeTest() {
+ initialize(false);
+
+ System.out.println("Test ready:\n");
+
+ // windowed mode
+ System.out.println("=========== WINDOWED MODE ==============");
+ for(int i=0; i<2; i++) {
+ System.out.println("Test " + (i+1) + ":");
+ wiggleMouse();
+ System.out.println("");
+ }
+
+ // recreate display in fullscreen mode
+ System.out.print("Destroying display...");
+
+ System.out.println("success");
+
+ System.out.print("Entering fullscreen mode...");
+ try {
+ Display.destroy();
+ initialize(true);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ System.out.println("success");
+
+
+ // fullscreen mode
+ System.out.println("=========== FULLSCREEN MODE ==============");
+ for(int i=0; i<2; i++) {
+ System.out.println("Test " + (i+3) + ":");
+ wiggleMouse();
+ System.out.println("");
+ }
+
+ System.out.println("Test completed successfully!");
+ System.out.print("Shutting down...");
+ Display.destroy();
+ System.out.println("shutdown complete");
+ }
+
+ private void wiggleMouse() {
+ System.out.print("Please move the mouse around");
+
+ long statustime = Sys.getTime();
+ long endtime = Sys.getTime() + Sys.getTimerResolution() * 5;
+
+ while (Sys.getTime() < endtime) {
+ Display.update();
+
+ // empty mouse buffer
+ while(Mouse.next());
+
+ position.x += Mouse.getDX();
+ position.y += Mouse.getDY();
+
+ if(position.x<0) {
+ position.x = 0;
+ } else if (position.x>640-60) {
+ position.x = 640-60;
+ }
+
+ if(position.y < 0) {
+ position.y = 0;
+ } else if (position.y>480-30) {
+ position.y = 480-30;
+ }
+
+ render();
+
+ if (Sys.getTime() - statustime > Sys.getTimerResolution()) {
+ System.out.print(".");
+ statustime = Sys.getTime();
+ }
+ }
+ System.out.println("thank you");
+ }
+
+ private void render() {
+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
+
+ GL11.glBegin(GL11.GL_POLYGON);
+ {
+ float color = 1.0f;
+ int buttonDown = 0;
+
+ for(int i=0;i<Mouse.getButtonCount(); i++) {
+ if(Mouse.isButtonDown(i)) {
+ color = (1.0f / Mouse.getButtonCount()) * (i+1);
+ break;
+ }
+ }
+ GL11.glColor3f(color, color, color);
+
+ GL11.glVertex2f(position.x + 0.0f, position.y + 0.0f);
+ GL11.glVertex2f(position.x + 0.0f, position.y + 30.0f);
+ GL11.glVertex2f(position.x + 40.0f, position.y + 30.0f);
+ GL11.glVertex2f(position.x + 60.0f, position.y + 15.f);
+ GL11.glVertex2f(position.x + 40.0f, position.y + 0.0f);
+ }
+ GL11.glEnd();
+ }
+
+ /**
+ * @param args the command line arguments
+ */
+ public static void main(String[] args) {
+ MouseCreationTest mt = new MouseCreationTest();
+ mt.executeTest();
+ System.exit(0);
+ }
+}
diff --git a/src/java/org/lwjgl/test/input/MouseTest.java b/src/java/org/lwjgl/test/input/MouseTest.java
index d1f6b13..a6b76ea 100644
--- a/src/java/org/lwjgl/test/input/MouseTest.java
+++ b/src/java/org/lwjgl/test/input/MouseTest.java
@@ -1,425 +1,425 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.input;
-
-import org.lwjgl.input.Keyboard;
-import org.lwjgl.input.Mouse;
-import org.lwjgl.opengl.Display;
-import org.lwjgl.opengl.DisplayMode;
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.util.glu.GLU;
-import org.lwjgl.util.vector.Vector2f;
-import org.lwjgl.util.vector.Vector3f;
-
-/**
- * <br>
- * Mouse test
- *
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 3240 $
- * $Id: MouseTest.java 3240 2009-09-12 22:15:21Z matzon $
- */
-public class MouseTest {
- /** Direction mouse has moved */
- private int direction;
-
- /** Last button pressed */
- private int lastButton = 0;
-
- /** Last direction we scrolled in */
- private int lastScrollDirection = -1;
-
- /** Width of window */
- private static int WINDOW_WIDTH = 640;
-
- /** Height of window */
- private static int WINDOW_HEIGHT = 640;
-
- /** Triangle size */
- private Vector2f triangleSize = new Vector2f(120, 100);
-
- /** Triangle color */
- private Vector3f triangleColor[] = new Vector3f[] {
- new Vector3f(1,1,1),
- new Vector3f(1,0,0),
- new Vector3f(0,1,0),
- new Vector3f(0,0,1)
- };
-
- private Vector3f quadColor[] = new Vector3f[] {
- new Vector3f(1,1,1),
- new Vector3f(1,0,0),
- new Vector3f(0,1,0),
- new Vector3f(0,0,1)
- };
-
- /** Triangles to paint */
- private Vector2f[] triangles = {
- new Vector2f(WINDOW_WIDTH/2, WINDOW_HEIGHT - triangleSize.y),
- new Vector2f(triangleSize.y, WINDOW_HEIGHT/2),
- new Vector2f(WINDOW_WIDTH/2, triangleSize.y),
- new Vector2f(WINDOW_WIDTH-triangleSize.y, WINDOW_HEIGHT/2)
- };
-
- /** Whether the test is closing */
- private boolean closing = false;
-
- /** Fullscreen or not */
- public static final boolean FULLSCREEN = false;
-
- /** Creates a new instance of MouseTest */
- public MouseTest() {
- }
-
- private void initialize() {
- // create display and opengl
- setupDisplay();
-
- setupMouse();
- setupKeyboard();
- }
-
- /**
- * Setup display
- */
- private void setupDisplay() {
- try {
- setDisplayMode();
- Display.setFullscreen(FULLSCREEN);
- Display.setVSyncEnabled(true);
- Display.create();
- Mouse.setGrabbed(true);
- } catch (Exception e) {
- e.printStackTrace();
- System.exit(-1);
- }
-
- initializeOpenGL();
- }
-
- /**
- * Sets the display mode for fullscreen mode
- */
- protected boolean setDisplayMode() {
- // get modes
- DisplayMode dm = new DisplayMode(WINDOW_WIDTH, WINDOW_HEIGHT);
-
- try {
- Display.setDisplayMode(dm);
- return true;
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- return false;
- }
-
- /**
- * Initializes OpenGL
- *
- */
- private void initializeOpenGL() {
- GL11.glMatrixMode(GL11.GL_PROJECTION);
- GL11.glLoadIdentity();
- GLU.gluOrtho2D(0, Display.getDisplayMode().getWidth(), 0, Display.getDisplayMode().getHeight());
- GL11.glMatrixMode(GL11.GL_MODELVIEW);
- GL11.glLoadIdentity();
- GL11.glViewport(0, 0, Display.getDisplayMode().getWidth(), Display.getDisplayMode().getHeight());
- GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
- }
-
- /**
- * Executes the actual test
- */
- public void executeTest() {
- initialize();
-
- runTest();
-
- Display.destroy();
- }
-
- /**
- * Creates the mouse
- */
- private void setupMouse() {
- }
-
- /**
- * Creates the keyboard
- */
- private void setupKeyboard() {
- }
-
- /**
- * Runs the test
- */
- private void runTest() {
- // while not exiting
- while (!closing) {
- handleWindow();
-
- // secondary check
- if(!closing) {
-
- // poll and check keyboard and mouse
- handleKeyboard();
- handleMouse();
-
- // pause and continue if minimized
- if(!Display.isVisible()) {
- if(Display.isDirty()) {
- render();
- }
- pause(100);
- continue;
- }
-
- // render and flip
- logic();
- render();
- }
- Thread.yield();
- }
- }
-
- /**
- * Pauses the current thread for a specified time
- *
- * @param time milliseconds to pause
- */
- private void pause(long time) {
- try {
- Thread.sleep(time);
- } catch (InterruptedException inte) {
- inte.printStackTrace();
- }
- }
-
- /**
- * Handles the window
- */
- private void handleWindow() {
- Display.update();
- closing = Display.isCloseRequested();
- }
-
- /**
- * handles the mouse
- */
- private void handleMouse() {
- readBufferedMouse();
-
- Display.setTitle("x: " + Mouse.getX() + ", y: " + Mouse.getY() + ", [0]: " + Mouse.isButtonDown(0) + ", [1]: " + Mouse.isButtonDown(1) + ", [2]: " + Mouse.isButtonDown(2) + ", inside: " + Mouse.isInsideWindow());
- }
-
- /**
- * reads a mouse in buffered mode
- */
- private void readBufferedMouse() {
- // iterate all events, use the last button down
- while(Mouse.next()) {
- if(Mouse.getEventButton() != -1 && Mouse.getEventButtonState()) {
- lastButton = Mouse.getEventButton();
- }
- }
-
- updateState();
- }
-
- /**
- * Updates our "model"
- *
- */
- private void updateState() {
- direction = -1;
-
- int dx = Mouse.getDX();
- int dy = Mouse.getDY();
- int dw = Mouse.getDWheel();
-
-
- // get out if no movement
- if (dx == dy && dx == 0 && dw == 0) {
- return;
- }
-
- // determine direction moved
- // ============================
- if(dx > 0) {
- direction = 3;
- }
-
- if(dx < 0) {
- direction = 1;
- }
-
- if(dy > 0) {
- direction = 0;
- }
-
- if(dy < 0) {
- direction = 2;
- }
-
- // ----------------------------
- if(direction > -1) {
-
- // based on which button was last pushed, update model
- switch(lastButton) {
- case -1:
- break;
- case 1:
- triangleColor[direction].y = 1;
- break;
- case 2:
- triangleColor[direction].z = 1;
- break;
- case 3:
- triangleColor[direction].x = 1;
- triangleColor[direction].y = 1;
- triangleColor[direction].z = 1;
- break;
- case 0: // fall through
- default:
- triangleColor[direction].x = 1;
- break;
- }
- }
-
- // get direction to update in
- if (dw > 0) {
- lastScrollDirection++;
- } else if (dw < 0) {
- lastScrollDirection--;
- } else if (dw == 0) {
- return;
- }
-
- // over/underflow
- if(lastScrollDirection < 0) {
- lastScrollDirection = 3;
- }
- if(lastScrollDirection > 3) {
- lastScrollDirection = 0;
- }
-
- // update colors
- quadColor[lastScrollDirection].x = (float) Math.random();
- quadColor[lastScrollDirection].y = (float) Math.random();
- quadColor[lastScrollDirection].z = (float) Math.random();
- }
-
- /**
- * Handles the keyboard
- */
- private void handleKeyboard() {
-
- while(Keyboard.next()) {
- // closing on ESCAPE
- if(Keyboard.getEventKey() == Keyboard.KEY_ESCAPE && Keyboard.getEventKeyState()) {
- closing = true;
- }
-
- if(Keyboard.getEventKey() == Keyboard.KEY_SPACE && Keyboard.getEventKeyState()) {
- Mouse.setGrabbed(!Mouse.isGrabbed());
- }
- }
- }
-
- /**
- * Does the "model logic"
- */
- private void logic() {
- // "we fade to black"
- // ===========================================
- for(int i=0; i<triangleColor.length; i++) {
- triangleColor[i].x -= 0.01;
- triangleColor[i].y -= 0.01;
- triangleColor[i].z -= 0.01;
- }
-
- for(int i=0; i<quadColor.length; i++) {
- quadColor[i].x -= 0.01;
- quadColor[i].y -= 0.01;
- quadColor[i].z -= 0.01;
- }
- // -------------------------------------------
- }
-
- /**
- * Render our triangles
- */
- private void render() {
- GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
-
- // for each triangle, render it at position, rotating degrees for each
- for(int i=0; i<triangles.length; i++) {
- GL11.glPushMatrix(); {
- GL11.glTranslatef(triangles[i].x, triangles[i].y, 0);
- GL11.glRotatef(i*90, 0, 0, 1);
-
- GL11.glColor3f(triangleColor[i].x, triangleColor[i].y, triangleColor[i].z);
-
- GL11.glBegin(GL11.GL_TRIANGLES); {
- GL11.glVertex2f(0, triangleSize.y);
- GL11.glVertex2f(-triangleSize.x, -triangleSize.y);
- GL11.glVertex2f(+triangleSize.x, -triangleSize.y);
- }
- GL11.glEnd();
- }
- GL11.glPopMatrix();
- }
-
- // paint quad in the middle (yes, wasting cpu cycles by not precalculating)
- GL11.glBegin(GL11.GL_QUADS); {
- GL11.glColor3f(quadColor[0].x, quadColor[0].y, quadColor[0].z);
- GL11.glVertex2f(WINDOW_WIDTH/2-triangleSize.x, WINDOW_HEIGHT/2-triangleSize.x);
- GL11.glColor3f(quadColor[1].x, quadColor[1].y, quadColor[1].z);
- GL11.glVertex2f(WINDOW_WIDTH/2+triangleSize.x, WINDOW_HEIGHT/2-triangleSize.x);
- GL11.glColor3f(quadColor[2].x, quadColor[2].y, quadColor[2].z);
- GL11.glVertex2f(WINDOW_WIDTH/2+triangleSize.x, WINDOW_HEIGHT/2+triangleSize.x);
- GL11.glColor3f(quadColor[3].x, quadColor[3].y, quadColor[3].z);
- GL11.glVertex2f(WINDOW_WIDTH/2-triangleSize.x, WINDOW_HEIGHT/2+triangleSize.x);
- }
- GL11.glEnd();
- }
-
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- MouseTest mt = new MouseTest();
- mt.executeTest();
- System.exit(0);
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.input;
+
+import org.lwjgl.input.Keyboard;
+import org.lwjgl.input.Mouse;
+import org.lwjgl.opengl.Display;
+import org.lwjgl.opengl.DisplayMode;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.util.glu.GLU;
+import org.lwjgl.util.vector.Vector2f;
+import org.lwjgl.util.vector.Vector3f;
+
+/**
+ * <br>
+ * Mouse test
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 3240 $
+ * $Id: MouseTest.java 3240 2009-09-12 22:15:21Z matzon $
+ */
+public class MouseTest {
+ /** Direction mouse has moved */
+ private int direction;
+
+ /** Last button pressed */
+ private int lastButton = 0;
+
+ /** Last direction we scrolled in */
+ private int lastScrollDirection = -1;
+
+ /** Width of window */
+ private static int WINDOW_WIDTH = 640;
+
+ /** Height of window */
+ private static int WINDOW_HEIGHT = 640;
+
+ /** Triangle size */
+ private Vector2f triangleSize = new Vector2f(120, 100);
+
+ /** Triangle color */
+ private Vector3f triangleColor[] = new Vector3f[] {
+ new Vector3f(1,1,1),
+ new Vector3f(1,0,0),
+ new Vector3f(0,1,0),
+ new Vector3f(0,0,1)
+ };
+
+ private Vector3f quadColor[] = new Vector3f[] {
+ new Vector3f(1,1,1),
+ new Vector3f(1,0,0),
+ new Vector3f(0,1,0),
+ new Vector3f(0,0,1)
+ };
+
+ /** Triangles to paint */
+ private Vector2f[] triangles = {
+ new Vector2f(WINDOW_WIDTH/2, WINDOW_HEIGHT - triangleSize.y),
+ new Vector2f(triangleSize.y, WINDOW_HEIGHT/2),
+ new Vector2f(WINDOW_WIDTH/2, triangleSize.y),
+ new Vector2f(WINDOW_WIDTH-triangleSize.y, WINDOW_HEIGHT/2)
+ };
+
+ /** Whether the test is closing */
+ private boolean closing = false;
+
+ /** Fullscreen or not */
+ public static final boolean FULLSCREEN = false;
+
+ /** Creates a new instance of MouseTest */
+ public MouseTest() {
+ }
+
+ private void initialize() {
+ // create display and opengl
+ setupDisplay();
+
+ setupMouse();
+ setupKeyboard();
+ }
+
+ /**
+ * Setup display
+ */
+ private void setupDisplay() {
+ try {
+ setDisplayMode();
+ Display.setFullscreen(FULLSCREEN);
+ Display.setVSyncEnabled(true);
+ Display.create();
+ Mouse.setGrabbed(true);
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.exit(-1);
+ }
+
+ initializeOpenGL();
+ }
+
+ /**
+ * Sets the display mode for fullscreen mode
+ */
+ protected boolean setDisplayMode() {
+ // get modes
+ DisplayMode dm = new DisplayMode(WINDOW_WIDTH, WINDOW_HEIGHT);
+
+ try {
+ Display.setDisplayMode(dm);
+ return true;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ return false;
+ }
+
+ /**
+ * Initializes OpenGL
+ *
+ */
+ private void initializeOpenGL() {
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+ GL11.glLoadIdentity();
+ GLU.gluOrtho2D(0, Display.getDisplayMode().getWidth(), 0, Display.getDisplayMode().getHeight());
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ GL11.glLoadIdentity();
+ GL11.glViewport(0, 0, Display.getDisplayMode().getWidth(), Display.getDisplayMode().getHeight());
+ GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+ }
+
+ /**
+ * Executes the actual test
+ */
+ public void executeTest() {
+ initialize();
+
+ runTest();
+
+ Display.destroy();
+ }
+
+ /**
+ * Creates the mouse
+ */
+ private void setupMouse() {
+ }
+
+ /**
+ * Creates the keyboard
+ */
+ private void setupKeyboard() {
+ }
+
+ /**
+ * Runs the test
+ */
+ private void runTest() {
+ // while not exiting
+ while (!closing) {
+ handleWindow();
+
+ // secondary check
+ if(!closing) {
+
+ // poll and check keyboard and mouse
+ handleKeyboard();
+ handleMouse();
+
+ // pause and continue if minimized
+ if(!Display.isVisible()) {
+ if(Display.isDirty()) {
+ render();
+ }
+ pause(100);
+ continue;
+ }
+
+ // render and flip
+ logic();
+ render();
+ }
+ Thread.yield();
+ }
+ }
+
+ /**
+ * Pauses the current thread for a specified time
+ *
+ * @param time milliseconds to pause
+ */
+ private void pause(long time) {
+ try {
+ Thread.sleep(time);
+ } catch (InterruptedException inte) {
+ inte.printStackTrace();
+ }
+ }
+
+ /**
+ * Handles the window
+ */
+ private void handleWindow() {
+ Display.update();
+ closing = Display.isCloseRequested();
+ }
+
+ /**
+ * handles the mouse
+ */
+ private void handleMouse() {
+ readBufferedMouse();
+
+ Display.setTitle("x: " + Mouse.getX() + ", y: " + Mouse.getY() + ", [0]: " + Mouse.isButtonDown(0) + ", [1]: " + Mouse.isButtonDown(1) + ", [2]: " + Mouse.isButtonDown(2) + ", inside: " + Mouse.isInsideWindow());
+ }
+
+ /**
+ * reads a mouse in buffered mode
+ */
+ private void readBufferedMouse() {
+ // iterate all events, use the last button down
+ while(Mouse.next()) {
+ if(Mouse.getEventButton() != -1 && Mouse.getEventButtonState()) {
+ lastButton = Mouse.getEventButton();
+ }
+ }
+
+ updateState();
+ }
+
+ /**
+ * Updates our "model"
+ *
+ */
+ private void updateState() {
+ direction = -1;
+
+ int dx = Mouse.getDX();
+ int dy = Mouse.getDY();
+ int dw = Mouse.getDWheel();
+
+
+ // get out if no movement
+ if (dx == dy && dx == 0 && dw == 0) {
+ return;
+ }
+
+ // determine direction moved
+ // ============================
+ if(dx > 0) {
+ direction = 3;
+ }
+
+ if(dx < 0) {
+ direction = 1;
+ }
+
+ if(dy > 0) {
+ direction = 0;
+ }
+
+ if(dy < 0) {
+ direction = 2;
+ }
+
+ // ----------------------------
+ if(direction > -1) {
+
+ // based on which button was last pushed, update model
+ switch(lastButton) {
+ case -1:
+ break;
+ case 1:
+ triangleColor[direction].y = 1;
+ break;
+ case 2:
+ triangleColor[direction].z = 1;
+ break;
+ case 3:
+ triangleColor[direction].x = 1;
+ triangleColor[direction].y = 1;
+ triangleColor[direction].z = 1;
+ break;
+ case 0: // fall through
+ default:
+ triangleColor[direction].x = 1;
+ break;
+ }
+ }
+
+ // get direction to update in
+ if (dw > 0) {
+ lastScrollDirection++;
+ } else if (dw < 0) {
+ lastScrollDirection--;
+ } else if (dw == 0) {
+ return;
+ }
+
+ // over/underflow
+ if(lastScrollDirection < 0) {
+ lastScrollDirection = 3;
+ }
+ if(lastScrollDirection > 3) {
+ lastScrollDirection = 0;
+ }
+
+ // update colors
+ quadColor[lastScrollDirection].x = (float) Math.random();
+ quadColor[lastScrollDirection].y = (float) Math.random();
+ quadColor[lastScrollDirection].z = (float) Math.random();
+ }
+
+ /**
+ * Handles the keyboard
+ */
+ private void handleKeyboard() {
+
+ while(Keyboard.next()) {
+ // closing on ESCAPE
+ if(Keyboard.getEventKey() == Keyboard.KEY_ESCAPE && Keyboard.getEventKeyState()) {
+ closing = true;
+ }
+
+ if(Keyboard.getEventKey() == Keyboard.KEY_SPACE && Keyboard.getEventKeyState()) {
+ Mouse.setGrabbed(!Mouse.isGrabbed());
+ }
+ }
+ }
+
+ /**
+ * Does the "model logic"
+ */
+ private void logic() {
+ // "we fade to black"
+ // ===========================================
+ for(int i=0; i<triangleColor.length; i++) {
+ triangleColor[i].x -= 0.01;
+ triangleColor[i].y -= 0.01;
+ triangleColor[i].z -= 0.01;
+ }
+
+ for(int i=0; i<quadColor.length; i++) {
+ quadColor[i].x -= 0.01;
+ quadColor[i].y -= 0.01;
+ quadColor[i].z -= 0.01;
+ }
+ // -------------------------------------------
+ }
+
+ /**
+ * Render our triangles
+ */
+ private void render() {
+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
+
+ // for each triangle, render it at position, rotating degrees for each
+ for(int i=0; i<triangles.length; i++) {
+ GL11.glPushMatrix(); {
+ GL11.glTranslatef(triangles[i].x, triangles[i].y, 0);
+ GL11.glRotatef(i*90, 0, 0, 1);
+
+ GL11.glColor3f(triangleColor[i].x, triangleColor[i].y, triangleColor[i].z);
+
+ GL11.glBegin(GL11.GL_TRIANGLES); {
+ GL11.glVertex2f(0, triangleSize.y);
+ GL11.glVertex2f(-triangleSize.x, -triangleSize.y);
+ GL11.glVertex2f(+triangleSize.x, -triangleSize.y);
+ }
+ GL11.glEnd();
+ }
+ GL11.glPopMatrix();
+ }
+
+ // paint quad in the middle (yes, wasting cpu cycles by not precalculating)
+ GL11.glBegin(GL11.GL_QUADS); {
+ GL11.glColor3f(quadColor[0].x, quadColor[0].y, quadColor[0].z);
+ GL11.glVertex2f(WINDOW_WIDTH/2-triangleSize.x, WINDOW_HEIGHT/2-triangleSize.x);
+ GL11.glColor3f(quadColor[1].x, quadColor[1].y, quadColor[1].z);
+ GL11.glVertex2f(WINDOW_WIDTH/2+triangleSize.x, WINDOW_HEIGHT/2-triangleSize.x);
+ GL11.glColor3f(quadColor[2].x, quadColor[2].y, quadColor[2].z);
+ GL11.glVertex2f(WINDOW_WIDTH/2+triangleSize.x, WINDOW_HEIGHT/2+triangleSize.x);
+ GL11.glColor3f(quadColor[3].x, quadColor[3].y, quadColor[3].z);
+ GL11.glVertex2f(WINDOW_WIDTH/2-triangleSize.x, WINDOW_HEIGHT/2+triangleSize.x);
+ }
+ GL11.glEnd();
+ }
+
+ /**
+ * @param args the command line arguments
+ */
+ public static void main(String[] args) {
+ MouseTest mt = new MouseTest();
+ mt.executeTest();
+ System.exit(0);
+ }
+}
diff --git a/src/java/org/lwjgl/test/input/TestControllers.java b/src/java/org/lwjgl/test/input/TestControllers.java
index d2c1340..5c7e083 100644
--- a/src/java/org/lwjgl/test/input/TestControllers.java
+++ b/src/java/org/lwjgl/test/input/TestControllers.java
@@ -1,186 +1,186 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.input;
-
-import java.awt.Dimension;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-
-import org.lwjgl.input.Controller;
-import org.lwjgl.input.Controllers;
-
-/**
- * Oops. Forgot to document this one.
- *
- * @author Kevin Glass
- */
-public class TestControllers extends JPanel {
- public static int total = 0;
-
- private JTextField[] values;
- private JTextField[] names;
- private Controller controller;
- private int buttonCount;
- private int itemCount;
-
- public TestControllers(int index) {
- controller = Controllers.getController(index);
- setLayout(null);
-
- buttonCount = controller.getButtonCount();
- itemCount = controller.getButtonCount() + controller.getAxisCount() + 2;
- values = new JTextField[itemCount];
- names = new JTextField[itemCount];
-
- for (int i=0;i<controller.getButtonCount();i++) {
- names[i] = new JTextField();
- names[i].setEditable(false);
- names[i].setBounds(0,i*30,100,30);
- names[i].setText(controller.getButtonName(i));
- add(names[i]);
- values[i] = new JTextField();
- values[i].setEditable(false);
- values[i].setBounds(100,i*30,100,30);
- add(values[i]);
- }
- for (int i=buttonCount;i<buttonCount+controller.getAxisCount();i++) {
- names[i] = new JTextField();
- names[i].setEditable(false);
- names[i].setBounds(0,i*30,100,30);
- names[i].setText(controller.getAxisName(i-buttonCount));
- add(names[i]);
- values[i] = new JTextField();
- values[i].setEditable(false);
- values[i].setBounds(100,i*30,100,30);
- add(values[i]);
- }
-
- int i = itemCount - 2;
- names[i] = new JTextField();
- names[i].setEditable(false);
- names[i].setBounds(0,i*30,100,30);
- names[i].setText("POV X");
- add(names[i]);
- values[i] = new JTextField();
- values[i].setEditable(false);
- values[i].setBounds(100,i*30,100,30);
- add(values[i]);
-
- i = itemCount - 1;
- names[i] = new JTextField();
- names[i].setEditable(false);
- names[i].setBounds(0,i*30,100,30);
- names[i].setText("POV Y");
- add(names[i]);
- values[i] = new JTextField();
- values[i].setEditable(false);
- values[i].setBounds(100,i*30,100,30);
- add(values[i]);
-
- total++;
-
- setPreferredSize(new Dimension(200,30*itemCount));
- JFrame frame = new JFrame(controller.getName());
- frame.setContentPane(new JScrollPane(this));
- frame.addWindowListener(new WindowAdapter() {
- public void windowClosing(WindowEvent e) {
- total--;
- if (total == 0) {
- System.exit(0);
- }
- }
- });
- frame.setSize(230,400);
- frame.setLocation(index*30,index*30);
- frame.setVisible(true);
- }
-
- public void updateDetails() {
- for (int i=0;i<controller.getButtonCount();i++) {
- values[i].setText(""+controller.isButtonPressed(i));
- }
- for (int i=buttonCount;i<buttonCount+controller.getAxisCount();i++) {
- values[i].setText(""+controller.getAxisValue(i-buttonCount));
- }
-
- values[itemCount-2].setText(""+controller.getPovX());
- values[itemCount-1].setText(""+controller.getPovY());
- }
-
- public static void main(String[] argv) {
- try {
- Controllers.create();
- } catch (Exception e) {
- e.printStackTrace();
- System.exit(0);
- }
-
- int count = Controllers.getControllerCount();
- System.out.println(count+" Controllers Found");
- for (int i=0;i<count;i++) {
- Controller controller = Controllers.getController(i);
- System.out.println(controller.getName());
- }
-
- if (count == 0) {
- System.exit(0);
- }
-
- TestControllers[] controllerWindows = new TestControllers[count];
- for (int i=0;i<count;i++) {
- controllerWindows[i] = new TestControllers(i);
- }
-
- boolean running = true;
- while (running) {
- try { Thread.sleep(100); } catch (Exception e) {};
-
- Controllers.poll();
-
- while (Controllers.next()) {
- System.out.println("Event Fired: ");
- System.out.println("\t"+Controllers.getEventNanoseconds());
- System.out.println("\t"+Controllers.getEventSource()+":"+Controllers.getEventControlIndex()+":"+Controllers.isEventButton());
- System.out.println("\t"+Controllers.isEventXAxis()+":"+Controllers.isEventYAxis());
- }
-
- for (int i=0;i<count;i++) {
- controllerWindows[i].updateDetails();
- }
- }
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.input;
+
+import java.awt.Dimension;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTextField;
+
+import org.lwjgl.input.Controller;
+import org.lwjgl.input.Controllers;
+
+/**
+ * Oops. Forgot to document this one.
+ *
+ * @author Kevin Glass
+ */
+public class TestControllers extends JPanel {
+ public static int total = 0;
+
+ private JTextField[] values;
+ private JTextField[] names;
+ private Controller controller;
+ private int buttonCount;
+ private int itemCount;
+
+ public TestControllers(int index) {
+ controller = Controllers.getController(index);
+ setLayout(null);
+
+ buttonCount = controller.getButtonCount();
+ itemCount = controller.getButtonCount() + controller.getAxisCount() + 2;
+ values = new JTextField[itemCount];
+ names = new JTextField[itemCount];
+
+ for (int i=0;i<controller.getButtonCount();i++) {
+ names[i] = new JTextField();
+ names[i].setEditable(false);
+ names[i].setBounds(0,i*30,100,30);
+ names[i].setText(controller.getButtonName(i));
+ add(names[i]);
+ values[i] = new JTextField();
+ values[i].setEditable(false);
+ values[i].setBounds(100,i*30,100,30);
+ add(values[i]);
+ }
+ for (int i=buttonCount;i<buttonCount+controller.getAxisCount();i++) {
+ names[i] = new JTextField();
+ names[i].setEditable(false);
+ names[i].setBounds(0,i*30,100,30);
+ names[i].setText(controller.getAxisName(i-buttonCount));
+ add(names[i]);
+ values[i] = new JTextField();
+ values[i].setEditable(false);
+ values[i].setBounds(100,i*30,100,30);
+ add(values[i]);
+ }
+
+ int i = itemCount - 2;
+ names[i] = new JTextField();
+ names[i].setEditable(false);
+ names[i].setBounds(0,i*30,100,30);
+ names[i].setText("POV X");
+ add(names[i]);
+ values[i] = new JTextField();
+ values[i].setEditable(false);
+ values[i].setBounds(100,i*30,100,30);
+ add(values[i]);
+
+ i = itemCount - 1;
+ names[i] = new JTextField();
+ names[i].setEditable(false);
+ names[i].setBounds(0,i*30,100,30);
+ names[i].setText("POV Y");
+ add(names[i]);
+ values[i] = new JTextField();
+ values[i].setEditable(false);
+ values[i].setBounds(100,i*30,100,30);
+ add(values[i]);
+
+ total++;
+
+ setPreferredSize(new Dimension(200,30*itemCount));
+ JFrame frame = new JFrame(controller.getName());
+ frame.setContentPane(new JScrollPane(this));
+ frame.addWindowListener(new WindowAdapter() {
+ public void windowClosing(WindowEvent e) {
+ total--;
+ if (total == 0) {
+ System.exit(0);
+ }
+ }
+ });
+ frame.setSize(230,400);
+ frame.setLocation(index*30,index*30);
+ frame.setVisible(true);
+ }
+
+ public void updateDetails() {
+ for (int i=0;i<controller.getButtonCount();i++) {
+ values[i].setText(""+controller.isButtonPressed(i));
+ }
+ for (int i=buttonCount;i<buttonCount+controller.getAxisCount();i++) {
+ values[i].setText(""+controller.getAxisValue(i-buttonCount));
+ }
+
+ values[itemCount-2].setText(""+controller.getPovX());
+ values[itemCount-1].setText(""+controller.getPovY());
+ }
+
+ public static void main(String[] argv) {
+ try {
+ Controllers.create();
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.exit(0);
+ }
+
+ int count = Controllers.getControllerCount();
+ System.out.println(count+" Controllers Found");
+ for (int i=0;i<count;i++) {
+ Controller controller = Controllers.getController(i);
+ System.out.println(controller.getName());
+ }
+
+ if (count == 0) {
+ System.exit(0);
+ }
+
+ TestControllers[] controllerWindows = new TestControllers[count];
+ for (int i=0;i<count;i++) {
+ controllerWindows[i] = new TestControllers(i);
+ }
+
+ boolean running = true;
+ while (running) {
+ try { Thread.sleep(100); } catch (Exception e) {};
+
+ Controllers.poll();
+
+ while (Controllers.next()) {
+ System.out.println("Event Fired: ");
+ System.out.println("\t"+Controllers.getEventNanoseconds());
+ System.out.println("\t"+Controllers.getEventSource()+":"+Controllers.getEventControlIndex()+":"+Controllers.isEventButton());
+ System.out.println("\t"+Controllers.isEventXAxis()+":"+Controllers.isEventYAxis());
+ }
+
+ for (int i=0;i<count;i++) {
+ controllerWindows[i].updateDetails();
+ }
+ }
+ }
+}
diff --git a/src/java/org/lwjgl/test/openal/ALCCaptureTest.java b/src/java/org/lwjgl/test/openal/ALCCaptureTest.java
index c3df9fb..25d71e0 100644
--- a/src/java/org/lwjgl/test/openal/ALCCaptureTest.java
+++ b/src/java/org/lwjgl/test/openal/ALCCaptureTest.java
@@ -1,154 +1,154 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.openal;
-
-import java.nio.ByteBuffer;
-import java.nio.IntBuffer;
-
-import org.lwjgl.BufferUtils;
-import org.lwjgl.openal.AL;
-import org.lwjgl.openal.AL10;
-import org.lwjgl.openal.ALC10;
-import org.lwjgl.openal.ALC11;
-import org.lwjgl.openal.ALCdevice;
-import org.lwjgl.openal.OpenALException;
-
-/**
- *
- * This is a test for the ALC part of OpenAL
- *
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 2286 $
- * $Id: ALCTest.java 2286 2006-03-23 19:32:21Z matzon $
- */
-public class ALCCaptureTest extends BasicTest {
-
- /**
- * Creates an instance of ALCTest
- */
- public ALCCaptureTest() {
- super();
- }
-
- /**
- * Runs the actual test, using supplied arguments
- */
- protected void execute(String[] args) {
- int lastError = ALC10.ALC_NO_ERROR;
- IntBuffer sampleCount = BufferUtils.createIntBuffer(1);
-
- int state = AL10.AL_PLAYING;
- int FMT = AL10.AL_FORMAT_MONO16;
- int FMTSIZE = 16/8;
- int FREQ = 44100;
- int TIME = 5;
- int SAMPS = (FREQ * TIME);
- ByteBuffer buf = BufferUtils.createByteBuffer(SAMPS * FMTSIZE);
-
- // check that capture is available
- if(!ALC10.alcIsExtensionPresent(AL.getDevice(), "ALC_EXT_CAPTURE")) {
- throw new OpenALException("ALC_EXT_CAPTURE extension not available");
- }
-
- // get list of devices
- String[] captureDevices = ALC10.alcGetString(null, ALC11.ALC_CAPTURE_DEVICE_SPECIFIER).split("\0");
- System.out.println("Available Capture Devices: ");
- for(int i=0; i<captureDevices.length; i++) {
- System.out.println(i + ": " + captureDevices[i]);
- }
-
- String defaultRecorder = ALC10.alcGetString(AL.getDevice(), ALC11.ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER);
- System.out.println("Default capture device: " + defaultRecorder);
-
- ALCdevice device = ALC11.alcCaptureOpenDevice(null, FREQ, FMT, SAMPS);
-
- if(device != null) {
- // record some sound
- // =====================================
- System.out.print("Recording using " + ALC10.alcGetString(device, ALC11.ALC_CAPTURE_DEVICE_SPECIFIER) + "...");
- ALC11.alcCaptureStart(device);
- while (sampleCount.get(0) < SAMPS) {
- pause(1000);
- ALC10.alcGetInteger(device, ALC11.ALC_CAPTURE_SAMPLES, sampleCount);
- }
- System.out.println("done");
- ALC11.alcCaptureStop(device);
-
- // capure the samples
- ALC11.alcCaptureSamples(device, buf, SAMPS);
- ALC11.alcCaptureCloseDevice(device);
- // -------------------------------------
-
- // play back recording
- // ===================
- IntBuffer buffers = BufferUtils.createIntBuffer(1);
- IntBuffer sources = BufferUtils.createIntBuffer(1);
-
- buffers.position(0).limit(1);
- AL10.alGenBuffers(buffers);
-
- sources.position(0).limit(1);
- AL10.alGenSources(sources);
-
- System.out.print("Playing...");
-
- AL10.alBufferData(buffers.get(0), FMT, buf, FREQ);
- AL10.alSourcei(sources.get(0), AL10.AL_BUFFER, buffers.get(0));
- AL10.alSourcei(sources.get(0), AL10.AL_LOOPING, AL10.AL_FALSE);
- AL10.alSourcePlay(sources.get(0));
-
- while (state == AL10.AL_PLAYING)
- {
- pause(100);
- state = AL10.alGetSourcei(sources.get(0), AL10.AL_SOURCE_STATE);
- }
-
- System.out.println("done");
-
- AL10.alDeleteSources(sources);
- AL10.alDeleteBuffers(buffers);
- }
-
- alExit();
- }
-
- /**
- * main entry point
- *
- * @param args String array containing arguments
- */
- public static void main(String[] args) {
- ALCCaptureTest alcTest = new ALCCaptureTest();
- alcTest.execute(args);
- System.exit(0);
- }
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.openal;
+
+import java.nio.ByteBuffer;
+import java.nio.IntBuffer;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.openal.AL;
+import org.lwjgl.openal.AL10;
+import org.lwjgl.openal.ALC10;
+import org.lwjgl.openal.ALC11;
+import org.lwjgl.openal.ALCdevice;
+import org.lwjgl.openal.OpenALException;
+
+/**
+ *
+ * This is a test for the ALC part of OpenAL
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 2286 $
+ * $Id: ALCTest.java 2286 2006-03-23 19:32:21Z matzon $
+ */
+public class ALCCaptureTest extends BasicTest {
+
+ /**
+ * Creates an instance of ALCTest
+ */
+ public ALCCaptureTest() {
+ super();
+ }
+
+ /**
+ * Runs the actual test, using supplied arguments
+ */
+ protected void execute(String[] args) {
+ int lastError = ALC10.ALC_NO_ERROR;
+ IntBuffer sampleCount = BufferUtils.createIntBuffer(1);
+
+ int state = AL10.AL_PLAYING;
+ int FMT = AL10.AL_FORMAT_MONO16;
+ int FMTSIZE = 16/8;
+ int FREQ = 44100;
+ int TIME = 5;
+ int SAMPS = (FREQ * TIME);
+ ByteBuffer buf = BufferUtils.createByteBuffer(SAMPS * FMTSIZE);
+
+ // check that capture is available
+ if(!ALC10.alcIsExtensionPresent(AL.getDevice(), "ALC_EXT_CAPTURE")) {
+ throw new OpenALException("ALC_EXT_CAPTURE extension not available");
+ }
+
+ // get list of devices
+ String[] captureDevices = ALC10.alcGetString(null, ALC11.ALC_CAPTURE_DEVICE_SPECIFIER).split("\0");
+ System.out.println("Available Capture Devices: ");
+ for(int i=0; i<captureDevices.length; i++) {
+ System.out.println(i + ": " + captureDevices[i]);
+ }
+
+ String defaultRecorder = ALC10.alcGetString(AL.getDevice(), ALC11.ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER);
+ System.out.println("Default capture device: " + defaultRecorder);
+
+ ALCdevice device = ALC11.alcCaptureOpenDevice(null, FREQ, FMT, SAMPS);
+
+ if(device != null) {
+ // record some sound
+ // =====================================
+ System.out.print("Recording using " + ALC10.alcGetString(device, ALC11.ALC_CAPTURE_DEVICE_SPECIFIER) + "...");
+ ALC11.alcCaptureStart(device);
+ while (sampleCount.get(0) < SAMPS) {
+ pause(1000);
+ ALC10.alcGetInteger(device, ALC11.ALC_CAPTURE_SAMPLES, sampleCount);
+ }
+ System.out.println("done");
+ ALC11.alcCaptureStop(device);
+
+ // capure the samples
+ ALC11.alcCaptureSamples(device, buf, SAMPS);
+ ALC11.alcCaptureCloseDevice(device);
+ // -------------------------------------
+
+ // play back recording
+ // ===================
+ IntBuffer buffers = BufferUtils.createIntBuffer(1);
+ IntBuffer sources = BufferUtils.createIntBuffer(1);
+
+ buffers.position(0).limit(1);
+ AL10.alGenBuffers(buffers);
+
+ sources.position(0).limit(1);
+ AL10.alGenSources(sources);
+
+ System.out.print("Playing...");
+
+ AL10.alBufferData(buffers.get(0), FMT, buf, FREQ);
+ AL10.alSourcei(sources.get(0), AL10.AL_BUFFER, buffers.get(0));
+ AL10.alSourcei(sources.get(0), AL10.AL_LOOPING, AL10.AL_FALSE);
+ AL10.alSourcePlay(sources.get(0));
+
+ while (state == AL10.AL_PLAYING)
+ {
+ pause(100);
+ state = AL10.alGetSourcei(sources.get(0), AL10.AL_SOURCE_STATE);
+ }
+
+ System.out.println("done");
+
+ AL10.alDeleteSources(sources);
+ AL10.alDeleteBuffers(buffers);
+ }
+
+ alExit();
+ }
+
+ /**
+ * main entry point
+ *
+ * @param args String array containing arguments
+ */
+ public static void main(String[] args) {
+ ALCCaptureTest alcTest = new ALCCaptureTest();
+ alcTest.execute(args);
+ System.exit(0);
+ }
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/test/openal/ALCTest.java b/src/java/org/lwjgl/test/openal/ALCTest.java
index fef5569..9d0f3f4 100644
--- a/src/java/org/lwjgl/test/openal/ALCTest.java
+++ b/src/java/org/lwjgl/test/openal/ALCTest.java
@@ -1,110 +1,110 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.openal;
-
-import java.nio.IntBuffer;
-
-import org.lwjgl.BufferUtils;
-import org.lwjgl.openal.AL;
-import org.lwjgl.openal.ALC10;
-
-/**
- *
- * This is a test for the ALC part of OpenAL
- *
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 2983 $
- * $Id: ALCTest.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public class ALCTest extends BasicTest {
-
- /**
- * Creates an instance of ALCTest
- */
- public ALCTest() {
- super();
- }
-
- /**
- * Runs the actual test, using supplied arguments
- */
- protected void execute(String[] args) {
- //error stuff
- int lastError = ALC10.ALC_NO_ERROR;
-
- //create attribute list for context creation
- IntBuffer buffer = BufferUtils.createIntBuffer(7);
-
- if ((lastError = ALC10.alcGetError(AL.getDevice())) != ALC10.ALC_NO_ERROR) {
- System.out.println("ALC Error: " + ALC10.alcGetString(AL.getDevice(), lastError));
- System.exit(-1);
- }
-
- //query
- System.out.println(
- "DEFAULT_DEVICE_SPECIFIER: "
- + ALC10.alcGetString(AL.getDevice(), ALC10.ALC_DEFAULT_DEVICE_SPECIFIER));
- System.out.println(
- "DEVICE_SPECIFIER: " + ALC10.alcGetString(AL.getDevice(), ALC10.ALC_DEVICE_SPECIFIER));
- System.out.println("EXTENSIONS: " + ALC10.alcGetString(AL.getDevice(), ALC10.ALC_EXTENSIONS));
-
- //mo query
- buffer.rewind();
- buffer.position(0);
- ALC10.alcGetInteger(AL.getDevice(), ALC10.ALC_MAJOR_VERSION, buffer);
- ALC10.alcGetInteger(AL.getDevice(), ALC10.ALC_MINOR_VERSION, (IntBuffer) buffer.position(1));
-
- System.out.println("ALC_MAJOR_VERSION: " + buffer.get(0));
- System.out.println("ALC_MINOR_VERSION: " + buffer.get(1));
-
- //no check for ALC_ALL_ATTRIBUTES / ALC_ATTRIBUTES_SIZE since it
- //is buggy on win32 - my dev platform
-
- //get an enumerstion value
- System.out.println(
- "Value of ALC_MAJOR_VERSION: "
- + ALC10.alcGetEnumValue(AL.getDevice(), "ALC_MAJOR_VERSION"));
-
- alExit();
- }
-
- /**
- * main entry point
- *
- * @param args String array containing arguments
- */
- public static void main(String[] args) {
- ALCTest alcTest = new ALCTest();
- alcTest.execute(args);
- System.exit(0);
- }
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.openal;
+
+import java.nio.IntBuffer;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.openal.AL;
+import org.lwjgl.openal.ALC10;
+
+/**
+ *
+ * This is a test for the ALC part of OpenAL
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 2983 $
+ * $Id: ALCTest.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public class ALCTest extends BasicTest {
+
+ /**
+ * Creates an instance of ALCTest
+ */
+ public ALCTest() {
+ super();
+ }
+
+ /**
+ * Runs the actual test, using supplied arguments
+ */
+ protected void execute(String[] args) {
+ //error stuff
+ int lastError = ALC10.ALC_NO_ERROR;
+
+ //create attribute list for context creation
+ IntBuffer buffer = BufferUtils.createIntBuffer(7);
+
+ if ((lastError = ALC10.alcGetError(AL.getDevice())) != ALC10.ALC_NO_ERROR) {
+ System.out.println("ALC Error: " + ALC10.alcGetString(AL.getDevice(), lastError));
+ System.exit(-1);
+ }
+
+ //query
+ System.out.println(
+ "DEFAULT_DEVICE_SPECIFIER: "
+ + ALC10.alcGetString(AL.getDevice(), ALC10.ALC_DEFAULT_DEVICE_SPECIFIER));
+ System.out.println(
+ "DEVICE_SPECIFIER: " + ALC10.alcGetString(AL.getDevice(), ALC10.ALC_DEVICE_SPECIFIER));
+ System.out.println("EXTENSIONS: " + ALC10.alcGetString(AL.getDevice(), ALC10.ALC_EXTENSIONS));
+
+ //mo query
+ buffer.rewind();
+ buffer.position(0);
+ ALC10.alcGetInteger(AL.getDevice(), ALC10.ALC_MAJOR_VERSION, buffer);
+ ALC10.alcGetInteger(AL.getDevice(), ALC10.ALC_MINOR_VERSION, (IntBuffer) buffer.position(1));
+
+ System.out.println("ALC_MAJOR_VERSION: " + buffer.get(0));
+ System.out.println("ALC_MINOR_VERSION: " + buffer.get(1));
+
+ //no check for ALC_ALL_ATTRIBUTES / ALC_ATTRIBUTES_SIZE since it
+ //is buggy on win32 - my dev platform
+
+ //get an enumerstion value
+ System.out.println(
+ "Value of ALC_MAJOR_VERSION: "
+ + ALC10.alcGetEnumValue(AL.getDevice(), "ALC_MAJOR_VERSION"));
+
+ alExit();
+ }
+
+ /**
+ * main entry point
+ *
+ * @param args String array containing arguments
+ */
+ public static void main(String[] args) {
+ ALCTest alcTest = new ALCTest();
+ alcTest.execute(args);
+ System.exit(0);
+ }
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/test/openal/BasicTest.java b/src/java/org/lwjgl/test/openal/BasicTest.java
index 8ca68de..c0763f8 100644
--- a/src/java/org/lwjgl/test/openal/BasicTest.java
+++ b/src/java/org/lwjgl/test/openal/BasicTest.java
@@ -1,140 +1,140 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.openal;
-
-import java.nio.FloatBuffer;
-
-import org.lwjgl.BufferUtils;
-import org.lwjgl.openal.AL;
-import org.lwjgl.openal.AL10;
-import org.lwjgl.openal.ALC10;
-import org.lwjgl.opengl.DisplayMode;
-
-/**
- *
- * This is a basic test, which contains the most used stuff
- *
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 2983 $
- * $Id: BasicTest.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public abstract class BasicTest {
-
- /**
- * Creates an instance of PlayTest
- */
- public BasicTest() {
- try {
- AL.create();
-
- System.out.println("Default device: " + ALC10.alcGetString(null, ALC10.ALC_DEFAULT_DEVICE_SPECIFIER));
-
- if(ALC10.alcIsExtensionPresent(null, "ALC_ENUMERATION_EXT")) {
- String[] devices = ALC10.alcGetString(null, ALC10.ALC_DEVICE_SPECIFIER).split("\0");
- System.out.println("Available devices: ");
- for(int i=0; i<devices.length; i++) {
- System.out.println(i +": " + devices[i]);
- }
- }
- } catch (Exception e) {
- System.out.println("Unable to create OpenAL.\nPlease make sure that OpenAL is available on this system. Exception: " + e);
- return;
- }
- }
-
- /**
- * Shutdowns OpenAL
- */
- protected void alExit() {
- if(AL.isCreated()) {
- AL.destroy();
- }
- }
-
- /**
- * Creates a float buffer to hold specified float array
- * - strictly a utility method
- *
- * @param array to hold
- * @return created FloatBuffer
- */
- protected FloatBuffer createFloatBuffer(float[] data) {
- FloatBuffer temp = BufferUtils.createFloatBuffer(data.length).put(data);
- temp.flip();
- return temp;
- }
-
- /**
- * Pauses the invoking thread for specified milliseconds
- *
- * @param time Milliseconds to sleep
- */
- protected void pause(long time) {
- try {
- Thread.sleep(time);
- } catch (InterruptedException inte) {
- }
- }
-
- /**
- * Exits the test NOW, printing errorcode to stdout
- *
- * @param error Error code causing exit
- */
- protected void exit(int error) {
- System.out.println("OpenAL Error: " + AL10.alGetString(error));
- alExit();
- System.exit(-1);
- }
-
- /**
- * Sets the display mode for fullscreen mode
- */
- protected boolean setDisplayMode() {
- try {
- // get modes
- DisplayMode[] dm = org.lwjgl.util.Display.getAvailableDisplayModes(640, 480, -1, -1, -1, -1, 60, 60);
-
- org.lwjgl.util.Display.setDisplayMode(dm, new String[] {
- "width=" + 640,
- "height=" + 480,
- "freq=" + 60,
- "bpp=" + org.lwjgl.opengl.Display.getDisplayMode().getBitsPerPixel()
- });
- return true;
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- return false;
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.openal;
+
+import java.nio.FloatBuffer;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.openal.AL;
+import org.lwjgl.openal.AL10;
+import org.lwjgl.openal.ALC10;
+import org.lwjgl.opengl.DisplayMode;
+
+/**
+ *
+ * This is a basic test, which contains the most used stuff
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 2983 $
+ * $Id: BasicTest.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public abstract class BasicTest {
+
+ /**
+ * Creates an instance of PlayTest
+ */
+ public BasicTest() {
+ try {
+ AL.create();
+
+ System.out.println("Default device: " + ALC10.alcGetString(null, ALC10.ALC_DEFAULT_DEVICE_SPECIFIER));
+
+ if(ALC10.alcIsExtensionPresent(null, "ALC_ENUMERATION_EXT")) {
+ String[] devices = ALC10.alcGetString(null, ALC10.ALC_DEVICE_SPECIFIER).split("\0");
+ System.out.println("Available devices: ");
+ for(int i=0; i<devices.length; i++) {
+ System.out.println(i +": " + devices[i]);
+ }
+ }
+ } catch (Exception e) {
+ System.out.println("Unable to create OpenAL.\nPlease make sure that OpenAL is available on this system. Exception: " + e);
+ return;
+ }
+ }
+
+ /**
+ * Shutdowns OpenAL
+ */
+ protected void alExit() {
+ if(AL.isCreated()) {
+ AL.destroy();
+ }
+ }
+
+ /**
+ * Creates a float buffer to hold specified float array
+ * - strictly a utility method
+ *
+ * @param array to hold
+ * @return created FloatBuffer
+ */
+ protected FloatBuffer createFloatBuffer(float[] data) {
+ FloatBuffer temp = BufferUtils.createFloatBuffer(data.length).put(data);
+ temp.flip();
+ return temp;
+ }
+
+ /**
+ * Pauses the invoking thread for specified milliseconds
+ *
+ * @param time Milliseconds to sleep
+ */
+ protected void pause(long time) {
+ try {
+ Thread.sleep(time);
+ } catch (InterruptedException inte) {
+ }
+ }
+
+ /**
+ * Exits the test NOW, printing errorcode to stdout
+ *
+ * @param error Error code causing exit
+ */
+ protected void exit(int error) {
+ System.out.println("OpenAL Error: " + AL10.alGetString(error));
+ alExit();
+ System.exit(-1);
+ }
+
+ /**
+ * Sets the display mode for fullscreen mode
+ */
+ protected boolean setDisplayMode() {
+ try {
+ // get modes
+ DisplayMode[] dm = org.lwjgl.util.Display.getAvailableDisplayModes(640, 480, -1, -1, -1, -1, 60, 60);
+
+ org.lwjgl.util.Display.setDisplayMode(dm, new String[] {
+ "width=" + 640,
+ "height=" + 480,
+ "freq=" + 60,
+ "bpp=" + org.lwjgl.opengl.Display.getDisplayMode().getBitsPerPixel()
+ });
+ return true;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ return false;
+ }
+}
diff --git a/src/java/org/lwjgl/test/openal/MovingSoundTest.java b/src/java/org/lwjgl/test/openal/MovingSoundTest.java
index 60790ab..bf8b65d 100644
--- a/src/java/org/lwjgl/test/openal/MovingSoundTest.java
+++ b/src/java/org/lwjgl/test/openal/MovingSoundTest.java
@@ -1,218 +1,218 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.openal;
-
-import java.nio.IntBuffer;
-
-import org.lwjgl.BufferUtils;
-import org.lwjgl.input.Keyboard;
-import org.lwjgl.openal.AL10;
-import org.lwjgl.opengl.Display;
-import org.lwjgl.util.WaveData;
-import org.lwjgl.util.vector.Vector3f;
-
-/**
- *
- * This test simulates a listener positioned in the center, and
- * a source moving around the listener using the keyboard
- *
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 2983 $
- * $Id: MovingSoundTest.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public class MovingSoundTest extends BasicTest {
-
- public static float MOVEMENT = 50.00f;
-
- /**
- * Creates an instance of MovingSoundTest
- */
- public MovingSoundTest() {
- super();
- }
-
- /**
- * Runs the actual test, using supplied arguments
- */
- protected void execute(String[] args) {
- if (args.length < 1) {
- System.out.println("no argument supplied, assuming Footsteps.wav");
- args = new String[] {"Footsteps.wav"};
- }
-
- try {
- setDisplayMode();
- Display.create();
- } catch (Exception e) {
- e.printStackTrace();
- }
-
-
- int lastError;
- Vector3f sourcePosition = new Vector3f();
- Vector3f listenerPosition = new Vector3f();
-
- //initialize keyboard
- try {
- Keyboard.create();
- } catch (Exception e) {
- e.printStackTrace();
- exit(-1);
- }
-
- //create 1 buffer and 1 source
- IntBuffer buffers = BufferUtils.createIntBuffer(1);
- IntBuffer sources = BufferUtils.createIntBuffer(1);
-
- // al generate buffers and sources
- buffers.position(0).limit(1);
- AL10.alGenBuffers(buffers);
- if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- sources.position(0).limit(1);
- AL10.alGenSources(sources);
- if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- //load wave data
- WaveData wavefile = WaveData.create(args[0]);
-
- //copy to buffers
- AL10.alBufferData(
- buffers.get(0),
- wavefile.format,
- wavefile.data,
- wavefile.samplerate);
- if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- //unload file again
- wavefile.dispose();
-
- //set up source input
- AL10.alSourcei(sources.get(0), AL10.AL_BUFFER, buffers.get(0));
- if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- AL10.alSourcef(sources.get(0), AL10.AL_REFERENCE_DISTANCE, 1024.0f);
- AL10.alSourcef(sources.get(0), AL10.AL_ROLLOFF_FACTOR, 0.5f);
-
- //lets loop the sound
- AL10.alSourcei(sources.get(0), AL10.AL_LOOPING, AL10.AL_TRUE);
- if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- //play source 0
- AL10.alSourcePlay(sources.get(0));
- if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- System.out.println("Move source with arrow keys\nMove listener with right shift and arrowkeys\nExit with ESC");
-
- while(!Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)) {
- Display.update();
-
- Keyboard.poll();
- if(Keyboard.isKeyDown(Keyboard.KEY_LEFT)) {
- if(Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) {
- listenerPosition.x -= MOVEMENT;
- AL10.alListener3f(AL10.AL_POSITION, listenerPosition.x, listenerPosition.y, listenerPosition.z);
- System.out.println("listenerx: " + listenerPosition.x);
- } else {
- sourcePosition.x -= MOVEMENT;
- AL10.alSource3f(sources.get(0), AL10.AL_POSITION, sourcePosition.x, sourcePosition.y, sourcePosition.z);
- System.out.println("sourcex: " + sourcePosition.x);
- }
- }
- if(Keyboard.isKeyDown(Keyboard.KEY_RIGHT)) {
- if(Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) {
- listenerPosition.x += MOVEMENT;
- AL10.alListener3f(AL10.AL_POSITION, listenerPosition.x, listenerPosition.y, listenerPosition.z);
- System.out.println("listenerx: " + listenerPosition.x);
- } else {
- sourcePosition.x += MOVEMENT;
- AL10.alSource3f(sources.get(0), AL10.AL_POSITION, sourcePosition.x, sourcePosition.y, sourcePosition.z);
- System.out.println("sourcex: " + sourcePosition.x);
- }
- }
-
- if(Display.isCloseRequested()) {
- break;
- }
-
- try {
- Thread.sleep(100);
- } catch (InterruptedException inte) {
- }
- }
-
- //stop source 0
- AL10.alSourceStop(sources.get(0));
- if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- //delete buffers and sources
- sources.position(0).limit(1);
- AL10.alDeleteSources(sources);
- if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- buffers.position(0).limit(1);
- AL10.alDeleteBuffers(buffers);
- if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- //shutdown
- alExit();
- }
-
- /**
- * main entry point
- *
- * @param args String array containing arguments
- */
- public static void main(String[] args) {
- MovingSoundTest movingSoundTest = new MovingSoundTest();
- movingSoundTest.execute(args);
- System.exit(0);
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.openal;
+
+import java.nio.IntBuffer;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.input.Keyboard;
+import org.lwjgl.openal.AL10;
+import org.lwjgl.opengl.Display;
+import org.lwjgl.util.WaveData;
+import org.lwjgl.util.vector.Vector3f;
+
+/**
+ *
+ * This test simulates a listener positioned in the center, and
+ * a source moving around the listener using the keyboard
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 2983 $
+ * $Id: MovingSoundTest.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public class MovingSoundTest extends BasicTest {
+
+ public static float MOVEMENT = 50.00f;
+
+ /**
+ * Creates an instance of MovingSoundTest
+ */
+ public MovingSoundTest() {
+ super();
+ }
+
+ /**
+ * Runs the actual test, using supplied arguments
+ */
+ protected void execute(String[] args) {
+ if (args.length < 1) {
+ System.out.println("no argument supplied, assuming Footsteps.wav");
+ args = new String[] {"Footsteps.wav"};
+ }
+
+ try {
+ setDisplayMode();
+ Display.create();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+
+ int lastError;
+ Vector3f sourcePosition = new Vector3f();
+ Vector3f listenerPosition = new Vector3f();
+
+ //initialize keyboard
+ try {
+ Keyboard.create();
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(-1);
+ }
+
+ //create 1 buffer and 1 source
+ IntBuffer buffers = BufferUtils.createIntBuffer(1);
+ IntBuffer sources = BufferUtils.createIntBuffer(1);
+
+ // al generate buffers and sources
+ buffers.position(0).limit(1);
+ AL10.alGenBuffers(buffers);
+ if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ sources.position(0).limit(1);
+ AL10.alGenSources(sources);
+ if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ //load wave data
+ WaveData wavefile = WaveData.create(args[0]);
+
+ //copy to buffers
+ AL10.alBufferData(
+ buffers.get(0),
+ wavefile.format,
+ wavefile.data,
+ wavefile.samplerate);
+ if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ //unload file again
+ wavefile.dispose();
+
+ //set up source input
+ AL10.alSourcei(sources.get(0), AL10.AL_BUFFER, buffers.get(0));
+ if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ AL10.alSourcef(sources.get(0), AL10.AL_REFERENCE_DISTANCE, 1024.0f);
+ AL10.alSourcef(sources.get(0), AL10.AL_ROLLOFF_FACTOR, 0.5f);
+
+ //lets loop the sound
+ AL10.alSourcei(sources.get(0), AL10.AL_LOOPING, AL10.AL_TRUE);
+ if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ //play source 0
+ AL10.alSourcePlay(sources.get(0));
+ if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ System.out.println("Move source with arrow keys\nMove listener with right shift and arrowkeys\nExit with ESC");
+
+ while(!Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)) {
+ Display.update();
+
+ Keyboard.poll();
+ if(Keyboard.isKeyDown(Keyboard.KEY_LEFT)) {
+ if(Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) {
+ listenerPosition.x -= MOVEMENT;
+ AL10.alListener3f(AL10.AL_POSITION, listenerPosition.x, listenerPosition.y, listenerPosition.z);
+ System.out.println("listenerx: " + listenerPosition.x);
+ } else {
+ sourcePosition.x -= MOVEMENT;
+ AL10.alSource3f(sources.get(0), AL10.AL_POSITION, sourcePosition.x, sourcePosition.y, sourcePosition.z);
+ System.out.println("sourcex: " + sourcePosition.x);
+ }
+ }
+ if(Keyboard.isKeyDown(Keyboard.KEY_RIGHT)) {
+ if(Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) {
+ listenerPosition.x += MOVEMENT;
+ AL10.alListener3f(AL10.AL_POSITION, listenerPosition.x, listenerPosition.y, listenerPosition.z);
+ System.out.println("listenerx: " + listenerPosition.x);
+ } else {
+ sourcePosition.x += MOVEMENT;
+ AL10.alSource3f(sources.get(0), AL10.AL_POSITION, sourcePosition.x, sourcePosition.y, sourcePosition.z);
+ System.out.println("sourcex: " + sourcePosition.x);
+ }
+ }
+
+ if(Display.isCloseRequested()) {
+ break;
+ }
+
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException inte) {
+ }
+ }
+
+ //stop source 0
+ AL10.alSourceStop(sources.get(0));
+ if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ //delete buffers and sources
+ sources.position(0).limit(1);
+ AL10.alDeleteSources(sources);
+ if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ buffers.position(0).limit(1);
+ AL10.alDeleteBuffers(buffers);
+ if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ //shutdown
+ alExit();
+ }
+
+ /**
+ * main entry point
+ *
+ * @param args String array containing arguments
+ */
+ public static void main(String[] args) {
+ MovingSoundTest movingSoundTest = new MovingSoundTest();
+ movingSoundTest.execute(args);
+ System.exit(0);
+ }
+}
diff --git a/src/java/org/lwjgl/test/openal/OpenALCreationTest.java b/src/java/org/lwjgl/test/openal/OpenALCreationTest.java
index 959a78e..0ebbc55 100644
--- a/src/java/org/lwjgl/test/openal/OpenALCreationTest.java
+++ b/src/java/org/lwjgl/test/openal/OpenALCreationTest.java
@@ -1,225 +1,225 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.openal;
-
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.nio.IntBuffer;
-
-import org.lwjgl.openal.AL;
-import org.lwjgl.openal.AL10;
-import org.lwjgl.util.WaveData;
-
-/**
- * <br>
- * Performs a creation test, by creating and destroying OpenAL twice.
- * We cannot inherit from BasicTest since it follows another structure.
- *
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 2983 $
- * $Id: OpenALCreationTest.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public class OpenALCreationTest {
-
- /**
- * Creates an instance of OpenALCreationTest
- */
- public OpenALCreationTest() {
- }
-
- public void alInitialize() {
- try {
- AL.create();
- } catch (Exception e) {
- e.printStackTrace();
- return;
- }
- }
-
- public void alExit() {
- AL.destroy();
- }
-
- /**
- * Creates an integer buffer to hold specified ints
- * - strictly a utility method
- *
- * @param size how many int to contain
- * @return created IntBuffer
- */
- protected IntBuffer createIntBuffer(int size) {
- ByteBuffer temp = ByteBuffer.allocateDirect(4 * size);
- temp.order(ByteOrder.nativeOrder());
-
- return temp.asIntBuffer();
- }
-
- /**
- * Exits the test NOW, printing errorcode to stdout
- *
- * @param error Error code causing exit
- */
- protected void exit(int error) {
- System.out.println("OpenAL Error: " + AL10.alGetString(error));
- alExit();
- System.exit(-1);
- }
-
- /**
- * Runs the actual test, using supplied arguments
- */
- protected void execute(String[] args) {
- int lastError;
-
- //initialize AL, using ALC
- System.out.print("initialize...");
- alInitialize();
- System.out.println("success");
-
- //do some audio
- executeAudioTest();
-
- //shutdown
- System.out.print("shutdown...");
- alExit();
- System.out.println("success");
-
- //initialize AL, using ALC
- System.out.print("initialize...");
- alInitialize();
- System.out.println("success");
-
- //do some audio
- executeAudioTest();
-
- //shutdown
- System.out.print("shutdown...");
- alExit();
- System.out.println("success");
- }
-
- /**
- * Executes the audio test, which just plays some sound
- */
- private void executeAudioTest() {
- int lastError;
-
- //create 1 buffer and 1 source
- IntBuffer buffers = createIntBuffer(1);
- IntBuffer sources = createIntBuffer(1);
-
- // al generate buffers and sources
- buffers.position(0).limit(1);
- AL10.alGenBuffers(buffers);
- if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- sources.position(0).limit(1);
- AL10.alGenSources(sources);
- if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- //load wave data
- WaveData wavefile = WaveData.create("Footsteps.wav");
-
- //copy to buffers
- AL10.alBufferData(
- buffers.get(0),
- wavefile.format,
- wavefile.data,
- wavefile.samplerate);
- if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- //unload file again
- wavefile.dispose();
-
- //set up source input
- AL10.alSourcei(sources.get(0), AL10.AL_BUFFER, buffers.get(0));
- if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- //lets loop the sound
- AL10.alSourcei(sources.get(0), AL10.AL_LOOPING, AL10.AL_TRUE);
- if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- //play source 0
- AL10.alSourcePlay(sources.get(0));
- if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- //wait 5 secs
- try {
- System.out.print("Playing 'Footsteps.wav' for 2 seconds...");
- Thread.sleep(2000);
- } catch (InterruptedException inte) {
- }
- System.out.println("done");
-
- //stop source 0
- AL10.alSourceStop(sources.get(0));
- if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- //delete buffers and sources
- sources.position(0).limit(1);
- AL10.alDeleteSources(sources);
- if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- buffers.position(0).limit(1);
- AL10.alDeleteBuffers(buffers);
- if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
- }
-
- /**
- * main entry point
- *
- * @param args String array containing arguments
- */
- public static void main(String[] args) {
- OpenALCreationTest oalCreationTest = new OpenALCreationTest();
- oalCreationTest.execute(args);
- System.exit(0);
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.openal;
+
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.IntBuffer;
+
+import org.lwjgl.openal.AL;
+import org.lwjgl.openal.AL10;
+import org.lwjgl.util.WaveData;
+
+/**
+ * <br>
+ * Performs a creation test, by creating and destroying OpenAL twice.
+ * We cannot inherit from BasicTest since it follows another structure.
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 2983 $
+ * $Id: OpenALCreationTest.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public class OpenALCreationTest {
+
+ /**
+ * Creates an instance of OpenALCreationTest
+ */
+ public OpenALCreationTest() {
+ }
+
+ public void alInitialize() {
+ try {
+ AL.create();
+ } catch (Exception e) {
+ e.printStackTrace();
+ return;
+ }
+ }
+
+ public void alExit() {
+ AL.destroy();
+ }
+
+ /**
+ * Creates an integer buffer to hold specified ints
+ * - strictly a utility method
+ *
+ * @param size how many int to contain
+ * @return created IntBuffer
+ */
+ protected IntBuffer createIntBuffer(int size) {
+ ByteBuffer temp = ByteBuffer.allocateDirect(4 * size);
+ temp.order(ByteOrder.nativeOrder());
+
+ return temp.asIntBuffer();
+ }
+
+ /**
+ * Exits the test NOW, printing errorcode to stdout
+ *
+ * @param error Error code causing exit
+ */
+ protected void exit(int error) {
+ System.out.println("OpenAL Error: " + AL10.alGetString(error));
+ alExit();
+ System.exit(-1);
+ }
+
+ /**
+ * Runs the actual test, using supplied arguments
+ */
+ protected void execute(String[] args) {
+ int lastError;
+
+ //initialize AL, using ALC
+ System.out.print("initialize...");
+ alInitialize();
+ System.out.println("success");
+
+ //do some audio
+ executeAudioTest();
+
+ //shutdown
+ System.out.print("shutdown...");
+ alExit();
+ System.out.println("success");
+
+ //initialize AL, using ALC
+ System.out.print("initialize...");
+ alInitialize();
+ System.out.println("success");
+
+ //do some audio
+ executeAudioTest();
+
+ //shutdown
+ System.out.print("shutdown...");
+ alExit();
+ System.out.println("success");
+ }
+
+ /**
+ * Executes the audio test, which just plays some sound
+ */
+ private void executeAudioTest() {
+ int lastError;
+
+ //create 1 buffer and 1 source
+ IntBuffer buffers = createIntBuffer(1);
+ IntBuffer sources = createIntBuffer(1);
+
+ // al generate buffers and sources
+ buffers.position(0).limit(1);
+ AL10.alGenBuffers(buffers);
+ if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ sources.position(0).limit(1);
+ AL10.alGenSources(sources);
+ if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ //load wave data
+ WaveData wavefile = WaveData.create("Footsteps.wav");
+
+ //copy to buffers
+ AL10.alBufferData(
+ buffers.get(0),
+ wavefile.format,
+ wavefile.data,
+ wavefile.samplerate);
+ if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ //unload file again
+ wavefile.dispose();
+
+ //set up source input
+ AL10.alSourcei(sources.get(0), AL10.AL_BUFFER, buffers.get(0));
+ if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ //lets loop the sound
+ AL10.alSourcei(sources.get(0), AL10.AL_LOOPING, AL10.AL_TRUE);
+ if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ //play source 0
+ AL10.alSourcePlay(sources.get(0));
+ if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ //wait 5 secs
+ try {
+ System.out.print("Playing 'Footsteps.wav' for 2 seconds...");
+ Thread.sleep(2000);
+ } catch (InterruptedException inte) {
+ }
+ System.out.println("done");
+
+ //stop source 0
+ AL10.alSourceStop(sources.get(0));
+ if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ //delete buffers and sources
+ sources.position(0).limit(1);
+ AL10.alDeleteSources(sources);
+ if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ buffers.position(0).limit(1);
+ AL10.alDeleteBuffers(buffers);
+ if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+ }
+
+ /**
+ * main entry point
+ *
+ * @param args String array containing arguments
+ */
+ public static void main(String[] args) {
+ OpenALCreationTest oalCreationTest = new OpenALCreationTest();
+ oalCreationTest.execute(args);
+ System.exit(0);
+ }
+}
diff --git a/src/java/org/lwjgl/test/openal/OpenALInfo.java b/src/java/org/lwjgl/test/openal/OpenALInfo.java
index 8ef5f2c..20c919a 100644
--- a/src/java/org/lwjgl/test/openal/OpenALInfo.java
+++ b/src/java/org/lwjgl/test/openal/OpenALInfo.java
@@ -1,173 +1,173 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.openal;
-
-import java.nio.IntBuffer;
-
-import org.lwjgl.BufferUtils;
-import org.lwjgl.LWJGLException;
-import org.lwjgl.openal.AL;
-import org.lwjgl.openal.AL10;
-import org.lwjgl.openal.ALC10;
-import org.lwjgl.openal.ALC11;
-import org.lwjgl.openal.ALCdevice;
-
-/**
- *
- * idea from openal-info
- *
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 2983 $
- * $Id$
- */
-public class OpenALInfo {
-
- /**
- * Creates an instance of OpenALInfo
- */
- public OpenALInfo() {
- }
-
- /**
- * Runs the actual test, using supplied arguments
- */
- protected void execute(String[] args) {
- try {
- AL.create(null, -1, 60, false);
- checkForErrors();
- } catch (LWJGLException le) {
- die("Init", le.getMessage());
- }
-
- printALCInfo();
- printALInfo();
-
- checkForErrors();
-
- AL.destroy();
- }
-
- private void printALCInfo() {
- IntBuffer version = BufferUtils.createIntBuffer(2);
- ALCdevice device;
-
- if(ALC10.alcIsExtensionPresent(null, "ALC_ENUMERATION_EXT")) {
- if(ALC10.alcIsExtensionPresent(null, "ALC_ENUMERATE_ALL_EXT")) {
- printDevices(ALC11.ALC_ALL_DEVICES_SPECIFIER, "playback");
- } else {
- printDevices(ALC10.ALC_DEVICE_SPECIFIER, "playback");
- }
- printDevices(ALC11.ALC_CAPTURE_DEVICE_SPECIFIER, "capture");
- } else {
- System.out.println("No device enumeration available");
- }
-
- device = ALC10.alcGetContextsDevice(ALC10.alcGetCurrentContext());
- checkForErrors();
-
- System.out.println("Default device: " + ALC10.alcGetString(device, ALC10.ALC_DEFAULT_DEVICE_SPECIFIER));
-
- System.out.println("Default capture device: " + ALC10.alcGetString(device, ALC11.ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER));
-
- ALC10.alcGetInteger(AL.getDevice(), ALC10.ALC_MAJOR_VERSION, version);
- ALC10.alcGetInteger(AL.getDevice(), ALC10.ALC_MINOR_VERSION, (IntBuffer) version.position(1));
- checkForErrors();
-
- System.out.println("ALC version: " + (int)version.get(0) + "." + (int)version.get(1));
-
- System.out.println("ALC extensions:");
- String[] extensions = ALC10.alcGetString(device, ALC10.ALC_EXTENSIONS).split(" ");
- for(int i=0; i<extensions.length; i++) {
- if(extensions[i].trim().length() == 0) {
- continue;
- }
- System.out.println(" " + extensions[i]);
- }
- checkForErrors();
- }
-
- private void printALInfo() {
- System.out.println("OpenAL vendor string: " + AL10.alGetString(AL10.AL_VENDOR));
- System.out.println("OpenAL renderer string: " + AL10.alGetString(AL10.AL_RENDERER));
- System.out.println("OpenAL version string: " + AL10.alGetString(AL10.AL_VERSION));
- System.out.println("AL extensions:");
- String[] extensions = AL10.alGetString(AL10.AL_EXTENSIONS).split(" ");
- for(int i=0; i<extensions.length; i++) {
- if(extensions[i].trim().length() == 0) {
- continue;
- }
- System.out.println(" " + extensions[i]);
- }
- checkForErrors();
- }
-
- private void printDevices(int which, String kind) {
- String[] devices = ALC10.alcGetString(null, which).split("\0");
- checkForErrors();
-
- System.out.println("Available " + kind + " devices: ");
- for(int i=0; i<devices.length; i++) {
- System.out.println(" " + devices[i]);
- }
- }
-
- private void die(String kind, String description) {
- System.out.println(kind + " error " + description + " occured");
- }
-
- private void checkForErrors() {
- {
- ALCdevice device = ALC10.alcGetContextsDevice(ALC10.alcGetCurrentContext());
- int error = ALC10.alcGetError(device);
- if(error != ALC10.ALC_NO_ERROR) {
- die("ALC", ALC10.alcGetString(device, error));
- }
- }
- {
- int error = AL10.alGetError();
- if(error != AL10.AL_NO_ERROR) {
- die("AL", AL10.alGetString(error));
- }
- }
- }
-
- /**
- * main entry point
- *
- * @param args String array containing arguments
- */
- public static void main(String[] args) {
- OpenALInfo openalInfo = new OpenALInfo();
- openalInfo.execute(args);
- System.exit(0);
- }
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.openal;
+
+import java.nio.IntBuffer;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.LWJGLException;
+import org.lwjgl.openal.AL;
+import org.lwjgl.openal.AL10;
+import org.lwjgl.openal.ALC10;
+import org.lwjgl.openal.ALC11;
+import org.lwjgl.openal.ALCdevice;
+
+/**
+ *
+ * idea from openal-info
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 2983 $
+ * $Id$
+ */
+public class OpenALInfo {
+
+ /**
+ * Creates an instance of OpenALInfo
+ */
+ public OpenALInfo() {
+ }
+
+ /**
+ * Runs the actual test, using supplied arguments
+ */
+ protected void execute(String[] args) {
+ try {
+ AL.create(null, -1, 60, false);
+ checkForErrors();
+ } catch (LWJGLException le) {
+ die("Init", le.getMessage());
+ }
+
+ printALCInfo();
+ printALInfo();
+
+ checkForErrors();
+
+ AL.destroy();
+ }
+
+ private void printALCInfo() {
+ IntBuffer version = BufferUtils.createIntBuffer(2);
+ ALCdevice device;
+
+ if(ALC10.alcIsExtensionPresent(null, "ALC_ENUMERATION_EXT")) {
+ if(ALC10.alcIsExtensionPresent(null, "ALC_ENUMERATE_ALL_EXT")) {
+ printDevices(ALC11.ALC_ALL_DEVICES_SPECIFIER, "playback");
+ } else {
+ printDevices(ALC10.ALC_DEVICE_SPECIFIER, "playback");
+ }
+ printDevices(ALC11.ALC_CAPTURE_DEVICE_SPECIFIER, "capture");
+ } else {
+ System.out.println("No device enumeration available");
+ }
+
+ device = ALC10.alcGetContextsDevice(ALC10.alcGetCurrentContext());
+ checkForErrors();
+
+ System.out.println("Default device: " + ALC10.alcGetString(device, ALC10.ALC_DEFAULT_DEVICE_SPECIFIER));
+
+ System.out.println("Default capture device: " + ALC10.alcGetString(device, ALC11.ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER));
+
+ ALC10.alcGetInteger(AL.getDevice(), ALC10.ALC_MAJOR_VERSION, version);
+ ALC10.alcGetInteger(AL.getDevice(), ALC10.ALC_MINOR_VERSION, (IntBuffer) version.position(1));
+ checkForErrors();
+
+ System.out.println("ALC version: " + (int)version.get(0) + "." + (int)version.get(1));
+
+ System.out.println("ALC extensions:");
+ String[] extensions = ALC10.alcGetString(device, ALC10.ALC_EXTENSIONS).split(" ");
+ for(int i=0; i<extensions.length; i++) {
+ if(extensions[i].trim().length() == 0) {
+ continue;
+ }
+ System.out.println(" " + extensions[i]);
+ }
+ checkForErrors();
+ }
+
+ private void printALInfo() {
+ System.out.println("OpenAL vendor string: " + AL10.alGetString(AL10.AL_VENDOR));
+ System.out.println("OpenAL renderer string: " + AL10.alGetString(AL10.AL_RENDERER));
+ System.out.println("OpenAL version string: " + AL10.alGetString(AL10.AL_VERSION));
+ System.out.println("AL extensions:");
+ String[] extensions = AL10.alGetString(AL10.AL_EXTENSIONS).split(" ");
+ for(int i=0; i<extensions.length; i++) {
+ if(extensions[i].trim().length() == 0) {
+ continue;
+ }
+ System.out.println(" " + extensions[i]);
+ }
+ checkForErrors();
+ }
+
+ private void printDevices(int which, String kind) {
+ String[] devices = ALC10.alcGetString(null, which).split("\0");
+ checkForErrors();
+
+ System.out.println("Available " + kind + " devices: ");
+ for(int i=0; i<devices.length; i++) {
+ System.out.println(" " + devices[i]);
+ }
+ }
+
+ private void die(String kind, String description) {
+ System.out.println(kind + " error " + description + " occured");
+ }
+
+ private void checkForErrors() {
+ {
+ ALCdevice device = ALC10.alcGetContextsDevice(ALC10.alcGetCurrentContext());
+ int error = ALC10.alcGetError(device);
+ if(error != ALC10.ALC_NO_ERROR) {
+ die("ALC", ALC10.alcGetString(device, error));
+ }
+ }
+ {
+ int error = AL10.alGetError();
+ if(error != AL10.AL_NO_ERROR) {
+ die("AL", AL10.alGetString(error));
+ }
+ }
+ }
+
+ /**
+ * main entry point
+ *
+ * @param args String array containing arguments
+ */
+ public static void main(String[] args) {
+ OpenALInfo openalInfo = new OpenALInfo();
+ openalInfo.execute(args);
+ System.exit(0);
+ }
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/test/openal/PlayTest.java b/src/java/org/lwjgl/test/openal/PlayTest.java
index 6eaffbc..9cc1056 100644
--- a/src/java/org/lwjgl/test/openal/PlayTest.java
+++ b/src/java/org/lwjgl/test/openal/PlayTest.java
@@ -1,221 +1,221 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.openal;
-
-import java.io.BufferedInputStream;
-import java.io.ByteArrayOutputStream;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.nio.IntBuffer;
-
-import org.lwjgl.BufferUtils;
-import org.lwjgl.openal.AL10;
-import org.lwjgl.util.WaveData;
-
-/**
- *
- * This is a basic play test
- * Yes, over zealous use of getError ;)
- *
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 2983 $
- * $Id: PlayTest.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public class PlayTest extends BasicTest {
-
- private boolean usingVorbis;
-
- /**
- * Creates an instance of PlayTest
- */
- public PlayTest() {
- super();
- }
-
- /**
- * Runs the actual test, using supplied arguments
- */
- protected void execute(String[] args) {
- if(args.length < 1) {
- System.out.println("no argument supplied, assuming Footsteps.wav");
- args = new String[] {"Footsteps.wav"};
- }
-
- if(args[0].endsWith(".ogg")) {
- System.out.print("Attempting to load Ogg Vorbis file, checking for extension...");
- if(AL10.alIsExtensionPresent("AL_EXT_vorbis")) {
- System.out.println("found");
- usingVorbis = true;
- } else {
- System.out.println("not supported");
- alExit();
- System.exit(-1);
- }
- }
-
- int lastError;
-
- //create 1 buffer and 1 source
- IntBuffer buffers = BufferUtils.createIntBuffer(1);
- IntBuffer sources = BufferUtils.createIntBuffer(1);
-
- // al generate buffers and sources
- buffers.position(0).limit(1);
- AL10.alGenBuffers(buffers);
- if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- sources.position(0).limit(1);
- AL10.alGenSources(sources);
- if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- if(usingVorbis) {
- ByteBuffer filebuffer = getData(args[0]);
-
- // pass directly to buffer data
- AL10.alBufferData(buffers.get(0), AL10.AL_FORMAT_VORBIS_EXT, filebuffer, -1);
- filebuffer.clear();
- } else {
- // load wave data from buffer
- WaveData wavefile = WaveData.create(args[0]);
-
- //copy to buffers
- AL10.alBufferData(buffers.get(0), wavefile.format, wavefile.data, wavefile.samplerate);
-
- //unload file again
- wavefile.dispose();
- }
-
- if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- //set up source input
- AL10.alSourcei(sources.get(0), AL10.AL_BUFFER, buffers.get(0));
- if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- //lets loop the sound
- AL10.alSourcei(sources.get(0), AL10.AL_LOOPING, AL10.AL_TRUE);
- if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- //play source 0
- AL10.alSourcePlay(sources.get(0));
- if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- //wait 5 secs
- try {
- System.out.println("Waiting 5 seconds for sound to complete");
- Thread.sleep(5000);
- } catch (InterruptedException inte) {
- }
-
- //stop source 0
- AL10.alSourceStop(sources.get(0));
- if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- //delete buffers and sources
- sources.position(0).limit(1);
- AL10.alDeleteSources(sources);
- if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- buffers.position(0).limit(1);
- AL10.alDeleteBuffers(buffers);
- if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- //no errorchecking from now on, since our context is gone.
- //shutdown
- alExit();
- }
-
- /**
- * Reads the file into a ByteBuffer
- *
- * @param filename Name of file to load
- * @return ByteBuffer containing file data
- */
- protected ByteBuffer getData(String filename) {
- ByteBuffer buffer = null;
-
- System.out.println("Attempting to load: " + filename);
-
- try {
- BufferedInputStream bis = new BufferedInputStream(WaveData.class.getClassLoader().getResourceAsStream(filename));
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
-
- int bufferLength = 4096;
- byte[] readBuffer = new byte[bufferLength];
- int read = -1;
-
- while((read = bis.read(readBuffer, 0, bufferLength)) != -1) {
- baos.write(readBuffer, 0, read);
- }
-
- //done reading, close
- bis.close();
-
- // if ogg vorbis data, we need to pass it unmodified to alBufferData
- buffer = ByteBuffer.allocateDirect(baos.size());
- buffer.order(ByteOrder.nativeOrder());
- buffer.put(baos.toByteArray());
- buffer.rewind();
- } catch (Exception ioe) {
- ioe.printStackTrace();
- }
- return buffer;
- }
-
- /**
- * main entry point
- *
- * @param args String array containing arguments
- */
- public static void main(String[] args) {
- PlayTest playTest = new PlayTest();
- playTest.execute(args);
- System.exit(0);
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.openal;
+
+import java.io.BufferedInputStream;
+import java.io.ByteArrayOutputStream;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.IntBuffer;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.openal.AL10;
+import org.lwjgl.util.WaveData;
+
+/**
+ *
+ * This is a basic play test
+ * Yes, over zealous use of getError ;)
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 2983 $
+ * $Id: PlayTest.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public class PlayTest extends BasicTest {
+
+ private boolean usingVorbis;
+
+ /**
+ * Creates an instance of PlayTest
+ */
+ public PlayTest() {
+ super();
+ }
+
+ /**
+ * Runs the actual test, using supplied arguments
+ */
+ protected void execute(String[] args) {
+ if(args.length < 1) {
+ System.out.println("no argument supplied, assuming Footsteps.wav");
+ args = new String[] {"Footsteps.wav"};
+ }
+
+ if(args[0].endsWith(".ogg")) {
+ System.out.print("Attempting to load Ogg Vorbis file, checking for extension...");
+ if(AL10.alIsExtensionPresent("AL_EXT_vorbis")) {
+ System.out.println("found");
+ usingVorbis = true;
+ } else {
+ System.out.println("not supported");
+ alExit();
+ System.exit(-1);
+ }
+ }
+
+ int lastError;
+
+ //create 1 buffer and 1 source
+ IntBuffer buffers = BufferUtils.createIntBuffer(1);
+ IntBuffer sources = BufferUtils.createIntBuffer(1);
+
+ // al generate buffers and sources
+ buffers.position(0).limit(1);
+ AL10.alGenBuffers(buffers);
+ if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ sources.position(0).limit(1);
+ AL10.alGenSources(sources);
+ if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ if(usingVorbis) {
+ ByteBuffer filebuffer = getData(args[0]);
+
+ // pass directly to buffer data
+ AL10.alBufferData(buffers.get(0), AL10.AL_FORMAT_VORBIS_EXT, filebuffer, -1);
+ filebuffer.clear();
+ } else {
+ // load wave data from buffer
+ WaveData wavefile = WaveData.create(args[0]);
+
+ //copy to buffers
+ AL10.alBufferData(buffers.get(0), wavefile.format, wavefile.data, wavefile.samplerate);
+
+ //unload file again
+ wavefile.dispose();
+ }
+
+ if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ //set up source input
+ AL10.alSourcei(sources.get(0), AL10.AL_BUFFER, buffers.get(0));
+ if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ //lets loop the sound
+ AL10.alSourcei(sources.get(0), AL10.AL_LOOPING, AL10.AL_TRUE);
+ if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ //play source 0
+ AL10.alSourcePlay(sources.get(0));
+ if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ //wait 5 secs
+ try {
+ System.out.println("Waiting 5 seconds for sound to complete");
+ Thread.sleep(5000);
+ } catch (InterruptedException inte) {
+ }
+
+ //stop source 0
+ AL10.alSourceStop(sources.get(0));
+ if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ //delete buffers and sources
+ sources.position(0).limit(1);
+ AL10.alDeleteSources(sources);
+ if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ buffers.position(0).limit(1);
+ AL10.alDeleteBuffers(buffers);
+ if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ //no errorchecking from now on, since our context is gone.
+ //shutdown
+ alExit();
+ }
+
+ /**
+ * Reads the file into a ByteBuffer
+ *
+ * @param filename Name of file to load
+ * @return ByteBuffer containing file data
+ */
+ protected ByteBuffer getData(String filename) {
+ ByteBuffer buffer = null;
+
+ System.out.println("Attempting to load: " + filename);
+
+ try {
+ BufferedInputStream bis = new BufferedInputStream(WaveData.class.getClassLoader().getResourceAsStream(filename));
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+
+ int bufferLength = 4096;
+ byte[] readBuffer = new byte[bufferLength];
+ int read = -1;
+
+ while((read = bis.read(readBuffer, 0, bufferLength)) != -1) {
+ baos.write(readBuffer, 0, read);
+ }
+
+ //done reading, close
+ bis.close();
+
+ // if ogg vorbis data, we need to pass it unmodified to alBufferData
+ buffer = ByteBuffer.allocateDirect(baos.size());
+ buffer.order(ByteOrder.nativeOrder());
+ buffer.put(baos.toByteArray());
+ buffer.rewind();
+ } catch (Exception ioe) {
+ ioe.printStackTrace();
+ }
+ return buffer;
+ }
+
+ /**
+ * main entry point
+ *
+ * @param args String array containing arguments
+ */
+ public static void main(String[] args) {
+ PlayTest playTest = new PlayTest();
+ playTest.execute(args);
+ System.exit(0);
+ }
+}
diff --git a/src/java/org/lwjgl/test/openal/PlayTestMemory.java b/src/java/org/lwjgl/test/openal/PlayTestMemory.java
index aedc4c4..38fec8c 100644
--- a/src/java/org/lwjgl/test/openal/PlayTestMemory.java
+++ b/src/java/org/lwjgl/test/openal/PlayTestMemory.java
@@ -1,234 +1,234 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.openal;
-
-import java.io.BufferedInputStream;
-import java.io.ByteArrayOutputStream;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.nio.IntBuffer;
-
-import org.lwjgl.BufferUtils;
-import org.lwjgl.openal.AL10;
-import org.lwjgl.util.WaveData;
-
-/**
- *
- * This is a basic play test
- * Yes, over zealous use of getError ;)
- *
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 2983 $
- * $Id: PlayTestMemory.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public class PlayTestMemory extends BasicTest {
-
- private boolean usingVorbis;
-
- /**
- * Creates an instance of PlayTestMemory
- */
- public PlayTestMemory() {
- super();
- }
-
- /**
- * Runs the actual test, using supplied arguments
- */
- protected void execute(String[] args) {
- if(args.length < 1) {
- System.out.println("no argument supplied, assuming Footsteps.wav");
- args = new String[] {"Footsteps.wav"};
- }
-
- if(args[0].endsWith(".ogg")) {
- System.out.print("Attempting to load Ogg Vorbis file, checking for extension...");
- if(AL10.alIsExtensionPresent("AL_EXT_vorbis")) {
- System.out.println("found");
- usingVorbis = true;
- } else {
- System.out.println("not supported");
- alExit();
- System.exit(-1);
- }
- }
-
- int lastError;
-
- //create 1 buffer and 1 source
- IntBuffer buffers = BufferUtils.createIntBuffer(1);
- IntBuffer sources = BufferUtils.createIntBuffer(1);
-
- // al generate buffers and sources
- buffers.position(0).limit(1);
- AL10.alGenBuffers(buffers);
- if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- sources.position(0).limit(1);
- AL10.alGenSources(sources);
- if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- //load wave data
- ByteBuffer filebuffer = getData(args[0]);
- if(filebuffer == null) {
- System.out.println("Error loading file: " + args[0]);
- System.exit(-1);
- }
-
- System.out.println("loaded " + filebuffer.capacity());
-
- //ALUTLoadWAVData file = alut.loadWAVMemory(Sys.getDirectBufferAddress(filebuffer));
- if(usingVorbis) {
- // pass directly to buffer data
- AL10.alBufferData(buffers.get(0), AL10.AL_FORMAT_VORBIS_EXT, filebuffer, -1);
- filebuffer.clear();
- } else {
- // load wave data from buffer
- WaveData wavefile = WaveData.create(filebuffer.array());
-
- //copy to buffers
- AL10.alBufferData(buffers.get(0), wavefile.format, wavefile.data, wavefile.samplerate);
-
- //unload file again
- wavefile.dispose();
- }
-
- // check for errors
- if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
-
- //set up source input
- AL10.alSourcei(sources.get(0), AL10.AL_BUFFER, buffers.get(0));
- if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- //lets loop the sound
- AL10.alSourcei(sources.get(0), AL10.AL_LOOPING, AL10.AL_TRUE);
- if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- //play source 0
- AL10.alSourcePlay(sources.get(0));
- if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- //wait 5 secs
- try {
- System.out.println("Waiting 5 seconds for sound to complete");
- Thread.sleep(5000);
- } catch (InterruptedException inte) {
- }
-
- //stop source 0
- AL10.alSourceStop(sources.get(0));
- if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- //delete buffers and sources
- sources.position(0).limit(1);
- AL10.alDeleteSources(sources);
- if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- buffers.position(0).limit(1);
- AL10.alDeleteBuffers(buffers);
- if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- exit(lastError);
- }
-
- //no errorchecking from now on, since our context is gone.
- alExit();
- }
-
- /**
- * Reads the file into a ByteBuffer
- *
- * @param filename Name of file to load
- * @return ByteBuffer containing file data
- */
- protected ByteBuffer getData(String filename) {
- ByteBuffer buffer = null;
-
- System.out.println("Attempting to load: " + filename);
-
- try {
- BufferedInputStream bis = new BufferedInputStream(WaveData.class.getClassLoader().getResourceAsStream(filename));
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
-
- int bufferLength = 4096;
- byte[] readBuffer = new byte[bufferLength];
- int read = -1;
-
- while((read = bis.read(readBuffer, 0, bufferLength)) != -1) {
- baos.write(readBuffer, 0, read);
- }
-
- //done reading, close
- bis.close();
-
- // if ogg vorbis data, we need to pass it unmodified to alBufferData
- if(usingVorbis) {
- buffer = ByteBuffer.allocateDirect(baos.size());
- } else {
- buffer = ByteBuffer.allocate(baos.size());
- }
- buffer.order(ByteOrder.nativeOrder());
- buffer.put(baos.toByteArray());
- buffer.rewind();
- } catch (Exception ioe) {
- ioe.printStackTrace();
- }
- return buffer;
- }
-
- /**
- * main entry point
- *
- * @param args String array containing arguments
- */
- public static void main(String[] args) {
- PlayTestMemory playTestMemory = new PlayTestMemory();
- playTestMemory.execute(args);
- System.exit(0);
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.openal;
+
+import java.io.BufferedInputStream;
+import java.io.ByteArrayOutputStream;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.IntBuffer;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.openal.AL10;
+import org.lwjgl.util.WaveData;
+
+/**
+ *
+ * This is a basic play test
+ * Yes, over zealous use of getError ;)
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 2983 $
+ * $Id: PlayTestMemory.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public class PlayTestMemory extends BasicTest {
+
+ private boolean usingVorbis;
+
+ /**
+ * Creates an instance of PlayTestMemory
+ */
+ public PlayTestMemory() {
+ super();
+ }
+
+ /**
+ * Runs the actual test, using supplied arguments
+ */
+ protected void execute(String[] args) {
+ if(args.length < 1) {
+ System.out.println("no argument supplied, assuming Footsteps.wav");
+ args = new String[] {"Footsteps.wav"};
+ }
+
+ if(args[0].endsWith(".ogg")) {
+ System.out.print("Attempting to load Ogg Vorbis file, checking for extension...");
+ if(AL10.alIsExtensionPresent("AL_EXT_vorbis")) {
+ System.out.println("found");
+ usingVorbis = true;
+ } else {
+ System.out.println("not supported");
+ alExit();
+ System.exit(-1);
+ }
+ }
+
+ int lastError;
+
+ //create 1 buffer and 1 source
+ IntBuffer buffers = BufferUtils.createIntBuffer(1);
+ IntBuffer sources = BufferUtils.createIntBuffer(1);
+
+ // al generate buffers and sources
+ buffers.position(0).limit(1);
+ AL10.alGenBuffers(buffers);
+ if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ sources.position(0).limit(1);
+ AL10.alGenSources(sources);
+ if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ //load wave data
+ ByteBuffer filebuffer = getData(args[0]);
+ if(filebuffer == null) {
+ System.out.println("Error loading file: " + args[0]);
+ System.exit(-1);
+ }
+
+ System.out.println("loaded " + filebuffer.capacity());
+
+ //ALUTLoadWAVData file = alut.loadWAVMemory(Sys.getDirectBufferAddress(filebuffer));
+ if(usingVorbis) {
+ // pass directly to buffer data
+ AL10.alBufferData(buffers.get(0), AL10.AL_FORMAT_VORBIS_EXT, filebuffer, -1);
+ filebuffer.clear();
+ } else {
+ // load wave data from buffer
+ WaveData wavefile = WaveData.create(filebuffer.array());
+
+ //copy to buffers
+ AL10.alBufferData(buffers.get(0), wavefile.format, wavefile.data, wavefile.samplerate);
+
+ //unload file again
+ wavefile.dispose();
+ }
+
+ // check for errors
+ if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+
+ //set up source input
+ AL10.alSourcei(sources.get(0), AL10.AL_BUFFER, buffers.get(0));
+ if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ //lets loop the sound
+ AL10.alSourcei(sources.get(0), AL10.AL_LOOPING, AL10.AL_TRUE);
+ if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ //play source 0
+ AL10.alSourcePlay(sources.get(0));
+ if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ //wait 5 secs
+ try {
+ System.out.println("Waiting 5 seconds for sound to complete");
+ Thread.sleep(5000);
+ } catch (InterruptedException inte) {
+ }
+
+ //stop source 0
+ AL10.alSourceStop(sources.get(0));
+ if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ //delete buffers and sources
+ sources.position(0).limit(1);
+ AL10.alDeleteSources(sources);
+ if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ buffers.position(0).limit(1);
+ AL10.alDeleteBuffers(buffers);
+ if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ exit(lastError);
+ }
+
+ //no errorchecking from now on, since our context is gone.
+ alExit();
+ }
+
+ /**
+ * Reads the file into a ByteBuffer
+ *
+ * @param filename Name of file to load
+ * @return ByteBuffer containing file data
+ */
+ protected ByteBuffer getData(String filename) {
+ ByteBuffer buffer = null;
+
+ System.out.println("Attempting to load: " + filename);
+
+ try {
+ BufferedInputStream bis = new BufferedInputStream(WaveData.class.getClassLoader().getResourceAsStream(filename));
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+
+ int bufferLength = 4096;
+ byte[] readBuffer = new byte[bufferLength];
+ int read = -1;
+
+ while((read = bis.read(readBuffer, 0, bufferLength)) != -1) {
+ baos.write(readBuffer, 0, read);
+ }
+
+ //done reading, close
+ bis.close();
+
+ // if ogg vorbis data, we need to pass it unmodified to alBufferData
+ if(usingVorbis) {
+ buffer = ByteBuffer.allocateDirect(baos.size());
+ } else {
+ buffer = ByteBuffer.allocate(baos.size());
+ }
+ buffer.order(ByteOrder.nativeOrder());
+ buffer.put(baos.toByteArray());
+ buffer.rewind();
+ } catch (Exception ioe) {
+ ioe.printStackTrace();
+ }
+ return buffer;
+ }
+
+ /**
+ * main entry point
+ *
+ * @param args String array containing arguments
+ */
+ public static void main(String[] args) {
+ PlayTestMemory playTestMemory = new PlayTestMemory();
+ playTestMemory.execute(args);
+ System.exit(0);
+ }
+}
diff --git a/src/java/org/lwjgl/test/openal/PositionTest.java b/src/java/org/lwjgl/test/openal/PositionTest.java
index 18feffa..29a89c4 100644
--- a/src/java/org/lwjgl/test/openal/PositionTest.java
+++ b/src/java/org/lwjgl/test/openal/PositionTest.java
@@ -1,552 +1,552 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.openal;
-
-import java.nio.FloatBuffer;
-import java.nio.IntBuffer;
-
-import org.lwjgl.BufferUtils;
-import org.lwjgl.LWJGLUtil;
-import org.lwjgl.input.Keyboard;
-import org.lwjgl.input.Mouse;
-import org.lwjgl.openal.AL;
-import org.lwjgl.openal.AL10;
-import org.lwjgl.opengl.Display;
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.util.glu.GLU;
-import org.lwjgl.util.WaveData;
-
-/**
- * <br>
- * This test demonstrates OpenAL positioning Based on the example by Chad Armstrong
- * (http://www.edenwaith.com/products/pige/tutorials/openal.php)
- *
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 2983 $
- * $Id: PositionTest.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public class PositionTest extends BasicTest {
-
- /** *Small* glut implementation :) */
- private GLUT glut;
-
- /** Width of window */
- public static final int WINDOW_WIDTH = 640;
-
- /** Height of window */
- public static final int WINDOW_HEIGHT = 480;
-
- /** LEFT enumeration */
- public static final int LEFT = 0;
-
- /** CENTER enumeration */
- public static final int CENTER = 1;
-
- /** RIGHT enumeration */
- public static final int RIGHT = 2;
-
- /** Whether the demo is done */
- private boolean finished = false;
-
- /** Whether in pause mode */
- private boolean pauseMode = false;
-
- // OpenAL stuff
- // ===================================================
-
- /** OpenAL buffers */
- private IntBuffer soundBuffers = BufferUtils.createIntBuffer(3);
-
- /** OpenAL sources */
- private IntBuffer soundSources = BufferUtils.createIntBuffer(3);
-
- /** Position of listener */
- private FloatBuffer listenerPosition = createFloatBuffer(new float[] { 0.0f, 0.0f, 0.0f });
-
- /** Velocity of listener */
- private FloatBuffer listenerVelocity = createFloatBuffer(new float[] { 0.0f, 0.0f, 0.0f });
-
- /** Orientation of listener */
- private FloatBuffer listenerOrientation =
- createFloatBuffer(new float[] { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f });
-
- /** Position of left sound */
- private FloatBuffer leftPosition = createFloatBuffer(new float[] { -2.0f, 0.0f, 0.0f });
-
- /** Velocity of left sound */
- private FloatBuffer leftVelocity = createFloatBuffer(new float[] { 0.0f, 0.0f, 0.0f });
-
- /** Position of center sound */
- private FloatBuffer centerPosition = createFloatBuffer(new float[] { 0.0f, 0.0f, -4.0f });
-
- /** Velocity of center sound */
- private FloatBuffer centerVelocity = createFloatBuffer(new float[] { 0.0f, 0.0f, 0.0f });
-
- /** Position of right sound */
- private FloatBuffer rightPosition = createFloatBuffer(new float[] { 2.0f, 0.0f, 0.0f });
-
- /** Velocity of right sound */
- private FloatBuffer rightVelocity = createFloatBuffer(new float[] { 0.0f, 0.0f, 0.0f });
- // ---------------------------------------------------
-
- /**
- * Runs the actual test, using supplied arguments
- */
- protected void execute(String[] args) {
- // Setup needed stuff
- try {
- setup();
- } catch (Exception e) {
- System.out.println("Error setting up demonstration: ");
- e.printStackTrace();
- System.exit(-1);
- }
-
- // run the actual demonstration
- run();
-
- // shutdown
- shutdown();
- }
-
- /**
- * Performs setup of demonstration
- */
- private void setup() throws Exception {
-
- // Setup Window
- // =====================================================
- LWJGLUtil.log("Setting up window");
-
- // calc center
- int centerX = (Display.getDisplayMode().getWidth() - WINDOW_WIDTH) / 2;
- int centerY = (Display.getDisplayMode().getHeight() - WINDOW_HEIGHT) / 2;
-
- // setup window
- setDisplayMode();
- Display.create();
- // -----------------------------------------------------
-
- // Setup OpenGL
- // =====================================================
- LWJGLUtil.log("Setting up OpenGL");
-
- GL11.glViewport(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT);
- GL11.glMatrixMode(GL11.GL_PROJECTION);
- GL11.glLoadIdentity();
- GLU.gluPerspective(50.0f, (float) WINDOW_WIDTH / WINDOW_HEIGHT, 0.0f, 50.0f);
- GL11.glMatrixMode(GL11.GL_MODELVIEW);
- GL11.glLoadIdentity();
- GL11.glTranslatef(0.0f, 0.0f, -6.6f);
- GL11.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
- glut = this.new GLUT();
-
- Display.setVSyncEnabled(true);
- // -----------------------------------------------------
-
- // Setup OpenAL
- // =====================================================
- LWJGLUtil.log("Setting up OpenAL");
-
- AL10.alListener(AL10.AL_POSITION, listenerPosition);
- AL10.alListener(AL10.AL_VELOCITY, listenerVelocity);
- AL10.alListener(AL10.AL_ORIENTATION, listenerOrientation);
-
- // creating buffers
- LWJGLUtil.log("Creating buffers");
- AL10.alGenBuffers(soundBuffers);
- soundBuffers.rewind();
-
- // creating sources
- AL10.alGenSources(soundSources);
- soundSources.rewind();
-
- // load sound files (left, center, right).wav
- LWJGLUtil.log("Loading soundfiles...");
-
- LWJGLUtil.log("Loading left.wav");
- WaveData left = WaveData.create("left.wav");
- AL10.alBufferData(soundBuffers.get(LEFT), left.format, left.data, left.samplerate);
- AL10.alSourcef(soundSources.get(LEFT), AL10.AL_PITCH, 1.0f);
- AL10.alSourcef(soundSources.get(LEFT), AL10.AL_GAIN, 1.0f);
- AL10.alSource(soundSources.get(LEFT), AL10.AL_POSITION, leftPosition);
- AL10.alSource(soundSources.get(LEFT), AL10.AL_VELOCITY, leftVelocity);
- AL10.alSourcei(soundSources.get(LEFT), AL10.AL_BUFFER, soundBuffers.get(LEFT));
- AL10.alSourcei(soundSources.get(LEFT), AL10.AL_LOOPING, AL10.AL_TRUE);
-
- LWJGLUtil.log("Loading center.wav");
- WaveData center = WaveData.create("center.wav");
- AL10.alBufferData(soundBuffers.get(CENTER), center.format, center.data, center.samplerate);
- AL10.alSourcef(soundSources.get(CENTER), AL10.AL_PITCH, 1.0f);
- AL10.alSourcef(soundSources.get(CENTER), AL10.AL_GAIN, 1.0f);
- AL10.alSource(soundSources.get(CENTER), AL10.AL_POSITION, centerPosition);
- AL10.alSource(soundSources.get(CENTER), AL10.AL_VELOCITY, centerVelocity);
- AL10.alSourcei(soundSources.get(CENTER), AL10.AL_BUFFER, soundBuffers.get(CENTER));
- AL10.alSourcei(soundSources.get(CENTER), AL10.AL_LOOPING, AL10.AL_TRUE);
-
- LWJGLUtil.log("Loading right.wav");
- WaveData right = WaveData.create("right.wav");
- AL10.alBufferData(soundBuffers.get(RIGHT), right.format, right.data, right.samplerate);
- AL10.alSourcef(soundSources.get(RIGHT), AL10.AL_PITCH, 1.0f);
- AL10.alSourcef(soundSources.get(RIGHT), AL10.AL_GAIN, 1.0f);
- AL10.alSource(soundSources.get(RIGHT), AL10.AL_POSITION, rightPosition);
- AL10.alSource(soundSources.get(RIGHT), AL10.AL_VELOCITY, rightVelocity);
- AL10.alSourcei(soundSources.get(RIGHT), AL10.AL_BUFFER, soundBuffers.get(RIGHT));
- AL10.alSourcei(soundSources.get(RIGHT), AL10.AL_LOOPING, AL10.AL_TRUE);
-
- LWJGLUtil.log("Soundfiles loaded successfully");
- // -----------------------------------------------------
-
- Mouse.setGrabbed(true);
- }
-
- /**
- * Runs the actual demonstration
- */
- private void run() {
- boolean firstRun = true;
-
- System.out.println("Press 1/4 (left), 2/5 (center) or 3/6 (right) to toggle sound");
- System.out.println("Press LEFT/RIGHT to move along x axis");
- System.out.println("Press SHIFT and either UP/DOWN to move along y axis");
- System.out.println("Press UP/DOWN to move along z axis");
- System.out.println("Move along the x and y axis with the mouse");
- System.out.println("Press LEFT or RIGHT mouse button to move along z axis");
- System.out.println("Press ESC to exit demo");
-
- LWJGLUtil.log(
- "Listener position: "
- + listenerPosition.get(0)
- + ", "
- + listenerPosition.get(1)
- + ", "
- + listenerPosition.get(2));
- LWJGLUtil.log("Left position: " + leftPosition.get(0) + ", " + leftPosition.get(1) + ", " + leftPosition.get(2));
- LWJGLUtil.log("Center position: " + centerPosition.get(0) + ", " + centerPosition.get(1) + ", " + centerPosition.get(2));
- LWJGLUtil.log("Right position: " + rightPosition.get(0) + ", " + rightPosition.get(1) + ", " + rightPosition.get(2));
-
- while (!finished) {
- // handle any input
- handleInput();
-
- // allow window to process internal messages
- Display.update();
-
- // render and paint if !minimized and not dirty
- if(Display.isVisible()) {
- render();
- } else {
- // sleeeeeep
- pause(100);
- }
-
- // act on pause mode
- paused(!(Display.isVisible() || Display.isActive()));
-
- // start sound after first paint, since we don't want
- // the delay before something is painted on the screen
- if (firstRun && !pauseMode) {
- firstRun = false;
-
- // start sounds with delays
- startSounds();
- }
- }
- }
-
- /**
- * Starts playing the sounds at different times
- */
- private void startSounds() {
- AL10.alSourcePlay(soundSources.get(LEFT));
- pause(300);
- AL10.alSourcePlay(soundSources.get(CENTER));
- pause(500);
- AL10.alSourcePlay(soundSources.get(RIGHT));
- }
-
- /**
- * Handles any changes in pause mode
- *
- * @param paused Which pause mode to enter
- */
- private void paused(boolean paused) {
- // if requesting pause, and not paused - pause and stop sound
- if(paused && !pauseMode) {
- pauseMode = true;
- AL10.alSourcePause(soundSources);
- System.out.println("pauseMode = true");
- }
-
- // else go out of pause mode and start sounds
- else if(!paused && pauseMode) {
- pauseMode = false;
- startSounds();
- System.out.println("pauseMode = false");
- }
- }
-
- /**
- * Handles any input
- */
- private void handleInput() {
- // User wants to exit?
- finished = Display.isCloseRequested() || Keyboard.isKeyDown(Keyboard.KEY_ESCAPE);
- if (finished) {
- return;
- }
-
- boolean shift = Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT);
-
- // Test for play
- // ============================================
- if (Keyboard.isKeyDown(Keyboard.KEY_1)) {
- AL10.alSourcePlay(soundSources.get(LEFT));
- LWJGLUtil.log("Playing left.wav");
- }
-
- if (Keyboard.isKeyDown(Keyboard.KEY_2)) {
- AL10.alSourcePlay(soundSources.get(CENTER));
- LWJGLUtil.log("Playing center.wav");
- }
-
- if (Keyboard.isKeyDown(Keyboard.KEY_3)) {
- AL10.alSourcePlay(soundSources.get(RIGHT));
- LWJGLUtil.log("Playing right.wav");
- }
- // --------------------------------------------
-
- // Test for stop
- // ============================================
- if (Keyboard.isKeyDown(Keyboard.KEY_4)) {
- AL10.alSourceStop(soundSources.get(LEFT));
- LWJGLUtil.log("Stopped left.wav");
- }
-
- if (Keyboard.isKeyDown(Keyboard.KEY_5)) {
- AL10.alSourceStop(soundSources.get(CENTER));
- LWJGLUtil.log("Stopped center.wav");
- }
-
- if (Keyboard.isKeyDown(Keyboard.KEY_6)) {
- AL10.alSourceStop(soundSources.get(RIGHT));
- LWJGLUtil.log("Stopped right.wav");
- }
- // --------------------------------------------
-
- // Test for movement with keyboard
- // ============================================
- if (Keyboard.isKeyDown(Keyboard.KEY_LEFT)) {
- listenerPosition.put(0, listenerPosition.get(0) - 0.1f);
- AL10.alListener(AL10.AL_POSITION, listenerPosition);
- }
-
- if (Keyboard.isKeyDown(Keyboard.KEY_RIGHT)) {
- listenerPosition.put(0, listenerPosition.get(0) + 0.1f);
- AL10.alListener(AL10.AL_POSITION, listenerPosition);
- }
-
- if (Keyboard.isKeyDown(Keyboard.KEY_UP)) {
- if (shift) {
- listenerPosition.put(1, listenerPosition.get(1) + 0.1f);
- } else {
- listenerPosition.put(2, listenerPosition.get(2) - 0.1f);
- }
- AL10.alListener(AL10.AL_POSITION, listenerPosition);
- }
-
- if (Keyboard.isKeyDown(Keyboard.KEY_DOWN)) {
- if (shift) {
- listenerPosition.put(1, listenerPosition.get(1) - 0.1f);
- } else {
- listenerPosition.put(2, listenerPosition.get(2) + 0.1f);
- }
- AL10.alListener(AL10.AL_POSITION, listenerPosition);
- }
- // --------------------------------------------
-
- // Test for movement with Mouse
- // ============================================
- listenerPosition.put(0, listenerPosition.get(0) + (0.01f * Mouse.getDX()));
- listenerPosition.put(1, listenerPosition.get(1) + (0.01f * Mouse.getDY()));
- if (Mouse.isButtonDown(0)) {
- listenerPosition.put(2, listenerPosition.get(2) - 0.1f);
- }
- if (Mouse.isButtonDown(1)) {
- listenerPosition.put(2, listenerPosition.get(2) + 0.1f);
- }
-
- AL10.alListener(AL10.AL_POSITION, listenerPosition);
-
- // empty mouse buffer
- while(Mouse.next());
- }
-
- /**
- * Render the scene
- */
- private void render() {
- GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
- GL11.glPushMatrix();
- {
- GL11.glRotatef(20.0f, 1.0f, 1.0f, 0.0f);
-
- // left
- GL11.glPushMatrix();
- {
- GL11.glTranslatef(leftPosition.get(0), leftPosition.get(1), leftPosition.get(2));
- GL11.glColor3f(1.0f, 0.0f, 0.0f);
- glut.glutWireCube(0.5f);
- }
- GL11.glPopMatrix();
-
- // center
- GL11.glPushMatrix();
- {
- GL11.glTranslatef(centerPosition.get(0), centerPosition.get(1), centerPosition.get(2));
- GL11.glColor3f(0.0f, 0.0f, 1.0f);
- glut.glutWireCube(0.5f);
- }
- GL11.glPopMatrix();
-
- // right
- GL11.glPushMatrix();
- {
- GL11.glTranslatef(rightPosition.get(0), rightPosition.get(1), rightPosition.get(2));
- GL11.glColor3f(0.0f, 1.0f, 0.0f);
- glut.glutWireCube(0.5f);
- }
- GL11.glPopMatrix();
-
- // listener
- GL11.glPushMatrix();
- {
- GL11.glTranslatef(listenerPosition.get(0), listenerPosition.get(1), listenerPosition.get(2));
- GL11.glColor3f(1.0f, 1.0f, 1.0f);
- glut.glutSolidCube(0.5f);
- }
- GL11.glPopMatrix();
- }
- GL11.glPopMatrix();
- }
-
- /**
- * Shutdown of demonstration
- */
- private void shutdown() {
- LWJGLUtil.log("Shutting down OpenAL");
- AL10.alSourceStop(soundSources);
- AL10.alDeleteSources(soundSources);
- AL10.alDeleteBuffers(soundBuffers);
- AL.destroy();
-
- LWJGLUtil.log("Shutting down Window");
- Display.destroy();
- }
-
- /**
- * main entry point
- *
- * @param args
- * String array containing arguments
- */
- public static void main(String[] args) {
- PositionTest positionTest = new PositionTest();
- positionTest.execute(args);
- System.exit(0);
- }
-
- /**
- * Minute implementation of GLUT: <br>COPYRIGHT:
- *
- * The OpenGL Utility Toolkit distribution for Win32 (Windows NT & Windows
- * 95) contains source code modified from the original source code for GLUT
- * version 3.3 which was developed by Mark J. Kilgard. The original source
- * code for GLUT is Copyright 1997 by Mark J. Kilgard. GLUT for Win32 is
- * Copyright 1997 by Nate Robins and is not in the public domain, but it is
- * freely distributable without licensing fees. It is provided without
- * guarantee or warrantee expressed or implied. It was ported with the
- * permission of Mark J. Kilgard by Nate Robins.
- *
- * THIS SOURCE CODE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OR MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
- */
- class GLUT {
-
- float n[][] = new float[][] { { -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 }
- };
-
- int faces[][] = new int[][] { { 0, 1, 2, 3 }, {
- 3, 2, 6, 7 }, {
- 7, 6, 5, 4 }, {
- 4, 5, 1, 0 }, {
- 5, 6, 2, 1 }, {
- 7, 4, 0, 3 }
- };
- float v[][] = new float[8][3];
-
- public void glutWireCube(float size) {
- drawBox(size, GL11.GL_LINE_LOOP);
- }
-
- public void glutSolidCube(float size) {
- drawBox(size, GL11.GL_QUADS);
- }
-
- private void drawBox(float size, int type) {
-
- v[0][0] = v[1][0] = v[2][0] = v[3][0] = -size / 2;
- v[4][0] = v[5][0] = v[6][0] = v[7][0] = size / 2;
- v[0][1] = v[1][1] = v[4][1] = v[5][1] = -size / 2;
- v[2][1] = v[3][1] = v[6][1] = v[7][1] = size / 2;
- v[0][2] = v[3][2] = v[4][2] = v[7][2] = -size / 2;
- v[1][2] = v[2][2] = v[5][2] = v[6][2] = size / 2;
-
- for (int i = 5; i >= 0; i--) {
- GL11.glBegin(type);
- GL11.glNormal3f(n[i][0], n[i][1], n[i][2]);
- GL11.glVertex3f(v[faces[i][0]][0], v[faces[i][0]][1], v[faces[i][0]][2]);
- GL11.glVertex3f(v[faces[i][1]][0], v[faces[i][1]][1], v[faces[i][1]][2]);
- GL11.glVertex3f(v[faces[i][2]][0], v[faces[i][2]][1], v[faces[i][2]][2]);
- GL11.glVertex3f(v[faces[i][3]][0], v[faces[i][3]][1], v[faces[i][3]][2]);
- GL11.glEnd();
- }
-
- }
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.openal;
+
+import java.nio.FloatBuffer;
+import java.nio.IntBuffer;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.LWJGLUtil;
+import org.lwjgl.input.Keyboard;
+import org.lwjgl.input.Mouse;
+import org.lwjgl.openal.AL;
+import org.lwjgl.openal.AL10;
+import org.lwjgl.opengl.Display;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.util.glu.GLU;
+import org.lwjgl.util.WaveData;
+
+/**
+ * <br>
+ * This test demonstrates OpenAL positioning Based on the example by Chad Armstrong
+ * (http://www.edenwaith.com/products/pige/tutorials/openal.php)
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 2983 $
+ * $Id: PositionTest.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public class PositionTest extends BasicTest {
+
+ /** *Small* glut implementation :) */
+ private GLUT glut;
+
+ /** Width of window */
+ public static final int WINDOW_WIDTH = 640;
+
+ /** Height of window */
+ public static final int WINDOW_HEIGHT = 480;
+
+ /** LEFT enumeration */
+ public static final int LEFT = 0;
+
+ /** CENTER enumeration */
+ public static final int CENTER = 1;
+
+ /** RIGHT enumeration */
+ public static final int RIGHT = 2;
+
+ /** Whether the demo is done */
+ private boolean finished = false;
+
+ /** Whether in pause mode */
+ private boolean pauseMode = false;
+
+ // OpenAL stuff
+ // ===================================================
+
+ /** OpenAL buffers */
+ private IntBuffer soundBuffers = BufferUtils.createIntBuffer(3);
+
+ /** OpenAL sources */
+ private IntBuffer soundSources = BufferUtils.createIntBuffer(3);
+
+ /** Position of listener */
+ private FloatBuffer listenerPosition = createFloatBuffer(new float[] { 0.0f, 0.0f, 0.0f });
+
+ /** Velocity of listener */
+ private FloatBuffer listenerVelocity = createFloatBuffer(new float[] { 0.0f, 0.0f, 0.0f });
+
+ /** Orientation of listener */
+ private FloatBuffer listenerOrientation =
+ createFloatBuffer(new float[] { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f });
+
+ /** Position of left sound */
+ private FloatBuffer leftPosition = createFloatBuffer(new float[] { -2.0f, 0.0f, 0.0f });
+
+ /** Velocity of left sound */
+ private FloatBuffer leftVelocity = createFloatBuffer(new float[] { 0.0f, 0.0f, 0.0f });
+
+ /** Position of center sound */
+ private FloatBuffer centerPosition = createFloatBuffer(new float[] { 0.0f, 0.0f, -4.0f });
+
+ /** Velocity of center sound */
+ private FloatBuffer centerVelocity = createFloatBuffer(new float[] { 0.0f, 0.0f, 0.0f });
+
+ /** Position of right sound */
+ private FloatBuffer rightPosition = createFloatBuffer(new float[] { 2.0f, 0.0f, 0.0f });
+
+ /** Velocity of right sound */
+ private FloatBuffer rightVelocity = createFloatBuffer(new float[] { 0.0f, 0.0f, 0.0f });
+ // ---------------------------------------------------
+
+ /**
+ * Runs the actual test, using supplied arguments
+ */
+ protected void execute(String[] args) {
+ // Setup needed stuff
+ try {
+ setup();
+ } catch (Exception e) {
+ System.out.println("Error setting up demonstration: ");
+ e.printStackTrace();
+ System.exit(-1);
+ }
+
+ // run the actual demonstration
+ run();
+
+ // shutdown
+ shutdown();
+ }
+
+ /**
+ * Performs setup of demonstration
+ */
+ private void setup() throws Exception {
+
+ // Setup Window
+ // =====================================================
+ LWJGLUtil.log("Setting up window");
+
+ // calc center
+ int centerX = (Display.getDisplayMode().getWidth() - WINDOW_WIDTH) / 2;
+ int centerY = (Display.getDisplayMode().getHeight() - WINDOW_HEIGHT) / 2;
+
+ // setup window
+ setDisplayMode();
+ Display.create();
+ // -----------------------------------------------------
+
+ // Setup OpenGL
+ // =====================================================
+ LWJGLUtil.log("Setting up OpenGL");
+
+ GL11.glViewport(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT);
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+ GL11.glLoadIdentity();
+ GLU.gluPerspective(50.0f, (float) WINDOW_WIDTH / WINDOW_HEIGHT, 0.0f, 50.0f);
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ GL11.glLoadIdentity();
+ GL11.glTranslatef(0.0f, 0.0f, -6.6f);
+ GL11.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
+ glut = this.new GLUT();
+
+ Display.setVSyncEnabled(true);
+ // -----------------------------------------------------
+
+ // Setup OpenAL
+ // =====================================================
+ LWJGLUtil.log("Setting up OpenAL");
+
+ AL10.alListener(AL10.AL_POSITION, listenerPosition);
+ AL10.alListener(AL10.AL_VELOCITY, listenerVelocity);
+ AL10.alListener(AL10.AL_ORIENTATION, listenerOrientation);
+
+ // creating buffers
+ LWJGLUtil.log("Creating buffers");
+ AL10.alGenBuffers(soundBuffers);
+ soundBuffers.rewind();
+
+ // creating sources
+ AL10.alGenSources(soundSources);
+ soundSources.rewind();
+
+ // load sound files (left, center, right).wav
+ LWJGLUtil.log("Loading soundfiles...");
+
+ LWJGLUtil.log("Loading left.wav");
+ WaveData left = WaveData.create("left.wav");
+ AL10.alBufferData(soundBuffers.get(LEFT), left.format, left.data, left.samplerate);
+ AL10.alSourcef(soundSources.get(LEFT), AL10.AL_PITCH, 1.0f);
+ AL10.alSourcef(soundSources.get(LEFT), AL10.AL_GAIN, 1.0f);
+ AL10.alSource(soundSources.get(LEFT), AL10.AL_POSITION, leftPosition);
+ AL10.alSource(soundSources.get(LEFT), AL10.AL_VELOCITY, leftVelocity);
+ AL10.alSourcei(soundSources.get(LEFT), AL10.AL_BUFFER, soundBuffers.get(LEFT));
+ AL10.alSourcei(soundSources.get(LEFT), AL10.AL_LOOPING, AL10.AL_TRUE);
+
+ LWJGLUtil.log("Loading center.wav");
+ WaveData center = WaveData.create("center.wav");
+ AL10.alBufferData(soundBuffers.get(CENTER), center.format, center.data, center.samplerate);
+ AL10.alSourcef(soundSources.get(CENTER), AL10.AL_PITCH, 1.0f);
+ AL10.alSourcef(soundSources.get(CENTER), AL10.AL_GAIN, 1.0f);
+ AL10.alSource(soundSources.get(CENTER), AL10.AL_POSITION, centerPosition);
+ AL10.alSource(soundSources.get(CENTER), AL10.AL_VELOCITY, centerVelocity);
+ AL10.alSourcei(soundSources.get(CENTER), AL10.AL_BUFFER, soundBuffers.get(CENTER));
+ AL10.alSourcei(soundSources.get(CENTER), AL10.AL_LOOPING, AL10.AL_TRUE);
+
+ LWJGLUtil.log("Loading right.wav");
+ WaveData right = WaveData.create("right.wav");
+ AL10.alBufferData(soundBuffers.get(RIGHT), right.format, right.data, right.samplerate);
+ AL10.alSourcef(soundSources.get(RIGHT), AL10.AL_PITCH, 1.0f);
+ AL10.alSourcef(soundSources.get(RIGHT), AL10.AL_GAIN, 1.0f);
+ AL10.alSource(soundSources.get(RIGHT), AL10.AL_POSITION, rightPosition);
+ AL10.alSource(soundSources.get(RIGHT), AL10.AL_VELOCITY, rightVelocity);
+ AL10.alSourcei(soundSources.get(RIGHT), AL10.AL_BUFFER, soundBuffers.get(RIGHT));
+ AL10.alSourcei(soundSources.get(RIGHT), AL10.AL_LOOPING, AL10.AL_TRUE);
+
+ LWJGLUtil.log("Soundfiles loaded successfully");
+ // -----------------------------------------------------
+
+ Mouse.setGrabbed(true);
+ }
+
+ /**
+ * Runs the actual demonstration
+ */
+ private void run() {
+ boolean firstRun = true;
+
+ System.out.println("Press 1/4 (left), 2/5 (center) or 3/6 (right) to toggle sound");
+ System.out.println("Press LEFT/RIGHT to move along x axis");
+ System.out.println("Press SHIFT and either UP/DOWN to move along y axis");
+ System.out.println("Press UP/DOWN to move along z axis");
+ System.out.println("Move along the x and y axis with the mouse");
+ System.out.println("Press LEFT or RIGHT mouse button to move along z axis");
+ System.out.println("Press ESC to exit demo");
+
+ LWJGLUtil.log(
+ "Listener position: "
+ + listenerPosition.get(0)
+ + ", "
+ + listenerPosition.get(1)
+ + ", "
+ + listenerPosition.get(2));
+ LWJGLUtil.log("Left position: " + leftPosition.get(0) + ", " + leftPosition.get(1) + ", " + leftPosition.get(2));
+ LWJGLUtil.log("Center position: " + centerPosition.get(0) + ", " + centerPosition.get(1) + ", " + centerPosition.get(2));
+ LWJGLUtil.log("Right position: " + rightPosition.get(0) + ", " + rightPosition.get(1) + ", " + rightPosition.get(2));
+
+ while (!finished) {
+ // handle any input
+ handleInput();
+
+ // allow window to process internal messages
+ Display.update();
+
+ // render and paint if !minimized and not dirty
+ if(Display.isVisible()) {
+ render();
+ } else {
+ // sleeeeeep
+ pause(100);
+ }
+
+ // act on pause mode
+ paused(!(Display.isVisible() || Display.isActive()));
+
+ // start sound after first paint, since we don't want
+ // the delay before something is painted on the screen
+ if (firstRun && !pauseMode) {
+ firstRun = false;
+
+ // start sounds with delays
+ startSounds();
+ }
+ }
+ }
+
+ /**
+ * Starts playing the sounds at different times
+ */
+ private void startSounds() {
+ AL10.alSourcePlay(soundSources.get(LEFT));
+ pause(300);
+ AL10.alSourcePlay(soundSources.get(CENTER));
+ pause(500);
+ AL10.alSourcePlay(soundSources.get(RIGHT));
+ }
+
+ /**
+ * Handles any changes in pause mode
+ *
+ * @param paused Which pause mode to enter
+ */
+ private void paused(boolean paused) {
+ // if requesting pause, and not paused - pause and stop sound
+ if(paused && !pauseMode) {
+ pauseMode = true;
+ AL10.alSourcePause(soundSources);
+ System.out.println("pauseMode = true");
+ }
+
+ // else go out of pause mode and start sounds
+ else if(!paused && pauseMode) {
+ pauseMode = false;
+ startSounds();
+ System.out.println("pauseMode = false");
+ }
+ }
+
+ /**
+ * Handles any input
+ */
+ private void handleInput() {
+ // User wants to exit?
+ finished = Display.isCloseRequested() || Keyboard.isKeyDown(Keyboard.KEY_ESCAPE);
+ if (finished) {
+ return;
+ }
+
+ boolean shift = Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT);
+
+ // Test for play
+ // ============================================
+ if (Keyboard.isKeyDown(Keyboard.KEY_1)) {
+ AL10.alSourcePlay(soundSources.get(LEFT));
+ LWJGLUtil.log("Playing left.wav");
+ }
+
+ if (Keyboard.isKeyDown(Keyboard.KEY_2)) {
+ AL10.alSourcePlay(soundSources.get(CENTER));
+ LWJGLUtil.log("Playing center.wav");
+ }
+
+ if (Keyboard.isKeyDown(Keyboard.KEY_3)) {
+ AL10.alSourcePlay(soundSources.get(RIGHT));
+ LWJGLUtil.log("Playing right.wav");
+ }
+ // --------------------------------------------
+
+ // Test for stop
+ // ============================================
+ if (Keyboard.isKeyDown(Keyboard.KEY_4)) {
+ AL10.alSourceStop(soundSources.get(LEFT));
+ LWJGLUtil.log("Stopped left.wav");
+ }
+
+ if (Keyboard.isKeyDown(Keyboard.KEY_5)) {
+ AL10.alSourceStop(soundSources.get(CENTER));
+ LWJGLUtil.log("Stopped center.wav");
+ }
+
+ if (Keyboard.isKeyDown(Keyboard.KEY_6)) {
+ AL10.alSourceStop(soundSources.get(RIGHT));
+ LWJGLUtil.log("Stopped right.wav");
+ }
+ // --------------------------------------------
+
+ // Test for movement with keyboard
+ // ============================================
+ if (Keyboard.isKeyDown(Keyboard.KEY_LEFT)) {
+ listenerPosition.put(0, listenerPosition.get(0) - 0.1f);
+ AL10.alListener(AL10.AL_POSITION, listenerPosition);
+ }
+
+ if (Keyboard.isKeyDown(Keyboard.KEY_RIGHT)) {
+ listenerPosition.put(0, listenerPosition.get(0) + 0.1f);
+ AL10.alListener(AL10.AL_POSITION, listenerPosition);
+ }
+
+ if (Keyboard.isKeyDown(Keyboard.KEY_UP)) {
+ if (shift) {
+ listenerPosition.put(1, listenerPosition.get(1) + 0.1f);
+ } else {
+ listenerPosition.put(2, listenerPosition.get(2) - 0.1f);
+ }
+ AL10.alListener(AL10.AL_POSITION, listenerPosition);
+ }
+
+ if (Keyboard.isKeyDown(Keyboard.KEY_DOWN)) {
+ if (shift) {
+ listenerPosition.put(1, listenerPosition.get(1) - 0.1f);
+ } else {
+ listenerPosition.put(2, listenerPosition.get(2) + 0.1f);
+ }
+ AL10.alListener(AL10.AL_POSITION, listenerPosition);
+ }
+ // --------------------------------------------
+
+ // Test for movement with Mouse
+ // ============================================
+ listenerPosition.put(0, listenerPosition.get(0) + (0.01f * Mouse.getDX()));
+ listenerPosition.put(1, listenerPosition.get(1) + (0.01f * Mouse.getDY()));
+ if (Mouse.isButtonDown(0)) {
+ listenerPosition.put(2, listenerPosition.get(2) - 0.1f);
+ }
+ if (Mouse.isButtonDown(1)) {
+ listenerPosition.put(2, listenerPosition.get(2) + 0.1f);
+ }
+
+ AL10.alListener(AL10.AL_POSITION, listenerPosition);
+
+ // empty mouse buffer
+ while(Mouse.next());
+ }
+
+ /**
+ * Render the scene
+ */
+ private void render() {
+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
+ GL11.glPushMatrix();
+ {
+ GL11.glRotatef(20.0f, 1.0f, 1.0f, 0.0f);
+
+ // left
+ GL11.glPushMatrix();
+ {
+ GL11.glTranslatef(leftPosition.get(0), leftPosition.get(1), leftPosition.get(2));
+ GL11.glColor3f(1.0f, 0.0f, 0.0f);
+ glut.glutWireCube(0.5f);
+ }
+ GL11.glPopMatrix();
+
+ // center
+ GL11.glPushMatrix();
+ {
+ GL11.glTranslatef(centerPosition.get(0), centerPosition.get(1), centerPosition.get(2));
+ GL11.glColor3f(0.0f, 0.0f, 1.0f);
+ glut.glutWireCube(0.5f);
+ }
+ GL11.glPopMatrix();
+
+ // right
+ GL11.glPushMatrix();
+ {
+ GL11.glTranslatef(rightPosition.get(0), rightPosition.get(1), rightPosition.get(2));
+ GL11.glColor3f(0.0f, 1.0f, 0.0f);
+ glut.glutWireCube(0.5f);
+ }
+ GL11.glPopMatrix();
+
+ // listener
+ GL11.glPushMatrix();
+ {
+ GL11.glTranslatef(listenerPosition.get(0), listenerPosition.get(1), listenerPosition.get(2));
+ GL11.glColor3f(1.0f, 1.0f, 1.0f);
+ glut.glutSolidCube(0.5f);
+ }
+ GL11.glPopMatrix();
+ }
+ GL11.glPopMatrix();
+ }
+
+ /**
+ * Shutdown of demonstration
+ */
+ private void shutdown() {
+ LWJGLUtil.log("Shutting down OpenAL");
+ AL10.alSourceStop(soundSources);
+ AL10.alDeleteSources(soundSources);
+ AL10.alDeleteBuffers(soundBuffers);
+ AL.destroy();
+
+ LWJGLUtil.log("Shutting down Window");
+ Display.destroy();
+ }
+
+ /**
+ * main entry point
+ *
+ * @param args
+ * String array containing arguments
+ */
+ public static void main(String[] args) {
+ PositionTest positionTest = new PositionTest();
+ positionTest.execute(args);
+ System.exit(0);
+ }
+
+ /**
+ * Minute implementation of GLUT: <br>COPYRIGHT:
+ *
+ * The OpenGL Utility Toolkit distribution for Win32 (Windows NT & Windows
+ * 95) contains source code modified from the original source code for GLUT
+ * version 3.3 which was developed by Mark J. Kilgard. The original source
+ * code for GLUT is Copyright 1997 by Mark J. Kilgard. GLUT for Win32 is
+ * Copyright 1997 by Nate Robins and is not in the public domain, but it is
+ * freely distributable without licensing fees. It is provided without
+ * guarantee or warrantee expressed or implied. It was ported with the
+ * permission of Mark J. Kilgard by Nate Robins.
+ *
+ * THIS SOURCE CODE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OR MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ */
+ class GLUT {
+
+ float n[][] = new float[][] { { -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 }
+ };
+
+ int faces[][] = new int[][] { { 0, 1, 2, 3 }, {
+ 3, 2, 6, 7 }, {
+ 7, 6, 5, 4 }, {
+ 4, 5, 1, 0 }, {
+ 5, 6, 2, 1 }, {
+ 7, 4, 0, 3 }
+ };
+ float v[][] = new float[8][3];
+
+ public void glutWireCube(float size) {
+ drawBox(size, GL11.GL_LINE_LOOP);
+ }
+
+ public void glutSolidCube(float size) {
+ drawBox(size, GL11.GL_QUADS);
+ }
+
+ private void drawBox(float size, int type) {
+
+ v[0][0] = v[1][0] = v[2][0] = v[3][0] = -size / 2;
+ v[4][0] = v[5][0] = v[6][0] = v[7][0] = size / 2;
+ v[0][1] = v[1][1] = v[4][1] = v[5][1] = -size / 2;
+ v[2][1] = v[3][1] = v[6][1] = v[7][1] = size / 2;
+ v[0][2] = v[3][2] = v[4][2] = v[7][2] = -size / 2;
+ v[1][2] = v[2][2] = v[5][2] = v[6][2] = size / 2;
+
+ for (int i = 5; i >= 0; i--) {
+ GL11.glBegin(type);
+ GL11.glNormal3f(n[i][0], n[i][1], n[i][2]);
+ GL11.glVertex3f(v[faces[i][0]][0], v[faces[i][0]][1], v[faces[i][0]][2]);
+ GL11.glVertex3f(v[faces[i][1]][0], v[faces[i][1]][1], v[faces[i][1]][2]);
+ GL11.glVertex3f(v[faces[i][2]][0], v[faces[i][2]][1], v[faces[i][2]][2]);
+ GL11.glVertex3f(v[faces[i][3]][0], v[faces[i][3]][1], v[faces[i][3]][2]);
+ GL11.glEnd();
+ }
+
+ }
+ }
+}
diff --git a/src/java/org/lwjgl/test/openal/SourceLimitTest.java b/src/java/org/lwjgl/test/openal/SourceLimitTest.java
index 98e7a1b..988a37c 100644
--- a/src/java/org/lwjgl/test/openal/SourceLimitTest.java
+++ b/src/java/org/lwjgl/test/openal/SourceLimitTest.java
@@ -1,165 +1,165 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.openal;
-
-import java.nio.IntBuffer;
-
-import org.lwjgl.BufferUtils;
-import org.lwjgl.openal.AL10;
-import org.lwjgl.openal.OpenALException;
-
-/**
- *
- * Simple test for testing the number of available sources
- *
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 2983 $
- * $Id: SourceLimitTest.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public class SourceLimitTest extends BasicTest {
-
- /** Sources to create */
- protected int sourcesToCreate = 64;
-
- /**
- * Creates an instance of SourceLimitTest
- */
- public SourceLimitTest() {
- super();
- }
-
- /**
- * Runs the actual test, using supplied arguments
- */
- protected void execute(String[] args) {
- //parse 1st arg to sourcecount
- if (args.length > 0) {
- try {
- sourcesToCreate = Integer.parseInt(args[0]);
- } catch (NumberFormatException nfe) {
- System.out.println(
- "Unable to parse parameter to integer. Defaulting to 64 sources.");
- }
- }
-
- System.out.print("Creating " + sourcesToCreate + " in one go...");
- try {
- CreateAllSources();
- } catch(OpenALException oale) {
- oale.printStackTrace();
- }
-
-
- System.out.print("Creating " + sourcesToCreate + " one at a time...");
- try {
- CreateSourcesStep();
- } catch(Exception e) {
- e.printStackTrace();
- }
- //shutdown
- alExit();
- }
-
- /**
- * Tests the creation of n sources in on go
- */
- protected void CreateAllSources() {
- int lastError;
-
- //make bytbuffer that can hold sourcesToCreate sources
- IntBuffer sources = BufferUtils.createIntBuffer(sourcesToCreate);
-
- //Create sourcesToCreate sources in one fell swoop
- try {
- sources.position(0).limit(sourcesToCreate);
- AL10.alGenSources(sources);
-
- //delete sources
- sources.position(0).limit(sourcesToCreate);
- AL10.alDeleteSources(sources);
-
- System.out.println("created " + sourcesToCreate + " sources successfully!");
- } catch (OpenALException oale) {
- System.out.println("Unable to create " + sourcesToCreate + " sources");
- }
- }
-
- /**
- * Tests if n sources can be created one at a time
- */
- protected void CreateSourcesStep() {
- int lastError;
- int sourcesCreated = 0;
-
- //make bytbuffer that can hold sourcesToCreate sources
- IntBuffer[] sources = new IntBuffer[sourcesToCreate];
-
- //create the sources
- try {
- for (int i = 0; i < sourcesToCreate; i++) {
- sources[i] = BufferUtils.createIntBuffer(1);
- sources[i].position(0).limit(1);
- AL10.alGenSources(sources[i]);
- if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
- break;
- }
- sourcesCreated++;
- }
- } catch (OpenALException oale) {
- System.out.println("failed to create source: " + (sourcesCreated + 1));
- }
-
- //delete allocated sources
- for (int i = 0; i < sourcesCreated; i++) {
- //delete buffers and sources
- sources[i].position(0).limit(1);
- AL10.alDeleteSources(sources[i]);
- }
-
- if(sourcesCreated != sourcesToCreate) {
- System.out.println("created " + sourcesCreated + " sources before failing");
- } else {
- System.out.println("created " + sourcesCreated + " sources successfully!");
- }
- }
-
- /**
- * main entry point
- *
- * @param args String array containing arguments
- */
- public static void main(String[] args) {
- SourceLimitTest sourceLimitTest = new SourceLimitTest();
- sourceLimitTest.execute(args);
- System.exit(0);
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.openal;
+
+import java.nio.IntBuffer;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.openal.AL10;
+import org.lwjgl.openal.OpenALException;
+
+/**
+ *
+ * Simple test for testing the number of available sources
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 2983 $
+ * $Id: SourceLimitTest.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public class SourceLimitTest extends BasicTest {
+
+ /** Sources to create */
+ protected int sourcesToCreate = 64;
+
+ /**
+ * Creates an instance of SourceLimitTest
+ */
+ public SourceLimitTest() {
+ super();
+ }
+
+ /**
+ * Runs the actual test, using supplied arguments
+ */
+ protected void execute(String[] args) {
+ //parse 1st arg to sourcecount
+ if (args.length > 0) {
+ try {
+ sourcesToCreate = Integer.parseInt(args[0]);
+ } catch (NumberFormatException nfe) {
+ System.out.println(
+ "Unable to parse parameter to integer. Defaulting to 64 sources.");
+ }
+ }
+
+ System.out.print("Creating " + sourcesToCreate + " in one go...");
+ try {
+ CreateAllSources();
+ } catch(OpenALException oale) {
+ oale.printStackTrace();
+ }
+
+
+ System.out.print("Creating " + sourcesToCreate + " one at a time...");
+ try {
+ CreateSourcesStep();
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
+ //shutdown
+ alExit();
+ }
+
+ /**
+ * Tests the creation of n sources in on go
+ */
+ protected void CreateAllSources() {
+ int lastError;
+
+ //make bytbuffer that can hold sourcesToCreate sources
+ IntBuffer sources = BufferUtils.createIntBuffer(sourcesToCreate);
+
+ //Create sourcesToCreate sources in one fell swoop
+ try {
+ sources.position(0).limit(sourcesToCreate);
+ AL10.alGenSources(sources);
+
+ //delete sources
+ sources.position(0).limit(sourcesToCreate);
+ AL10.alDeleteSources(sources);
+
+ System.out.println("created " + sourcesToCreate + " sources successfully!");
+ } catch (OpenALException oale) {
+ System.out.println("Unable to create " + sourcesToCreate + " sources");
+ }
+ }
+
+ /**
+ * Tests if n sources can be created one at a time
+ */
+ protected void CreateSourcesStep() {
+ int lastError;
+ int sourcesCreated = 0;
+
+ //make bytbuffer that can hold sourcesToCreate sources
+ IntBuffer[] sources = new IntBuffer[sourcesToCreate];
+
+ //create the sources
+ try {
+ for (int i = 0; i < sourcesToCreate; i++) {
+ sources[i] = BufferUtils.createIntBuffer(1);
+ sources[i].position(0).limit(1);
+ AL10.alGenSources(sources[i]);
+ if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
+ break;
+ }
+ sourcesCreated++;
+ }
+ } catch (OpenALException oale) {
+ System.out.println("failed to create source: " + (sourcesCreated + 1));
+ }
+
+ //delete allocated sources
+ for (int i = 0; i < sourcesCreated; i++) {
+ //delete buffers and sources
+ sources[i].position(0).limit(1);
+ AL10.alDeleteSources(sources[i]);
+ }
+
+ if(sourcesCreated != sourcesToCreate) {
+ System.out.println("created " + sourcesCreated + " sources before failing");
+ } else {
+ System.out.println("created " + sourcesCreated + " sources successfully!");
+ }
+ }
+
+ /**
+ * main entry point
+ *
+ * @param args String array containing arguments
+ */
+ public static void main(String[] args) {
+ SourceLimitTest sourceLimitTest = new SourceLimitTest();
+ sourceLimitTest.execute(args);
+ System.exit(0);
+ }
+}
diff --git a/src/java/org/lwjgl/test/openal/StressTest.java b/src/java/org/lwjgl/test/openal/StressTest.java
index f67b7d8..1e65e82 100644
--- a/src/java/org/lwjgl/test/openal/StressTest.java
+++ b/src/java/org/lwjgl/test/openal/StressTest.java
@@ -1,223 +1,223 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.openal;
-
-import java.nio.IntBuffer;
-
-import org.lwjgl.BufferUtils;
-import org.lwjgl.openal.AL10;
-import org.lwjgl.util.WaveData;
-
-/**
- *
- * Simple test for stresstesting OpenAL playing random samples ad nausea
- *
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 2983 $
- * $Id: StressTest.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public class StressTest extends BasicTest {
-
- /** Buffer containing sources */
- private IntBuffer sources;
-
- /** Buffer containing buffers */
- private IntBuffer buffers;
-
- /**
- * Creates an instance of StressTest
- */
- public StressTest() {
- super();
- }
-
- /**
- * Runs the actual test, using supplied arguments
- */
- protected void execute(String[] args) {
-
- createSources();
-
- createBuffers();
-
- try {
- loadSamples();
- runTest();
- } catch (Exception e) {
- e.printStackTrace();
- }
-
-
- alExit();
- }
-
- private void createSources() {
- sources = BufferUtils.createIntBuffer(4);
- sources.position(0).limit(4);
- AL10.alGenSources(sources);
- if (AL10.alGetError() != AL10.AL_NO_ERROR) {
- System.out.println("Unable to create 4 sources");
- alExit();
- }
- }
-
- private void createBuffers() {
- buffers = BufferUtils.createIntBuffer(10);
- buffers.position(0).limit(10);
- AL10.alGenBuffers(buffers);
- if (AL10.alGetError() != AL10.AL_NO_ERROR) {
- System.out.println("Unable to create 10 buffers");
- sources.position(0).limit(4);
- AL10.alDeleteSources(sources);
- alExit();
- }
- }
-
- private void loadSamples() throws Exception {
- AL10.alGetError();
- WaveData data = WaveData.create("ding.wav");
- for (int i = 1; i <= 10; i++) {
- AL10.alBufferData(
- buffers.get(i - 1),
- data.format,
- data.data,
- data.samplerate);
-
- if (AL10.alGetError() != AL10.AL_NO_ERROR) {
- System.out.println("Failed to load " + i + ".wav into buffer");
- sources.position(0).limit(4);
- AL10.alDeleteSources(sources);
- buffers.position(0).limit(10);
- AL10.alDeleteBuffers(buffers);
-
- alExit();
- }
- }
- data.dispose();
- }
-
- public void runTest() {
- int iterations = 0;
- int randomBuffer;
- int startSlot = 1;
- int nextSlot = startSlot;
- long startTime = System.currentTimeMillis();
-
- //mark background source as looping
- AL10.alSourcei(sources.get(0), AL10.AL_LOOPING, AL10.AL_TRUE);
-
- //play background
- AL10.alSourcei(sources.get(0), AL10.AL_BUFFER, buffers.get(0));
- AL10.alSourcePlay(sources.get(0));
-
- while (System.currentTimeMillis() - startTime < (2000)) {
-
- randomBuffer = getRandomBuffer();
- System.out.println("random:" + randomBuffer);
-
- //stop source at slot
- AL10.alSourceStop(sources.get(nextSlot));
- if (AL10.alGetError() != AL10.AL_NO_ERROR) {
- System.out.println("Error stopping source.");
- }
- System.out.println("Stopped source: " + nextSlot);
-
- //link source<->buffer
- AL10.alSourcei(sources.get(nextSlot), AL10.AL_BUFFER, buffers.get(randomBuffer));
- if (AL10.alGetError() != AL10.AL_NO_ERROR) {
- System.out.println("Error linking buffer and source.");
- }
- System.out.println("linked source " + nextSlot + " with buffer " + randomBuffer);
-
- //start playing
- System.out.println("playing source " + nextSlot);
- AL10.alSourcePlay(sources.get(nextSlot++));
- if (nextSlot == 4) {
- nextSlot = startSlot;
- }
-
- //pause
- try {
- Thread.sleep(500);
- } catch (InterruptedException inte) {
- }
-
- //debug info
- if ((++iterations % 10) == 0) {
- System.out.println("========================");
- System.out.println("MaxMemory: " + Runtime.getRuntime().maxMemory() / 1024);
- System.out.println("FreeMemory: " + Runtime.getRuntime().freeMemory() / 1024);
- System.out.println("TotalMemory: " + Runtime.getRuntime().totalMemory() / 1024);
- System.out.println("========================");
- }
- }
-
- //stop all sources
- for (int i = 0; i < 4; i++) {
- AL10.alSourceStop(sources.get(i));
- System.out.println("Stopping source " + (i+1));
- }
-
- //test done - ask for user input
- try {
- System.out.println("Test completed");
- System.out.println("========================");
- System.out.println("MaxMemory: " + Runtime.getRuntime().maxMemory() / 1024);
- System.out.println("FreeMemory: " + Runtime.getRuntime().freeMemory() / 1024);
- System.out.println("TotalMemory: " + Runtime.getRuntime().totalMemory() / 1024);
- System.out.println("========================");
- System.out.println("Push any key to exit...");
- System.in.read();
- } catch (Exception e) {
- }
-
- sources.position(0).limit(4);
- AL10.alDeleteSources(sources);
- buffers.position(0).limit(10);
- AL10.alDeleteBuffers(buffers);
- }
-
- private int getRandomBuffer() {
- return (int) (Math.random() * 10.0);
- }
-
- /**
- * main entry point
- *
- * @param args String array containing arguments
- */
- public static void main(String[] args) {
- StressTest stressTest = new StressTest();
- stressTest.execute(args);
- System.exit(0);
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.openal;
+
+import java.nio.IntBuffer;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.openal.AL10;
+import org.lwjgl.util.WaveData;
+
+/**
+ *
+ * Simple test for stresstesting OpenAL playing random samples ad nausea
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 2983 $
+ * $Id: StressTest.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public class StressTest extends BasicTest {
+
+ /** Buffer containing sources */
+ private IntBuffer sources;
+
+ /** Buffer containing buffers */
+ private IntBuffer buffers;
+
+ /**
+ * Creates an instance of StressTest
+ */
+ public StressTest() {
+ super();
+ }
+
+ /**
+ * Runs the actual test, using supplied arguments
+ */
+ protected void execute(String[] args) {
+
+ createSources();
+
+ createBuffers();
+
+ try {
+ loadSamples();
+ runTest();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+
+ alExit();
+ }
+
+ private void createSources() {
+ sources = BufferUtils.createIntBuffer(4);
+ sources.position(0).limit(4);
+ AL10.alGenSources(sources);
+ if (AL10.alGetError() != AL10.AL_NO_ERROR) {
+ System.out.println("Unable to create 4 sources");
+ alExit();
+ }
+ }
+
+ private void createBuffers() {
+ buffers = BufferUtils.createIntBuffer(10);
+ buffers.position(0).limit(10);
+ AL10.alGenBuffers(buffers);
+ if (AL10.alGetError() != AL10.AL_NO_ERROR) {
+ System.out.println("Unable to create 10 buffers");
+ sources.position(0).limit(4);
+ AL10.alDeleteSources(sources);
+ alExit();
+ }
+ }
+
+ private void loadSamples() throws Exception {
+ AL10.alGetError();
+ WaveData data = WaveData.create("ding.wav");
+ for (int i = 1; i <= 10; i++) {
+ AL10.alBufferData(
+ buffers.get(i - 1),
+ data.format,
+ data.data,
+ data.samplerate);
+
+ if (AL10.alGetError() != AL10.AL_NO_ERROR) {
+ System.out.println("Failed to load " + i + ".wav into buffer");
+ sources.position(0).limit(4);
+ AL10.alDeleteSources(sources);
+ buffers.position(0).limit(10);
+ AL10.alDeleteBuffers(buffers);
+
+ alExit();
+ }
+ }
+ data.dispose();
+ }
+
+ public void runTest() {
+ int iterations = 0;
+ int randomBuffer;
+ int startSlot = 1;
+ int nextSlot = startSlot;
+ long startTime = System.currentTimeMillis();
+
+ //mark background source as looping
+ AL10.alSourcei(sources.get(0), AL10.AL_LOOPING, AL10.AL_TRUE);
+
+ //play background
+ AL10.alSourcei(sources.get(0), AL10.AL_BUFFER, buffers.get(0));
+ AL10.alSourcePlay(sources.get(0));
+
+ while (System.currentTimeMillis() - startTime < (2000)) {
+
+ randomBuffer = getRandomBuffer();
+ System.out.println("random:" + randomBuffer);
+
+ //stop source at slot
+ AL10.alSourceStop(sources.get(nextSlot));
+ if (AL10.alGetError() != AL10.AL_NO_ERROR) {
+ System.out.println("Error stopping source.");
+ }
+ System.out.println("Stopped source: " + nextSlot);
+
+ //link source<->buffer
+ AL10.alSourcei(sources.get(nextSlot), AL10.AL_BUFFER, buffers.get(randomBuffer));
+ if (AL10.alGetError() != AL10.AL_NO_ERROR) {
+ System.out.println("Error linking buffer and source.");
+ }
+ System.out.println("linked source " + nextSlot + " with buffer " + randomBuffer);
+
+ //start playing
+ System.out.println("playing source " + nextSlot);
+ AL10.alSourcePlay(sources.get(nextSlot++));
+ if (nextSlot == 4) {
+ nextSlot = startSlot;
+ }
+
+ //pause
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException inte) {
+ }
+
+ //debug info
+ if ((++iterations % 10) == 0) {
+ System.out.println("========================");
+ System.out.println("MaxMemory: " + Runtime.getRuntime().maxMemory() / 1024);
+ System.out.println("FreeMemory: " + Runtime.getRuntime().freeMemory() / 1024);
+ System.out.println("TotalMemory: " + Runtime.getRuntime().totalMemory() / 1024);
+ System.out.println("========================");
+ }
+ }
+
+ //stop all sources
+ for (int i = 0; i < 4; i++) {
+ AL10.alSourceStop(sources.get(i));
+ System.out.println("Stopping source " + (i+1));
+ }
+
+ //test done - ask for user input
+ try {
+ System.out.println("Test completed");
+ System.out.println("========================");
+ System.out.println("MaxMemory: " + Runtime.getRuntime().maxMemory() / 1024);
+ System.out.println("FreeMemory: " + Runtime.getRuntime().freeMemory() / 1024);
+ System.out.println("TotalMemory: " + Runtime.getRuntime().totalMemory() / 1024);
+ System.out.println("========================");
+ System.out.println("Push any key to exit...");
+ System.in.read();
+ } catch (Exception e) {
+ }
+
+ sources.position(0).limit(4);
+ AL10.alDeleteSources(sources);
+ buffers.position(0).limit(10);
+ AL10.alDeleteBuffers(buffers);
+ }
+
+ private int getRandomBuffer() {
+ return (int) (Math.random() * 10.0);
+ }
+
+ /**
+ * main entry point
+ *
+ * @param args String array containing arguments
+ */
+ public static void main(String[] args) {
+ StressTest stressTest = new StressTest();
+ stressTest.execute(args);
+ System.exit(0);
+ }
+}
diff --git a/src/java/org/lwjgl/test/opengl/FullScreenWindowedTest.java b/src/java/org/lwjgl/test/opengl/FullScreenWindowedTest.java
index d749c8a..d05ef3e 100644
--- a/src/java/org/lwjgl/test/opengl/FullScreenWindowedTest.java
+++ b/src/java/org/lwjgl/test/opengl/FullScreenWindowedTest.java
@@ -1,279 +1,279 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.opengl;
-
-import org.lwjgl.LWJGLException;
-import org.lwjgl.input.Keyboard;
-import org.lwjgl.opengl.Display;
-import org.lwjgl.opengl.DisplayMode;
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.util.glu.GLU;
-import org.lwjgl.util.vector.Vector2f;
-
-/**
- *
- * Tests switching between windowed and fullscreen
- *
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 3172 $
- * $Id: FullScreenWindowedTest.java 3172 2008-12-28 19:30:43Z elias_naur $
- */
-public class FullScreenWindowedTest {
- /** Intended deiplay mode */
- private DisplayMode mode;
- /** our quad moving around */
- private Vector2f quadPosition;
- /** our quadVelocity */
- private Vector2f quadVelocity;
- /** angle of quad */
- private float angle;
- /** degrees to rotate per frame */
- private float angleRotation = 1.0f;
- /** Max speed of all changable attributes */
- private static final float MAX_SPEED = 20.0f;
-
- /**
- * Creates a FullScreenWindowedTest
- */
- public FullScreenWindowedTest() {
- }
- /**
- * Executes the test
- */
- public void execute() {
- initialize();
- mainLoop();
- cleanup();
- }
-
- private void switchMode() throws LWJGLException {
- mode = findDisplayMode(800, 600, Display.getDisplayMode().getBitsPerPixel());
- Display.setDisplayModeAndFullscreen(mode);
- }
-
- /**
- * Initializes the test
- */
- private void initialize() {
- try {
- //find displaymode
- switchMode();
- // start of in windowed mode
- Display.create();
- glInit();
- quadPosition = new Vector2f(100f, 100f);
- quadVelocity = new Vector2f(1.0f, 1.0f);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- /**
- * Runs the main loop of the "test"
- */
- private void mainLoop() {
- while (!Keyboard.isKeyDown(Keyboard.KEY_ESCAPE) && !Display.isCloseRequested()) {
- if (Display.isVisible()) {
- // check keyboard input
- processKeyboard();
- // do "game" logic, and render it
- logic();
- render();
- } else {
- // no need to render/paint if nothing has changed (ie. window
- // dragged over)
- if (Display.isDirty()) {
- render();
- }
- // don't waste cpu time, sleep more
- try {
- Thread.sleep(100);
- } catch (InterruptedException inte) {
- }
- }
- // Update window
- Display.update();
- }
- }
- /**
- * Performs the logic
- */
- private void logic() {
- angle += angleRotation;
- if (angle > 90.0f) {
- angle = 0.0f;
- }
- quadPosition.x += quadVelocity.x;
- quadPosition.y += quadVelocity.y;
- //check colision with vertical border border
- if (quadPosition.x + 50 >= mode.getWidth() || quadPosition.x - 50 <= 0) {
- quadVelocity.x *= -1;
- }
- //check collision with horizontal border
- if (quadPosition.y + 50 >= mode.getHeight() || quadPosition.y - 50 <= 0) {
- quadVelocity.y *= -1;
- }
- }
- private void render() {
- //clear background
- GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
- // draw white quad
- GL11.glPushMatrix();
- {
- GL11.glTranslatef(quadPosition.x, quadPosition.y, 0);
- GL11.glRotatef(angle, 0.0f, 0.0f, 1.0f);
- GL11.glColor3f(1.0f, 1.0f, 1.0f);
- GL11.glBegin(GL11.GL_QUADS);
- {
- GL11.glVertex2i(-50, -50);
- GL11.glVertex2i(50, -50);
- GL11.glVertex2i(50, 50);
- GL11.glVertex2i(-50, 50);
- }
- GL11.glEnd();
- }
- GL11.glPopMatrix();
- }
- /**
- * Processes keyboard input
- */
- private void processKeyboard() {
- //check for fullscreen key
- if (Keyboard.isKeyDown(Keyboard.KEY_F)) {
- try {
- switchMode();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- //check for window key
- if (Keyboard.isKeyDown(Keyboard.KEY_W)) {
- try {
- mode = new DisplayMode(640, 480);
- Display.setDisplayModeAndFullscreen(mode);
- glInit();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- //check for speed changes
- if (Keyboard.isKeyDown(Keyboard.KEY_UP)) {
- quadVelocity.y += 0.1f;
- }
- if (Keyboard.isKeyDown(Keyboard.KEY_DOWN)) {
- quadVelocity.y -= 0.1f;
- }
- if (Keyboard.isKeyDown(Keyboard.KEY_RIGHT)) {
- quadVelocity.x += 0.1f;
- }
- if (Keyboard.isKeyDown(Keyboard.KEY_LEFT)) {
- quadVelocity.x -= 0.1f;
- }
- if (Keyboard.isKeyDown(Keyboard.KEY_ADD)) {
- angleRotation += 0.1f;
- }
- if (Keyboard.isKeyDown(Keyboard.KEY_SUBTRACT)) {
- angleRotation -= 0.1f;
- }
- //throttle
- if (quadVelocity.x < -MAX_SPEED) {
- quadVelocity.x = -MAX_SPEED;
- }
- if (quadVelocity.x > MAX_SPEED) {
- quadVelocity.x = MAX_SPEED;
- }
- if (quadVelocity.y < -MAX_SPEED) {
- quadVelocity.y = -MAX_SPEED;
- }
- if (quadVelocity.y > MAX_SPEED) {
- quadVelocity.y = MAX_SPEED;
- }
- if (angleRotation < 0.0f) {
- angleRotation = 0.0f;
- }
- if (angleRotation > MAX_SPEED) {
- angleRotation = MAX_SPEED;
- }
- }
- /**
- * Cleans up the test
- */
- private void cleanup() {
- Display.destroy();
- }
-
- /**
- * Retrieves a displaymode, if one such is available
- *
- * @param width
- * Required width
- * @param height
- * Required height
- * @param bpp
- * Minimum required bits per pixel
- * @return
- */
- private DisplayMode findDisplayMode(int width, int height, int bpp) throws LWJGLException {
- DisplayMode[] modes = Display.getAvailableDisplayModes();
- for (int i = 0; i < modes.length; i++) {
- if (modes[i].getWidth() == width && modes[i].getHeight() == height && modes[i].getBitsPerPixel() >= bpp && modes[i].getFrequency() <= 60) {
- return modes[i];
- }
- }
- return Display.getDesktopDisplayMode();
- }
- /**
- * Initializes OGL
- */
- private void glInit() {
- // Go into orthographic projection mode.
- GL11.glMatrixMode(GL11.GL_PROJECTION);
- GL11.glLoadIdentity();
- GLU.gluOrtho2D(0, mode.getWidth(), 0, mode.getHeight());
- GL11.glMatrixMode(GL11.GL_MODELVIEW);
- GL11.glLoadIdentity();
- GL11.glViewport(0, 0, mode.getWidth(), mode.getHeight());
- //set clear color to black
- GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
- //sync frame (only works on windows)
- Display.setVSyncEnabled(true);
- }
- /**
- * Test entry point
- */
- public static void main(String[] args) {
- System.out.println("Change between fullscreen and windowed mode, by pressing F and W respectively");
- System.out.println("Move quad using arrowkeys, and change rotation using +/-");
- FullScreenWindowedTest fswTest = new FullScreenWindowedTest();
- fswTest.execute();
- System.exit(0);
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.opengl;
+
+import org.lwjgl.LWJGLException;
+import org.lwjgl.input.Keyboard;
+import org.lwjgl.opengl.Display;
+import org.lwjgl.opengl.DisplayMode;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.util.glu.GLU;
+import org.lwjgl.util.vector.Vector2f;
+
+/**
+ *
+ * Tests switching between windowed and fullscreen
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 3172 $
+ * $Id: FullScreenWindowedTest.java 3172 2008-12-28 19:30:43Z elias_naur $
+ */
+public class FullScreenWindowedTest {
+ /** Intended deiplay mode */
+ private DisplayMode mode;
+ /** our quad moving around */
+ private Vector2f quadPosition;
+ /** our quadVelocity */
+ private Vector2f quadVelocity;
+ /** angle of quad */
+ private float angle;
+ /** degrees to rotate per frame */
+ private float angleRotation = 1.0f;
+ /** Max speed of all changable attributes */
+ private static final float MAX_SPEED = 20.0f;
+
+ /**
+ * Creates a FullScreenWindowedTest
+ */
+ public FullScreenWindowedTest() {
+ }
+ /**
+ * Executes the test
+ */
+ public void execute() {
+ initialize();
+ mainLoop();
+ cleanup();
+ }
+
+ private void switchMode() throws LWJGLException {
+ mode = findDisplayMode(800, 600, Display.getDisplayMode().getBitsPerPixel());
+ Display.setDisplayModeAndFullscreen(mode);
+ }
+
+ /**
+ * Initializes the test
+ */
+ private void initialize() {
+ try {
+ //find displaymode
+ switchMode();
+ // start of in windowed mode
+ Display.create();
+ glInit();
+ quadPosition = new Vector2f(100f, 100f);
+ quadVelocity = new Vector2f(1.0f, 1.0f);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ /**
+ * Runs the main loop of the "test"
+ */
+ private void mainLoop() {
+ while (!Keyboard.isKeyDown(Keyboard.KEY_ESCAPE) && !Display.isCloseRequested()) {
+ if (Display.isVisible()) {
+ // check keyboard input
+ processKeyboard();
+ // do "game" logic, and render it
+ logic();
+ render();
+ } else {
+ // no need to render/paint if nothing has changed (ie. window
+ // dragged over)
+ if (Display.isDirty()) {
+ render();
+ }
+ // don't waste cpu time, sleep more
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException inte) {
+ }
+ }
+ // Update window
+ Display.update();
+ }
+ }
+ /**
+ * Performs the logic
+ */
+ private void logic() {
+ angle += angleRotation;
+ if (angle > 90.0f) {
+ angle = 0.0f;
+ }
+ quadPosition.x += quadVelocity.x;
+ quadPosition.y += quadVelocity.y;
+ //check colision with vertical border border
+ if (quadPosition.x + 50 >= mode.getWidth() || quadPosition.x - 50 <= 0) {
+ quadVelocity.x *= -1;
+ }
+ //check collision with horizontal border
+ if (quadPosition.y + 50 >= mode.getHeight() || quadPosition.y - 50 <= 0) {
+ quadVelocity.y *= -1;
+ }
+ }
+ private void render() {
+ //clear background
+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
+ // draw white quad
+ GL11.glPushMatrix();
+ {
+ GL11.glTranslatef(quadPosition.x, quadPosition.y, 0);
+ GL11.glRotatef(angle, 0.0f, 0.0f, 1.0f);
+ GL11.glColor3f(1.0f, 1.0f, 1.0f);
+ GL11.glBegin(GL11.GL_QUADS);
+ {
+ GL11.glVertex2i(-50, -50);
+ GL11.glVertex2i(50, -50);
+ GL11.glVertex2i(50, 50);
+ GL11.glVertex2i(-50, 50);
+ }
+ GL11.glEnd();
+ }
+ GL11.glPopMatrix();
+ }
+ /**
+ * Processes keyboard input
+ */
+ private void processKeyboard() {
+ //check for fullscreen key
+ if (Keyboard.isKeyDown(Keyboard.KEY_F)) {
+ try {
+ switchMode();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ //check for window key
+ if (Keyboard.isKeyDown(Keyboard.KEY_W)) {
+ try {
+ mode = new DisplayMode(640, 480);
+ Display.setDisplayModeAndFullscreen(mode);
+ glInit();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ //check for speed changes
+ if (Keyboard.isKeyDown(Keyboard.KEY_UP)) {
+ quadVelocity.y += 0.1f;
+ }
+ if (Keyboard.isKeyDown(Keyboard.KEY_DOWN)) {
+ quadVelocity.y -= 0.1f;
+ }
+ if (Keyboard.isKeyDown(Keyboard.KEY_RIGHT)) {
+ quadVelocity.x += 0.1f;
+ }
+ if (Keyboard.isKeyDown(Keyboard.KEY_LEFT)) {
+ quadVelocity.x -= 0.1f;
+ }
+ if (Keyboard.isKeyDown(Keyboard.KEY_ADD)) {
+ angleRotation += 0.1f;
+ }
+ if (Keyboard.isKeyDown(Keyboard.KEY_SUBTRACT)) {
+ angleRotation -= 0.1f;
+ }
+ //throttle
+ if (quadVelocity.x < -MAX_SPEED) {
+ quadVelocity.x = -MAX_SPEED;
+ }
+ if (quadVelocity.x > MAX_SPEED) {
+ quadVelocity.x = MAX_SPEED;
+ }
+ if (quadVelocity.y < -MAX_SPEED) {
+ quadVelocity.y = -MAX_SPEED;
+ }
+ if (quadVelocity.y > MAX_SPEED) {
+ quadVelocity.y = MAX_SPEED;
+ }
+ if (angleRotation < 0.0f) {
+ angleRotation = 0.0f;
+ }
+ if (angleRotation > MAX_SPEED) {
+ angleRotation = MAX_SPEED;
+ }
+ }
+ /**
+ * Cleans up the test
+ */
+ private void cleanup() {
+ Display.destroy();
+ }
+
+ /**
+ * Retrieves a displaymode, if one such is available
+ *
+ * @param width
+ * Required width
+ * @param height
+ * Required height
+ * @param bpp
+ * Minimum required bits per pixel
+ * @return
+ */
+ private DisplayMode findDisplayMode(int width, int height, int bpp) throws LWJGLException {
+ DisplayMode[] modes = Display.getAvailableDisplayModes();
+ for (int i = 0; i < modes.length; i++) {
+ if (modes[i].getWidth() == width && modes[i].getHeight() == height && modes[i].getBitsPerPixel() >= bpp && modes[i].getFrequency() <= 60) {
+ return modes[i];
+ }
+ }
+ return Display.getDesktopDisplayMode();
+ }
+ /**
+ * Initializes OGL
+ */
+ private void glInit() {
+ // Go into orthographic projection mode.
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+ GL11.glLoadIdentity();
+ GLU.gluOrtho2D(0, mode.getWidth(), 0, mode.getHeight());
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ GL11.glLoadIdentity();
+ GL11.glViewport(0, 0, mode.getWidth(), mode.getHeight());
+ //set clear color to black
+ GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+ //sync frame (only works on windows)
+ Display.setVSyncEnabled(true);
+ }
+ /**
+ * Test entry point
+ */
+ public static void main(String[] args) {
+ System.out.println("Change between fullscreen and windowed mode, by pressing F and W respectively");
+ System.out.println("Move quad using arrowkeys, and change rotation using +/-");
+ FullScreenWindowedTest fswTest = new FullScreenWindowedTest();
+ fswTest.execute();
+ System.exit(0);
+ }
+}
diff --git a/src/java/org/lwjgl/test/opengl/Gears.java b/src/java/org/lwjgl/test/opengl/Gears.java
index 8ce8672..0fd2269 100644
--- a/src/java/org/lwjgl/test/opengl/Gears.java
+++ b/src/java/org/lwjgl/test/opengl/Gears.java
@@ -1,339 +1,339 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/*
- * 3-D gear wheels. Originally by Brian Paul
- */
-package org.lwjgl.test.opengl;
-
-import java.nio.FloatBuffer;
-
-import org.lwjgl.BufferUtils;
-import org.lwjgl.LWJGLException;
-import org.lwjgl.opengl.ARBTransposeMatrix;
-import org.lwjgl.opengl.Display;
-import org.lwjgl.opengl.DisplayMode;
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.opengl.GLContext;
-
-/**
- * <p>
- * This is the OpenGL "standard" Gears demo, originally by Brian Paul
- * </p>
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 3276 $
- * $Id: Gears.java 3276 2010-02-21 21:18:17Z matzon $
- */
-public class Gears {
-
- private float view_rotx = 20.0f;
-
- private float view_roty = 30.0f;
-
- private float view_rotz = 0.0f;
-
- private int gear1;
-
- private int gear2;
-
- private int gear3;
-
- private float angle = 0.0f;
-
- public static void main(String[] args) {
- new Gears().execute();
- System.exit(0);
- }
-
- /**
- *
- */
- private void execute() {
- try {
- init();
- } catch (LWJGLException le) {
- le.printStackTrace();
- System.out.println("Failed to initialize Gears.");
- return;
- }
-
- loop();
-
- destroy();
- }
-
- /**
- *
- */
- private void destroy() {
- Display.destroy();
- }
-
- /**
- *
- */
- private void loop() {
- long startTime = System.currentTimeMillis() + 5000;
- long fps = 0;
-
- while (!Display.isCloseRequested()) {
- angle += 2.0f;
-
- GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
-
- GL11.glPushMatrix();
- GL11.glRotatef(view_rotx, 1.0f, 0.0f, 0.0f);
- GL11.glRotatef(view_roty, 0.0f, 1.0f, 0.0f);
- GL11.glRotatef(view_rotz, 0.0f, 0.0f, 1.0f);
-
- GL11.glPushMatrix();
- GL11.glTranslatef(-3.0f, -2.0f, 0.0f);
- GL11.glRotatef(angle, 0.0f, 0.0f, 1.0f);
- GL11.glCallList(gear1);
- GL11.glPopMatrix();
-
- GL11.glPushMatrix();
- GL11.glTranslatef(3.1f, -2.0f, 0.0f);
- GL11.glRotatef(-2.0f * angle - 9.0f, 0.0f, 0.0f, 1.0f);
- GL11.glCallList(gear2);
- GL11.glPopMatrix();
-
- GL11.glPushMatrix();
- GL11.glTranslatef(-3.1f, 4.2f, 0.0f);
- GL11.glRotatef(-2.0f * angle - 25.0f, 0.0f, 0.0f, 1.0f);
- GL11.glCallList(gear3);
- GL11.glPopMatrix();
-
- GL11.glPopMatrix();
-
- Display.update();
- if (startTime > System.currentTimeMillis()) {
- fps++;
- } else {
- long timeUsed = 5000 + (startTime - System.currentTimeMillis());
- startTime = System.currentTimeMillis() + 5000;
- System.out.println(fps + " frames in " + (float) (timeUsed / 1000f) + " seconds = "
- + (fps / (timeUsed / 1000f)));
- fps = 0;
- }
- }
- }
-
- /**
- *
- */
- private void init() throws LWJGLException {
- // create Window of size 300x300
- Display.setLocation((Display.getDisplayMode().getWidth() - 300) / 2,
- (Display.getDisplayMode().getHeight() - 300) / 2);
- Display.setDisplayMode(new DisplayMode(300, 300));
- Display.setTitle("Gears");
- Display.create();
-
- // setup ogl
- FloatBuffer pos = BufferUtils.createFloatBuffer(4).put(new float[] { 5.0f, 5.0f, 10.0f, 0.0f});
- FloatBuffer red = BufferUtils.createFloatBuffer(4).put(new float[] { 0.8f, 0.1f, 0.0f, 1.0f});
- FloatBuffer green = BufferUtils.createFloatBuffer(4).put(new float[] { 0.0f, 0.8f, 0.2f, 1.0f});
- FloatBuffer blue = BufferUtils.createFloatBuffer(4).put(new float[] { 0.2f, 0.2f, 1.0f, 1.0f});
-
- pos.flip();
- red.flip();
- green.flip();
- blue.flip();
-
- GL11.glLight(GL11.GL_LIGHT0, GL11.GL_POSITION, pos);
- GL11.glEnable(GL11.GL_CULL_FACE);
- GL11.glEnable(GL11.GL_LIGHTING);
- GL11.glEnable(GL11.GL_LIGHT0);
- GL11.glEnable(GL11.GL_DEPTH_TEST);
-
- /* make the gears */
- gear1 = GL11.glGenLists(1);
- GL11.glNewList(gear1, GL11.GL_COMPILE);
- GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, red);
- gear(1.0f, 4.0f, 1.0f, 20, 0.7f);
- GL11.glEndList();
-
- gear2 = GL11.glGenLists(1);
- GL11.glNewList(gear2, GL11.GL_COMPILE);
- GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, green);
- gear(0.5f, 2.0f, 2.0f, 10, 0.7f);
- GL11.glEndList();
-
- gear3 = GL11.glGenLists(1);
- GL11.glNewList(gear3, GL11.GL_COMPILE);
- GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, blue);
- gear(1.3f, 2.0f, 0.5f, 10, 0.7f);
- GL11.glEndList();
-
- GL11.glEnable(GL11.GL_NORMALIZE);
-
- GL11.glMatrixMode(GL11.GL_PROJECTION);
-
- System.err.println("GL_VENDOR: " + GL11.glGetString(GL11.GL_VENDOR));
- System.err.println("GL_RENDERER: " + GL11.glGetString(GL11.GL_RENDERER));
- System.err.println("GL_VERSION: " + GL11.glGetString(GL11.GL_VERSION));
- System.err.println();
- System.err.println("glLoadTransposeMatrixfARB() supported: " + GLContext.getCapabilities().GL_ARB_transpose_matrix);
- if (!GLContext.getCapabilities().GL_ARB_transpose_matrix) {
- // --- not using extensions
- GL11.glLoadIdentity();
- } else {
- // --- using extensions
- final FloatBuffer identityTranspose = BufferUtils.createFloatBuffer(16).put(
- new float[] { 1, 0, 0, 0, 0, 1, 0, 0,
- 0, 0, 1, 0, 0, 0, 0, 1});
- identityTranspose.flip();
- ARBTransposeMatrix.glLoadTransposeMatrixARB(identityTranspose);
- }
-
- float h = (float) 300 / (float) 300;
- GL11.glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f);
- GL11.glMatrixMode(GL11.GL_MODELVIEW);
- GL11.glLoadIdentity();
- GL11.glTranslatef(0.0f, 0.0f, -40.0f);
- }
-
- /**
- * Draw a gear wheel. You'll probably want to call this function when
- * building a display list since we do a lot of trig here.
- *
- * @param inner_radius radius of hole at center
- * @param outer_radius radius at center of teeth
- * @param width width of gear
- * @param teeth number of teeth
- * @param tooth_depth depth of tooth
- */
- private void gear(float inner_radius, float outer_radius, float width, int teeth, float tooth_depth) {
- int i;
- float r0, r1, r2;
- float angle, da;
- float u, v, len;
-
- r0 = inner_radius;
- r1 = outer_radius - tooth_depth / 2.0f;
- r2 = outer_radius + tooth_depth / 2.0f;
-
- da = 2.0f * (float) Math.PI / teeth / 4.0f;
-
- GL11.glShadeModel(GL11.GL_FLAT);
-
- GL11.glNormal3f(0.0f, 0.0f, 1.0f);
-
- /* draw front face */
- GL11.glBegin(GL11.GL_QUAD_STRIP);
- for (i = 0; i <= teeth; i++) {
- angle = i * 2.0f * (float) Math.PI / teeth;
- GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f);
- if (i < teeth) {
- GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle + 3.0f * da), r1 * (float) Math.sin(angle + 3.0f * da),
- width * 0.5f);
- }
- }
- GL11.glEnd();
-
- /* draw front sides of teeth */
- GL11.glBegin(GL11.GL_QUADS);
- for (i = 0; i < teeth; i++) {
- angle = i * 2.0f * (float) Math.PI / teeth;
- GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), width * 0.5f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + 2.0f * da), r2 * (float) Math.sin(angle + 2.0f * da), width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle + 3.0f * da), r1 * (float) Math.sin(angle + 3.0f * da), width * 0.5f);
- }
- GL11.glEnd();
-
- /* draw back face */
- GL11.glBegin(GL11.GL_QUAD_STRIP);
- for (i = 0; i <= teeth; i++) {
- angle = i * 2.0f * (float) Math.PI / teeth;
- GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f);
- GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f);
- GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f);
- }
- GL11.glEnd();
-
- /* draw back sides of teeth */
- GL11.glBegin(GL11.GL_QUADS);
- for (i = 0; i < teeth; i++) {
- angle = i * 2.0f * (float) Math.PI / teeth;
- GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), -width * 0.5f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), -width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f);
- }
- GL11.glEnd();
-
- /* draw outward faces of teeth */
- GL11.glBegin(GL11.GL_QUAD_STRIP);
- for (i = 0; i < teeth; i++) {
- angle = i * 2.0f * (float) Math.PI / teeth;
- GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f);
- u = r2 * (float) Math.cos(angle + da) - r1 * (float) Math.cos(angle);
- v = r2 * (float) Math.sin(angle + da) - r1 * (float) Math.sin(angle);
- len = (float) Math.sqrt(u * u + v * v);
- u /= len;
- v /= len;
- GL11.glNormal3f(v, -u, 0.0f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), width * 0.5f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), -width * 0.5f);
- GL11.glNormal3f((float) Math.cos(angle), (float) Math.sin(angle), 0.0f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), width * 0.5f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), -width * 0.5f);
- u = r1 * (float) Math.cos(angle + 3 * da) - r2 * (float) Math.cos(angle + 2 * da);
- v = r1 * (float) Math.sin(angle + 3 * da) - r2 * (float) Math.sin(angle + 2 * da);
- GL11.glNormal3f(v, -u, 0.0f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f);
- GL11.glNormal3f((float) Math.cos(angle), (float) Math.sin(angle), 0.0f);
- }
- GL11.glVertex3f(r1 * (float) Math.cos(0), r1 * (float) Math.sin(0), width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(0), r1 * (float) Math.sin(0), -width * 0.5f);
- GL11.glEnd();
-
- GL11.glShadeModel(GL11.GL_SMOOTH);
-
- /* draw inside radius cylinder */
- GL11.glBegin(GL11.GL_QUAD_STRIP);
- for (i = 0; i <= teeth; i++) {
- angle = i * 2.0f * (float) Math.PI / teeth;
- GL11.glNormal3f(-(float) Math.cos(angle), -(float) Math.sin(angle), 0.0f);
- GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f);
- GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f);
- }
- GL11.glEnd();
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/*
+ * 3-D gear wheels. Originally by Brian Paul
+ */
+package org.lwjgl.test.opengl;
+
+import java.nio.FloatBuffer;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.LWJGLException;
+import org.lwjgl.opengl.ARBTransposeMatrix;
+import org.lwjgl.opengl.Display;
+import org.lwjgl.opengl.DisplayMode;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GLContext;
+
+/**
+ * <p>
+ * This is the OpenGL "standard" Gears demo, originally by Brian Paul
+ * </p>
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 3276 $
+ * $Id: Gears.java 3276 2010-02-21 21:18:17Z matzon $
+ */
+public class Gears {
+
+ private float view_rotx = 20.0f;
+
+ private float view_roty = 30.0f;
+
+ private float view_rotz = 0.0f;
+
+ private int gear1;
+
+ private int gear2;
+
+ private int gear3;
+
+ private float angle = 0.0f;
+
+ public static void main(String[] args) {
+ new Gears().execute();
+ System.exit(0);
+ }
+
+ /**
+ *
+ */
+ private void execute() {
+ try {
+ init();
+ } catch (LWJGLException le) {
+ le.printStackTrace();
+ System.out.println("Failed to initialize Gears.");
+ return;
+ }
+
+ loop();
+
+ destroy();
+ }
+
+ /**
+ *
+ */
+ private void destroy() {
+ Display.destroy();
+ }
+
+ /**
+ *
+ */
+ private void loop() {
+ long startTime = System.currentTimeMillis() + 5000;
+ long fps = 0;
+
+ while (!Display.isCloseRequested()) {
+ angle += 2.0f;
+
+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
+
+ GL11.glPushMatrix();
+ GL11.glRotatef(view_rotx, 1.0f, 0.0f, 0.0f);
+ GL11.glRotatef(view_roty, 0.0f, 1.0f, 0.0f);
+ GL11.glRotatef(view_rotz, 0.0f, 0.0f, 1.0f);
+
+ GL11.glPushMatrix();
+ GL11.glTranslatef(-3.0f, -2.0f, 0.0f);
+ GL11.glRotatef(angle, 0.0f, 0.0f, 1.0f);
+ GL11.glCallList(gear1);
+ GL11.glPopMatrix();
+
+ GL11.glPushMatrix();
+ GL11.glTranslatef(3.1f, -2.0f, 0.0f);
+ GL11.glRotatef(-2.0f * angle - 9.0f, 0.0f, 0.0f, 1.0f);
+ GL11.glCallList(gear2);
+ GL11.glPopMatrix();
+
+ GL11.glPushMatrix();
+ GL11.glTranslatef(-3.1f, 4.2f, 0.0f);
+ GL11.glRotatef(-2.0f * angle - 25.0f, 0.0f, 0.0f, 1.0f);
+ GL11.glCallList(gear3);
+ GL11.glPopMatrix();
+
+ GL11.glPopMatrix();
+
+ Display.update();
+ if (startTime > System.currentTimeMillis()) {
+ fps++;
+ } else {
+ long timeUsed = 5000 + (startTime - System.currentTimeMillis());
+ startTime = System.currentTimeMillis() + 5000;
+ System.out.println(fps + " frames in " + (float) (timeUsed / 1000f) + " seconds = "
+ + (fps / (timeUsed / 1000f)));
+ fps = 0;
+ }
+ }
+ }
+
+ /**
+ *
+ */
+ private void init() throws LWJGLException {
+ // create Window of size 300x300
+ Display.setLocation((Display.getDisplayMode().getWidth() - 300) / 2,
+ (Display.getDisplayMode().getHeight() - 300) / 2);
+ Display.setDisplayMode(new DisplayMode(300, 300));
+ Display.setTitle("Gears");
+ Display.create();
+
+ // setup ogl
+ FloatBuffer pos = BufferUtils.createFloatBuffer(4).put(new float[] { 5.0f, 5.0f, 10.0f, 0.0f});
+ FloatBuffer red = BufferUtils.createFloatBuffer(4).put(new float[] { 0.8f, 0.1f, 0.0f, 1.0f});
+ FloatBuffer green = BufferUtils.createFloatBuffer(4).put(new float[] { 0.0f, 0.8f, 0.2f, 1.0f});
+ FloatBuffer blue = BufferUtils.createFloatBuffer(4).put(new float[] { 0.2f, 0.2f, 1.0f, 1.0f});
+
+ pos.flip();
+ red.flip();
+ green.flip();
+ blue.flip();
+
+ GL11.glLight(GL11.GL_LIGHT0, GL11.GL_POSITION, pos);
+ GL11.glEnable(GL11.GL_CULL_FACE);
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glEnable(GL11.GL_LIGHT0);
+ GL11.glEnable(GL11.GL_DEPTH_TEST);
+
+ /* make the gears */
+ gear1 = GL11.glGenLists(1);
+ GL11.glNewList(gear1, GL11.GL_COMPILE);
+ GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, red);
+ gear(1.0f, 4.0f, 1.0f, 20, 0.7f);
+ GL11.glEndList();
+
+ gear2 = GL11.glGenLists(1);
+ GL11.glNewList(gear2, GL11.GL_COMPILE);
+ GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, green);
+ gear(0.5f, 2.0f, 2.0f, 10, 0.7f);
+ GL11.glEndList();
+
+ gear3 = GL11.glGenLists(1);
+ GL11.glNewList(gear3, GL11.GL_COMPILE);
+ GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, blue);
+ gear(1.3f, 2.0f, 0.5f, 10, 0.7f);
+ GL11.glEndList();
+
+ GL11.glEnable(GL11.GL_NORMALIZE);
+
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+
+ System.err.println("GL_VENDOR: " + GL11.glGetString(GL11.GL_VENDOR));
+ System.err.println("GL_RENDERER: " + GL11.glGetString(GL11.GL_RENDERER));
+ System.err.println("GL_VERSION: " + GL11.glGetString(GL11.GL_VERSION));
+ System.err.println();
+ System.err.println("glLoadTransposeMatrixfARB() supported: " + GLContext.getCapabilities().GL_ARB_transpose_matrix);
+ if (!GLContext.getCapabilities().GL_ARB_transpose_matrix) {
+ // --- not using extensions
+ GL11.glLoadIdentity();
+ } else {
+ // --- using extensions
+ final FloatBuffer identityTranspose = BufferUtils.createFloatBuffer(16).put(
+ new float[] { 1, 0, 0, 0, 0, 1, 0, 0,
+ 0, 0, 1, 0, 0, 0, 0, 1});
+ identityTranspose.flip();
+ ARBTransposeMatrix.glLoadTransposeMatrixARB(identityTranspose);
+ }
+
+ float h = (float) 300 / (float) 300;
+ GL11.glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f);
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ GL11.glLoadIdentity();
+ GL11.glTranslatef(0.0f, 0.0f, -40.0f);
+ }
+
+ /**
+ * Draw a gear wheel. You'll probably want to call this function when
+ * building a display list since we do a lot of trig here.
+ *
+ * @param inner_radius radius of hole at center
+ * @param outer_radius radius at center of teeth
+ * @param width width of gear
+ * @param teeth number of teeth
+ * @param tooth_depth depth of tooth
+ */
+ private void gear(float inner_radius, float outer_radius, float width, int teeth, float tooth_depth) {
+ int i;
+ float r0, r1, r2;
+ float angle, da;
+ float u, v, len;
+
+ r0 = inner_radius;
+ r1 = outer_radius - tooth_depth / 2.0f;
+ r2 = outer_radius + tooth_depth / 2.0f;
+
+ da = 2.0f * (float) Math.PI / teeth / 4.0f;
+
+ GL11.glShadeModel(GL11.GL_FLAT);
+
+ GL11.glNormal3f(0.0f, 0.0f, 1.0f);
+
+ /* draw front face */
+ GL11.glBegin(GL11.GL_QUAD_STRIP);
+ for (i = 0; i <= teeth; i++) {
+ angle = i * 2.0f * (float) Math.PI / teeth;
+ GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f);
+ if (i < teeth) {
+ GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle + 3.0f * da), r1 * (float) Math.sin(angle + 3.0f * da),
+ width * 0.5f);
+ }
+ }
+ GL11.glEnd();
+
+ /* draw front sides of teeth */
+ GL11.glBegin(GL11.GL_QUADS);
+ for (i = 0; i < teeth; i++) {
+ angle = i * 2.0f * (float) Math.PI / teeth;
+ GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), width * 0.5f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + 2.0f * da), r2 * (float) Math.sin(angle + 2.0f * da), width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle + 3.0f * da), r1 * (float) Math.sin(angle + 3.0f * da), width * 0.5f);
+ }
+ GL11.glEnd();
+
+ /* draw back face */
+ GL11.glBegin(GL11.GL_QUAD_STRIP);
+ for (i = 0; i <= teeth; i++) {
+ angle = i * 2.0f * (float) Math.PI / teeth;
+ GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f);
+ GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f);
+ GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f);
+ }
+ GL11.glEnd();
+
+ /* draw back sides of teeth */
+ GL11.glBegin(GL11.GL_QUADS);
+ for (i = 0; i < teeth; i++) {
+ angle = i * 2.0f * (float) Math.PI / teeth;
+ GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), -width * 0.5f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), -width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f);
+ }
+ GL11.glEnd();
+
+ /* draw outward faces of teeth */
+ GL11.glBegin(GL11.GL_QUAD_STRIP);
+ for (i = 0; i < teeth; i++) {
+ angle = i * 2.0f * (float) Math.PI / teeth;
+ GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f);
+ u = r2 * (float) Math.cos(angle + da) - r1 * (float) Math.cos(angle);
+ v = r2 * (float) Math.sin(angle + da) - r1 * (float) Math.sin(angle);
+ len = (float) Math.sqrt(u * u + v * v);
+ u /= len;
+ v /= len;
+ GL11.glNormal3f(v, -u, 0.0f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), width * 0.5f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), -width * 0.5f);
+ GL11.glNormal3f((float) Math.cos(angle), (float) Math.sin(angle), 0.0f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), width * 0.5f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), -width * 0.5f);
+ u = r1 * (float) Math.cos(angle + 3 * da) - r2 * (float) Math.cos(angle + 2 * da);
+ v = r1 * (float) Math.sin(angle + 3 * da) - r2 * (float) Math.sin(angle + 2 * da);
+ GL11.glNormal3f(v, -u, 0.0f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f);
+ GL11.glNormal3f((float) Math.cos(angle), (float) Math.sin(angle), 0.0f);
+ }
+ GL11.glVertex3f(r1 * (float) Math.cos(0), r1 * (float) Math.sin(0), width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(0), r1 * (float) Math.sin(0), -width * 0.5f);
+ GL11.glEnd();
+
+ GL11.glShadeModel(GL11.GL_SMOOTH);
+
+ /* draw inside radius cylinder */
+ GL11.glBegin(GL11.GL_QUAD_STRIP);
+ for (i = 0; i <= teeth; i++) {
+ angle = i * 2.0f * (float) Math.PI / teeth;
+ GL11.glNormal3f(-(float) Math.cos(angle), -(float) Math.sin(angle), 0.0f);
+ GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f);
+ GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f);
+ }
+ GL11.glEnd();
+ }
+}
diff --git a/src/java/org/lwjgl/test/opengl/PbufferTest.java b/src/java/org/lwjgl/test/opengl/PbufferTest.java
index eac8e8c..379b7fd 100644
--- a/src/java/org/lwjgl/test/opengl/PbufferTest.java
+++ b/src/java/org/lwjgl/test/opengl/PbufferTest.java
@@ -1,400 +1,400 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.opengl;
-
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.nio.IntBuffer;
-
-import org.lwjgl.LWJGLException;
-import org.lwjgl.input.Keyboard;
-import org.lwjgl.opengl.Display;
-import org.lwjgl.opengl.DisplayMode;
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.opengl.Pbuffer;
-import org.lwjgl.opengl.PixelFormat;
-import org.lwjgl.util.glu.GLU;
-import org.lwjgl.util.vector.Vector2f;
-
-/**
- *
- * Tests Pbuffers
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: PbufferTest.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public class PbufferTest {
-
- /** Intended deiplay mode */
- private DisplayMode mode;
-
- /** our quad moving around */
- private Vector2f quadPosition;
-
- /** our quadVelocity */
- private Vector2f quadVelocity;
-
- /** angle of quad */
- private float angle;
-
- /** degrees to rotate per frame */
- private float angleRotation = 1.0f;
-
- /** Max speed of all changable attributes */
- private static final float MAX_SPEED = 20.0f;
-
- /** Pbuffer instance */
- private static Pbuffer pbuffer;
-
- /** The shared texture */
- private static int tex_handle;
-
- /**
- * Executes the test
- */
- public void execute() {
- initialize();
-
- mainLoop();
-
- cleanup();
- }
-
- /**
- * Initializes the test
- */
- private void initialize() {
- try {
- //find displaymode
- pbuffer = new Pbuffer(512, 512, new PixelFormat(), null, null);
- mode = findDisplayMode(800, 600, 16);
- Display.setDisplayMode(mode);
- // start of in windowed mode
- Display.create();
-// gl = new GLWindow("Test", 50, 50, mode.width, mode.height, mode.bpp, 0, 0, 0);
- if ((Pbuffer.getCapabilities() & Pbuffer.PBUFFER_SUPPORTED) == 0) {
- System.out.println("No Pbuffer support!");
- System.exit(1);
- }
- System.out.println("Pbuffer support detected");
-
- glInit();
- initPbuffer();
-
- Keyboard.create();
-
- quadPosition = new Vector2f(100f, 100f);
- quadVelocity = new Vector2f(1.0f, 1.0f);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- /**
- * Runs the main loop of the "test"
- */
- private void mainLoop() {
- while (!Keyboard.isKeyDown(Keyboard.KEY_ESCAPE) && !Display.isCloseRequested()) {
- if (Display.isVisible()) {
- // check keyboard input
- processKeyboard();
- // do "game" logic, and render it
- logic();
- render();
- } else {
- // no need to render/paint if nothing has changed (ie. window
- // dragged over)
- if (Display.isDirty()) {
- render();
- }
- // don't waste cpu time, sleep more
- try {
- Thread.sleep(100);
- } catch (InterruptedException inte) {
- }
- }
- // Update window
- Display.update();
- }
- }
-
- /**
- * Performs the logic
- */
- private void logic() {
- angle += angleRotation;
- if (angle > 90.0f) {
- angle = 0.0f;
- }
-
- quadPosition.x += quadVelocity.x;
- quadPosition.y += quadVelocity.y;
-
- //check colision with vertical border border
- if (quadPosition.x + 50 >= mode.getWidth() || quadPosition.x - 50 <= 0) {
- quadVelocity.x *= -1;
- }
-
- //check collision with horizontal border
- if (quadPosition.y + 50 >= mode.getHeight() || quadPosition.y - 50 <= 0) {
- quadVelocity.y *= -1;
- }
- }
-
- private void render() {
- if (pbuffer.isBufferLost()) {
- System.out.println("Buffer contents lost - will recreate the buffer");
- pbuffer.destroy();
- try {
- pbuffer = new Pbuffer(512, 512, new PixelFormat(), null, null);
- initPbuffer();
- } catch (LWJGLException e) {
- e.printStackTrace();
- }
- }
- try {
- pbuffer.makeCurrent();
- } catch (LWJGLException e) {
- throw new RuntimeException(e);
- }
- // Pbuffer rendering
- //clear background
- GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
-
- // draw white quad
- GL11.glPushMatrix();
- {
- GL11.glTranslatef(quadPosition.x, quadPosition.y, 0);
- GL11.glRotatef(angle, 0.0f, 0.0f, 1.0f);
- GL11.glColor3f(1.0f, 1.0f, 1.0f);
- GL11.glBegin(GL11.GL_QUADS);
- {
- GL11.glVertex2i(-50, -50);
- GL11.glVertex2i(50, -50);
- GL11.glVertex2i(50, 50);
- GL11.glVertex2i(-50, 50);
- }
- GL11.glEnd();
- }
- GL11.glPopMatrix();
- GL11.glCopyTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGB, 0, 0, 512, 512, 0);
- try {
- Display.makeCurrent();
- } catch (LWJGLException e) {
- throw new RuntimeException(e);
- }
-
- // OpenGL window rendering
- GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
- // draw white quad
- GL11.glPushMatrix();
- {
- GL11.glTranslatef(quadPosition.x, quadPosition.y, 0);
- GL11.glRotatef(angle, 0.0f, 0.0f, 1.0f);
- GL11.glColor3f(1.0f, 1.0f, 0.0f);
- GL11.glBegin(GL11.GL_QUADS);
- {
- GL11.glTexCoord2f(0f, 0f);
- GL11.glVertex2i(-50, -50);
- GL11.glTexCoord2f(1f, 0f);
- GL11.glVertex2i(50, -50);
- GL11.glTexCoord2f(1f, 1f);
- GL11.glVertex2i(50, 50);
- GL11.glTexCoord2f(0f, 1f);
- GL11.glVertex2i(-50, 50);
- }
- GL11.glEnd();
- }
- GL11.glPopMatrix();
- }
-
- private void initPbuffer() {
- try {
- pbuffer.makeCurrent();
- initGLState(256, 256, 0.5f);
- GL11.glBindTexture(GL11.GL_TEXTURE_2D, tex_handle);
- Display.makeCurrent();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- /**
- * Processes keyboard input
- */
- private void processKeyboard() {
- Keyboard.poll();
-
- //check for fullscreen key
- if (Keyboard.isKeyDown(Keyboard.KEY_F)) {
-
- try {
- Display.setDisplayMode(mode);
- Display.setFullscreen(true);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- //check for window key
- if (Keyboard.isKeyDown(Keyboard.KEY_W)) {
- try {
- Display.setFullscreen(false);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- //check for speed changes
- if (Keyboard.isKeyDown(Keyboard.KEY_UP)) {
- quadVelocity.y += 0.1f;
- }
- if (Keyboard.isKeyDown(Keyboard.KEY_DOWN)) {
- quadVelocity.y -= 0.1f;
- }
- if (Keyboard.isKeyDown(Keyboard.KEY_RIGHT)) {
- quadVelocity.x += 0.1f;
- }
- if (Keyboard.isKeyDown(Keyboard.KEY_LEFT)) {
- quadVelocity.x -= 0.1f;
- }
-
- if (Keyboard.isKeyDown(Keyboard.KEY_ADD)) {
- angleRotation += 0.1f;
- }
- if (Keyboard.isKeyDown(Keyboard.KEY_SUBTRACT)) {
- angleRotation -= 0.1f;
- }
-
- //throttle
- if (quadVelocity.x < -MAX_SPEED) {
- quadVelocity.x = -MAX_SPEED;
- }
- if (quadVelocity.x > MAX_SPEED) {
- quadVelocity.x = MAX_SPEED;
- }
- if (quadVelocity.y < -MAX_SPEED) {
- quadVelocity.y = -MAX_SPEED;
- }
- if (quadVelocity.y > MAX_SPEED) {
- quadVelocity.y = MAX_SPEED;
- }
-
- if (angleRotation < 0.0f) {
- angleRotation = 0.0f;
- }
- if (angleRotation > MAX_SPEED) {
- angleRotation = MAX_SPEED;
- }
- }
-
- private void destroyTexture() {
- IntBuffer buffer = ByteBuffer.allocateDirect(4).order(ByteOrder.nativeOrder()).asIntBuffer();
- buffer.put(0, tex_handle);
- GL11.glDeleteTextures(buffer);
- }
-
- /**
- * Cleans up the test
- */
- private void cleanup() {
- destroyTexture();
- pbuffer.destroy();
- Display.destroy();
- }
-
- /**
- * Retrieves a displaymode, if one such is available
- *
- * @param width Required width
- * @param height Required height
- * @param bpp Minimum required bits per pixel
- * @return
- */
- private DisplayMode findDisplayMode(int width, int height, int bpp) throws LWJGLException {
- DisplayMode[] modes = Display.getAvailableDisplayModes();
- for (int i = 0; i < modes.length; i++) {
- if (modes[i].getWidth() == width
- && modes[i].getHeight() == height
- && modes[i].getBitsPerPixel() >= bpp) {
- return modes[i];
- }
- }
- return null;
- }
-
- private void initGLState(int width, int height, float color) {
- GL11.glMatrixMode(GL11.GL_PROJECTION);
- GL11.glLoadIdentity();
- GLU.gluOrtho2D(0, mode.getWidth(), 0, mode.getHeight());
- GL11.glMatrixMode(GL11.GL_MODELVIEW);
- GL11.glLoadIdentity();
- GL11.glViewport(0, 0, width, height);
-
- //set clear color to black
- GL11.glClearColor(color, color, color, 0.0f);
- }
-
- /**
- * Initializes OGL
- */
- private void glInit() {
- //sync frame (only works on windows)
- Display.setVSyncEnabled(true);
-
- GL11.glTexEnvf(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_REPLACE);
- GL11.glEnable(GL11.GL_TEXTURE_2D);
- // Create shared texture
- IntBuffer buffer = ByteBuffer.allocateDirect(4).order(ByteOrder.nativeOrder()).asIntBuffer();
- GL11.glGenTextures(buffer);
- tex_handle = buffer.get(0);
- GL11.glBindTexture(GL11.GL_TEXTURE_2D, tex_handle);
- GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_CLAMP);
- GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_CLAMP);
- GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);
- GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
- initGLState(mode.getWidth(), mode.getHeight(), 0f);
- }
-
- /**
- * Test entry point
- */
- public static void main(String[] args) {
- System.out.println(
- "Change between fullscreen and windowed mode, by pressing F and W respectively");
- System.out.println("Move quad using arrowkeys, and change rotation using +/-");
- PbufferTest fswTest = new PbufferTest();
- fswTest.execute();
- System.exit(0);
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.opengl;
+
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.IntBuffer;
+
+import org.lwjgl.LWJGLException;
+import org.lwjgl.input.Keyboard;
+import org.lwjgl.opengl.Display;
+import org.lwjgl.opengl.DisplayMode;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.Pbuffer;
+import org.lwjgl.opengl.PixelFormat;
+import org.lwjgl.util.glu.GLU;
+import org.lwjgl.util.vector.Vector2f;
+
+/**
+ *
+ * Tests Pbuffers
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: PbufferTest.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public class PbufferTest {
+
+ /** Intended deiplay mode */
+ private DisplayMode mode;
+
+ /** our quad moving around */
+ private Vector2f quadPosition;
+
+ /** our quadVelocity */
+ private Vector2f quadVelocity;
+
+ /** angle of quad */
+ private float angle;
+
+ /** degrees to rotate per frame */
+ private float angleRotation = 1.0f;
+
+ /** Max speed of all changable attributes */
+ private static final float MAX_SPEED = 20.0f;
+
+ /** Pbuffer instance */
+ private static Pbuffer pbuffer;
+
+ /** The shared texture */
+ private static int tex_handle;
+
+ /**
+ * Executes the test
+ */
+ public void execute() {
+ initialize();
+
+ mainLoop();
+
+ cleanup();
+ }
+
+ /**
+ * Initializes the test
+ */
+ private void initialize() {
+ try {
+ //find displaymode
+ pbuffer = new Pbuffer(512, 512, new PixelFormat(), null, null);
+ mode = findDisplayMode(800, 600, 16);
+ Display.setDisplayMode(mode);
+ // start of in windowed mode
+ Display.create();
+// gl = new GLWindow("Test", 50, 50, mode.width, mode.height, mode.bpp, 0, 0, 0);
+ if ((Pbuffer.getCapabilities() & Pbuffer.PBUFFER_SUPPORTED) == 0) {
+ System.out.println("No Pbuffer support!");
+ System.exit(1);
+ }
+ System.out.println("Pbuffer support detected");
+
+ glInit();
+ initPbuffer();
+
+ Keyboard.create();
+
+ quadPosition = new Vector2f(100f, 100f);
+ quadVelocity = new Vector2f(1.0f, 1.0f);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Runs the main loop of the "test"
+ */
+ private void mainLoop() {
+ while (!Keyboard.isKeyDown(Keyboard.KEY_ESCAPE) && !Display.isCloseRequested()) {
+ if (Display.isVisible()) {
+ // check keyboard input
+ processKeyboard();
+ // do "game" logic, and render it
+ logic();
+ render();
+ } else {
+ // no need to render/paint if nothing has changed (ie. window
+ // dragged over)
+ if (Display.isDirty()) {
+ render();
+ }
+ // don't waste cpu time, sleep more
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException inte) {
+ }
+ }
+ // Update window
+ Display.update();
+ }
+ }
+
+ /**
+ * Performs the logic
+ */
+ private void logic() {
+ angle += angleRotation;
+ if (angle > 90.0f) {
+ angle = 0.0f;
+ }
+
+ quadPosition.x += quadVelocity.x;
+ quadPosition.y += quadVelocity.y;
+
+ //check colision with vertical border border
+ if (quadPosition.x + 50 >= mode.getWidth() || quadPosition.x - 50 <= 0) {
+ quadVelocity.x *= -1;
+ }
+
+ //check collision with horizontal border
+ if (quadPosition.y + 50 >= mode.getHeight() || quadPosition.y - 50 <= 0) {
+ quadVelocity.y *= -1;
+ }
+ }
+
+ private void render() {
+ if (pbuffer.isBufferLost()) {
+ System.out.println("Buffer contents lost - will recreate the buffer");
+ pbuffer.destroy();
+ try {
+ pbuffer = new Pbuffer(512, 512, new PixelFormat(), null, null);
+ initPbuffer();
+ } catch (LWJGLException e) {
+ e.printStackTrace();
+ }
+ }
+ try {
+ pbuffer.makeCurrent();
+ } catch (LWJGLException e) {
+ throw new RuntimeException(e);
+ }
+ // Pbuffer rendering
+ //clear background
+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
+
+ // draw white quad
+ GL11.glPushMatrix();
+ {
+ GL11.glTranslatef(quadPosition.x, quadPosition.y, 0);
+ GL11.glRotatef(angle, 0.0f, 0.0f, 1.0f);
+ GL11.glColor3f(1.0f, 1.0f, 1.0f);
+ GL11.glBegin(GL11.GL_QUADS);
+ {
+ GL11.glVertex2i(-50, -50);
+ GL11.glVertex2i(50, -50);
+ GL11.glVertex2i(50, 50);
+ GL11.glVertex2i(-50, 50);
+ }
+ GL11.glEnd();
+ }
+ GL11.glPopMatrix();
+ GL11.glCopyTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGB, 0, 0, 512, 512, 0);
+ try {
+ Display.makeCurrent();
+ } catch (LWJGLException e) {
+ throw new RuntimeException(e);
+ }
+
+ // OpenGL window rendering
+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
+ // draw white quad
+ GL11.glPushMatrix();
+ {
+ GL11.glTranslatef(quadPosition.x, quadPosition.y, 0);
+ GL11.glRotatef(angle, 0.0f, 0.0f, 1.0f);
+ GL11.glColor3f(1.0f, 1.0f, 0.0f);
+ GL11.glBegin(GL11.GL_QUADS);
+ {
+ GL11.glTexCoord2f(0f, 0f);
+ GL11.glVertex2i(-50, -50);
+ GL11.glTexCoord2f(1f, 0f);
+ GL11.glVertex2i(50, -50);
+ GL11.glTexCoord2f(1f, 1f);
+ GL11.glVertex2i(50, 50);
+ GL11.glTexCoord2f(0f, 1f);
+ GL11.glVertex2i(-50, 50);
+ }
+ GL11.glEnd();
+ }
+ GL11.glPopMatrix();
+ }
+
+ private void initPbuffer() {
+ try {
+ pbuffer.makeCurrent();
+ initGLState(256, 256, 0.5f);
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, tex_handle);
+ Display.makeCurrent();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Processes keyboard input
+ */
+ private void processKeyboard() {
+ Keyboard.poll();
+
+ //check for fullscreen key
+ if (Keyboard.isKeyDown(Keyboard.KEY_F)) {
+
+ try {
+ Display.setDisplayMode(mode);
+ Display.setFullscreen(true);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ //check for window key
+ if (Keyboard.isKeyDown(Keyboard.KEY_W)) {
+ try {
+ Display.setFullscreen(false);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ //check for speed changes
+ if (Keyboard.isKeyDown(Keyboard.KEY_UP)) {
+ quadVelocity.y += 0.1f;
+ }
+ if (Keyboard.isKeyDown(Keyboard.KEY_DOWN)) {
+ quadVelocity.y -= 0.1f;
+ }
+ if (Keyboard.isKeyDown(Keyboard.KEY_RIGHT)) {
+ quadVelocity.x += 0.1f;
+ }
+ if (Keyboard.isKeyDown(Keyboard.KEY_LEFT)) {
+ quadVelocity.x -= 0.1f;
+ }
+
+ if (Keyboard.isKeyDown(Keyboard.KEY_ADD)) {
+ angleRotation += 0.1f;
+ }
+ if (Keyboard.isKeyDown(Keyboard.KEY_SUBTRACT)) {
+ angleRotation -= 0.1f;
+ }
+
+ //throttle
+ if (quadVelocity.x < -MAX_SPEED) {
+ quadVelocity.x = -MAX_SPEED;
+ }
+ if (quadVelocity.x > MAX_SPEED) {
+ quadVelocity.x = MAX_SPEED;
+ }
+ if (quadVelocity.y < -MAX_SPEED) {
+ quadVelocity.y = -MAX_SPEED;
+ }
+ if (quadVelocity.y > MAX_SPEED) {
+ quadVelocity.y = MAX_SPEED;
+ }
+
+ if (angleRotation < 0.0f) {
+ angleRotation = 0.0f;
+ }
+ if (angleRotation > MAX_SPEED) {
+ angleRotation = MAX_SPEED;
+ }
+ }
+
+ private void destroyTexture() {
+ IntBuffer buffer = ByteBuffer.allocateDirect(4).order(ByteOrder.nativeOrder()).asIntBuffer();
+ buffer.put(0, tex_handle);
+ GL11.glDeleteTextures(buffer);
+ }
+
+ /**
+ * Cleans up the test
+ */
+ private void cleanup() {
+ destroyTexture();
+ pbuffer.destroy();
+ Display.destroy();
+ }
+
+ /**
+ * Retrieves a displaymode, if one such is available
+ *
+ * @param width Required width
+ * @param height Required height
+ * @param bpp Minimum required bits per pixel
+ * @return
+ */
+ private DisplayMode findDisplayMode(int width, int height, int bpp) throws LWJGLException {
+ DisplayMode[] modes = Display.getAvailableDisplayModes();
+ for (int i = 0; i < modes.length; i++) {
+ if (modes[i].getWidth() == width
+ && modes[i].getHeight() == height
+ && modes[i].getBitsPerPixel() >= bpp) {
+ return modes[i];
+ }
+ }
+ return null;
+ }
+
+ private void initGLState(int width, int height, float color) {
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+ GL11.glLoadIdentity();
+ GLU.gluOrtho2D(0, mode.getWidth(), 0, mode.getHeight());
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ GL11.glLoadIdentity();
+ GL11.glViewport(0, 0, width, height);
+
+ //set clear color to black
+ GL11.glClearColor(color, color, color, 0.0f);
+ }
+
+ /**
+ * Initializes OGL
+ */
+ private void glInit() {
+ //sync frame (only works on windows)
+ Display.setVSyncEnabled(true);
+
+ GL11.glTexEnvf(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_REPLACE);
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ // Create shared texture
+ IntBuffer buffer = ByteBuffer.allocateDirect(4).order(ByteOrder.nativeOrder()).asIntBuffer();
+ GL11.glGenTextures(buffer);
+ tex_handle = buffer.get(0);
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, tex_handle);
+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_CLAMP);
+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_CLAMP);
+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);
+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
+ initGLState(mode.getWidth(), mode.getHeight(), 0f);
+ }
+
+ /**
+ * Test entry point
+ */
+ public static void main(String[] args) {
+ System.out.println(
+ "Change between fullscreen and windowed mode, by pressing F and W respectively");
+ System.out.println("Move quad using arrowkeys, and change rotation using +/-");
+ PbufferTest fswTest = new PbufferTest();
+ fswTest.execute();
+ System.exit(0);
+ }
+}
diff --git a/src/java/org/lwjgl/test/opengl/SyncTest.java b/src/java/org/lwjgl/test/opengl/SyncTest.java
index cc8cd87..706bc36 100644
--- a/src/java/org/lwjgl/test/opengl/SyncTest.java
+++ b/src/java/org/lwjgl/test/opengl/SyncTest.java
@@ -1,178 +1,178 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.opengl;
-
-import org.lwjgl.LWJGLException;
-import org.lwjgl.Sys;
-import org.lwjgl.opengl.*;
-
-import java.util.Random;
-
-/** @author spasi <spasi at users.sourceforge.net> */
-public final class SyncTest {
-
- private SyncTest() {
- }
-
- public static void main(String[] args) {
- runTest(args);
- cleanup();
- System.exit(0);
- }
-
- private static void runTest(String[] args) {
- if ( args.length < 2 )
- argsError("Insufficient number of arguments.");
-
- int clears = 1;
- int timeout = 0;
-
- try {
- clears = Integer.parseInt(args[0]);
- timeout = Integer.parseInt(args[1]);
- } catch (NumberFormatException e) {
- argsError("Invalid number format.");
- }
-
- ContextAttribs ca = new ContextAttribs();
-
- try {
- DisplayMode[] modes = Display.getAvailableDisplayModes();
-
- DisplayMode displayMode = chooseMode(modes, 1024, 768);
- if ( displayMode == null )
- displayMode = chooseMode(modes, 800, 600);
- if ( displayMode == null )
- displayMode = chooseMode(modes, 640, 480);
- if ( displayMode == null )
- kill("Failed to set an appropriate display mode.");
-
- System.out.println("Setting display mode to: " + displayMode);
- Display.setDisplayMode(displayMode);
- Display.create(new PixelFormat(8, 24, 0), ca);
- } catch (LWJGLException e) {
- kill(e.getMessage());
- }
-
- System.out.println("\n---------\n");
-
- final String version = GL11.glGetString(GL11.GL_VERSION);
-
- System.out.println("GL Version: " + version);
- System.out.println("ARB_sync: " + GLContext.getCapabilities().GL_ARB_sync);
-
- if ( !GLContext.getCapabilities().OpenGL32 && !GLContext.getCapabilities().GL_ARB_sync )
- kill("OpenGL3.2 or ARB_sync support is required for this test.");
-
- System.out.println("\n---------\n");
-
- System.out.println("Clearing the framebuffer a gazillion times...");
-
- Random rand = new Random(System.currentTimeMillis());
- for ( int i = 0; i < clears; i++ ) {
- GL11.glClearColor(rand.nextFloat(), rand.nextFloat(), rand.nextFloat(), 1.0f);
- GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
- }
-
- GLSync sync = GL32.glFenceSync(GL32.GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
-
- System.out.println("\nWaiting on fence...");
- long time = Sys.getTime();
- int status = GL32.glClientWaitSync(sync, 0, timeout < 0 ? GL32.GL_TIMEOUT_IGNORED : timeout * 1000 * 1000);
- System.out.println("\nFence sync complete after: " + ((Sys.getTime() - time) / (double)Sys.getTimerResolution()) + " seconds.");
- System.out.print("\nWait Status: ");
- switch ( status ) {
- case GL32.GL_ALREADY_SIGNALED:
- System.out.println("ALREADY_SIGNALED");
- break;
- case GL32.GL_CONDITION_SATISFIED:
- System.out.println("CONDITION_SATISFIED");
- break;
- case GL32.GL_TIMEOUT_EXPIRED:
- System.out.println("TIMEOUT_EXPIRED");
- break;
- case GL32.GL_WAIT_FAILED:
- System.out.println("WAIT_FAILED");
- break;
- default:
- System.out.println("Unexpected wait status: 0x" + Integer.toHexString(status));
- }
-
- System.out.println("Sync Status: " + (GL32.glGetSync(sync, GL32.GL_SYNC_STATUS) == GL32.GL_UNSIGNALED ? "UNSIGNALED" : "SIGNALED"));
-
- GL32.glDeleteSync(sync);
-
- int error = GL11.glGetError();
- if ( error != 0 )
- System.out.println("\nTest failed with OpenGL error: " + error);
- else
- System.out.println("\nTest completed successfully.");
- }
-
- private static DisplayMode chooseMode(DisplayMode[] modes, int width, int height) {
- DisplayMode bestMode = null;
-
- for ( int i = 0; i < modes.length; i++ ) {
- DisplayMode mode = modes[i];
- if ( mode.getWidth() == width && mode.getHeight() == height && mode.getFrequency() <= 85 ) {
- if ( bestMode == null || (mode.getBitsPerPixel() >= bestMode.getBitsPerPixel() && mode.getFrequency() > bestMode.getFrequency()) )
- bestMode = mode;
- }
- }
-
- return bestMode;
- }
-
- private static void cleanup() {
- if ( Display.isCreated() )
- Display.destroy();
- }
-
- private static void argsError(final String msg) {
- System.out.println("\nInvalid arguments error: " + msg);
- System.out.println("\nUsage: SyncTest <clears> <timeout>:\n");
- System.out.println("clears\t- Number of times to clear the framebuffer.");
- System.out.println("timeout\t- WaitSync timeout in milliseconds.");
-
- cleanup();
- System.exit(-1);
- }
-
- static void kill(String reason) {
- System.out.println("The SyncTest program was terminated because an error occured.\n");
- System.out.println("Reason: " + (reason == null ? "Unknown" : reason));
-
- cleanup();
- System.exit(-1);
- }
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.opengl;
+
+import org.lwjgl.LWJGLException;
+import org.lwjgl.Sys;
+import org.lwjgl.opengl.*;
+
+import java.util.Random;
+
+/** @author spasi <spasi at users.sourceforge.net> */
+public final class SyncTest {
+
+ private SyncTest() {
+ }
+
+ public static void main(String[] args) {
+ runTest(args);
+ cleanup();
+ System.exit(0);
+ }
+
+ private static void runTest(String[] args) {
+ if ( args.length < 2 )
+ argsError("Insufficient number of arguments.");
+
+ int clears = 1;
+ int timeout = 0;
+
+ try {
+ clears = Integer.parseInt(args[0]);
+ timeout = Integer.parseInt(args[1]);
+ } catch (NumberFormatException e) {
+ argsError("Invalid number format.");
+ }
+
+ ContextAttribs ca = new ContextAttribs();
+
+ try {
+ DisplayMode[] modes = Display.getAvailableDisplayModes();
+
+ DisplayMode displayMode = chooseMode(modes, 1024, 768);
+ if ( displayMode == null )
+ displayMode = chooseMode(modes, 800, 600);
+ if ( displayMode == null )
+ displayMode = chooseMode(modes, 640, 480);
+ if ( displayMode == null )
+ kill("Failed to set an appropriate display mode.");
+
+ System.out.println("Setting display mode to: " + displayMode);
+ Display.setDisplayMode(displayMode);
+ Display.create(new PixelFormat(8, 24, 0), ca);
+ } catch (LWJGLException e) {
+ kill(e.getMessage());
+ }
+
+ System.out.println("\n---------\n");
+
+ final String version = GL11.glGetString(GL11.GL_VERSION);
+
+ System.out.println("GL Version: " + version);
+ System.out.println("ARB_sync: " + GLContext.getCapabilities().GL_ARB_sync);
+
+ if ( !GLContext.getCapabilities().OpenGL32 && !GLContext.getCapabilities().GL_ARB_sync )
+ kill("OpenGL3.2 or ARB_sync support is required for this test.");
+
+ System.out.println("\n---------\n");
+
+ System.out.println("Clearing the framebuffer a gazillion times...");
+
+ Random rand = new Random(System.currentTimeMillis());
+ for ( int i = 0; i < clears; i++ ) {
+ GL11.glClearColor(rand.nextFloat(), rand.nextFloat(), rand.nextFloat(), 1.0f);
+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
+ }
+
+ GLSync sync = GL32.glFenceSync(GL32.GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
+
+ System.out.println("\nWaiting on fence...");
+ long time = Sys.getTime();
+ int status = GL32.glClientWaitSync(sync, 0, timeout < 0 ? GL32.GL_TIMEOUT_IGNORED : timeout * 1000 * 1000);
+ System.out.println("\nFence sync complete after: " + ((Sys.getTime() - time) / (double)Sys.getTimerResolution()) + " seconds.");
+ System.out.print("\nWait Status: ");
+ switch ( status ) {
+ case GL32.GL_ALREADY_SIGNALED:
+ System.out.println("ALREADY_SIGNALED");
+ break;
+ case GL32.GL_CONDITION_SATISFIED:
+ System.out.println("CONDITION_SATISFIED");
+ break;
+ case GL32.GL_TIMEOUT_EXPIRED:
+ System.out.println("TIMEOUT_EXPIRED");
+ break;
+ case GL32.GL_WAIT_FAILED:
+ System.out.println("WAIT_FAILED");
+ break;
+ default:
+ System.out.println("Unexpected wait status: 0x" + Integer.toHexString(status));
+ }
+
+ System.out.println("Sync Status: " + (GL32.glGetSync(sync, GL32.GL_SYNC_STATUS) == GL32.GL_UNSIGNALED ? "UNSIGNALED" : "SIGNALED"));
+
+ GL32.glDeleteSync(sync);
+
+ int error = GL11.glGetError();
+ if ( error != 0 )
+ System.out.println("\nTest failed with OpenGL error: " + error);
+ else
+ System.out.println("\nTest completed successfully.");
+ }
+
+ private static DisplayMode chooseMode(DisplayMode[] modes, int width, int height) {
+ DisplayMode bestMode = null;
+
+ for ( int i = 0; i < modes.length; i++ ) {
+ DisplayMode mode = modes[i];
+ if ( mode.getWidth() == width && mode.getHeight() == height && mode.getFrequency() <= 85 ) {
+ if ( bestMode == null || (mode.getBitsPerPixel() >= bestMode.getBitsPerPixel() && mode.getFrequency() > bestMode.getFrequency()) )
+ bestMode = mode;
+ }
+ }
+
+ return bestMode;
+ }
+
+ private static void cleanup() {
+ if ( Display.isCreated() )
+ Display.destroy();
+ }
+
+ private static void argsError(final String msg) {
+ System.out.println("\nInvalid arguments error: " + msg);
+ System.out.println("\nUsage: SyncTest <clears> <timeout>:\n");
+ System.out.println("clears\t- Number of times to clear the framebuffer.");
+ System.out.println("timeout\t- WaitSync timeout in milliseconds.");
+
+ cleanup();
+ System.exit(-1);
+ }
+
+ static void kill(String reason) {
+ System.out.println("The SyncTest program was terminated because an error occured.\n");
+ System.out.println("Reason: " + (reason == null ? "Unknown" : reason));
+
+ cleanup();
+ System.exit(-1);
+ }
+
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/test/opengl/VBOIndexTest.java b/src/java/org/lwjgl/test/opengl/VBOIndexTest.java
index 21e68cd..c563730 100644
--- a/src/java/org/lwjgl/test/opengl/VBOIndexTest.java
+++ b/src/java/org/lwjgl/test/opengl/VBOIndexTest.java
@@ -1,242 +1,242 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: VBOIndexTest.java 2983 2008-04-07 18:36:09Z matzon $
- *
- * Simple java test program.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- */
-
-package org.lwjgl.test.opengl;
-
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.nio.FloatBuffer;
-import java.nio.IntBuffer;
-
-import org.lwjgl.Sys;
-import org.lwjgl.input.Keyboard;
-import org.lwjgl.input.Mouse;
-import org.lwjgl.opengl.ARBBufferObject;
-import org.lwjgl.opengl.ARBVertexBufferObject;
-import org.lwjgl.opengl.Display;
-import org.lwjgl.opengl.DisplayMode;
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.opengl.GLContext;
-import org.lwjgl.util.glu.GLU;
-
-public final class VBOIndexTest {
-
- static {
- try {
- //find first display mode that allows us 640*480*16
- int mode = -1;
- DisplayMode[] modes = Display.getAvailableDisplayModes();
- for ( int i = 0; i < modes.length; i++ ) {
- if ( modes[i].getWidth() == 640
- && modes[i].getHeight() == 480
- && modes[i].getBitsPerPixel() >= 16 ) {
- mode = i;
- break;
- }
- }
- if ( mode != -1 ) {
- //select above found displaymode
- System.out.println("Setting display mode to " + modes[mode]);
- Display.setDisplayMode(modes[mode]);
- System.out.println("Created display.");
- }
- } catch (Exception e) {
- System.err.println("Failed to create display due to " + e);
- }
- }
-
- static {
- try {
- Display.create();
- System.out.println("Created OpenGL.");
- } catch (Exception e) {
- System.err.println("Failed to create OpenGL due to " + e);
- System.exit(1);
- }
- }
-
- /**
- * Is the game finished?
- */
- private static boolean finished;
-
- /**
- * A rotating square!
- */
- private static float angle;
- private static int buffer_id;
- private static int indices_buffer_id;
- private static FloatBuffer vertices;
- private static ByteBuffer mapped_buffer = null;
- private static FloatBuffer mapped_float_buffer = null;
- private static IntBuffer indices;
- private static ByteBuffer mapped_indices_buffer = null;
- private static IntBuffer mapped_indices_int_buffer = null;
-
- public static void main(String[] arguments) {
- try {
- init();
- while ( !finished ) {
- Display.update();
-
- if ( !Display.isVisible() )
- Thread.sleep(200);
- else if ( Display.isCloseRequested() )
- System.exit(0);
-
- mainLoop();
- render();
- }
- } catch (Throwable t) {
- t.printStackTrace();
- } finally {
- cleanup();
- }
- System.exit(0);
- }
-
- /**
- * All calculations are done in here
- */
- private static void mainLoop() {
- angle += 1f;
- if ( angle > 360.0f )
- angle = 0.0f;
-
- if ( Mouse.getDX() != 0 || Mouse.getDY() != 0 || Mouse.getDWheel() != 0 )
- System.out.println("Mouse moved " + Mouse.getDX() + " " + Mouse.getDY() + " " + Mouse.getDWheel());
- for ( int i = 0; i < Mouse.getButtonCount(); i++ )
- if ( Mouse.isButtonDown(i) )
- System.out.println("Button " + i + " down");
- if ( Keyboard.isKeyDown(Keyboard.KEY_ESCAPE) )
- finished = true;
- for ( int i = 0; i < Keyboard.getNumKeyboardEvents(); i++ ) {
- Keyboard.next();
- if ( Keyboard.getEventKey() == Keyboard.KEY_ESCAPE && Keyboard.getEventKeyState() )
- finished = true;
- if ( Keyboard.getEventKey() == Keyboard.KEY_T && Keyboard.getEventKeyState() )
- System.out.println("Current time: " + Sys.getTime());
- }
- }
-
- /**
- * All rendering is done in here
- */
- private static void render() {
- GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
- GL11.glPushMatrix();
- GL11.glTranslatef(Display.getDisplayMode().getWidth() / 2, Display.getDisplayMode().getHeight() / 2, 0.0f);
- GL11.glRotatef(angle, 0, 0, 1.0f);
-
-
- ByteBuffer new_mapped_buffer = ARBBufferObject.glMapBufferARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB,
- ARBBufferObject.GL_WRITE_ONLY_ARB,
- mapped_buffer);
- if ( new_mapped_buffer != mapped_buffer )
- mapped_float_buffer = new_mapped_buffer.order(ByteOrder.nativeOrder()).asFloatBuffer();
- mapped_buffer = new_mapped_buffer;
-
- new_mapped_buffer = ARBBufferObject.glMapBufferARB(ARBVertexBufferObject.GL_ELEMENT_ARRAY_BUFFER_ARB,
- ARBBufferObject.GL_WRITE_ONLY_ARB,
- mapped_indices_buffer);
- if ( new_mapped_buffer != mapped_indices_buffer )
- mapped_indices_int_buffer = new_mapped_buffer.order(ByteOrder.nativeOrder()).asIntBuffer();
-
- mapped_float_buffer.rewind();
- vertices.rewind();
- mapped_float_buffer.put(vertices);
-
- mapped_indices_int_buffer.rewind();
- indices.rewind();
- mapped_indices_int_buffer.put(indices);
- if ( ARBBufferObject.glUnmapBufferARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB) &&
- ARBBufferObject.glUnmapBufferARB(ARBVertexBufferObject.GL_ELEMENT_ARRAY_BUFFER_ARB) ) {
- GL11.glDrawElements(GL11.GL_QUADS, 4, GL11.GL_UNSIGNED_INT, 0);
- }
- GL11.glPopMatrix();
- }
-
- /**
- * Initialize
- */
- private static void init() throws Exception {
-
- System.out.println("Timer resolution: " + Sys.getTimerResolution());
- // Go into orthographic projection mode.
- GL11.glMatrixMode(GL11.GL_PROJECTION);
- GL11.glLoadIdentity();
- GLU.gluOrtho2D(0, Display.getDisplayMode().getWidth(), 0, Display.getDisplayMode().getHeight());
- GL11.glMatrixMode(GL11.GL_MODELVIEW);
- GL11.glLoadIdentity();
- GL11.glViewport(0, 0, Display.getDisplayMode().getWidth(), Display.getDisplayMode().getHeight());
- if ( !GLContext.getCapabilities().GL_ARB_vertex_buffer_object ) {
- System.out.println("ARB VBO not supported!");
- System.exit(1);
- }
- IntBuffer int_buffer = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()).asIntBuffer();
- ARBBufferObject.glGenBuffersARB(int_buffer);
- buffer_id = int_buffer.get(0);
- indices_buffer_id = int_buffer.get(1);
- ARBBufferObject.glBindBufferARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, buffer_id);
- ARBBufferObject.glBindBufferARB(ARBVertexBufferObject.GL_ELEMENT_ARRAY_BUFFER_ARB, indices_buffer_id);
- vertices = ByteBuffer.allocateDirect(2 * 4 * 4).order(ByteOrder.nativeOrder()).asFloatBuffer();
- vertices.put(-50).put(-50).put(50).put(-50).put(50).put(50).put(-50).put(50);
- vertices.rewind();
- indices = ByteBuffer.allocateDirect(4 * 4).order(ByteOrder.nativeOrder()).asIntBuffer();
- indices.put(0).put(1).put(2).put(3);
- indices.rewind();
- ARBBufferObject.glBufferDataARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, 2 * 4 * 4, ARBBufferObject.GL_STREAM_DRAW_ARB);
- ARBBufferObject.glBufferDataARB(ARBVertexBufferObject.GL_ELEMENT_ARRAY_BUFFER_ARB, 4 * 4, ARBBufferObject.GL_STREAM_DRAW_ARB);
- GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY);
- GL11.glVertexPointer(2, GL11.GL_FLOAT, 0, 0);
- }
-
- /**
- * Cleanup
- */
- private static void cleanup() {
- IntBuffer int_buffer = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()).asIntBuffer();
- int_buffer.put(0, buffer_id);
- int_buffer.put(1, indices_buffer_id);
- ARBBufferObject.glDeleteBuffersARB(int_buffer);
- Display.destroy();
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: VBOIndexTest.java 2983 2008-04-07 18:36:09Z matzon $
+ *
+ * Simple java test program.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ */
+
+package org.lwjgl.test.opengl;
+
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.FloatBuffer;
+import java.nio.IntBuffer;
+
+import org.lwjgl.Sys;
+import org.lwjgl.input.Keyboard;
+import org.lwjgl.input.Mouse;
+import org.lwjgl.opengl.ARBBufferObject;
+import org.lwjgl.opengl.ARBVertexBufferObject;
+import org.lwjgl.opengl.Display;
+import org.lwjgl.opengl.DisplayMode;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GLContext;
+import org.lwjgl.util.glu.GLU;
+
+public final class VBOIndexTest {
+
+ static {
+ try {
+ //find first display mode that allows us 640*480*16
+ int mode = -1;
+ DisplayMode[] modes = Display.getAvailableDisplayModes();
+ for ( int i = 0; i < modes.length; i++ ) {
+ if ( modes[i].getWidth() == 640
+ && modes[i].getHeight() == 480
+ && modes[i].getBitsPerPixel() >= 16 ) {
+ mode = i;
+ break;
+ }
+ }
+ if ( mode != -1 ) {
+ //select above found displaymode
+ System.out.println("Setting display mode to " + modes[mode]);
+ Display.setDisplayMode(modes[mode]);
+ System.out.println("Created display.");
+ }
+ } catch (Exception e) {
+ System.err.println("Failed to create display due to " + e);
+ }
+ }
+
+ static {
+ try {
+ Display.create();
+ System.out.println("Created OpenGL.");
+ } catch (Exception e) {
+ System.err.println("Failed to create OpenGL due to " + e);
+ System.exit(1);
+ }
+ }
+
+ /**
+ * Is the game finished?
+ */
+ private static boolean finished;
+
+ /**
+ * A rotating square!
+ */
+ private static float angle;
+ private static int buffer_id;
+ private static int indices_buffer_id;
+ private static FloatBuffer vertices;
+ private static ByteBuffer mapped_buffer = null;
+ private static FloatBuffer mapped_float_buffer = null;
+ private static IntBuffer indices;
+ private static ByteBuffer mapped_indices_buffer = null;
+ private static IntBuffer mapped_indices_int_buffer = null;
+
+ public static void main(String[] arguments) {
+ try {
+ init();
+ while ( !finished ) {
+ Display.update();
+
+ if ( !Display.isVisible() )
+ Thread.sleep(200);
+ else if ( Display.isCloseRequested() )
+ System.exit(0);
+
+ mainLoop();
+ render();
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ } finally {
+ cleanup();
+ }
+ System.exit(0);
+ }
+
+ /**
+ * All calculations are done in here
+ */
+ private static void mainLoop() {
+ angle += 1f;
+ if ( angle > 360.0f )
+ angle = 0.0f;
+
+ if ( Mouse.getDX() != 0 || Mouse.getDY() != 0 || Mouse.getDWheel() != 0 )
+ System.out.println("Mouse moved " + Mouse.getDX() + " " + Mouse.getDY() + " " + Mouse.getDWheel());
+ for ( int i = 0; i < Mouse.getButtonCount(); i++ )
+ if ( Mouse.isButtonDown(i) )
+ System.out.println("Button " + i + " down");
+ if ( Keyboard.isKeyDown(Keyboard.KEY_ESCAPE) )
+ finished = true;
+ for ( int i = 0; i < Keyboard.getNumKeyboardEvents(); i++ ) {
+ Keyboard.next();
+ if ( Keyboard.getEventKey() == Keyboard.KEY_ESCAPE && Keyboard.getEventKeyState() )
+ finished = true;
+ if ( Keyboard.getEventKey() == Keyboard.KEY_T && Keyboard.getEventKeyState() )
+ System.out.println("Current time: " + Sys.getTime());
+ }
+ }
+
+ /**
+ * All rendering is done in here
+ */
+ private static void render() {
+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
+ GL11.glPushMatrix();
+ GL11.glTranslatef(Display.getDisplayMode().getWidth() / 2, Display.getDisplayMode().getHeight() / 2, 0.0f);
+ GL11.glRotatef(angle, 0, 0, 1.0f);
+
+
+ ByteBuffer new_mapped_buffer = ARBBufferObject.glMapBufferARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB,
+ ARBBufferObject.GL_WRITE_ONLY_ARB,
+ mapped_buffer);
+ if ( new_mapped_buffer != mapped_buffer )
+ mapped_float_buffer = new_mapped_buffer.order(ByteOrder.nativeOrder()).asFloatBuffer();
+ mapped_buffer = new_mapped_buffer;
+
+ new_mapped_buffer = ARBBufferObject.glMapBufferARB(ARBVertexBufferObject.GL_ELEMENT_ARRAY_BUFFER_ARB,
+ ARBBufferObject.GL_WRITE_ONLY_ARB,
+ mapped_indices_buffer);
+ if ( new_mapped_buffer != mapped_indices_buffer )
+ mapped_indices_int_buffer = new_mapped_buffer.order(ByteOrder.nativeOrder()).asIntBuffer();
+
+ mapped_float_buffer.rewind();
+ vertices.rewind();
+ mapped_float_buffer.put(vertices);
+
+ mapped_indices_int_buffer.rewind();
+ indices.rewind();
+ mapped_indices_int_buffer.put(indices);
+ if ( ARBBufferObject.glUnmapBufferARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB) &&
+ ARBBufferObject.glUnmapBufferARB(ARBVertexBufferObject.GL_ELEMENT_ARRAY_BUFFER_ARB) ) {
+ GL11.glDrawElements(GL11.GL_QUADS, 4, GL11.GL_UNSIGNED_INT, 0);
+ }
+ GL11.glPopMatrix();
+ }
+
+ /**
+ * Initialize
+ */
+ private static void init() throws Exception {
+
+ System.out.println("Timer resolution: " + Sys.getTimerResolution());
+ // Go into orthographic projection mode.
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+ GL11.glLoadIdentity();
+ GLU.gluOrtho2D(0, Display.getDisplayMode().getWidth(), 0, Display.getDisplayMode().getHeight());
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ GL11.glLoadIdentity();
+ GL11.glViewport(0, 0, Display.getDisplayMode().getWidth(), Display.getDisplayMode().getHeight());
+ if ( !GLContext.getCapabilities().GL_ARB_vertex_buffer_object ) {
+ System.out.println("ARB VBO not supported!");
+ System.exit(1);
+ }
+ IntBuffer int_buffer = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()).asIntBuffer();
+ ARBBufferObject.glGenBuffersARB(int_buffer);
+ buffer_id = int_buffer.get(0);
+ indices_buffer_id = int_buffer.get(1);
+ ARBBufferObject.glBindBufferARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, buffer_id);
+ ARBBufferObject.glBindBufferARB(ARBVertexBufferObject.GL_ELEMENT_ARRAY_BUFFER_ARB, indices_buffer_id);
+ vertices = ByteBuffer.allocateDirect(2 * 4 * 4).order(ByteOrder.nativeOrder()).asFloatBuffer();
+ vertices.put(-50).put(-50).put(50).put(-50).put(50).put(50).put(-50).put(50);
+ vertices.rewind();
+ indices = ByteBuffer.allocateDirect(4 * 4).order(ByteOrder.nativeOrder()).asIntBuffer();
+ indices.put(0).put(1).put(2).put(3);
+ indices.rewind();
+ ARBBufferObject.glBufferDataARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, 2 * 4 * 4, ARBBufferObject.GL_STREAM_DRAW_ARB);
+ ARBBufferObject.glBufferDataARB(ARBVertexBufferObject.GL_ELEMENT_ARRAY_BUFFER_ARB, 4 * 4, ARBBufferObject.GL_STREAM_DRAW_ARB);
+ GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY);
+ GL11.glVertexPointer(2, GL11.GL_FLOAT, 0, 0);
+ }
+
+ /**
+ * Cleanup
+ */
+ private static void cleanup() {
+ IntBuffer int_buffer = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()).asIntBuffer();
+ int_buffer.put(0, buffer_id);
+ int_buffer.put(1, indices_buffer_id);
+ ARBBufferObject.glDeleteBuffersARB(int_buffer);
+ Display.destroy();
+ }
+}
diff --git a/src/java/org/lwjgl/test/opengl/VBOTest.java b/src/java/org/lwjgl/test/opengl/VBOTest.java
index 7bdf9ea..cb00a52 100644
--- a/src/java/org/lwjgl/test/opengl/VBOTest.java
+++ b/src/java/org/lwjgl/test/opengl/VBOTest.java
@@ -1,209 +1,209 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: VBOTest.java 3287 2010-03-14 23:24:40Z spasi $
- *
- * Simple java test program.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3287 $
- */
-
-package org.lwjgl.test.opengl;
-
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.nio.FloatBuffer;
-
-import org.lwjgl.Sys;
-import org.lwjgl.input.Keyboard;
-import org.lwjgl.input.Mouse;
-import org.lwjgl.opengl.ARBBufferObject;
-import org.lwjgl.opengl.ARBVertexBufferObject;
-import org.lwjgl.opengl.Display;
-import org.lwjgl.opengl.DisplayMode;
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.opengl.GLContext;
-import org.lwjgl.util.glu.GLU;
-
-public final class VBOTest {
-
- static {
- try {
- //find first display mode that allows us 640*480*16
- int mode = -1;
- DisplayMode[] modes = Display.getAvailableDisplayModes();
- for ( int i = 0; i < modes.length; i++ ) {
- if ( modes[i].getWidth() == 640
- && modes[i].getHeight() == 480
- && modes[i].getBitsPerPixel() >= 16 ) {
- mode = i;
- break;
- }
- }
- if ( mode != -1 ) {
- //select above found displaymode
- System.out.println("Setting display mode to " + modes[mode]);
- Display.setDisplayMode(modes[mode]);
- System.out.println("Created display.");
- }
- } catch (Exception e) {
- System.err.println("Failed to create display due to " + e);
- }
- }
-
- static {
- try {
- Display.create();
- System.out.println("Created OpenGL.");
- } catch (Exception e) {
- System.err.println("Failed to create OpenGL due to " + e);
- System.exit(1);
- }
- }
-
- /**
- * Is the game finished?
- */
- private static boolean finished;
-
- /**
- * A rotating square!
- */
- private static float angle;
- private static int buffer_id;
- private static FloatBuffer vertices;
- private static ByteBuffer mapped_buffer = null;
- private static FloatBuffer mapped_float_buffer = null;
-
- public static void main(String[] arguments) {
- try {
- init();
- while ( !finished ) {
- Display.update();
-
- if ( !Display.isVisible() )
- Thread.sleep(200);
- else if ( Display.isCloseRequested() )
- System.exit(0);
-
- mainLoop();
- render();
- }
- } catch (Throwable t) {
- t.printStackTrace();
- } finally {
- cleanup();
- }
- System.exit(0);
- }
-
- /**
- * All calculations are done in here
- */
- private static void mainLoop() {
- angle += 1f;
- if ( angle > 360.0f )
- angle = 0.0f;
-
- if ( Mouse.getDX() != 0 || Mouse.getDY() != 0 || Mouse.getDWheel() != 0 )
- System.out.println("Mouse moved " + Mouse.getDX() + " " + Mouse.getDY() + " " + Mouse.getDWheel());
- for ( int i = 0; i < Mouse.getButtonCount(); i++ )
- if ( Mouse.isButtonDown(i) )
- System.out.println("Button " + i + " down");
- if ( Keyboard.isKeyDown(Keyboard.KEY_ESCAPE) )
- finished = true;
- for ( int i = 0; i < Keyboard.getNumKeyboardEvents(); i++ ) {
- Keyboard.next();
- if ( Keyboard.getEventKey() == Keyboard.KEY_ESCAPE && Keyboard.getEventKeyState() )
- finished = true;
- if ( Keyboard.getEventKey() == Keyboard.KEY_T && Keyboard.getEventKeyState() )
- System.out.println("Current time: " + Sys.getTime());
- }
- }
-
- /**
- * All rendering is done in here
- */
- private static void render() {
- GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
- GL11.glPushMatrix();
- GL11.glTranslatef(Display.getDisplayMode().getWidth() / 2, Display.getDisplayMode().getHeight() / 2, 0.0f);
- GL11.glRotatef(angle, 0, 0, 1.0f);
- ByteBuffer new_mapped_buffer = ARBBufferObject.glMapBufferARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB,
- ARBBufferObject.GL_WRITE_ONLY_ARB,
- mapped_buffer);
- if ( new_mapped_buffer != mapped_buffer )
- mapped_float_buffer = new_mapped_buffer.order(ByteOrder.nativeOrder()).asFloatBuffer();
- mapped_buffer = new_mapped_buffer;
- mapped_float_buffer.rewind();
- vertices.rewind();
- mapped_float_buffer.put(vertices);
- if ( ARBBufferObject.glUnmapBufferARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB) )
- GL11.glDrawArrays(GL11.GL_QUADS, 0, 4);
- GL11.glPopMatrix();
- }
-
- /**
- * Initialize
- */
- private static void init() throws Exception {
- System.out.println("Timer resolution: " + Sys.getTimerResolution());
- // Go into orthographic projection mode.
- GL11.glMatrixMode(GL11.GL_PROJECTION);
- GL11.glLoadIdentity();
- GLU.gluOrtho2D(0, Display.getDisplayMode().getWidth(), 0, Display.getDisplayMode().getHeight());
- GL11.glMatrixMode(GL11.GL_MODELVIEW);
- GL11.glLoadIdentity();
- GL11.glViewport(0, 0, Display.getDisplayMode().getWidth(), Display.getDisplayMode().getHeight());
- if ( !GLContext.getCapabilities().GL_ARB_vertex_buffer_object ) {
- System.out.println("ARB VBO not supported!");
- System.exit(1);
- }
- buffer_id = ARBBufferObject.glGenBuffersARB();
- ARBBufferObject.glBindBufferARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, buffer_id);
- vertices = ByteBuffer.allocateDirect(2 * 4 * 4).order(ByteOrder.nativeOrder()).asFloatBuffer();
- vertices.put(-50).put(-50).put(50).put(-50).put(50).put(50).put(-50).put(50);
- ARBBufferObject.glBufferDataARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, 2 * 4 * 4, ARBBufferObject.GL_STREAM_DRAW_ARB);
- GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY);
- GL11.glVertexPointer(2, GL11.GL_FLOAT, 0, 0);
- }
-
- /**
- * Cleanup
- */
- private static void cleanup() {
- ARBBufferObject.glDeleteBuffersARB(buffer_id);
- Display.destroy();
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: VBOTest.java 3287 2010-03-14 23:24:40Z spasi $
+ *
+ * Simple java test program.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3287 $
+ */
+
+package org.lwjgl.test.opengl;
+
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.FloatBuffer;
+
+import org.lwjgl.Sys;
+import org.lwjgl.input.Keyboard;
+import org.lwjgl.input.Mouse;
+import org.lwjgl.opengl.ARBBufferObject;
+import org.lwjgl.opengl.ARBVertexBufferObject;
+import org.lwjgl.opengl.Display;
+import org.lwjgl.opengl.DisplayMode;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GLContext;
+import org.lwjgl.util.glu.GLU;
+
+public final class VBOTest {
+
+ static {
+ try {
+ //find first display mode that allows us 640*480*16
+ int mode = -1;
+ DisplayMode[] modes = Display.getAvailableDisplayModes();
+ for ( int i = 0; i < modes.length; i++ ) {
+ if ( modes[i].getWidth() == 640
+ && modes[i].getHeight() == 480
+ && modes[i].getBitsPerPixel() >= 16 ) {
+ mode = i;
+ break;
+ }
+ }
+ if ( mode != -1 ) {
+ //select above found displaymode
+ System.out.println("Setting display mode to " + modes[mode]);
+ Display.setDisplayMode(modes[mode]);
+ System.out.println("Created display.");
+ }
+ } catch (Exception e) {
+ System.err.println("Failed to create display due to " + e);
+ }
+ }
+
+ static {
+ try {
+ Display.create();
+ System.out.println("Created OpenGL.");
+ } catch (Exception e) {
+ System.err.println("Failed to create OpenGL due to " + e);
+ System.exit(1);
+ }
+ }
+
+ /**
+ * Is the game finished?
+ */
+ private static boolean finished;
+
+ /**
+ * A rotating square!
+ */
+ private static float angle;
+ private static int buffer_id;
+ private static FloatBuffer vertices;
+ private static ByteBuffer mapped_buffer = null;
+ private static FloatBuffer mapped_float_buffer = null;
+
+ public static void main(String[] arguments) {
+ try {
+ init();
+ while ( !finished ) {
+ Display.update();
+
+ if ( !Display.isVisible() )
+ Thread.sleep(200);
+ else if ( Display.isCloseRequested() )
+ System.exit(0);
+
+ mainLoop();
+ render();
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ } finally {
+ cleanup();
+ }
+ System.exit(0);
+ }
+
+ /**
+ * All calculations are done in here
+ */
+ private static void mainLoop() {
+ angle += 1f;
+ if ( angle > 360.0f )
+ angle = 0.0f;
+
+ if ( Mouse.getDX() != 0 || Mouse.getDY() != 0 || Mouse.getDWheel() != 0 )
+ System.out.println("Mouse moved " + Mouse.getDX() + " " + Mouse.getDY() + " " + Mouse.getDWheel());
+ for ( int i = 0; i < Mouse.getButtonCount(); i++ )
+ if ( Mouse.isButtonDown(i) )
+ System.out.println("Button " + i + " down");
+ if ( Keyboard.isKeyDown(Keyboard.KEY_ESCAPE) )
+ finished = true;
+ for ( int i = 0; i < Keyboard.getNumKeyboardEvents(); i++ ) {
+ Keyboard.next();
+ if ( Keyboard.getEventKey() == Keyboard.KEY_ESCAPE && Keyboard.getEventKeyState() )
+ finished = true;
+ if ( Keyboard.getEventKey() == Keyboard.KEY_T && Keyboard.getEventKeyState() )
+ System.out.println("Current time: " + Sys.getTime());
+ }
+ }
+
+ /**
+ * All rendering is done in here
+ */
+ private static void render() {
+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
+ GL11.glPushMatrix();
+ GL11.glTranslatef(Display.getDisplayMode().getWidth() / 2, Display.getDisplayMode().getHeight() / 2, 0.0f);
+ GL11.glRotatef(angle, 0, 0, 1.0f);
+ ByteBuffer new_mapped_buffer = ARBBufferObject.glMapBufferARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB,
+ ARBBufferObject.GL_WRITE_ONLY_ARB,
+ mapped_buffer);
+ if ( new_mapped_buffer != mapped_buffer )
+ mapped_float_buffer = new_mapped_buffer.order(ByteOrder.nativeOrder()).asFloatBuffer();
+ mapped_buffer = new_mapped_buffer;
+ mapped_float_buffer.rewind();
+ vertices.rewind();
+ mapped_float_buffer.put(vertices);
+ if ( ARBBufferObject.glUnmapBufferARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB) )
+ GL11.glDrawArrays(GL11.GL_QUADS, 0, 4);
+ GL11.glPopMatrix();
+ }
+
+ /**
+ * Initialize
+ */
+ private static void init() throws Exception {
+ System.out.println("Timer resolution: " + Sys.getTimerResolution());
+ // Go into orthographic projection mode.
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+ GL11.glLoadIdentity();
+ GLU.gluOrtho2D(0, Display.getDisplayMode().getWidth(), 0, Display.getDisplayMode().getHeight());
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ GL11.glLoadIdentity();
+ GL11.glViewport(0, 0, Display.getDisplayMode().getWidth(), Display.getDisplayMode().getHeight());
+ if ( !GLContext.getCapabilities().GL_ARB_vertex_buffer_object ) {
+ System.out.println("ARB VBO not supported!");
+ System.exit(1);
+ }
+ buffer_id = ARBBufferObject.glGenBuffersARB();
+ ARBBufferObject.glBindBufferARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, buffer_id);
+ vertices = ByteBuffer.allocateDirect(2 * 4 * 4).order(ByteOrder.nativeOrder()).asFloatBuffer();
+ vertices.put(-50).put(-50).put(50).put(-50).put(50).put(50).put(-50).put(50);
+ ARBBufferObject.glBufferDataARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, 2 * 4 * 4, ARBBufferObject.GL_STREAM_DRAW_ARB);
+ GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY);
+ GL11.glVertexPointer(2, GL11.GL_FLOAT, 0, 0);
+ }
+
+ /**
+ * Cleanup
+ */
+ private static void cleanup() {
+ ARBBufferObject.glDeleteBuffersARB(buffer_id);
+ Display.destroy();
+ }
+}
diff --git a/src/java/org/lwjgl/test/opengl/VersionTest.java b/src/java/org/lwjgl/test/opengl/VersionTest.java
index f85ea07..b5172bc 100644
--- a/src/java/org/lwjgl/test/opengl/VersionTest.java
+++ b/src/java/org/lwjgl/test/opengl/VersionTest.java
@@ -1,196 +1,196 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-/*
- * Created by LWJGL.
- * User: spasi
- * Date: 2009-04-04
- * Time: 21:20:24 pm
- */
-
-package org.lwjgl.test.opengl;
-
-import org.lwjgl.LWJGLException;
-import org.lwjgl.opengl.*;
-
-import java.util.StringTokenizer;
-import java.util.regex.Pattern;
-
-public final class VersionTest {
-
- private VersionTest() {
- }
-
- public static void main(String[] args) {
- initialize(args);
- cleanup();
- System.exit(0);
- }
-
- private static void initialize(String[] args) {
- if ( args.length < 2 )
- argsError("Insufficient number of arguments");
-
- int majorInput = 1;
- int minorInput = 0;
-
- try {
- majorInput = Integer.parseInt(args[0]);
- minorInput = Integer.parseInt(args[1]);
- } catch (NumberFormatException e) {
- argsError("Invalid number format");
- }
-
- ContextAttribs ca = new ContextAttribs(majorInput, minorInput);
-
- if ( 2 < args.length ) {
- for ( int i = 2; i < args.length; i++ ) {
- if ( Pattern.matches("[0-9]+", args[i]) )
- ca = ca.withLayer(Integer.parseInt(args[i]));
- else if ( "debug".equalsIgnoreCase(args[i]) )
- ca = ca.withDebug(true);
- else if ( "fc".equalsIgnoreCase(args[i]) )
- ca = ca.withForwardCompatible(true);
- else if ( "core".equalsIgnoreCase(args[i]) )
- ca = ca.withProfileCore(true);
- else if ( "compatibility".equalsIgnoreCase(args[i]) )
- ca = ca.withProfileCompatibility(true);
- else
- argsError("Unknown argument: \'" + args[i] + "\'");
- }
- }
-
- try {
- DisplayMode[] modes = Display.getAvailableDisplayModes();
-
- DisplayMode displayMode;
-
- displayMode = chooseMode(modes, 1024, 768);
- if ( displayMode == null )
- displayMode = chooseMode(modes, 800, 600);
- if ( displayMode == null )
- displayMode = chooseMode(modes, 640, 480);
- if ( displayMode == null )
- kill("Failed to set an appropriate display mode.");
-
- System.out.println("Setting display mode to: " + displayMode);
- Display.setDisplayMode(displayMode);
- Display.create(new PixelFormat(8, 24, 0), ca);
- } catch (LWJGLException e) {
- kill(e.getMessage());
- }
-
- System.out.println("\n---------\n");
-
- final String version = GL11.glGetString(GL11.GL_VERSION);
-
- System.out.print("GL Version requested: " + majorInput + '.' + minorInput);
- if ( ca.isProfileCore() )
- System.out.print(" - Core Profile");
- else if ( ca.isProfileCompatibility() )
- System.out.print(" - Compatibility Profile");
- System.out.println("\nGL Version returned : " + version);
-
- final StringTokenizer version_tokenizer = new StringTokenizer(version, ". ");
-
- int majorVersion = Integer.parseInt(version_tokenizer.nextToken());
- int minorVersion = Integer.parseInt(version_tokenizer.nextToken());
-
- if ( majorVersion != majorInput || minorVersion != minorInput ) {
- if ( majorInput == 1 && minorInput == 0 )
- System.out.println("\tThe maximum supported version has been returned. The driver is well-behaved. :)");
- else if ( majorInput < 3 && majorVersion < 3 )
- System.out.println("\tThe maximum supported version pre-3.0 has been returned. The driver is well-behaved. :)");
- else
- System.out.println("\tThe requested version was not returned. The driver is buggy! :(");
- } else
- System.out.println("\tThe requested version was returned. :)");
-
- if ( ca.isProfileCompatibility() && !GLContext.getCapabilities().GL_ARB_compatibility )
- System.out.println("\tThe driver does not support the Compatibility Profile.");
-
- System.out.println("\n---------\n");
-
- System.out.println("Debug mode: " + ca.isDebug());
- System.out.println("Forward compatible mode: " + ca.isForwardCompatible());
- System.out.println("ARB_compatibility: " + GLContext.getCapabilities().GL_ARB_compatibility);
- try {
- GL11.glVertex3f(0.0f, 0.0f, 0.0f);
- System.out.println("Deprecated functionality present: " + true);
- } catch (Throwable t) {
- System.out.println("Deprecated functionality present: " + false);
- if ( GLContext.getCapabilities().GL_ARB_compatibility ) {
- System.out.println("\tARB_compatibility is present, but LWJGL has enabled pseudo-forward compatible mode.");
- }
- }
- }
-
- private static DisplayMode chooseMode(DisplayMode[] modes, int width, int height) {
- DisplayMode bestMode = null;
-
- for ( int i = 0; i < modes.length; i++ ) {
- DisplayMode mode = modes[i];
- if ( mode.getWidth() == width && mode.getHeight() == height && mode.getFrequency() <= 85 ) {
- if ( bestMode == null || (mode.getBitsPerPixel() >= bestMode.getBitsPerPixel() && mode.getFrequency() > bestMode.getFrequency()) )
- bestMode = mode;
- }
- }
-
- return bestMode;
- }
-
- private static void cleanup() {
- if ( Display.isCreated() )
- Display.destroy();
- }
-
- private static void argsError(final String msg) {
- System.out.println("\nInvalid arguments error: " + msg);
- System.out.println("\nUsage: VersionTest <majorVersion> <minorVersion> {<layer>, 'debug', 'fc'}:\n");
- System.out.println("majorVersion\t- Major OpenGL version.");
- System.out.println("majorVersion\t- Minor OpenGL version.");
- System.out.println("layer\t- Layer plane (optional).");
- System.out.println("debug\t- Enables debug mode (optional).");
- System.out.println("fc\t- Enables forward compatibility mode (optional).");
-
- cleanup();
- System.exit(-1);
- }
-
- static void kill(String reason) {
- System.out.println("The VersionTest program was terminated because an error occured.\n");
- System.out.println("Reason: " + (reason == null ? "Unknown" : reason));
-
- cleanup();
- System.exit(-1);
- }
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+/*
+ * Created by LWJGL.
+ * User: spasi
+ * Date: 2009-04-04
+ * Time: 21:20:24 pm
+ */
+
+package org.lwjgl.test.opengl;
+
+import org.lwjgl.LWJGLException;
+import org.lwjgl.opengl.*;
+
+import java.util.StringTokenizer;
+import java.util.regex.Pattern;
+
+public final class VersionTest {
+
+ private VersionTest() {
+ }
+
+ public static void main(String[] args) {
+ initialize(args);
+ cleanup();
+ System.exit(0);
+ }
+
+ private static void initialize(String[] args) {
+ if ( args.length < 2 )
+ argsError("Insufficient number of arguments");
+
+ int majorInput = 1;
+ int minorInput = 0;
+
+ try {
+ majorInput = Integer.parseInt(args[0]);
+ minorInput = Integer.parseInt(args[1]);
+ } catch (NumberFormatException e) {
+ argsError("Invalid number format");
+ }
+
+ ContextAttribs ca = new ContextAttribs(majorInput, minorInput);
+
+ if ( 2 < args.length ) {
+ for ( int i = 2; i < args.length; i++ ) {
+ if ( Pattern.matches("[0-9]+", args[i]) )
+ ca = ca.withLayer(Integer.parseInt(args[i]));
+ else if ( "debug".equalsIgnoreCase(args[i]) )
+ ca = ca.withDebug(true);
+ else if ( "fc".equalsIgnoreCase(args[i]) )
+ ca = ca.withForwardCompatible(true);
+ else if ( "core".equalsIgnoreCase(args[i]) )
+ ca = ca.withProfileCore(true);
+ else if ( "compatibility".equalsIgnoreCase(args[i]) )
+ ca = ca.withProfileCompatibility(true);
+ else
+ argsError("Unknown argument: \'" + args[i] + "\'");
+ }
+ }
+
+ try {
+ DisplayMode[] modes = Display.getAvailableDisplayModes();
+
+ DisplayMode displayMode;
+
+ displayMode = chooseMode(modes, 1024, 768);
+ if ( displayMode == null )
+ displayMode = chooseMode(modes, 800, 600);
+ if ( displayMode == null )
+ displayMode = chooseMode(modes, 640, 480);
+ if ( displayMode == null )
+ kill("Failed to set an appropriate display mode.");
+
+ System.out.println("Setting display mode to: " + displayMode);
+ Display.setDisplayMode(displayMode);
+ Display.create(new PixelFormat(8, 24, 0), ca);
+ } catch (LWJGLException e) {
+ kill(e.getMessage());
+ }
+
+ System.out.println("\n---------\n");
+
+ final String version = GL11.glGetString(GL11.GL_VERSION);
+
+ System.out.print("GL Version requested: " + majorInput + '.' + minorInput);
+ if ( ca.isProfileCore() )
+ System.out.print(" - Core Profile");
+ else if ( ca.isProfileCompatibility() )
+ System.out.print(" - Compatibility Profile");
+ System.out.println("\nGL Version returned : " + version);
+
+ final StringTokenizer version_tokenizer = new StringTokenizer(version, ". ");
+
+ int majorVersion = Integer.parseInt(version_tokenizer.nextToken());
+ int minorVersion = Integer.parseInt(version_tokenizer.nextToken());
+
+ if ( majorVersion != majorInput || minorVersion != minorInput ) {
+ if ( majorInput == 1 && minorInput == 0 )
+ System.out.println("\tThe maximum supported version has been returned. The driver is well-behaved. :)");
+ else if ( majorInput < 3 && majorVersion < 3 )
+ System.out.println("\tThe maximum supported version pre-3.0 has been returned. The driver is well-behaved. :)");
+ else
+ System.out.println("\tThe requested version was not returned. The driver is buggy! :(");
+ } else
+ System.out.println("\tThe requested version was returned. :)");
+
+ if ( ca.isProfileCompatibility() && !GLContext.getCapabilities().GL_ARB_compatibility )
+ System.out.println("\tThe driver does not support the Compatibility Profile.");
+
+ System.out.println("\n---------\n");
+
+ System.out.println("Debug mode: " + ca.isDebug());
+ System.out.println("Forward compatible mode: " + ca.isForwardCompatible());
+ System.out.println("ARB_compatibility: " + GLContext.getCapabilities().GL_ARB_compatibility);
+ try {
+ GL11.glVertex3f(0.0f, 0.0f, 0.0f);
+ System.out.println("Deprecated functionality present: " + true);
+ } catch (Throwable t) {
+ System.out.println("Deprecated functionality present: " + false);
+ if ( GLContext.getCapabilities().GL_ARB_compatibility ) {
+ System.out.println("\tARB_compatibility is present, but LWJGL has enabled pseudo-forward compatible mode.");
+ }
+ }
+ }
+
+ private static DisplayMode chooseMode(DisplayMode[] modes, int width, int height) {
+ DisplayMode bestMode = null;
+
+ for ( int i = 0; i < modes.length; i++ ) {
+ DisplayMode mode = modes[i];
+ if ( mode.getWidth() == width && mode.getHeight() == height && mode.getFrequency() <= 85 ) {
+ if ( bestMode == null || (mode.getBitsPerPixel() >= bestMode.getBitsPerPixel() && mode.getFrequency() > bestMode.getFrequency()) )
+ bestMode = mode;
+ }
+ }
+
+ return bestMode;
+ }
+
+ private static void cleanup() {
+ if ( Display.isCreated() )
+ Display.destroy();
+ }
+
+ private static void argsError(final String msg) {
+ System.out.println("\nInvalid arguments error: " + msg);
+ System.out.println("\nUsage: VersionTest <majorVersion> <minorVersion> {<layer>, 'debug', 'fc'}:\n");
+ System.out.println("majorVersion\t- Major OpenGL version.");
+ System.out.println("majorVersion\t- Minor OpenGL version.");
+ System.out.println("layer\t- Layer plane (optional).");
+ System.out.println("debug\t- Enables debug mode (optional).");
+ System.out.println("fc\t- Enables forward compatibility mode (optional).");
+
+ cleanup();
+ System.exit(-1);
+ }
+
+ static void kill(String reason) {
+ System.out.println("The VersionTest program was terminated because an error occured.\n");
+ System.out.println("Reason: " + (reason == null ? "Unknown" : reason));
+
+ cleanup();
+ System.exit(-1);
+ }
+
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/test/opengl/awt/AWTGears.java b/src/java/org/lwjgl/test/opengl/awt/AWTGears.java
index 8c7fd62..bb078be 100644
--- a/src/java/org/lwjgl/test/opengl/awt/AWTGears.java
+++ b/src/java/org/lwjgl/test/opengl/awt/AWTGears.java
@@ -1,275 +1,275 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.opengl.awt;
-
-import java.awt.Frame;
-import java.awt.Color;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.nio.FloatBuffer;
-
-import org.lwjgl.BufferUtils;
-import org.lwjgl.LWJGLException;
-import org.lwjgl.opengl.ARBTransposeMatrix;
-import org.lwjgl.opengl.AWTGLCanvas;
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.opengl.GLContext;
-
-/**
- * <p>
- * AWT version of the gears demo
- * <p>
- * @version $Revision$
- * @author Brian Matzon <brian at matzon.dk>
- * $Id$
- */
-public class AWTGears extends Frame {
-
- /** AWT GL canvas */
- private AWTGLCanvas canvas0;
-
- private float view_rotx = 20.0f;
-
- private float view_roty = 30.0f;
-
- private float view_rotz = 0.0f;
-
- private int gear1;
-
- private int gear2;
-
- private int gear3;
-
- private float angle = 0.0f;
-
- /**
- * C'tor
- */
- public AWTGears() throws LWJGLException {
- setTitle("Gears");
- setBackground(Color.BLACK);
- AWTGearsCanvas canvas = new AWTGearsCanvas();
- canvas.setSize(300, 300);
- add(canvas);
- addWindowListener(new WindowAdapter() {
- public void windowClosing(WindowEvent e) {
- dispose();
- System.exit(0);
- }
- });
- setResizable(true);
- pack();
- setVisible(true);
- }
-
- private void setup() {
- // setup ogl
- FloatBuffer pos = BufferUtils.createFloatBuffer(4).put(new float[] { 5.0f, 5.0f, 10.0f, 0.0f});
- FloatBuffer red = BufferUtils.createFloatBuffer(4).put(new float[] { 0.8f, 0.1f, 0.0f, 1.0f});
- FloatBuffer green = BufferUtils.createFloatBuffer(4).put(new float[] { 0.0f, 0.8f, 0.2f, 1.0f});
- FloatBuffer blue = BufferUtils.createFloatBuffer(4).put(new float[] { 0.2f, 0.2f, 1.0f, 1.0f});
- pos.flip();
- red.flip();
- green.flip();
- blue.flip();
-
- GL11.glLight(GL11.GL_LIGHT0, GL11.GL_POSITION, pos);
- GL11.glEnable(GL11.GL_CULL_FACE);
- GL11.glEnable(GL11.GL_LIGHTING);
- GL11.glEnable(GL11.GL_LIGHT0);
- GL11.glEnable(GL11.GL_DEPTH_TEST);
-
- /* make the gears */
- gear1 = GL11.glGenLists(1);
- GL11.glNewList(gear1, GL11.GL_COMPILE);
- GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, red);
- gear(1.0f, 4.0f, 1.0f, 20, 0.7f);
- GL11.glEndList();
-
- gear2 = GL11.glGenLists(1);
- GL11.glNewList(gear2, GL11.GL_COMPILE);
- GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, green);
- gear(0.5f, 2.0f, 2.0f, 10, 0.7f);
- GL11.glEndList();
-
- gear3 = GL11.glGenLists(1);
- GL11.glNewList(gear3, GL11.GL_COMPILE);
- GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, blue);
- gear(1.3f, 2.0f, 0.5f, 10, 0.7f);
- GL11.glEndList();
-
- GL11.glEnable(GL11.GL_NORMALIZE);
-
- GL11.glMatrixMode(GL11.GL_PROJECTION);
-
- System.err.println("GL_VENDOR: " + GL11.glGetString(GL11.GL_VENDOR));
- System.err.println("GL_RENDERER: " + GL11.glGetString(GL11.GL_RENDERER));
- System.err.println("GL_VERSION: " + GL11.glGetString(GL11.GL_VERSION));
- System.err.println();
- System.err.println("glLoadTransposeMatrixfARB() supported: " + GLContext.getCapabilities().GL_ARB_transpose_matrix);
- if (!GLContext.getCapabilities().GL_ARB_transpose_matrix) {
- // --- not using extensions
- GL11.glLoadIdentity();
- } else {
- // --- using extensions
- final FloatBuffer identityTranspose = BufferUtils.createFloatBuffer(16).put(
- new float[] { 1, 0, 0, 0, 0, 1, 0, 0,
- 0, 0, 1, 0, 0, 0, 0, 1});
- identityTranspose.flip();
- ARBTransposeMatrix.glLoadTransposeMatrixARB(identityTranspose);
- }
-
- float h = (float) 300 / (float) 300;
- GL11.glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f);
- GL11.glMatrixMode(GL11.GL_MODELVIEW);
- GL11.glLoadIdentity();
- GL11.glTranslatef(0.0f, 0.0f, -40.0f);
- }
-
- /**
- * Draw a gear wheel. You'll probably want to call this function when
- * building a display list since we do a lot of trig here.
- *
- * @param inner_radius radius of hole at center
- * @param outer_radius radius at center of teeth
- * @param width width of gear
- * @param teeth number of teeth
- * @param tooth_depth depth of tooth
- */
- private void gear(float inner_radius, float outer_radius, float width, int teeth, float tooth_depth) {
- int i;
- float r0, r1, r2;
- float angle, da;
- float u, v, len;
-
- r0 = inner_radius;
- r1 = outer_radius - tooth_depth / 2.0f;
- r2 = outer_radius + tooth_depth / 2.0f;
-
- da = 2.0f * (float) Math.PI / teeth / 4.0f;
-
- GL11.glShadeModel(GL11.GL_FLAT);
-
- GL11.glNormal3f(0.0f, 0.0f, 1.0f);
-
- /* draw front face */
- GL11.glBegin(GL11.GL_QUAD_STRIP);
- for (i = 0; i <= teeth; i++) {
- angle = i * 2.0f * (float) Math.PI / teeth;
- GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f);
- if (i < teeth) {
- GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle + 3.0f * da), r1 * (float) Math.sin(angle + 3.0f * da),
- width * 0.5f);
- }
- }
- GL11.glEnd();
-
- /* draw front sides of teeth */
- GL11.glBegin(GL11.GL_QUADS);
- for (i = 0; i < teeth; i++) {
- angle = i * 2.0f * (float) Math.PI / teeth;
- GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), width * 0.5f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + 2.0f * da), r2 * (float) Math.sin(angle + 2.0f * da), width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle + 3.0f * da), r1 * (float) Math.sin(angle + 3.0f * da), width * 0.5f);
- }
- GL11.glEnd();
-
- /* draw back face */
- GL11.glBegin(GL11.GL_QUAD_STRIP);
- for (i = 0; i <= teeth; i++) {
- angle = i * 2.0f * (float) Math.PI / teeth;
- GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f);
- GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f);
- GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f);
- }
- GL11.glEnd();
-
- /* draw back sides of teeth */
- GL11.glBegin(GL11.GL_QUADS);
- for (i = 0; i < teeth; i++) {
- angle = i * 2.0f * (float) Math.PI / teeth;
- GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), -width * 0.5f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), -width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f);
- }
- GL11.glEnd();
-
- /* draw outward faces of teeth */
- GL11.glBegin(GL11.GL_QUAD_STRIP);
- for (i = 0; i < teeth; i++) {
- angle = i * 2.0f * (float) Math.PI / teeth;
- GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f);
- u = r2 * (float) Math.cos(angle + da) - r1 * (float) Math.cos(angle);
- v = r2 * (float) Math.sin(angle + da) - r1 * (float) Math.sin(angle);
- len = (float) Math.sqrt(u * u + v * v);
- u /= len;
- v /= len;
- GL11.glNormal3f(v, -u, 0.0f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), width * 0.5f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), -width * 0.5f);
- GL11.glNormal3f((float) Math.cos(angle), (float) Math.sin(angle), 0.0f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), width * 0.5f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), -width * 0.5f);
- u = r1 * (float) Math.cos(angle + 3 * da) - r2 * (float) Math.cos(angle + 2 * da);
- v = r1 * (float) Math.sin(angle + 3 * da) - r2 * (float) Math.sin(angle + 2 * da);
- GL11.glNormal3f(v, -u, 0.0f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f);
- GL11.glNormal3f((float) Math.cos(angle), (float) Math.sin(angle), 0.0f);
- }
- GL11.glVertex3f(r1 * (float) Math.cos(0), r1 * (float) Math.sin(0), width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(0), r1 * (float) Math.sin(0), -width * 0.5f);
- GL11.glEnd();
-
- GL11.glShadeModel(GL11.GL_SMOOTH);
-
- /* draw inside radius cylinder */
- GL11.glBegin(GL11.GL_QUAD_STRIP);
- for (i = 0; i <= teeth; i++) {
- angle = i * 2.0f * (float) Math.PI / teeth;
- GL11.glNormal3f(-(float) Math.cos(angle), -(float) Math.sin(angle), 0.0f);
- GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f);
- GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f);
- }
- GL11.glEnd();
- }
-
- public static void main(String[] args) throws LWJGLException {
- new AWTGears();
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.opengl.awt;
+
+import java.awt.Frame;
+import java.awt.Color;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.nio.FloatBuffer;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.LWJGLException;
+import org.lwjgl.opengl.ARBTransposeMatrix;
+import org.lwjgl.opengl.AWTGLCanvas;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GLContext;
+
+/**
+ * <p>
+ * AWT version of the gears demo
+ * <p>
+ * @version $Revision$
+ * @author Brian Matzon <brian at matzon.dk>
+ * $Id$
+ */
+public class AWTGears extends Frame {
+
+ /** AWT GL canvas */
+ private AWTGLCanvas canvas0;
+
+ private float view_rotx = 20.0f;
+
+ private float view_roty = 30.0f;
+
+ private float view_rotz = 0.0f;
+
+ private int gear1;
+
+ private int gear2;
+
+ private int gear3;
+
+ private float angle = 0.0f;
+
+ /**
+ * C'tor
+ */
+ public AWTGears() throws LWJGLException {
+ setTitle("Gears");
+ setBackground(Color.BLACK);
+ AWTGearsCanvas canvas = new AWTGearsCanvas();
+ canvas.setSize(300, 300);
+ add(canvas);
+ addWindowListener(new WindowAdapter() {
+ public void windowClosing(WindowEvent e) {
+ dispose();
+ System.exit(0);
+ }
+ });
+ setResizable(true);
+ pack();
+ setVisible(true);
+ }
+
+ private void setup() {
+ // setup ogl
+ FloatBuffer pos = BufferUtils.createFloatBuffer(4).put(new float[] { 5.0f, 5.0f, 10.0f, 0.0f});
+ FloatBuffer red = BufferUtils.createFloatBuffer(4).put(new float[] { 0.8f, 0.1f, 0.0f, 1.0f});
+ FloatBuffer green = BufferUtils.createFloatBuffer(4).put(new float[] { 0.0f, 0.8f, 0.2f, 1.0f});
+ FloatBuffer blue = BufferUtils.createFloatBuffer(4).put(new float[] { 0.2f, 0.2f, 1.0f, 1.0f});
+ pos.flip();
+ red.flip();
+ green.flip();
+ blue.flip();
+
+ GL11.glLight(GL11.GL_LIGHT0, GL11.GL_POSITION, pos);
+ GL11.glEnable(GL11.GL_CULL_FACE);
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glEnable(GL11.GL_LIGHT0);
+ GL11.glEnable(GL11.GL_DEPTH_TEST);
+
+ /* make the gears */
+ gear1 = GL11.glGenLists(1);
+ GL11.glNewList(gear1, GL11.GL_COMPILE);
+ GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, red);
+ gear(1.0f, 4.0f, 1.0f, 20, 0.7f);
+ GL11.glEndList();
+
+ gear2 = GL11.glGenLists(1);
+ GL11.glNewList(gear2, GL11.GL_COMPILE);
+ GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, green);
+ gear(0.5f, 2.0f, 2.0f, 10, 0.7f);
+ GL11.glEndList();
+
+ gear3 = GL11.glGenLists(1);
+ GL11.glNewList(gear3, GL11.GL_COMPILE);
+ GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, blue);
+ gear(1.3f, 2.0f, 0.5f, 10, 0.7f);
+ GL11.glEndList();
+
+ GL11.glEnable(GL11.GL_NORMALIZE);
+
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+
+ System.err.println("GL_VENDOR: " + GL11.glGetString(GL11.GL_VENDOR));
+ System.err.println("GL_RENDERER: " + GL11.glGetString(GL11.GL_RENDERER));
+ System.err.println("GL_VERSION: " + GL11.glGetString(GL11.GL_VERSION));
+ System.err.println();
+ System.err.println("glLoadTransposeMatrixfARB() supported: " + GLContext.getCapabilities().GL_ARB_transpose_matrix);
+ if (!GLContext.getCapabilities().GL_ARB_transpose_matrix) {
+ // --- not using extensions
+ GL11.glLoadIdentity();
+ } else {
+ // --- using extensions
+ final FloatBuffer identityTranspose = BufferUtils.createFloatBuffer(16).put(
+ new float[] { 1, 0, 0, 0, 0, 1, 0, 0,
+ 0, 0, 1, 0, 0, 0, 0, 1});
+ identityTranspose.flip();
+ ARBTransposeMatrix.glLoadTransposeMatrixARB(identityTranspose);
+ }
+
+ float h = (float) 300 / (float) 300;
+ GL11.glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f);
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ GL11.glLoadIdentity();
+ GL11.glTranslatef(0.0f, 0.0f, -40.0f);
+ }
+
+ /**
+ * Draw a gear wheel. You'll probably want to call this function when
+ * building a display list since we do a lot of trig here.
+ *
+ * @param inner_radius radius of hole at center
+ * @param outer_radius radius at center of teeth
+ * @param width width of gear
+ * @param teeth number of teeth
+ * @param tooth_depth depth of tooth
+ */
+ private void gear(float inner_radius, float outer_radius, float width, int teeth, float tooth_depth) {
+ int i;
+ float r0, r1, r2;
+ float angle, da;
+ float u, v, len;
+
+ r0 = inner_radius;
+ r1 = outer_radius - tooth_depth / 2.0f;
+ r2 = outer_radius + tooth_depth / 2.0f;
+
+ da = 2.0f * (float) Math.PI / teeth / 4.0f;
+
+ GL11.glShadeModel(GL11.GL_FLAT);
+
+ GL11.glNormal3f(0.0f, 0.0f, 1.0f);
+
+ /* draw front face */
+ GL11.glBegin(GL11.GL_QUAD_STRIP);
+ for (i = 0; i <= teeth; i++) {
+ angle = i * 2.0f * (float) Math.PI / teeth;
+ GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f);
+ if (i < teeth) {
+ GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle + 3.0f * da), r1 * (float) Math.sin(angle + 3.0f * da),
+ width * 0.5f);
+ }
+ }
+ GL11.glEnd();
+
+ /* draw front sides of teeth */
+ GL11.glBegin(GL11.GL_QUADS);
+ for (i = 0; i < teeth; i++) {
+ angle = i * 2.0f * (float) Math.PI / teeth;
+ GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), width * 0.5f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + 2.0f * da), r2 * (float) Math.sin(angle + 2.0f * da), width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle + 3.0f * da), r1 * (float) Math.sin(angle + 3.0f * da), width * 0.5f);
+ }
+ GL11.glEnd();
+
+ /* draw back face */
+ GL11.glBegin(GL11.GL_QUAD_STRIP);
+ for (i = 0; i <= teeth; i++) {
+ angle = i * 2.0f * (float) Math.PI / teeth;
+ GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f);
+ GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f);
+ GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f);
+ }
+ GL11.glEnd();
+
+ /* draw back sides of teeth */
+ GL11.glBegin(GL11.GL_QUADS);
+ for (i = 0; i < teeth; i++) {
+ angle = i * 2.0f * (float) Math.PI / teeth;
+ GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), -width * 0.5f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), -width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f);
+ }
+ GL11.glEnd();
+
+ /* draw outward faces of teeth */
+ GL11.glBegin(GL11.GL_QUAD_STRIP);
+ for (i = 0; i < teeth; i++) {
+ angle = i * 2.0f * (float) Math.PI / teeth;
+ GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f);
+ u = r2 * (float) Math.cos(angle + da) - r1 * (float) Math.cos(angle);
+ v = r2 * (float) Math.sin(angle + da) - r1 * (float) Math.sin(angle);
+ len = (float) Math.sqrt(u * u + v * v);
+ u /= len;
+ v /= len;
+ GL11.glNormal3f(v, -u, 0.0f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), width * 0.5f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), -width * 0.5f);
+ GL11.glNormal3f((float) Math.cos(angle), (float) Math.sin(angle), 0.0f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), width * 0.5f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), -width * 0.5f);
+ u = r1 * (float) Math.cos(angle + 3 * da) - r2 * (float) Math.cos(angle + 2 * da);
+ v = r1 * (float) Math.sin(angle + 3 * da) - r2 * (float) Math.sin(angle + 2 * da);
+ GL11.glNormal3f(v, -u, 0.0f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f);
+ GL11.glNormal3f((float) Math.cos(angle), (float) Math.sin(angle), 0.0f);
+ }
+ GL11.glVertex3f(r1 * (float) Math.cos(0), r1 * (float) Math.sin(0), width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(0), r1 * (float) Math.sin(0), -width * 0.5f);
+ GL11.glEnd();
+
+ GL11.glShadeModel(GL11.GL_SMOOTH);
+
+ /* draw inside radius cylinder */
+ GL11.glBegin(GL11.GL_QUAD_STRIP);
+ for (i = 0; i <= teeth; i++) {
+ angle = i * 2.0f * (float) Math.PI / teeth;
+ GL11.glNormal3f(-(float) Math.cos(angle), -(float) Math.sin(angle), 0.0f);
+ GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f);
+ GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f);
+ }
+ GL11.glEnd();
+ }
+
+ public static void main(String[] args) throws LWJGLException {
+ new AWTGears();
+ }
+}
diff --git a/src/java/org/lwjgl/test/opengl/awt/AWTGearsCanvas.java b/src/java/org/lwjgl/test/opengl/awt/AWTGearsCanvas.java
index c6dbb9a..0291bb5 100644
--- a/src/java/org/lwjgl/test/opengl/awt/AWTGearsCanvas.java
+++ b/src/java/org/lwjgl/test/opengl/awt/AWTGearsCanvas.java
@@ -1,325 +1,325 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.opengl.awt;
-
-import java.nio.FloatBuffer;
-
-import org.lwjgl.BufferUtils;
-import org.lwjgl.LWJGLException;
-import org.lwjgl.opengl.ARBTransposeMatrix;
-import org.lwjgl.opengl.AWTGLCanvas;
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.opengl.GLContext;
-import org.lwjgl.test.applet.Test;
-
-/**
- * <p>
- * AWT version of the gears demo
- * <p>
- * @version $Revision$
- * @author Brian Matzon <brian at matzon.dk>
- * $Id$
- */
-public class AWTGearsCanvas extends AWTGLCanvas implements Test {
-
- private float view_rotx = 20.0f;
-
- private float view_roty = 30.0f;
-
- private float view_rotz = 0.0f;
-
- private int gear1;
-
- private int gear2;
-
- private int gear3;
-
- private float angle = 0.0f;
-
- long startTime = 0;
- long fps = 0;
- int current_width;
- int current_height;
-
- /**
- * C'tor
- */
- public AWTGearsCanvas() throws LWJGLException {
- super();
- }
-
- public void paintGL() {
-
- if(startTime == 0) {
- setup();
- startTime = System.currentTimeMillis() + 5000;
- }
-
- try {
- angle += 2.0f;
- if (getWidth() != current_width || getHeight() != current_height) {
- current_width = getWidth();
- current_height = getHeight();
- GL11.glViewport(0, 0, current_width, current_height);
- }
- GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
-
- GL11.glPushMatrix();
- GL11.glRotatef(view_rotx, 1.0f, 0.0f, 0.0f);
- GL11.glRotatef(view_roty, 0.0f, 1.0f, 0.0f);
- GL11.glRotatef(view_rotz, 0.0f, 0.0f, 1.0f);
-
- GL11.glPushMatrix();
- GL11.glTranslatef(-3.0f, -2.0f, 0.0f);
- GL11.glRotatef(angle, 0.0f, 0.0f, 1.0f);
- GL11.glCallList(gear1);
- GL11.glPopMatrix();
-
- GL11.glPushMatrix();
- GL11.glTranslatef(3.1f, -2.0f, 0.0f);
- GL11.glRotatef(-2.0f * angle - 9.0f, 0.0f, 0.0f, 1.0f);
- GL11.glCallList(gear2);
- GL11.glPopMatrix();
-
- GL11.glPushMatrix();
- GL11.glTranslatef(-3.1f, 4.2f, 0.0f);
- GL11.glRotatef(-2.0f * angle - 25.0f, 0.0f, 0.0f, 1.0f);
- GL11.glCallList(gear3);
- GL11.glPopMatrix();
-
- GL11.glPopMatrix();
- swapBuffers();
- repaint();
- } catch (LWJGLException e) {
- throw new RuntimeException(e);
- }
- if (startTime > System.currentTimeMillis()) {
- fps++;
- } else {
- long timeUsed = 5000 + (startTime - System.currentTimeMillis());
- startTime = System.currentTimeMillis() + 5000;
- System.out.println(fps + " frames in " + (float) (timeUsed / 1000f) + " seconds = "
- + (fps / (timeUsed / 1000f)));
- fps = 0;
- }
- }
-
- private void setup() {
- // setup ogl
- FloatBuffer pos = BufferUtils.createFloatBuffer(4).put(new float[] { 5.0f, 5.0f, 10.0f, 0.0f});
- FloatBuffer red = BufferUtils.createFloatBuffer(4).put(new float[] { 0.8f, 0.1f, 0.0f, 1.0f});
- FloatBuffer green = BufferUtils.createFloatBuffer(4).put(new float[] { 0.0f, 0.8f, 0.2f, 1.0f});
- FloatBuffer blue = BufferUtils.createFloatBuffer(4).put(new float[] { 0.2f, 0.2f, 1.0f, 1.0f});
- pos.flip();
- red.flip();
- green.flip();
- blue.flip();
-
- GL11.glLight(GL11.GL_LIGHT0, GL11.GL_POSITION, pos);
- GL11.glEnable(GL11.GL_CULL_FACE);
- GL11.glEnable(GL11.GL_LIGHTING);
- GL11.glEnable(GL11.GL_LIGHT0);
- GL11.glEnable(GL11.GL_DEPTH_TEST);
-
- /* make the gears */
- gear1 = GL11.glGenLists(1);
- GL11.glNewList(gear1, GL11.GL_COMPILE);
- GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, red);
- gear(1.0f, 4.0f, 1.0f, 20, 0.7f);
- GL11.glEndList();
-
- gear2 = GL11.glGenLists(1);
- GL11.glNewList(gear2, GL11.GL_COMPILE);
- GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, green);
- gear(0.5f, 2.0f, 2.0f, 10, 0.7f);
- GL11.glEndList();
-
- gear3 = GL11.glGenLists(1);
- GL11.glNewList(gear3, GL11.GL_COMPILE);
- GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, blue);
- gear(1.3f, 2.0f, 0.5f, 10, 0.7f);
- GL11.glEndList();
-
- GL11.glEnable(GL11.GL_NORMALIZE);
-
- GL11.glMatrixMode(GL11.GL_PROJECTION);
-
- System.err.println("GL_VENDOR: " + GL11.glGetString(GL11.GL_VENDOR));
- System.err.println("GL_RENDERER: " + GL11.glGetString(GL11.GL_RENDERER));
- System.err.println("GL_VERSION: " + GL11.glGetString(GL11.GL_VERSION));
- System.err.println();
- System.err.println("glLoadTransposeMatrixfARB() supported: " + GLContext.getCapabilities().GL_ARB_transpose_matrix);
- if (!GLContext.getCapabilities().GL_ARB_transpose_matrix) {
- // --- not using extensions
- GL11.glLoadIdentity();
- } else {
- // --- using extensions
- final FloatBuffer identityTranspose = BufferUtils.createFloatBuffer(16).put(
- new float[] { 1, 0, 0, 0, 0, 1, 0, 0,
- 0, 0, 1, 0, 0, 0, 0, 1});
- identityTranspose.flip();
- ARBTransposeMatrix.glLoadTransposeMatrixARB(identityTranspose);
- }
-
- float h = (float) 300 / (float) 300;
- GL11.glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f);
- GL11.glMatrixMode(GL11.GL_MODELVIEW);
- GL11.glLoadIdentity();
- GL11.glTranslatef(0.0f, 0.0f, -40.0f);
- }
-
- /**
- * Draw a gear wheel. You'll probably want to call this function when
- * building a display list since we do a lot of trig here.
- *
- * @param inner_radius radius of hole at center
- * @param outer_radius radius at center of teeth
- * @param width width of gear
- * @param teeth number of teeth
- * @param tooth_depth depth of tooth
- */
- private void gear(float inner_radius, float outer_radius, float width, int teeth, float tooth_depth) {
- int i;
- float r0, r1, r2;
- float angle, da;
- float u, v, len;
-
- r0 = inner_radius;
- r1 = outer_radius - tooth_depth / 2.0f;
- r2 = outer_radius + tooth_depth / 2.0f;
-
- da = 2.0f * (float) Math.PI / teeth / 4.0f;
-
- GL11.glShadeModel(GL11.GL_FLAT);
-
- GL11.glNormal3f(0.0f, 0.0f, 1.0f);
-
- /* draw front face */
- GL11.glBegin(GL11.GL_QUAD_STRIP);
- for (i = 0; i <= teeth; i++) {
- angle = i * 2.0f * (float) Math.PI / teeth;
- GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f);
- if (i < teeth) {
- GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle + 3.0f * da), r1 * (float) Math.sin(angle + 3.0f * da),
- width * 0.5f);
- }
- }
- GL11.glEnd();
-
- /* draw front sides of teeth */
- GL11.glBegin(GL11.GL_QUADS);
- for (i = 0; i < teeth; i++) {
- angle = i * 2.0f * (float) Math.PI / teeth;
- GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), width * 0.5f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + 2.0f * da), r2 * (float) Math.sin(angle + 2.0f * da), width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle + 3.0f * da), r1 * (float) Math.sin(angle + 3.0f * da), width * 0.5f);
- }
- GL11.glEnd();
-
- /* draw back face */
- GL11.glBegin(GL11.GL_QUAD_STRIP);
- for (i = 0; i <= teeth; i++) {
- angle = i * 2.0f * (float) Math.PI / teeth;
- GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f);
- GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f);
- GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f);
- }
- GL11.glEnd();
-
- /* draw back sides of teeth */
- GL11.glBegin(GL11.GL_QUADS);
- for (i = 0; i < teeth; i++) {
- angle = i * 2.0f * (float) Math.PI / teeth;
- GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), -width * 0.5f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), -width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f);
- }
- GL11.glEnd();
-
- /* draw outward faces of teeth */
- GL11.glBegin(GL11.GL_QUAD_STRIP);
- for (i = 0; i < teeth; i++) {
- angle = i * 2.0f * (float) Math.PI / teeth;
- GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f);
- u = r2 * (float) Math.cos(angle + da) - r1 * (float) Math.cos(angle);
- v = r2 * (float) Math.sin(angle + da) - r1 * (float) Math.sin(angle);
- len = (float) Math.sqrt(u * u + v * v);
- u /= len;
- v /= len;
- GL11.glNormal3f(v, -u, 0.0f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), width * 0.5f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), -width * 0.5f);
- GL11.glNormal3f((float) Math.cos(angle), (float) Math.sin(angle), 0.0f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), width * 0.5f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), -width * 0.5f);
- u = r1 * (float) Math.cos(angle + 3 * da) - r2 * (float) Math.cos(angle + 2 * da);
- v = r1 * (float) Math.sin(angle + 3 * da) - r2 * (float) Math.sin(angle + 2 * da);
- GL11.glNormal3f(v, -u, 0.0f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f);
- GL11.glNormal3f((float) Math.cos(angle), (float) Math.sin(angle), 0.0f);
- }
- GL11.glVertex3f(r1 * (float) Math.cos(0), r1 * (float) Math.sin(0), width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(0), r1 * (float) Math.sin(0), -width * 0.5f);
- GL11.glEnd();
-
- GL11.glShadeModel(GL11.GL_SMOOTH);
-
- /* draw inside radius cylinder */
- GL11.glBegin(GL11.GL_QUAD_STRIP);
- for (i = 0; i <= teeth; i++) {
- angle = i * 2.0f * (float) Math.PI / teeth;
- GL11.glNormal3f(-(float) Math.cos(angle), -(float) Math.sin(angle), 0.0f);
- GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f);
- GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f);
- }
- GL11.glEnd();
- }
-
- /*
- * @see org.lwjgl.test.applet.Test#start()
- */
- public void start() {
- }
-
- /*
- * @see org.lwjgl.test.applet.Test#stop()
- */
- public void stop() {
- }
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.opengl.awt;
+
+import java.nio.FloatBuffer;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.LWJGLException;
+import org.lwjgl.opengl.ARBTransposeMatrix;
+import org.lwjgl.opengl.AWTGLCanvas;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GLContext;
+import org.lwjgl.test.applet.Test;
+
+/**
+ * <p>
+ * AWT version of the gears demo
+ * <p>
+ * @version $Revision$
+ * @author Brian Matzon <brian at matzon.dk>
+ * $Id$
+ */
+public class AWTGearsCanvas extends AWTGLCanvas implements Test {
+
+ private float view_rotx = 20.0f;
+
+ private float view_roty = 30.0f;
+
+ private float view_rotz = 0.0f;
+
+ private int gear1;
+
+ private int gear2;
+
+ private int gear3;
+
+ private float angle = 0.0f;
+
+ long startTime = 0;
+ long fps = 0;
+ int current_width;
+ int current_height;
+
+ /**
+ * C'tor
+ */
+ public AWTGearsCanvas() throws LWJGLException {
+ super();
+ }
+
+ public void paintGL() {
+
+ if(startTime == 0) {
+ setup();
+ startTime = System.currentTimeMillis() + 5000;
+ }
+
+ try {
+ angle += 2.0f;
+ if (getWidth() != current_width || getHeight() != current_height) {
+ current_width = getWidth();
+ current_height = getHeight();
+ GL11.glViewport(0, 0, current_width, current_height);
+ }
+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
+
+ GL11.glPushMatrix();
+ GL11.glRotatef(view_rotx, 1.0f, 0.0f, 0.0f);
+ GL11.glRotatef(view_roty, 0.0f, 1.0f, 0.0f);
+ GL11.glRotatef(view_rotz, 0.0f, 0.0f, 1.0f);
+
+ GL11.glPushMatrix();
+ GL11.glTranslatef(-3.0f, -2.0f, 0.0f);
+ GL11.glRotatef(angle, 0.0f, 0.0f, 1.0f);
+ GL11.glCallList(gear1);
+ GL11.glPopMatrix();
+
+ GL11.glPushMatrix();
+ GL11.glTranslatef(3.1f, -2.0f, 0.0f);
+ GL11.glRotatef(-2.0f * angle - 9.0f, 0.0f, 0.0f, 1.0f);
+ GL11.glCallList(gear2);
+ GL11.glPopMatrix();
+
+ GL11.glPushMatrix();
+ GL11.glTranslatef(-3.1f, 4.2f, 0.0f);
+ GL11.glRotatef(-2.0f * angle - 25.0f, 0.0f, 0.0f, 1.0f);
+ GL11.glCallList(gear3);
+ GL11.glPopMatrix();
+
+ GL11.glPopMatrix();
+ swapBuffers();
+ repaint();
+ } catch (LWJGLException e) {
+ throw new RuntimeException(e);
+ }
+ if (startTime > System.currentTimeMillis()) {
+ fps++;
+ } else {
+ long timeUsed = 5000 + (startTime - System.currentTimeMillis());
+ startTime = System.currentTimeMillis() + 5000;
+ System.out.println(fps + " frames in " + (float) (timeUsed / 1000f) + " seconds = "
+ + (fps / (timeUsed / 1000f)));
+ fps = 0;
+ }
+ }
+
+ private void setup() {
+ // setup ogl
+ FloatBuffer pos = BufferUtils.createFloatBuffer(4).put(new float[] { 5.0f, 5.0f, 10.0f, 0.0f});
+ FloatBuffer red = BufferUtils.createFloatBuffer(4).put(new float[] { 0.8f, 0.1f, 0.0f, 1.0f});
+ FloatBuffer green = BufferUtils.createFloatBuffer(4).put(new float[] { 0.0f, 0.8f, 0.2f, 1.0f});
+ FloatBuffer blue = BufferUtils.createFloatBuffer(4).put(new float[] { 0.2f, 0.2f, 1.0f, 1.0f});
+ pos.flip();
+ red.flip();
+ green.flip();
+ blue.flip();
+
+ GL11.glLight(GL11.GL_LIGHT0, GL11.GL_POSITION, pos);
+ GL11.glEnable(GL11.GL_CULL_FACE);
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glEnable(GL11.GL_LIGHT0);
+ GL11.glEnable(GL11.GL_DEPTH_TEST);
+
+ /* make the gears */
+ gear1 = GL11.glGenLists(1);
+ GL11.glNewList(gear1, GL11.GL_COMPILE);
+ GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, red);
+ gear(1.0f, 4.0f, 1.0f, 20, 0.7f);
+ GL11.glEndList();
+
+ gear2 = GL11.glGenLists(1);
+ GL11.glNewList(gear2, GL11.GL_COMPILE);
+ GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, green);
+ gear(0.5f, 2.0f, 2.0f, 10, 0.7f);
+ GL11.glEndList();
+
+ gear3 = GL11.glGenLists(1);
+ GL11.glNewList(gear3, GL11.GL_COMPILE);
+ GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, blue);
+ gear(1.3f, 2.0f, 0.5f, 10, 0.7f);
+ GL11.glEndList();
+
+ GL11.glEnable(GL11.GL_NORMALIZE);
+
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+
+ System.err.println("GL_VENDOR: " + GL11.glGetString(GL11.GL_VENDOR));
+ System.err.println("GL_RENDERER: " + GL11.glGetString(GL11.GL_RENDERER));
+ System.err.println("GL_VERSION: " + GL11.glGetString(GL11.GL_VERSION));
+ System.err.println();
+ System.err.println("glLoadTransposeMatrixfARB() supported: " + GLContext.getCapabilities().GL_ARB_transpose_matrix);
+ if (!GLContext.getCapabilities().GL_ARB_transpose_matrix) {
+ // --- not using extensions
+ GL11.glLoadIdentity();
+ } else {
+ // --- using extensions
+ final FloatBuffer identityTranspose = BufferUtils.createFloatBuffer(16).put(
+ new float[] { 1, 0, 0, 0, 0, 1, 0, 0,
+ 0, 0, 1, 0, 0, 0, 0, 1});
+ identityTranspose.flip();
+ ARBTransposeMatrix.glLoadTransposeMatrixARB(identityTranspose);
+ }
+
+ float h = (float) 300 / (float) 300;
+ GL11.glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f);
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ GL11.glLoadIdentity();
+ GL11.glTranslatef(0.0f, 0.0f, -40.0f);
+ }
+
+ /**
+ * Draw a gear wheel. You'll probably want to call this function when
+ * building a display list since we do a lot of trig here.
+ *
+ * @param inner_radius radius of hole at center
+ * @param outer_radius radius at center of teeth
+ * @param width width of gear
+ * @param teeth number of teeth
+ * @param tooth_depth depth of tooth
+ */
+ private void gear(float inner_radius, float outer_radius, float width, int teeth, float tooth_depth) {
+ int i;
+ float r0, r1, r2;
+ float angle, da;
+ float u, v, len;
+
+ r0 = inner_radius;
+ r1 = outer_radius - tooth_depth / 2.0f;
+ r2 = outer_radius + tooth_depth / 2.0f;
+
+ da = 2.0f * (float) Math.PI / teeth / 4.0f;
+
+ GL11.glShadeModel(GL11.GL_FLAT);
+
+ GL11.glNormal3f(0.0f, 0.0f, 1.0f);
+
+ /* draw front face */
+ GL11.glBegin(GL11.GL_QUAD_STRIP);
+ for (i = 0; i <= teeth; i++) {
+ angle = i * 2.0f * (float) Math.PI / teeth;
+ GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f);
+ if (i < teeth) {
+ GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle + 3.0f * da), r1 * (float) Math.sin(angle + 3.0f * da),
+ width * 0.5f);
+ }
+ }
+ GL11.glEnd();
+
+ /* draw front sides of teeth */
+ GL11.glBegin(GL11.GL_QUADS);
+ for (i = 0; i < teeth; i++) {
+ angle = i * 2.0f * (float) Math.PI / teeth;
+ GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), width * 0.5f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + 2.0f * da), r2 * (float) Math.sin(angle + 2.0f * da), width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle + 3.0f * da), r1 * (float) Math.sin(angle + 3.0f * da), width * 0.5f);
+ }
+ GL11.glEnd();
+
+ /* draw back face */
+ GL11.glBegin(GL11.GL_QUAD_STRIP);
+ for (i = 0; i <= teeth; i++) {
+ angle = i * 2.0f * (float) Math.PI / teeth;
+ GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f);
+ GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f);
+ GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f);
+ }
+ GL11.glEnd();
+
+ /* draw back sides of teeth */
+ GL11.glBegin(GL11.GL_QUADS);
+ for (i = 0; i < teeth; i++) {
+ angle = i * 2.0f * (float) Math.PI / teeth;
+ GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), -width * 0.5f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), -width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f);
+ }
+ GL11.glEnd();
+
+ /* draw outward faces of teeth */
+ GL11.glBegin(GL11.GL_QUAD_STRIP);
+ for (i = 0; i < teeth; i++) {
+ angle = i * 2.0f * (float) Math.PI / teeth;
+ GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f);
+ u = r2 * (float) Math.cos(angle + da) - r1 * (float) Math.cos(angle);
+ v = r2 * (float) Math.sin(angle + da) - r1 * (float) Math.sin(angle);
+ len = (float) Math.sqrt(u * u + v * v);
+ u /= len;
+ v /= len;
+ GL11.glNormal3f(v, -u, 0.0f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), width * 0.5f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), -width * 0.5f);
+ GL11.glNormal3f((float) Math.cos(angle), (float) Math.sin(angle), 0.0f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), width * 0.5f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), -width * 0.5f);
+ u = r1 * (float) Math.cos(angle + 3 * da) - r2 * (float) Math.cos(angle + 2 * da);
+ v = r1 * (float) Math.sin(angle + 3 * da) - r2 * (float) Math.sin(angle + 2 * da);
+ GL11.glNormal3f(v, -u, 0.0f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f);
+ GL11.glNormal3f((float) Math.cos(angle), (float) Math.sin(angle), 0.0f);
+ }
+ GL11.glVertex3f(r1 * (float) Math.cos(0), r1 * (float) Math.sin(0), width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(0), r1 * (float) Math.sin(0), -width * 0.5f);
+ GL11.glEnd();
+
+ GL11.glShadeModel(GL11.GL_SMOOTH);
+
+ /* draw inside radius cylinder */
+ GL11.glBegin(GL11.GL_QUAD_STRIP);
+ for (i = 0; i <= teeth; i++) {
+ angle = i * 2.0f * (float) Math.PI / teeth;
+ GL11.glNormal3f(-(float) Math.cos(angle), -(float) Math.sin(angle), 0.0f);
+ GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f);
+ GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f);
+ }
+ GL11.glEnd();
+ }
+
+ /*
+ * @see org.lwjgl.test.applet.Test#start()
+ */
+ public void start() {
+ }
+
+ /*
+ * @see org.lwjgl.test.applet.Test#stop()
+ */
+ public void stop() {
+ }
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/test/opengl/awt/AWTTest.java b/src/java/org/lwjgl/test/opengl/awt/AWTTest.java
index 80e8af7..40c7a93 100644
--- a/src/java/org/lwjgl/test/opengl/awt/AWTTest.java
+++ b/src/java/org/lwjgl/test/opengl/awt/AWTTest.java
@@ -1,139 +1,139 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.opengl.awt;
-
-import java.awt.Frame;
-import java.awt.GridLayout;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-
-import org.lwjgl.LWJGLException;
-import org.lwjgl.opengl.AWTGLCanvas;
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.util.glu.GLU;
-
-/**
- * <p>
- * Tests AWTGLCanvas functionality
- * <p>
- * @version $Revision: 2983 $
- * @author $Author: matzon $
- * $Id: AWTTest.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public class AWTTest extends Frame {
-
- /** AWT GL canvas */
- private AWTGLCanvas canvas0, canvas1;
-
- private volatile float angle;
-
- /**
- * C'tor
- */
- public AWTTest() throws LWJGLException {
- setTitle("LWJGL AWT Canvas Test");
- setSize(640, 320);
- setLayout(new GridLayout(1, 2));
- add(canvas0 = new AWTGLCanvas() {
- int current_height;
- int current_width;
- public void paintGL() {
- try {
- if (getWidth() != current_width || getHeight() != current_height) {
- current_width = getWidth();
- current_height = getHeight();
- GL11.glViewport(0, 0, current_width, current_height);
- }
- GL11.glViewport(0, 0, getWidth(), getHeight());
- GL11.glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
- GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
- GL11.glMatrixMode(GL11.GL_PROJECTION);
- GL11.glLoadIdentity();
- GLU.gluOrtho2D(0.0f, (float) getWidth(), 0.0f, (float) getHeight());
- GL11.glMatrixMode(GL11.GL_MODELVIEW);
- GL11.glPushMatrix();
- GL11.glColor3f(1f, 1f, 0f);
- GL11.glTranslatef(getWidth() / 2.0f, getHeight() / 2.0f, 0.0f);
- GL11.glRotatef(angle, 0f, 0f, 1.0f);
- GL11.glRectf(-50.0f, -50.0f, 50.0f, 50.0f);
- GL11.glPopMatrix();
- swapBuffers();
- repaint();
- } catch (LWJGLException e) {
- throw new RuntimeException(e);
- }
- }
- });
- add(canvas1 = new AWTGLCanvas() {
- int current_height;
- int current_width;
- public void paintGL() {
- try {
- angle += 1.0f;
- if (getWidth() != current_width || getHeight() != current_height) {
- current_width = getWidth();
- current_height = getHeight();
- GL11.glViewport(0, 0, current_width, current_height);
- }
- GL11.glViewport(0, 0, getWidth(), getHeight());
- GL11.glClearColor(0.0f, 1.0f, 0.0f, 1.0f);
- GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
- GL11.glMatrixMode(GL11.GL_PROJECTION);
- GL11.glLoadIdentity();
- GLU.gluOrtho2D(0.0f, (float) getWidth(), 0.0f, (float) getHeight());
- GL11.glMatrixMode(GL11.GL_MODELVIEW);
- GL11.glPushMatrix();
- GL11.glTranslatef(getWidth() / 2.0f, getHeight() / 2.0f, 0.0f);
- GL11.glRotatef(2*angle, 0f, 0f, -1.0f);
- GL11.glRectf(-50.0f, -50.0f, 50.0f, 50.0f);
- GL11.glPopMatrix();
- swapBuffers();
- repaint();
- } catch (LWJGLException e) {
- throw new RuntimeException(e);
- }
- }
- });
- addWindowListener(new WindowAdapter() {
- public void windowClosing(WindowEvent e) {
- dispose();
- System.exit(0);
- }
- });
- setResizable(true);
- setVisible(true);
- }
-
- public static void main(String[] args) throws LWJGLException {
- new AWTTest();
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.opengl.awt;
+
+import java.awt.Frame;
+import java.awt.GridLayout;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+
+import org.lwjgl.LWJGLException;
+import org.lwjgl.opengl.AWTGLCanvas;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.util.glu.GLU;
+
+/**
+ * <p>
+ * Tests AWTGLCanvas functionality
+ * <p>
+ * @version $Revision: 2983 $
+ * @author $Author: matzon $
+ * $Id: AWTTest.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public class AWTTest extends Frame {
+
+ /** AWT GL canvas */
+ private AWTGLCanvas canvas0, canvas1;
+
+ private volatile float angle;
+
+ /**
+ * C'tor
+ */
+ public AWTTest() throws LWJGLException {
+ setTitle("LWJGL AWT Canvas Test");
+ setSize(640, 320);
+ setLayout(new GridLayout(1, 2));
+ add(canvas0 = new AWTGLCanvas() {
+ int current_height;
+ int current_width;
+ public void paintGL() {
+ try {
+ if (getWidth() != current_width || getHeight() != current_height) {
+ current_width = getWidth();
+ current_height = getHeight();
+ GL11.glViewport(0, 0, current_width, current_height);
+ }
+ GL11.glViewport(0, 0, getWidth(), getHeight());
+ GL11.glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+ GL11.glLoadIdentity();
+ GLU.gluOrtho2D(0.0f, (float) getWidth(), 0.0f, (float) getHeight());
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ GL11.glPushMatrix();
+ GL11.glColor3f(1f, 1f, 0f);
+ GL11.glTranslatef(getWidth() / 2.0f, getHeight() / 2.0f, 0.0f);
+ GL11.glRotatef(angle, 0f, 0f, 1.0f);
+ GL11.glRectf(-50.0f, -50.0f, 50.0f, 50.0f);
+ GL11.glPopMatrix();
+ swapBuffers();
+ repaint();
+ } catch (LWJGLException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ });
+ add(canvas1 = new AWTGLCanvas() {
+ int current_height;
+ int current_width;
+ public void paintGL() {
+ try {
+ angle += 1.0f;
+ if (getWidth() != current_width || getHeight() != current_height) {
+ current_width = getWidth();
+ current_height = getHeight();
+ GL11.glViewport(0, 0, current_width, current_height);
+ }
+ GL11.glViewport(0, 0, getWidth(), getHeight());
+ GL11.glClearColor(0.0f, 1.0f, 0.0f, 1.0f);
+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+ GL11.glLoadIdentity();
+ GLU.gluOrtho2D(0.0f, (float) getWidth(), 0.0f, (float) getHeight());
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ GL11.glPushMatrix();
+ GL11.glTranslatef(getWidth() / 2.0f, getHeight() / 2.0f, 0.0f);
+ GL11.glRotatef(2*angle, 0f, 0f, -1.0f);
+ GL11.glRectf(-50.0f, -50.0f, 50.0f, 50.0f);
+ GL11.glPopMatrix();
+ swapBuffers();
+ repaint();
+ } catch (LWJGLException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ });
+ addWindowListener(new WindowAdapter() {
+ public void windowClosing(WindowEvent e) {
+ dispose();
+ System.exit(0);
+ }
+ });
+ setResizable(true);
+ setVisible(true);
+ }
+
+ public static void main(String[] args) throws LWJGLException {
+ new AWTTest();
+ }
+}
diff --git a/src/java/org/lwjgl/test/opengl/awt/DemoBox.java b/src/java/org/lwjgl/test/opengl/awt/DemoBox.java
index 9e4be2d..b0250ac 100644
--- a/src/java/org/lwjgl/test/opengl/awt/DemoBox.java
+++ b/src/java/org/lwjgl/test/opengl/awt/DemoBox.java
@@ -1,638 +1,638 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.opengl.awt;
-
-import java.awt.BorderLayout;
-import java.awt.Button;
-import java.awt.Frame;
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
-import java.awt.Label;
-import java.awt.List;
-import java.awt.Panel;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.nio.FloatBuffer;
-import java.util.Enumeration;
-import java.util.Hashtable;
-
-import org.lwjgl.BufferUtils;
-import org.lwjgl.LWJGLException;
-import org.lwjgl.opengl.ARBTransposeMatrix;
-import org.lwjgl.opengl.AWTGLCanvas;
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.opengl.GLContext;
-
-/**
- * <p>
- * </p>
- * @version $Revision$
- * @author Brian Matzon <brian at matzon.dk>
- * $Id$
- */
-public class DemoBox extends Frame {
-
- /** GL canvas */
- private DemoBoxGLCanvas demoCanvas;
-
- /** Demo selection panel */
- private Panel selectionPanel;
-
- /** Hashtable of demos */
- private Hashtable selectableDemos;
-
- /**
- * Creates a new demo box instance
- */
- public DemoBox() {
- selectableDemos = new Hashtable();
- selectableDemos.put("default", new NullDemoBox());
- selectableDemos.put("clear_color", new ClearColorDemoBox());
- selectableDemos.put("gears", new GearsDemoBox());
- }
-
- /**
- * @return
- */
- public boolean initialize() {
- setTitle("LWJGL - Demo Box");
- setSize(640, 480);
- setLayout(new GridBagLayout());
-
- // Setup selection panel
- // =================================
- selectionPanel = new Panel();
- selectionPanel.setLayout(new BorderLayout());
- selectionPanel.add(new Label("Demo", Label.CENTER), BorderLayout.NORTH);
-
- Button fullScreen = new Button("Fullscreen");
- fullScreen.addActionListener(new ActionListener() {
-
- public void actionPerformed(ActionEvent event) {
- toggleFullscreen();
- }
- });
- selectionPanel.add(fullScreen, BorderLayout.SOUTH);
-
- final List demos = new List();
- for (Enumeration e = selectableDemos.keys(); e.hasMoreElements();) {
- demos.add(e.nextElement().toString());
- }
- selectionPanel.add(demos, BorderLayout.CENTER);
-
- demos.addItemListener(new ItemListener() {
-
- public void itemStateChanged(ItemEvent event) {
- demoSelected(event.getItemSelectable().getSelectedObjects()[0].toString());
- }
- });
-
- GridBagConstraints gbc = new GridBagConstraints();
- gbc.gridx = 0;
- gbc.gridy = 0;
- gbc.fill = java.awt.GridBagConstraints.BOTH;
- gbc.weightx = 0.05;
- gbc.weighty = 1.0;
- add(selectionPanel, gbc);
- // ---------------------------------
-
- // setup demo canvas
- // =================================
- try {
- demoCanvas = new DemoBoxGLCanvas(this);
-
- gbc = new GridBagConstraints();
- gbc.gridx = 1;
- gbc.gridy = 0;
- gbc.fill = java.awt.GridBagConstraints.BOTH;
- gbc.weightx = 0.95;
- gbc.weighty = 1.0;
- add(demoCanvas, gbc);
- } catch (LWJGLException le) {
- le.printStackTrace();
- return false;
- }
- // ---------------------------------
-
- addWindowListener(new WindowAdapter() {
-
- public void windowClosing(WindowEvent e) {
- demoCanvas.destroy();
- dispose();
- System.exit(0);
- }
- });
-
- //demos.select(0);
- //demoSelected(demos.getSelectedItem());
- return true;
- }
-
- public void updateFPS(float fps) {
- if(fps != -1) {
- setTitle("LWJGL - Demo Box (FPS: " + fps + ")");
- } else {
- setTitle("LWJGL - Demo Box");
- }
- }
-
- /**
- * Enter fullscreen mode for this demo
- */
- protected void toggleFullscreen() {
- System.out.println("Toggle Fullscreen");
- }
-
- /**
- * Selected a demo
- * @param demo Name of demo that was selected
- */
- protected void demoSelected(String demo) {
- System.out.println("Selecting demo: " + demo);
- demoCanvas.setActiveDemo((Demo) selectableDemos.get(demo));
- }
-
- /**
- * @param args
- * @throws LWJGLException
- */
- public static void main(String[] args) throws LWJGLException {
- DemoBox demo = new DemoBox();
- demo.initialize();
- demo.setVisible(true);
- }
-
- /**
- * Interface for a demo
- */
- public interface Demo {
- public boolean isInitialized();
- public boolean initialize();
- public void render();
- public void destroy();
- }
-
- /**
- *
- */
- private class DemoBoxGLCanvas extends AWTGLCanvas implements Runnable {
-
- /** Parent demo box */
- DemoBox parent;
-
- /** Currently active demo */
- Demo activeDemo;
-
- /** last active demo */
- Demo lastActiveDemo;
-
- /** Render thread */
- private Thread renderThread;
-
- public DemoBoxGLCanvas(DemoBox parent) throws LWJGLException {
- super();
- this.parent = parent;
- }
-
- // FPS
- long startTime = 0;
- long fps = 0;
-
- protected void paintGL() {
- synchronized (this) {
- if (lastActiveDemo != null && lastActiveDemo != activeDemo) {
- lastActiveDemo.destroy();
- lastActiveDemo = null;
- if (activeDemo != null) {
- activeDemo.initialize();
- startTime = System.currentTimeMillis() + 5000;
- } else {
- parent.updateFPS(-1);
- }
- }
-
- if (activeDemo != null) {
-
- if(!activeDemo.isInitialized()) {
- activeDemo.initialize();
- }
-
- activeDemo.render();
- try {
- swapBuffers();
- } catch (LWJGLException le) {
- le.printStackTrace();
- }
-
- if (startTime > System.currentTimeMillis()) {
- fps++;
- } else {
- long timeUsed = 5000 + (startTime - System.currentTimeMillis());
- startTime = System.currentTimeMillis() + 5000;
- parent.updateFPS((fps / (timeUsed / 1000f)));
- fps = 0;
- }
- }
- }
- }
-
- public void destroy() {
- setActiveDemo(null);
- renderThread = null;
- }
-
- public void setActiveDemo(Demo activeDemo) {
- synchronized (this) {
- // setting no current demo
- if (activeDemo == null) {
- lastActiveDemo = this.activeDemo;
- this.activeDemo = null;
- return;
- }
-
- // setting to new demo
- lastActiveDemo = this.activeDemo;
- this.activeDemo = activeDemo;
- }
-
- if (renderThread == null) {
- renderThread = new Thread(this);
- renderThread.setName("DemoBox-Renderer");
- renderThread.start();
- }
- }
-
- public DemoBoxGLCanvas() throws LWJGLException {
- super();
- }
-
- public void run() {
- long sleep_time = 1000;
- while (renderThread != null) {
-
- // check for change of demo
- synchronized (this) {
- // if no demo set, just sleep
- if (activeDemo == null) {
- sleep_time = 1000;
- } else {
- // we have a demo!
- sleep_time = 16;
- repaint();
- }
- }
- sleep(sleep_time);
- }
- System.out.println("dead");
- }
-
- private void sleep(long time) {
- try {
- Thread.sleep(time);
- } catch (InterruptedException inte) {
- }
- }
- }
-
- // Demo box demo
- // ========================================================
- public class ClearColorDemoBox implements Demo {
-
- private boolean initialized;
-
- int direction = 1;
-
- float color;
-
- public boolean isInitialized() {
- return initialized;
- }
-
- public boolean initialize() {
- return initialized = true;
- }
-
- public void render() {
- GL11.glClearColor(color, color, color, 1f);
- GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
-
- color += direction * .05f;
-
- if (color > 1f) {
- color = 1f;
- direction = -1 * direction;
- } else if (color < 0f) {
- direction = -1 * direction;
- color = 0f;
- }
- }
-
- public void destroy() {
- initialized = false;
- }
- }
-
- // --------------------------------------------------------
-
- // Demo box demo
- // ========================================================
- public class NullDemoBox implements Demo {
-
- private boolean initialized;
-
- public boolean isInitialized() {
- return initialized;
- }
-
- public boolean initialize() {
- GL11.glClearColor(0, 0, 0, 1f);
- return true;
- }
-
- public void render() {
- GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
- }
-
- public void destroy() {
- initialized = false;
- }
- }
- // --------------------------------------------------------
-
- // Demo box demo
- // ========================================================
- public class GearsDemoBox implements Demo {
-
- private boolean initialized;
-
- private float view_rotx = 20.0f;
-
- private float view_roty = 30.0f;
-
- private float view_rotz = 0.0f;
-
- private int gear1;
-
- private int gear2;
-
- private int gear3;
-
- private float angle = 0.0f;
-
- public boolean isInitialized() {
- return initialized;
- }
-
- public boolean initialize() {
- // setup ogl
- FloatBuffer pos = BufferUtils.createFloatBuffer(4).put(new float[] { 5.0f, 5.0f, 10.0f, 0.0f});
- FloatBuffer red = BufferUtils.createFloatBuffer(4).put(new float[] { 0.8f, 0.1f, 0.0f, 1.0f});
- FloatBuffer green = BufferUtils.createFloatBuffer(4).put(new float[] { 0.0f, 0.8f, 0.2f, 1.0f});
- FloatBuffer blue = BufferUtils.createFloatBuffer(4).put(new float[] { 0.2f, 0.2f, 1.0f, 1.0f});
- pos.flip();
- red.flip();
- green.flip();
- blue.flip();
-
- GL11.glClearColor(0, 0, 0, 1f);
-
- GL11.glLight(GL11.GL_LIGHT0, GL11.GL_POSITION, pos);
- GL11.glEnable(GL11.GL_CULL_FACE);
- GL11.glEnable(GL11.GL_LIGHTING);
- GL11.glEnable(GL11.GL_LIGHT0);
- GL11.glEnable(GL11.GL_DEPTH_TEST);
-
- /* make the gears */
- gear1 = GL11.glGenLists(1);
- GL11.glNewList(gear1, GL11.GL_COMPILE);
- GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, red);
- gear(1.0f, 4.0f, 1.0f, 20, 0.7f);
- GL11.glEndList();
-
- gear2 = GL11.glGenLists(1);
- GL11.glNewList(gear2, GL11.GL_COMPILE);
- GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, green);
- gear(0.5f, 2.0f, 2.0f, 10, 0.7f);
- GL11.glEndList();
-
- gear3 = GL11.glGenLists(1);
- GL11.glNewList(gear3, GL11.GL_COMPILE);
- GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, blue);
- gear(1.3f, 2.0f, 0.5f, 10, 0.7f);
- GL11.glEndList();
-
- GL11.glEnable(GL11.GL_NORMALIZE);
-
- GL11.glMatrixMode(GL11.GL_PROJECTION);
-
- System.err.println("GL_VENDOR: " + GL11.glGetString(GL11.GL_VENDOR));
- System.err.println("GL_RENDERER: " + GL11.glGetString(GL11.GL_RENDERER));
- System.err.println("GL_VERSION: " + GL11.glGetString(GL11.GL_VERSION));
- System.err.println();
- System.err.println("glLoadTransposeMatrixfARB() supported: " + GLContext.getCapabilities().GL_ARB_transpose_matrix);
- if (!GLContext.getCapabilities().GL_ARB_transpose_matrix) {
- // --- not using extensions
- GL11.glLoadIdentity();
- } else {
- // --- using extensions
- final FloatBuffer identityTranspose = BufferUtils.createFloatBuffer(16).put(
- new float[] { 1, 0, 0, 0, 0, 1, 0, 0,
- 0, 0, 1, 0, 0, 0, 0, 1});
- identityTranspose.flip();
- ARBTransposeMatrix.glLoadTransposeMatrixARB(identityTranspose);
- }
-
- float h = (float) 300 / (float) 300;
- GL11.glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f);
- GL11.glMatrixMode(GL11.GL_MODELVIEW);
- GL11.glLoadIdentity();
- GL11.glTranslatef(0.0f, 0.0f, -40.0f);
- return initialized = true;
- }
-
- public void render() {
- angle += 2.0f;
- GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
-
- GL11.glPushMatrix();
- GL11.glRotatef(view_rotx, 1.0f, 0.0f, 0.0f);
- GL11.glRotatef(view_roty, 0.0f, 1.0f, 0.0f);
- GL11.glRotatef(view_rotz, 0.0f, 0.0f, 1.0f);
-
- GL11.glPushMatrix();
- GL11.glTranslatef(-3.0f, -2.0f, 0.0f);
- GL11.glRotatef(angle, 0.0f, 0.0f, 1.0f);
- GL11.glCallList(gear1);
- GL11.glPopMatrix();
-
- GL11.glPushMatrix();
- GL11.glTranslatef(3.1f, -2.0f, 0.0f);
- GL11.glRotatef(-2.0f * angle - 9.0f, 0.0f, 0.0f, 1.0f);
- GL11.glCallList(gear2);
- GL11.glPopMatrix();
-
- GL11.glPushMatrix();
- GL11.glTranslatef(-3.1f, 4.2f, 0.0f);
- GL11.glRotatef(-2.0f * angle - 25.0f, 0.0f, 0.0f, 1.0f);
- GL11.glCallList(gear3);
- GL11.glPopMatrix();
-
- GL11.glPopMatrix();
- }
-
- /**
- * Draw a gear wheel. You'll probably want to call this function when
- * building a display list since we do a lot of trig here.
- *
- * @param inner_radius radius of hole at center
- * @param outer_radius radius at center of teeth
- * @param width width of gear
- * @param teeth number of teeth
- * @param tooth_depth depth of tooth
- */
- private void gear(float inner_radius, float outer_radius, float width, int teeth, float tooth_depth) {
- int i;
- float r0, r1, r2;
- float angle, da;
- float u, v, len;
-
- r0 = inner_radius;
- r1 = outer_radius - tooth_depth / 2.0f;
- r2 = outer_radius + tooth_depth / 2.0f;
-
- da = 2.0f * (float) Math.PI / teeth / 4.0f;
-
- GL11.glShadeModel(GL11.GL_FLAT);
-
- GL11.glNormal3f(0.0f, 0.0f, 1.0f);
-
- /* draw front face */
- GL11.glBegin(GL11.GL_QUAD_STRIP);
- for (i = 0; i <= teeth; i++) {
- angle = i * 2.0f * (float) Math.PI / teeth;
- GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f);
- if (i < teeth) {
- GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle + 3.0f * da), r1 * (float) Math.sin(angle + 3.0f * da),
- width * 0.5f);
- }
- }
- GL11.glEnd();
-
- /* draw front sides of teeth */
- GL11.glBegin(GL11.GL_QUADS);
- for (i = 0; i < teeth; i++) {
- angle = i * 2.0f * (float) Math.PI / teeth;
- GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), width * 0.5f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + 2.0f * da), r2 * (float) Math.sin(angle + 2.0f * da), width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle + 3.0f * da), r1 * (float) Math.sin(angle + 3.0f * da), width * 0.5f);
- }
- GL11.glEnd();
-
- /* draw back face */
- GL11.glBegin(GL11.GL_QUAD_STRIP);
- for (i = 0; i <= teeth; i++) {
- angle = i * 2.0f * (float) Math.PI / teeth;
- GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f);
- GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f);
- GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f);
- }
- GL11.glEnd();
-
- /* draw back sides of teeth */
- GL11.glBegin(GL11.GL_QUADS);
- for (i = 0; i < teeth; i++) {
- angle = i * 2.0f * (float) Math.PI / teeth;
- GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), -width * 0.5f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), -width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f);
- }
- GL11.glEnd();
-
- /* draw outward faces of teeth */
- GL11.glBegin(GL11.GL_QUAD_STRIP);
- for (i = 0; i < teeth; i++) {
- angle = i * 2.0f * (float) Math.PI / teeth;
- GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f);
- u = r2 * (float) Math.cos(angle + da) - r1 * (float) Math.cos(angle);
- v = r2 * (float) Math.sin(angle + da) - r1 * (float) Math.sin(angle);
- len = (float) Math.sqrt(u * u + v * v);
- u /= len;
- v /= len;
- GL11.glNormal3f(v, -u, 0.0f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), width * 0.5f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), -width * 0.5f);
- GL11.glNormal3f((float) Math.cos(angle), (float) Math.sin(angle), 0.0f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), width * 0.5f);
- GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), -width * 0.5f);
- u = r1 * (float) Math.cos(angle + 3 * da) - r2 * (float) Math.cos(angle + 2 * da);
- v = r1 * (float) Math.sin(angle + 3 * da) - r2 * (float) Math.sin(angle + 2 * da);
- GL11.glNormal3f(v, -u, 0.0f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f);
- GL11.glNormal3f((float) Math.cos(angle), (float) Math.sin(angle), 0.0f);
- }
- GL11.glVertex3f(r1 * (float) Math.cos(0), r1 * (float) Math.sin(0), width * 0.5f);
- GL11.glVertex3f(r1 * (float) Math.cos(0), r1 * (float) Math.sin(0), -width * 0.5f);
- GL11.glEnd();
-
- GL11.glShadeModel(GL11.GL_SMOOTH);
-
- /* draw inside radius cylinder */
- GL11.glBegin(GL11.GL_QUAD_STRIP);
- for (i = 0; i <= teeth; i++) {
- angle = i * 2.0f * (float) Math.PI / teeth;
- GL11.glNormal3f(-(float) Math.cos(angle), -(float) Math.sin(angle), 0.0f);
- GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f);
- GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f);
- }
- GL11.glEnd();
- }
-
- public void destroy() {
- GL11.glDeleteLists(gear1, 1);
- GL11.glDeleteLists(gear2, 1);
- GL11.glDeleteLists(gear3, 1);
- initialized = false;
- }
- }
- // --------------------------------------------------------
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.opengl.awt;
+
+import java.awt.BorderLayout;
+import java.awt.Button;
+import java.awt.Frame;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Label;
+import java.awt.List;
+import java.awt.Panel;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.nio.FloatBuffer;
+import java.util.Enumeration;
+import java.util.Hashtable;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.LWJGLException;
+import org.lwjgl.opengl.ARBTransposeMatrix;
+import org.lwjgl.opengl.AWTGLCanvas;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GLContext;
+
+/**
+ * <p>
+ * </p>
+ * @version $Revision$
+ * @author Brian Matzon <brian at matzon.dk>
+ * $Id$
+ */
+public class DemoBox extends Frame {
+
+ /** GL canvas */
+ private DemoBoxGLCanvas demoCanvas;
+
+ /** Demo selection panel */
+ private Panel selectionPanel;
+
+ /** Hashtable of demos */
+ private Hashtable selectableDemos;
+
+ /**
+ * Creates a new demo box instance
+ */
+ public DemoBox() {
+ selectableDemos = new Hashtable();
+ selectableDemos.put("default", new NullDemoBox());
+ selectableDemos.put("clear_color", new ClearColorDemoBox());
+ selectableDemos.put("gears", new GearsDemoBox());
+ }
+
+ /**
+ * @return
+ */
+ public boolean initialize() {
+ setTitle("LWJGL - Demo Box");
+ setSize(640, 480);
+ setLayout(new GridBagLayout());
+
+ // Setup selection panel
+ // =================================
+ selectionPanel = new Panel();
+ selectionPanel.setLayout(new BorderLayout());
+ selectionPanel.add(new Label("Demo", Label.CENTER), BorderLayout.NORTH);
+
+ Button fullScreen = new Button("Fullscreen");
+ fullScreen.addActionListener(new ActionListener() {
+
+ public void actionPerformed(ActionEvent event) {
+ toggleFullscreen();
+ }
+ });
+ selectionPanel.add(fullScreen, BorderLayout.SOUTH);
+
+ final List demos = new List();
+ for (Enumeration e = selectableDemos.keys(); e.hasMoreElements();) {
+ demos.add(e.nextElement().toString());
+ }
+ selectionPanel.add(demos, BorderLayout.CENTER);
+
+ demos.addItemListener(new ItemListener() {
+
+ public void itemStateChanged(ItemEvent event) {
+ demoSelected(event.getItemSelectable().getSelectedObjects()[0].toString());
+ }
+ });
+
+ GridBagConstraints gbc = new GridBagConstraints();
+ gbc.gridx = 0;
+ gbc.gridy = 0;
+ gbc.fill = java.awt.GridBagConstraints.BOTH;
+ gbc.weightx = 0.05;
+ gbc.weighty = 1.0;
+ add(selectionPanel, gbc);
+ // ---------------------------------
+
+ // setup demo canvas
+ // =================================
+ try {
+ demoCanvas = new DemoBoxGLCanvas(this);
+
+ gbc = new GridBagConstraints();
+ gbc.gridx = 1;
+ gbc.gridy = 0;
+ gbc.fill = java.awt.GridBagConstraints.BOTH;
+ gbc.weightx = 0.95;
+ gbc.weighty = 1.0;
+ add(demoCanvas, gbc);
+ } catch (LWJGLException le) {
+ le.printStackTrace();
+ return false;
+ }
+ // ---------------------------------
+
+ addWindowListener(new WindowAdapter() {
+
+ public void windowClosing(WindowEvent e) {
+ demoCanvas.destroy();
+ dispose();
+ System.exit(0);
+ }
+ });
+
+ //demos.select(0);
+ //demoSelected(demos.getSelectedItem());
+ return true;
+ }
+
+ public void updateFPS(float fps) {
+ if(fps != -1) {
+ setTitle("LWJGL - Demo Box (FPS: " + fps + ")");
+ } else {
+ setTitle("LWJGL - Demo Box");
+ }
+ }
+
+ /**
+ * Enter fullscreen mode for this demo
+ */
+ protected void toggleFullscreen() {
+ System.out.println("Toggle Fullscreen");
+ }
+
+ /**
+ * Selected a demo
+ * @param demo Name of demo that was selected
+ */
+ protected void demoSelected(String demo) {
+ System.out.println("Selecting demo: " + demo);
+ demoCanvas.setActiveDemo((Demo) selectableDemos.get(demo));
+ }
+
+ /**
+ * @param args
+ * @throws LWJGLException
+ */
+ public static void main(String[] args) throws LWJGLException {
+ DemoBox demo = new DemoBox();
+ demo.initialize();
+ demo.setVisible(true);
+ }
+
+ /**
+ * Interface for a demo
+ */
+ public interface Demo {
+ public boolean isInitialized();
+ public boolean initialize();
+ public void render();
+ public void destroy();
+ }
+
+ /**
+ *
+ */
+ private class DemoBoxGLCanvas extends AWTGLCanvas implements Runnable {
+
+ /** Parent demo box */
+ DemoBox parent;
+
+ /** Currently active demo */
+ Demo activeDemo;
+
+ /** last active demo */
+ Demo lastActiveDemo;
+
+ /** Render thread */
+ private Thread renderThread;
+
+ public DemoBoxGLCanvas(DemoBox parent) throws LWJGLException {
+ super();
+ this.parent = parent;
+ }
+
+ // FPS
+ long startTime = 0;
+ long fps = 0;
+
+ protected void paintGL() {
+ synchronized (this) {
+ if (lastActiveDemo != null && lastActiveDemo != activeDemo) {
+ lastActiveDemo.destroy();
+ lastActiveDemo = null;
+ if (activeDemo != null) {
+ activeDemo.initialize();
+ startTime = System.currentTimeMillis() + 5000;
+ } else {
+ parent.updateFPS(-1);
+ }
+ }
+
+ if (activeDemo != null) {
+
+ if(!activeDemo.isInitialized()) {
+ activeDemo.initialize();
+ }
+
+ activeDemo.render();
+ try {
+ swapBuffers();
+ } catch (LWJGLException le) {
+ le.printStackTrace();
+ }
+
+ if (startTime > System.currentTimeMillis()) {
+ fps++;
+ } else {
+ long timeUsed = 5000 + (startTime - System.currentTimeMillis());
+ startTime = System.currentTimeMillis() + 5000;
+ parent.updateFPS((fps / (timeUsed / 1000f)));
+ fps = 0;
+ }
+ }
+ }
+ }
+
+ public void destroy() {
+ setActiveDemo(null);
+ renderThread = null;
+ }
+
+ public void setActiveDemo(Demo activeDemo) {
+ synchronized (this) {
+ // setting no current demo
+ if (activeDemo == null) {
+ lastActiveDemo = this.activeDemo;
+ this.activeDemo = null;
+ return;
+ }
+
+ // setting to new demo
+ lastActiveDemo = this.activeDemo;
+ this.activeDemo = activeDemo;
+ }
+
+ if (renderThread == null) {
+ renderThread = new Thread(this);
+ renderThread.setName("DemoBox-Renderer");
+ renderThread.start();
+ }
+ }
+
+ public DemoBoxGLCanvas() throws LWJGLException {
+ super();
+ }
+
+ public void run() {
+ long sleep_time = 1000;
+ while (renderThread != null) {
+
+ // check for change of demo
+ synchronized (this) {
+ // if no demo set, just sleep
+ if (activeDemo == null) {
+ sleep_time = 1000;
+ } else {
+ // we have a demo!
+ sleep_time = 16;
+ repaint();
+ }
+ }
+ sleep(sleep_time);
+ }
+ System.out.println("dead");
+ }
+
+ private void sleep(long time) {
+ try {
+ Thread.sleep(time);
+ } catch (InterruptedException inte) {
+ }
+ }
+ }
+
+ // Demo box demo
+ // ========================================================
+ public class ClearColorDemoBox implements Demo {
+
+ private boolean initialized;
+
+ int direction = 1;
+
+ float color;
+
+ public boolean isInitialized() {
+ return initialized;
+ }
+
+ public boolean initialize() {
+ return initialized = true;
+ }
+
+ public void render() {
+ GL11.glClearColor(color, color, color, 1f);
+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
+
+ color += direction * .05f;
+
+ if (color > 1f) {
+ color = 1f;
+ direction = -1 * direction;
+ } else if (color < 0f) {
+ direction = -1 * direction;
+ color = 0f;
+ }
+ }
+
+ public void destroy() {
+ initialized = false;
+ }
+ }
+
+ // --------------------------------------------------------
+
+ // Demo box demo
+ // ========================================================
+ public class NullDemoBox implements Demo {
+
+ private boolean initialized;
+
+ public boolean isInitialized() {
+ return initialized;
+ }
+
+ public boolean initialize() {
+ GL11.glClearColor(0, 0, 0, 1f);
+ return true;
+ }
+
+ public void render() {
+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
+ }
+
+ public void destroy() {
+ initialized = false;
+ }
+ }
+ // --------------------------------------------------------
+
+ // Demo box demo
+ // ========================================================
+ public class GearsDemoBox implements Demo {
+
+ private boolean initialized;
+
+ private float view_rotx = 20.0f;
+
+ private float view_roty = 30.0f;
+
+ private float view_rotz = 0.0f;
+
+ private int gear1;
+
+ private int gear2;
+
+ private int gear3;
+
+ private float angle = 0.0f;
+
+ public boolean isInitialized() {
+ return initialized;
+ }
+
+ public boolean initialize() {
+ // setup ogl
+ FloatBuffer pos = BufferUtils.createFloatBuffer(4).put(new float[] { 5.0f, 5.0f, 10.0f, 0.0f});
+ FloatBuffer red = BufferUtils.createFloatBuffer(4).put(new float[] { 0.8f, 0.1f, 0.0f, 1.0f});
+ FloatBuffer green = BufferUtils.createFloatBuffer(4).put(new float[] { 0.0f, 0.8f, 0.2f, 1.0f});
+ FloatBuffer blue = BufferUtils.createFloatBuffer(4).put(new float[] { 0.2f, 0.2f, 1.0f, 1.0f});
+ pos.flip();
+ red.flip();
+ green.flip();
+ blue.flip();
+
+ GL11.glClearColor(0, 0, 0, 1f);
+
+ GL11.glLight(GL11.GL_LIGHT0, GL11.GL_POSITION, pos);
+ GL11.glEnable(GL11.GL_CULL_FACE);
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glEnable(GL11.GL_LIGHT0);
+ GL11.glEnable(GL11.GL_DEPTH_TEST);
+
+ /* make the gears */
+ gear1 = GL11.glGenLists(1);
+ GL11.glNewList(gear1, GL11.GL_COMPILE);
+ GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, red);
+ gear(1.0f, 4.0f, 1.0f, 20, 0.7f);
+ GL11.glEndList();
+
+ gear2 = GL11.glGenLists(1);
+ GL11.glNewList(gear2, GL11.GL_COMPILE);
+ GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, green);
+ gear(0.5f, 2.0f, 2.0f, 10, 0.7f);
+ GL11.glEndList();
+
+ gear3 = GL11.glGenLists(1);
+ GL11.glNewList(gear3, GL11.GL_COMPILE);
+ GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, blue);
+ gear(1.3f, 2.0f, 0.5f, 10, 0.7f);
+ GL11.glEndList();
+
+ GL11.glEnable(GL11.GL_NORMALIZE);
+
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+
+ System.err.println("GL_VENDOR: " + GL11.glGetString(GL11.GL_VENDOR));
+ System.err.println("GL_RENDERER: " + GL11.glGetString(GL11.GL_RENDERER));
+ System.err.println("GL_VERSION: " + GL11.glGetString(GL11.GL_VERSION));
+ System.err.println();
+ System.err.println("glLoadTransposeMatrixfARB() supported: " + GLContext.getCapabilities().GL_ARB_transpose_matrix);
+ if (!GLContext.getCapabilities().GL_ARB_transpose_matrix) {
+ // --- not using extensions
+ GL11.glLoadIdentity();
+ } else {
+ // --- using extensions
+ final FloatBuffer identityTranspose = BufferUtils.createFloatBuffer(16).put(
+ new float[] { 1, 0, 0, 0, 0, 1, 0, 0,
+ 0, 0, 1, 0, 0, 0, 0, 1});
+ identityTranspose.flip();
+ ARBTransposeMatrix.glLoadTransposeMatrixARB(identityTranspose);
+ }
+
+ float h = (float) 300 / (float) 300;
+ GL11.glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f);
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ GL11.glLoadIdentity();
+ GL11.glTranslatef(0.0f, 0.0f, -40.0f);
+ return initialized = true;
+ }
+
+ public void render() {
+ angle += 2.0f;
+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
+
+ GL11.glPushMatrix();
+ GL11.glRotatef(view_rotx, 1.0f, 0.0f, 0.0f);
+ GL11.glRotatef(view_roty, 0.0f, 1.0f, 0.0f);
+ GL11.glRotatef(view_rotz, 0.0f, 0.0f, 1.0f);
+
+ GL11.glPushMatrix();
+ GL11.glTranslatef(-3.0f, -2.0f, 0.0f);
+ GL11.glRotatef(angle, 0.0f, 0.0f, 1.0f);
+ GL11.glCallList(gear1);
+ GL11.glPopMatrix();
+
+ GL11.glPushMatrix();
+ GL11.glTranslatef(3.1f, -2.0f, 0.0f);
+ GL11.glRotatef(-2.0f * angle - 9.0f, 0.0f, 0.0f, 1.0f);
+ GL11.glCallList(gear2);
+ GL11.glPopMatrix();
+
+ GL11.glPushMatrix();
+ GL11.glTranslatef(-3.1f, 4.2f, 0.0f);
+ GL11.glRotatef(-2.0f * angle - 25.0f, 0.0f, 0.0f, 1.0f);
+ GL11.glCallList(gear3);
+ GL11.glPopMatrix();
+
+ GL11.glPopMatrix();
+ }
+
+ /**
+ * Draw a gear wheel. You'll probably want to call this function when
+ * building a display list since we do a lot of trig here.
+ *
+ * @param inner_radius radius of hole at center
+ * @param outer_radius radius at center of teeth
+ * @param width width of gear
+ * @param teeth number of teeth
+ * @param tooth_depth depth of tooth
+ */
+ private void gear(float inner_radius, float outer_radius, float width, int teeth, float tooth_depth) {
+ int i;
+ float r0, r1, r2;
+ float angle, da;
+ float u, v, len;
+
+ r0 = inner_radius;
+ r1 = outer_radius - tooth_depth / 2.0f;
+ r2 = outer_radius + tooth_depth / 2.0f;
+
+ da = 2.0f * (float) Math.PI / teeth / 4.0f;
+
+ GL11.glShadeModel(GL11.GL_FLAT);
+
+ GL11.glNormal3f(0.0f, 0.0f, 1.0f);
+
+ /* draw front face */
+ GL11.glBegin(GL11.GL_QUAD_STRIP);
+ for (i = 0; i <= teeth; i++) {
+ angle = i * 2.0f * (float) Math.PI / teeth;
+ GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f);
+ if (i < teeth) {
+ GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle + 3.0f * da), r1 * (float) Math.sin(angle + 3.0f * da),
+ width * 0.5f);
+ }
+ }
+ GL11.glEnd();
+
+ /* draw front sides of teeth */
+ GL11.glBegin(GL11.GL_QUADS);
+ for (i = 0; i < teeth; i++) {
+ angle = i * 2.0f * (float) Math.PI / teeth;
+ GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), width * 0.5f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + 2.0f * da), r2 * (float) Math.sin(angle + 2.0f * da), width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle + 3.0f * da), r1 * (float) Math.sin(angle + 3.0f * da), width * 0.5f);
+ }
+ GL11.glEnd();
+
+ /* draw back face */
+ GL11.glBegin(GL11.GL_QUAD_STRIP);
+ for (i = 0; i <= teeth; i++) {
+ angle = i * 2.0f * (float) Math.PI / teeth;
+ GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f);
+ GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f);
+ GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f);
+ }
+ GL11.glEnd();
+
+ /* draw back sides of teeth */
+ GL11.glBegin(GL11.GL_QUADS);
+ for (i = 0; i < teeth; i++) {
+ angle = i * 2.0f * (float) Math.PI / teeth;
+ GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), -width * 0.5f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), -width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f);
+ }
+ GL11.glEnd();
+
+ /* draw outward faces of teeth */
+ GL11.glBegin(GL11.GL_QUAD_STRIP);
+ for (i = 0; i < teeth; i++) {
+ angle = i * 2.0f * (float) Math.PI / teeth;
+ GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f);
+ u = r2 * (float) Math.cos(angle + da) - r1 * (float) Math.cos(angle);
+ v = r2 * (float) Math.sin(angle + da) - r1 * (float) Math.sin(angle);
+ len = (float) Math.sqrt(u * u + v * v);
+ u /= len;
+ v /= len;
+ GL11.glNormal3f(v, -u, 0.0f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), width * 0.5f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), -width * 0.5f);
+ GL11.glNormal3f((float) Math.cos(angle), (float) Math.sin(angle), 0.0f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), width * 0.5f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), -width * 0.5f);
+ u = r1 * (float) Math.cos(angle + 3 * da) - r2 * (float) Math.cos(angle + 2 * da);
+ v = r1 * (float) Math.sin(angle + 3 * da) - r2 * (float) Math.sin(angle + 2 * da);
+ GL11.glNormal3f(v, -u, 0.0f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f);
+ GL11.glNormal3f((float) Math.cos(angle), (float) Math.sin(angle), 0.0f);
+ }
+ GL11.glVertex3f(r1 * (float) Math.cos(0), r1 * (float) Math.sin(0), width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(0), r1 * (float) Math.sin(0), -width * 0.5f);
+ GL11.glEnd();
+
+ GL11.glShadeModel(GL11.GL_SMOOTH);
+
+ /* draw inside radius cylinder */
+ GL11.glBegin(GL11.GL_QUAD_STRIP);
+ for (i = 0; i <= teeth; i++) {
+ angle = i * 2.0f * (float) Math.PI / teeth;
+ GL11.glNormal3f(-(float) Math.cos(angle), -(float) Math.sin(angle), 0.0f);
+ GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f);
+ GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f);
+ }
+ GL11.glEnd();
+ }
+
+ public void destroy() {
+ GL11.glDeleteLists(gear1, 1);
+ GL11.glDeleteLists(gear2, 1);
+ GL11.glDeleteLists(gear3, 1);
+ initialized = false;
+ }
+ }
+ // --------------------------------------------------------
+}
diff --git a/src/java/org/lwjgl/test/opengl/awt/DisplayParentTest.java b/src/java/org/lwjgl/test/opengl/awt/DisplayParentTest.java
index e5848db..7eacd8a 100644
--- a/src/java/org/lwjgl/test/opengl/awt/DisplayParentTest.java
+++ b/src/java/org/lwjgl/test/opengl/awt/DisplayParentTest.java
@@ -1,132 +1,132 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.opengl.awt;
-
-import java.awt.Canvas;
-import java.awt.Frame;
-import java.awt.GridLayout;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-
-import org.lwjgl.LWJGLException;
-import org.lwjgl.input.Keyboard;
-import org.lwjgl.input.Mouse;
-import org.lwjgl.opengl.Display;
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.util.glu.GLU;
-
-/**
- * <p>
- * Tests Display.setParent()
- * <p>
- * @version $Revision: 3102 $
- * @author $Author: matzon $
- * $Id: DisplayParentTest.java 3102 2008-06-08 09:30:24Z matzon $
- */
-public class DisplayParentTest extends Frame {
- boolean killswitch = false;
- public DisplayParentTest() throws LWJGLException {
- setTitle("LWJGL Display Parent Test");
- setSize(640, 320);
- setLayout(new GridLayout(1, 2));
- final Canvas display_parent = new Canvas();
- display_parent.setFocusable(true);
- display_parent.setIgnoreRepaint(true);
- add(display_parent);
- addWindowListener(new WindowAdapter() {
- public void windowClosing(WindowEvent e) {
- killswitch = true;
- }
- });
- setResizable(true);
- setVisible(true);
- Display.setParent(display_parent);
- Display.setVSyncEnabled(true);
- Display.create();
- float angle = 0f;
-
- while (isVisible() && !killswitch) {
- angle += 1.0f;
- int width;
- int height;
- if (!Display.isFullscreen()) {
- width = display_parent.getWidth();
- height = display_parent.getHeight();
- } else {
- width = Display.getDisplayMode().getWidth();
- height = Display.getDisplayMode().getHeight();
- }
-
- if(width < 1 || height < 1) {
- continue;
- }
-
- GL11.glViewport(0, 0, width, height);
- GL11.glClearColor(0.0f, 1.0f, 0.0f, 1.0f);
- GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
- GL11.glMatrixMode(GL11.GL_PROJECTION);
- GL11.glLoadIdentity();
- GLU.gluOrtho2D(0.0f, (float) width, 0.0f, (float) height);
- GL11.glMatrixMode(GL11.GL_MODELVIEW);
- GL11.glPushMatrix();
- GL11.glTranslatef(width / 2.0f, height / 2.0f, 0.0f);
- GL11.glRotatef(2*angle, 0f, 0f, -1.0f);
- GL11.glRectf(-50.0f, -50.0f, 50.0f, 50.0f);
- GL11.glPopMatrix();
- Display.update();
- while(Keyboard.next()) {
- // closing on ESCAPE
- if(Keyboard.getEventKey() == Keyboard.KEY_ESCAPE && Keyboard.getEventKeyState()) {
- Display.destroy();
- dispose();
- break;
- }
-
- if(Keyboard.getEventKey() == Keyboard.KEY_SPACE && Keyboard.getEventKeyState()) {
- Mouse.setGrabbed(!Mouse.isGrabbed());
- }
- if(Keyboard.getEventKey() == Keyboard.KEY_F && Keyboard.getEventKeyState()) {
- Display.setFullscreen(!Display.isFullscreen());
- }
- }
-/* while (Mouse.next()) {
-System.out.println(" Mouse.getEventX() = " + Mouse.getEventX() + " | Mouse.getEventY() = " + Mouse.getEventY());
- }*/
- }
- Display.destroy();
- dispose();
- }
-
- public static void main(String[] args) throws LWJGLException {
- new DisplayParentTest();
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.opengl.awt;
+
+import java.awt.Canvas;
+import java.awt.Frame;
+import java.awt.GridLayout;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+
+import org.lwjgl.LWJGLException;
+import org.lwjgl.input.Keyboard;
+import org.lwjgl.input.Mouse;
+import org.lwjgl.opengl.Display;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.util.glu.GLU;
+
+/**
+ * <p>
+ * Tests Display.setParent()
+ * <p>
+ * @version $Revision: 3102 $
+ * @author $Author: matzon $
+ * $Id: DisplayParentTest.java 3102 2008-06-08 09:30:24Z matzon $
+ */
+public class DisplayParentTest extends Frame {
+ boolean killswitch = false;
+ public DisplayParentTest() throws LWJGLException {
+ setTitle("LWJGL Display Parent Test");
+ setSize(640, 320);
+ setLayout(new GridLayout(1, 2));
+ final Canvas display_parent = new Canvas();
+ display_parent.setFocusable(true);
+ display_parent.setIgnoreRepaint(true);
+ add(display_parent);
+ addWindowListener(new WindowAdapter() {
+ public void windowClosing(WindowEvent e) {
+ killswitch = true;
+ }
+ });
+ setResizable(true);
+ setVisible(true);
+ Display.setParent(display_parent);
+ Display.setVSyncEnabled(true);
+ Display.create();
+ float angle = 0f;
+
+ while (isVisible() && !killswitch) {
+ angle += 1.0f;
+ int width;
+ int height;
+ if (!Display.isFullscreen()) {
+ width = display_parent.getWidth();
+ height = display_parent.getHeight();
+ } else {
+ width = Display.getDisplayMode().getWidth();
+ height = Display.getDisplayMode().getHeight();
+ }
+
+ if(width < 1 || height < 1) {
+ continue;
+ }
+
+ GL11.glViewport(0, 0, width, height);
+ GL11.glClearColor(0.0f, 1.0f, 0.0f, 1.0f);
+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+ GL11.glLoadIdentity();
+ GLU.gluOrtho2D(0.0f, (float) width, 0.0f, (float) height);
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ GL11.glPushMatrix();
+ GL11.glTranslatef(width / 2.0f, height / 2.0f, 0.0f);
+ GL11.glRotatef(2*angle, 0f, 0f, -1.0f);
+ GL11.glRectf(-50.0f, -50.0f, 50.0f, 50.0f);
+ GL11.glPopMatrix();
+ Display.update();
+ while(Keyboard.next()) {
+ // closing on ESCAPE
+ if(Keyboard.getEventKey() == Keyboard.KEY_ESCAPE && Keyboard.getEventKeyState()) {
+ Display.destroy();
+ dispose();
+ break;
+ }
+
+ if(Keyboard.getEventKey() == Keyboard.KEY_SPACE && Keyboard.getEventKeyState()) {
+ Mouse.setGrabbed(!Mouse.isGrabbed());
+ }
+ if(Keyboard.getEventKey() == Keyboard.KEY_F && Keyboard.getEventKeyState()) {
+ Display.setFullscreen(!Display.isFullscreen());
+ }
+ }
+/* while (Mouse.next()) {
+System.out.println(" Mouse.getEventX() = " + Mouse.getEventX() + " | Mouse.getEventY() = " + Mouse.getEventY());
+ }*/
+ }
+ Display.destroy();
+ dispose();
+ }
+
+ public static void main(String[] args) throws LWJGLException {
+ new DisplayParentTest();
+ }
+}
diff --git a/src/java/org/lwjgl/test/opengl/pbuffers/PbufferTest.java b/src/java/org/lwjgl/test/opengl/pbuffers/PbufferTest.java
index 4f822ca..d3d7f0e 100644
--- a/src/java/org/lwjgl/test/opengl/pbuffers/PbufferTest.java
+++ b/src/java/org/lwjgl/test/opengl/pbuffers/PbufferTest.java
@@ -1,438 +1,438 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.opengl.pbuffers;
-
-import java.nio.IntBuffer;
-
-import org.lwjgl.BufferUtils;
-import org.lwjgl.LWJGLException;
-import org.lwjgl.input.Keyboard;
-import org.lwjgl.opengl.Display;
-import org.lwjgl.opengl.DisplayMode;
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.opengl.Pbuffer;
-import org.lwjgl.opengl.PixelFormat;
-import org.lwjgl.util.glu.GLU;
-import org.lwjgl.util.vector.Vector2f;
-
-/**
- * <p/>
- * Tests Pbuffers
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: PbufferTest.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public final class PbufferTest {
-
- /**
- * Texture and pbuffer size
- */
- private static final int TEXTURE_SIZE = 512;
-
- /**
- * Size of the animated quad
- */
- private static final int QUAD_SIZE = 64;
-
- /**
- * The renderer to use when rendering to texture.
- */
- private TextureRenderer texRenderer;
-
- /**
- * Intended deiplay mode
- */
- private DisplayMode mode;
-
- /**
- * our quad moving around
- */
- private Vector2f quadPosition;
-
- /**
- * For positioning our quad in the texture
- */
- private float texScaleX, texScaleY;
-
- /**
- * our quadVelocity
- */
- private Vector2f quadVelocity;
-
- /**
- * angle of quad
- */
- private float angle;
-
- /**
- * degrees to rotate per frame
- */
- private float angleRotation = 1.0f;
-
- /**
- * Max speed of all changable attributes
- */
- private static final float MAX_SPEED = 20.0f;
-
- /**
- * The shared texture
- */
- private static int texID;
-
- public PbufferTest(final int renderMode) {
- try {
- //find displaymode
- mode = findDisplayMode(800, 600, 16);
- Display.setDisplayMode(mode);
- Display.create(new PixelFormat(16, 0, 0, 0, 0));
-
- glInit();
-
- if ( (Pbuffer.getCapabilities() & Pbuffer.PBUFFER_SUPPORTED) == 0 ) {
- System.out.println("No Pbuffer support!");
- System.exit(-1);
- }
- System.out.println("Pbuffer support detected. Initializing...\n");
-
- switch ( renderMode ) {
- case 1:
- System.out.print("Creating pbuffer with unique context...");
- texRenderer = new UniqueRenderer(TEXTURE_SIZE, TEXTURE_SIZE, texID);
- break;
- case 2:
- System.out.print("Creating render-to-texture pbuffer with unique context...");
- texRenderer = new UniqueRendererRTT(TEXTURE_SIZE, TEXTURE_SIZE, texID);
- break;
- }
-
- System.out.println("OK");
-
- quadPosition = new Vector2f(100f, 100f);
- quadVelocity = new Vector2f(1.0f, 1.0f);
-
- texScaleX = TEXTURE_SIZE / (float)mode.getWidth();
- texScaleY = TEXTURE_SIZE / (float)mode.getHeight();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- /**
- * Executes the test
- */
- public void execute() {
- mainLoop();
- cleanup();
- }
-
- /**
- * Runs the main loop of the "test"
- */
- private void mainLoop() {
- while ( !Keyboard.isKeyDown(Keyboard.KEY_ESCAPE) && !Display.isCloseRequested() ) {
- if ( Display.isVisible() ) {
- // check keyboard input
- processKeyboard();
-
- // do "game" logic, and render it
- logic();
-
- render();
- } else {
- // no need to render/paint if nothing has changed (ie. window dragged over)
- if ( Display.isDirty() )
- render();
-
-
- // don't waste cpu time, sleep more
- try {
- Thread.sleep(100);
- } catch (InterruptedException inte) {
- }
- }
- // Update window
- Display.update();
- // Sync
- Display.sync(100);
- }
- }
-
- /**
- * Performs the logic
- */
- private void logic() {
- angle += angleRotation;
- if ( angle > 360.0f )
- angle -= 360.0f;
-
- quadPosition.x += quadVelocity.x;
- quadPosition.y += quadVelocity.y;
-
- // check colision with vertical border border
- if ( quadPosition.x + QUAD_SIZE >= mode.getWidth() || quadPosition.x - QUAD_SIZE <= 0 )
- quadVelocity.x *= -1;
-
- // check collision with horizontal border
- if ( quadPosition.y + QUAD_SIZE >= mode.getHeight() || quadPosition.y - QUAD_SIZE <= 0 )
- quadVelocity.y *= -1;
- }
-
- private void render() {
- // -----------------------------------------------------------
- // -------------------- Pbuffer rendering --------------------
- // -----------------------------------------------------------
- // Tell the pbuffer to get ready for rendering
- texRenderer.enable();
-
- // Clear the background
- GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
-
- // Draw quad with gradient
- GL11.glPushMatrix();
- {
- GL11.glTranslatef(quadPosition.x * texScaleX, quadPosition.y * texScaleY, 0);
- GL11.glRotatef(angle, 0.0f, 0.0f, 1.0f);
- GL11.glBegin(GL11.GL_QUADS);
- {
- GL11.glColor3f(1.0f, 0.0f, 0.0f);
- GL11.glVertex2i(-QUAD_SIZE, -QUAD_SIZE);
- GL11.glVertex2i(QUAD_SIZE, -QUAD_SIZE);
- GL11.glColor3f(0.0f, 0.0f, 1.0f);
- GL11.glVertex2i(QUAD_SIZE, QUAD_SIZE);
- GL11.glVertex2i(-QUAD_SIZE, QUAD_SIZE);
- }
- GL11.glEnd();
- }
- GL11.glPopMatrix();
-
- // Refresh the texture
- texRenderer.updateTexture();
-
- // -----------------------------------------------------------
- // -------------------- Display rendering --------------------
- // -----------------------------------------------------------
- try {
- Display.makeCurrent();
- } catch (LWJGLException e) {
- throw new RuntimeException(e);
- }
-
- GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
-
- // draw white quad
- GL11.glPushMatrix();
- {
- GL11.glTranslatef(quadPosition.x, quadPosition.y, 0);
- GL11.glRotatef(angle, 0.0f, 0.0f, 1.0f);
- GL11.glColor3f(1.0f, 1.0f, 1.0f);
- GL11.glBegin(GL11.GL_QUADS);
- {
- GL11.glTexCoord2f(0f, 0f);
- GL11.glVertex2i(-QUAD_SIZE, -QUAD_SIZE);
- GL11.glTexCoord2f(1f, 0f);
- GL11.glVertex2i(QUAD_SIZE, -QUAD_SIZE);
- GL11.glTexCoord2f(1f, 1f);
- GL11.glVertex2i(QUAD_SIZE, QUAD_SIZE);
- GL11.glTexCoord2f(0f, 1f);
- GL11.glVertex2i(-QUAD_SIZE, QUAD_SIZE);
- }
- GL11.glEnd();
- }
- GL11.glPopMatrix();
- }
-
- /**
- * Processes keyboard input
- */
- private void processKeyboard() {
- Keyboard.poll();
-
- //check for fullscreen key
- if ( Keyboard.isKeyDown(Keyboard.KEY_F) ) {
- try {
- Display.setDisplayMode(mode);
- Display.setFullscreen(true);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- //check for window key
- if ( Keyboard.isKeyDown(Keyboard.KEY_W) ) {
- try {
- Display.setFullscreen(false);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- //check for speed changes
- if ( Keyboard.isKeyDown(Keyboard.KEY_UP) )
- quadVelocity.y += 0.1f;
- if ( Keyboard.isKeyDown(Keyboard.KEY_DOWN) )
- quadVelocity.y -= 0.1f;
- if ( Keyboard.isKeyDown(Keyboard.KEY_RIGHT) )
- quadVelocity.x += 0.1f;
- if ( Keyboard.isKeyDown(Keyboard.KEY_LEFT) )
- quadVelocity.x -= 0.1f;
-
- if ( Keyboard.isKeyDown(Keyboard.KEY_ADD) )
- angleRotation += 0.1f;
- if ( Keyboard.isKeyDown(Keyboard.KEY_SUBTRACT) )
- angleRotation -= 0.1f;
-
- //throttle
- if ( quadVelocity.x < -MAX_SPEED )
- quadVelocity.x = -MAX_SPEED;
- if ( quadVelocity.x > MAX_SPEED )
- quadVelocity.x = MAX_SPEED;
- if ( quadVelocity.y < -MAX_SPEED )
- quadVelocity.y = -MAX_SPEED;
- if ( quadVelocity.y > MAX_SPEED )
- quadVelocity.y = MAX_SPEED;
-
- if ( angleRotation < 0.0f )
- angleRotation = 0.0f;
- if ( angleRotation > MAX_SPEED )
- angleRotation = MAX_SPEED;
- }
-
- /**
- * Cleans up the test
- */
- private void cleanup() {
- // Destroy texture
- IntBuffer buffer = BufferUtils.createIntBuffer(1);
- buffer.put(0, texID);
- GL11.glDeleteTextures(buffer);
-
- texRenderer.destroy();
- Display.destroy();
- }
-
- /**
- * Retrieves a displaymode, if one such is available
- *
- * @param width Required width
- * @param height Required height
- * @param bpp Minimum required bits per pixel
- *
- * @return
- */
- private DisplayMode findDisplayMode(int width, int height, int bpp) throws LWJGLException {
- DisplayMode[] modes = Display.getAvailableDisplayModes();
- for ( int i = 0; i < modes.length; i++ ) {
- if ( modes[i].getWidth() == width
- && modes[i].getHeight() == height
- && modes[i].getBitsPerPixel() >= bpp ) {
- return modes[i];
- }
- }
- return null;
- }
-
- static void initGLState(int width, int height, float color) {
- GL11.glMatrixMode(GL11.GL_PROJECTION);
- GL11.glLoadIdentity();
- GLU.gluOrtho2D(0, width, 0, height);
-
- GL11.glMatrixMode(GL11.GL_MODELVIEW);
- GL11.glLoadIdentity();
- GL11.glViewport(0, 0, width, height);
-
- //set clear color
- GL11.glClearColor(color, color, color, 0.0f);
- }
-
- /**
- * Initializes OGL
- */
- private void glInit() {
- // Sync frame (only works on windows)
- Display.setVSyncEnabled(true);
-
- // Create shared texture
- IntBuffer buffer = BufferUtils.createIntBuffer(1);
- GL11.glGenTextures(buffer);
- texID = buffer.get(0);
-
- GL11.glTexEnvf(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_MODULATE);
- GL11.glEnable(GL11.GL_TEXTURE_2D);
-
- GL11.glBindTexture(GL11.GL_TEXTURE_2D, texID);
-
- GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_CLAMP);
- GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_CLAMP);
- GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);
- GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
-
- initGLState(mode.getWidth(), mode.getHeight(), 0.0f);
- }
-
- /**
- * Test entry point
- */
- public static void main(String[] args) {
- if ( args.length != 1 )
- kill("Invalid arguments length.");
-
- int mode = -1;
- try {
- mode = Integer.parseInt(args[0]);
- } catch (NumberFormatException e) {
- kill("Invalid mode.");
- }
-
- if ( mode != 1 && mode != 2 )
- kill("Invalid mode.");
-
- System.out.println("Change between fullscreen and windowed mode, by pressing F and W respectively");
- System.out.println("Move quad using arrowkeys, and change rotation using +/-");
-
- PbufferTest test = new PbufferTest(mode);
-
- test.execute();
- System.exit(0);
- }
-
- private static void kill(final String msg) {
- System.out.println(msg);
- System.out.println("-------");
- System.out.println("Usage: java org.lwjgl.test.opengl.pbuffer.PbufferTest <mode>");
- System.out.println("\n<mode>.");
- System.out.println("\t1: no render-to-texture");
- System.out.println("\t2: with render-to-texture");
-
- System.exit(-1);
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.opengl.pbuffers;
+
+import java.nio.IntBuffer;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.LWJGLException;
+import org.lwjgl.input.Keyboard;
+import org.lwjgl.opengl.Display;
+import org.lwjgl.opengl.DisplayMode;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.Pbuffer;
+import org.lwjgl.opengl.PixelFormat;
+import org.lwjgl.util.glu.GLU;
+import org.lwjgl.util.vector.Vector2f;
+
+/**
+ * <p/>
+ * Tests Pbuffers
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: PbufferTest.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public final class PbufferTest {
+
+ /**
+ * Texture and pbuffer size
+ */
+ private static final int TEXTURE_SIZE = 512;
+
+ /**
+ * Size of the animated quad
+ */
+ private static final int QUAD_SIZE = 64;
+
+ /**
+ * The renderer to use when rendering to texture.
+ */
+ private TextureRenderer texRenderer;
+
+ /**
+ * Intended deiplay mode
+ */
+ private DisplayMode mode;
+
+ /**
+ * our quad moving around
+ */
+ private Vector2f quadPosition;
+
+ /**
+ * For positioning our quad in the texture
+ */
+ private float texScaleX, texScaleY;
+
+ /**
+ * our quadVelocity
+ */
+ private Vector2f quadVelocity;
+
+ /**
+ * angle of quad
+ */
+ private float angle;
+
+ /**
+ * degrees to rotate per frame
+ */
+ private float angleRotation = 1.0f;
+
+ /**
+ * Max speed of all changable attributes
+ */
+ private static final float MAX_SPEED = 20.0f;
+
+ /**
+ * The shared texture
+ */
+ private static int texID;
+
+ public PbufferTest(final int renderMode) {
+ try {
+ //find displaymode
+ mode = findDisplayMode(800, 600, 16);
+ Display.setDisplayMode(mode);
+ Display.create(new PixelFormat(16, 0, 0, 0, 0));
+
+ glInit();
+
+ if ( (Pbuffer.getCapabilities() & Pbuffer.PBUFFER_SUPPORTED) == 0 ) {
+ System.out.println("No Pbuffer support!");
+ System.exit(-1);
+ }
+ System.out.println("Pbuffer support detected. Initializing...\n");
+
+ switch ( renderMode ) {
+ case 1:
+ System.out.print("Creating pbuffer with unique context...");
+ texRenderer = new UniqueRenderer(TEXTURE_SIZE, TEXTURE_SIZE, texID);
+ break;
+ case 2:
+ System.out.print("Creating render-to-texture pbuffer with unique context...");
+ texRenderer = new UniqueRendererRTT(TEXTURE_SIZE, TEXTURE_SIZE, texID);
+ break;
+ }
+
+ System.out.println("OK");
+
+ quadPosition = new Vector2f(100f, 100f);
+ quadVelocity = new Vector2f(1.0f, 1.0f);
+
+ texScaleX = TEXTURE_SIZE / (float)mode.getWidth();
+ texScaleY = TEXTURE_SIZE / (float)mode.getHeight();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Executes the test
+ */
+ public void execute() {
+ mainLoop();
+ cleanup();
+ }
+
+ /**
+ * Runs the main loop of the "test"
+ */
+ private void mainLoop() {
+ while ( !Keyboard.isKeyDown(Keyboard.KEY_ESCAPE) && !Display.isCloseRequested() ) {
+ if ( Display.isVisible() ) {
+ // check keyboard input
+ processKeyboard();
+
+ // do "game" logic, and render it
+ logic();
+
+ render();
+ } else {
+ // no need to render/paint if nothing has changed (ie. window dragged over)
+ if ( Display.isDirty() )
+ render();
+
+
+ // don't waste cpu time, sleep more
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException inte) {
+ }
+ }
+ // Update window
+ Display.update();
+ // Sync
+ Display.sync(100);
+ }
+ }
+
+ /**
+ * Performs the logic
+ */
+ private void logic() {
+ angle += angleRotation;
+ if ( angle > 360.0f )
+ angle -= 360.0f;
+
+ quadPosition.x += quadVelocity.x;
+ quadPosition.y += quadVelocity.y;
+
+ // check colision with vertical border border
+ if ( quadPosition.x + QUAD_SIZE >= mode.getWidth() || quadPosition.x - QUAD_SIZE <= 0 )
+ quadVelocity.x *= -1;
+
+ // check collision with horizontal border
+ if ( quadPosition.y + QUAD_SIZE >= mode.getHeight() || quadPosition.y - QUAD_SIZE <= 0 )
+ quadVelocity.y *= -1;
+ }
+
+ private void render() {
+ // -----------------------------------------------------------
+ // -------------------- Pbuffer rendering --------------------
+ // -----------------------------------------------------------
+ // Tell the pbuffer to get ready for rendering
+ texRenderer.enable();
+
+ // Clear the background
+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
+
+ // Draw quad with gradient
+ GL11.glPushMatrix();
+ {
+ GL11.glTranslatef(quadPosition.x * texScaleX, quadPosition.y * texScaleY, 0);
+ GL11.glRotatef(angle, 0.0f, 0.0f, 1.0f);
+ GL11.glBegin(GL11.GL_QUADS);
+ {
+ GL11.glColor3f(1.0f, 0.0f, 0.0f);
+ GL11.glVertex2i(-QUAD_SIZE, -QUAD_SIZE);
+ GL11.glVertex2i(QUAD_SIZE, -QUAD_SIZE);
+ GL11.glColor3f(0.0f, 0.0f, 1.0f);
+ GL11.glVertex2i(QUAD_SIZE, QUAD_SIZE);
+ GL11.glVertex2i(-QUAD_SIZE, QUAD_SIZE);
+ }
+ GL11.glEnd();
+ }
+ GL11.glPopMatrix();
+
+ // Refresh the texture
+ texRenderer.updateTexture();
+
+ // -----------------------------------------------------------
+ // -------------------- Display rendering --------------------
+ // -----------------------------------------------------------
+ try {
+ Display.makeCurrent();
+ } catch (LWJGLException e) {
+ throw new RuntimeException(e);
+ }
+
+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
+
+ // draw white quad
+ GL11.glPushMatrix();
+ {
+ GL11.glTranslatef(quadPosition.x, quadPosition.y, 0);
+ GL11.glRotatef(angle, 0.0f, 0.0f, 1.0f);
+ GL11.glColor3f(1.0f, 1.0f, 1.0f);
+ GL11.glBegin(GL11.GL_QUADS);
+ {
+ GL11.glTexCoord2f(0f, 0f);
+ GL11.glVertex2i(-QUAD_SIZE, -QUAD_SIZE);
+ GL11.glTexCoord2f(1f, 0f);
+ GL11.glVertex2i(QUAD_SIZE, -QUAD_SIZE);
+ GL11.glTexCoord2f(1f, 1f);
+ GL11.glVertex2i(QUAD_SIZE, QUAD_SIZE);
+ GL11.glTexCoord2f(0f, 1f);
+ GL11.glVertex2i(-QUAD_SIZE, QUAD_SIZE);
+ }
+ GL11.glEnd();
+ }
+ GL11.glPopMatrix();
+ }
+
+ /**
+ * Processes keyboard input
+ */
+ private void processKeyboard() {
+ Keyboard.poll();
+
+ //check for fullscreen key
+ if ( Keyboard.isKeyDown(Keyboard.KEY_F) ) {
+ try {
+ Display.setDisplayMode(mode);
+ Display.setFullscreen(true);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ //check for window key
+ if ( Keyboard.isKeyDown(Keyboard.KEY_W) ) {
+ try {
+ Display.setFullscreen(false);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ //check for speed changes
+ if ( Keyboard.isKeyDown(Keyboard.KEY_UP) )
+ quadVelocity.y += 0.1f;
+ if ( Keyboard.isKeyDown(Keyboard.KEY_DOWN) )
+ quadVelocity.y -= 0.1f;
+ if ( Keyboard.isKeyDown(Keyboard.KEY_RIGHT) )
+ quadVelocity.x += 0.1f;
+ if ( Keyboard.isKeyDown(Keyboard.KEY_LEFT) )
+ quadVelocity.x -= 0.1f;
+
+ if ( Keyboard.isKeyDown(Keyboard.KEY_ADD) )
+ angleRotation += 0.1f;
+ if ( Keyboard.isKeyDown(Keyboard.KEY_SUBTRACT) )
+ angleRotation -= 0.1f;
+
+ //throttle
+ if ( quadVelocity.x < -MAX_SPEED )
+ quadVelocity.x = -MAX_SPEED;
+ if ( quadVelocity.x > MAX_SPEED )
+ quadVelocity.x = MAX_SPEED;
+ if ( quadVelocity.y < -MAX_SPEED )
+ quadVelocity.y = -MAX_SPEED;
+ if ( quadVelocity.y > MAX_SPEED )
+ quadVelocity.y = MAX_SPEED;
+
+ if ( angleRotation < 0.0f )
+ angleRotation = 0.0f;
+ if ( angleRotation > MAX_SPEED )
+ angleRotation = MAX_SPEED;
+ }
+
+ /**
+ * Cleans up the test
+ */
+ private void cleanup() {
+ // Destroy texture
+ IntBuffer buffer = BufferUtils.createIntBuffer(1);
+ buffer.put(0, texID);
+ GL11.glDeleteTextures(buffer);
+
+ texRenderer.destroy();
+ Display.destroy();
+ }
+
+ /**
+ * Retrieves a displaymode, if one such is available
+ *
+ * @param width Required width
+ * @param height Required height
+ * @param bpp Minimum required bits per pixel
+ *
+ * @return
+ */
+ private DisplayMode findDisplayMode(int width, int height, int bpp) throws LWJGLException {
+ DisplayMode[] modes = Display.getAvailableDisplayModes();
+ for ( int i = 0; i < modes.length; i++ ) {
+ if ( modes[i].getWidth() == width
+ && modes[i].getHeight() == height
+ && modes[i].getBitsPerPixel() >= bpp ) {
+ return modes[i];
+ }
+ }
+ return null;
+ }
+
+ static void initGLState(int width, int height, float color) {
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+ GL11.glLoadIdentity();
+ GLU.gluOrtho2D(0, width, 0, height);
+
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ GL11.glLoadIdentity();
+ GL11.glViewport(0, 0, width, height);
+
+ //set clear color
+ GL11.glClearColor(color, color, color, 0.0f);
+ }
+
+ /**
+ * Initializes OGL
+ */
+ private void glInit() {
+ // Sync frame (only works on windows)
+ Display.setVSyncEnabled(true);
+
+ // Create shared texture
+ IntBuffer buffer = BufferUtils.createIntBuffer(1);
+ GL11.glGenTextures(buffer);
+ texID = buffer.get(0);
+
+ GL11.glTexEnvf(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_MODULATE);
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, texID);
+
+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_CLAMP);
+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_CLAMP);
+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);
+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
+
+ initGLState(mode.getWidth(), mode.getHeight(), 0.0f);
+ }
+
+ /**
+ * Test entry point
+ */
+ public static void main(String[] args) {
+ if ( args.length != 1 )
+ kill("Invalid arguments length.");
+
+ int mode = -1;
+ try {
+ mode = Integer.parseInt(args[0]);
+ } catch (NumberFormatException e) {
+ kill("Invalid mode.");
+ }
+
+ if ( mode != 1 && mode != 2 )
+ kill("Invalid mode.");
+
+ System.out.println("Change between fullscreen and windowed mode, by pressing F and W respectively");
+ System.out.println("Move quad using arrowkeys, and change rotation using +/-");
+
+ PbufferTest test = new PbufferTest(mode);
+
+ test.execute();
+ System.exit(0);
+ }
+
+ private static void kill(final String msg) {
+ System.out.println(msg);
+ System.out.println("-------");
+ System.out.println("Usage: java org.lwjgl.test.opengl.pbuffer.PbufferTest <mode>");
+ System.out.println("\n<mode>.");
+ System.out.println("\t1: no render-to-texture");
+ System.out.println("\t2: with render-to-texture");
+
+ System.exit(-1);
+ }
+}
diff --git a/src/java/org/lwjgl/test/opengl/pbuffers/TextureRenderer.java b/src/java/org/lwjgl/test/opengl/pbuffers/TextureRenderer.java
index a8a2f77..7d3f509 100644
--- a/src/java/org/lwjgl/test/opengl/pbuffers/TextureRenderer.java
+++ b/src/java/org/lwjgl/test/opengl/pbuffers/TextureRenderer.java
@@ -1,101 +1,101 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.opengl.pbuffers;
-
-import org.lwjgl.LWJGLException;
-import org.lwjgl.opengl.Pbuffer;
-
-/**
- * Implementations of this class should create a pbuffer and implement "render-to-texture" accordingly.
- */
-abstract class TextureRenderer {
-
- protected final int width;
- protected final int height;
- private final int texID;
-
- protected Pbuffer pbuffer;
-
- protected TextureRenderer(final int width, final int height, final int texID) {
- this.width = width;
- this.height = height;
- this.texID = texID;
-
- try {
- pbuffer = init(width, height, texID);
- } catch (LWJGLException e) {
- e.printStackTrace();
- System.exit(-1);
- }
- }
-
- /**
- * Create and initialize the pbuffer.
- *
- * @param width
- * @param height
- * @param texID
- * @return
- * @throws LWJGLException
- */
- protected abstract Pbuffer init(int width, int height, int texID) throws LWJGLException;
-
- /**
- * This will be called before rendering to the renderer. Implementations should setup the pbuffer context as necessary.
- */
- void enable() {
- try {
- if ( pbuffer.isBufferLost() ) {
- System.out.println("Buffer contents lost - recreating the pbuffer");
- pbuffer.destroy();
- pbuffer = init(width, height, texID);
- }
-
- pbuffer.makeCurrent();
- } catch (LWJGLException e) {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * Implementations should update the texture contents here.
- */
- abstract void updateTexture();
-
- /**
- * Clean-up resources held by the renderer
- */
- final void destroy() {
- pbuffer.destroy();
- }
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.opengl.pbuffers;
+
+import org.lwjgl.LWJGLException;
+import org.lwjgl.opengl.Pbuffer;
+
+/**
+ * Implementations of this class should create a pbuffer and implement "render-to-texture" accordingly.
+ */
+abstract class TextureRenderer {
+
+ protected final int width;
+ protected final int height;
+ private final int texID;
+
+ protected Pbuffer pbuffer;
+
+ protected TextureRenderer(final int width, final int height, final int texID) {
+ this.width = width;
+ this.height = height;
+ this.texID = texID;
+
+ try {
+ pbuffer = init(width, height, texID);
+ } catch (LWJGLException e) {
+ e.printStackTrace();
+ System.exit(-1);
+ }
+ }
+
+ /**
+ * Create and initialize the pbuffer.
+ *
+ * @param width
+ * @param height
+ * @param texID
+ * @return
+ * @throws LWJGLException
+ */
+ protected abstract Pbuffer init(int width, int height, int texID) throws LWJGLException;
+
+ /**
+ * This will be called before rendering to the renderer. Implementations should setup the pbuffer context as necessary.
+ */
+ void enable() {
+ try {
+ if ( pbuffer.isBufferLost() ) {
+ System.out.println("Buffer contents lost - recreating the pbuffer");
+ pbuffer.destroy();
+ pbuffer = init(width, height, texID);
+ }
+
+ pbuffer.makeCurrent();
+ } catch (LWJGLException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ * Implementations should update the texture contents here.
+ */
+ abstract void updateTexture();
+
+ /**
+ * Clean-up resources held by the renderer
+ */
+ final void destroy() {
+ pbuffer.destroy();
+ }
+
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/test/opengl/pbuffers/UniqueRenderer.java b/src/java/org/lwjgl/test/opengl/pbuffers/UniqueRenderer.java
index fd3cf9e..24fe7f1 100644
--- a/src/java/org/lwjgl/test/opengl/pbuffers/UniqueRenderer.java
+++ b/src/java/org/lwjgl/test/opengl/pbuffers/UniqueRenderer.java
@@ -1,72 +1,72 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.opengl.pbuffers;
-
-import org.lwjgl.LWJGLException;
-import org.lwjgl.opengl.Display;
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.opengl.Pbuffer;
-import org.lwjgl.opengl.PixelFormat;
-
-final class UniqueRenderer extends TextureRenderer {
-
- UniqueRenderer(final int width, final int height, final int texID) {
- super(width, height, texID);
- }
-
- protected Pbuffer init(final int width, final int height, final int texID) {
- Pbuffer pbuffer = null;
-
- try {
- pbuffer = new Pbuffer(width, height, new PixelFormat(16, 0, 0, 0, 0), null, null);
-
- // Initialise state of the pbuffer context.
- pbuffer.makeCurrent();
-
- PbufferTest.initGLState(width, height, 0.5f);
- GL11.glBindTexture(GL11.GL_TEXTURE_2D, texID);
-
- Display.makeCurrent();
- } catch (LWJGLException e) {
- e.printStackTrace();
- System.exit(-1);
- }
-
- return pbuffer;
- }
-
- public void updateTexture() {
- // Copy the pbuffer contents to the texture.
- GL11.glCopyTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGB, 0, 0, width, height, 0);
- }
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.opengl.pbuffers;
+
+import org.lwjgl.LWJGLException;
+import org.lwjgl.opengl.Display;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.Pbuffer;
+import org.lwjgl.opengl.PixelFormat;
+
+final class UniqueRenderer extends TextureRenderer {
+
+ UniqueRenderer(final int width, final int height, final int texID) {
+ super(width, height, texID);
+ }
+
+ protected Pbuffer init(final int width, final int height, final int texID) {
+ Pbuffer pbuffer = null;
+
+ try {
+ pbuffer = new Pbuffer(width, height, new PixelFormat(16, 0, 0, 0, 0), null, null);
+
+ // Initialise state of the pbuffer context.
+ pbuffer.makeCurrent();
+
+ PbufferTest.initGLState(width, height, 0.5f);
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, texID);
+
+ Display.makeCurrent();
+ } catch (LWJGLException e) {
+ e.printStackTrace();
+ System.exit(-1);
+ }
+
+ return pbuffer;
+ }
+
+ public void updateTexture() {
+ // Copy the pbuffer contents to the texture.
+ GL11.glCopyTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGB, 0, 0, width, height, 0);
+ }
+
+}
diff --git a/src/java/org/lwjgl/test/opengl/pbuffers/UniqueRendererRTT.java b/src/java/org/lwjgl/test/opengl/pbuffers/UniqueRendererRTT.java
index c726bff..9195b6c 100644
--- a/src/java/org/lwjgl/test/opengl/pbuffers/UniqueRendererRTT.java
+++ b/src/java/org/lwjgl/test/opengl/pbuffers/UniqueRendererRTT.java
@@ -1,82 +1,82 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.test.opengl.pbuffers;
-
-import org.lwjgl.LWJGLException;
-import org.lwjgl.opengl.Display;
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.opengl.Pbuffer;
-import org.lwjgl.opengl.PixelFormat;
-import org.lwjgl.opengl.RenderTexture;
-
-final class UniqueRendererRTT extends TextureRenderer {
-
- UniqueRendererRTT(final int width, final int height, final int texID) {
- super(width, height, texID);
- }
-
- // Initialize texture renderer
- protected Pbuffer init(final int width, final int height, final int texID) {
- Pbuffer pbuffer = null;
-
- try {
- final RenderTexture rt = new RenderTexture(true, false, false, false, RenderTexture.RENDER_TEXTURE_2D, 0);
- pbuffer = new Pbuffer(width, height, new PixelFormat(16, 0, 0, 0, 0), rt, null);
-
- // Initialise state of the pbuffer context.
- pbuffer.makeCurrent();
-
- PbufferTest.initGLState(width, height, 0.5f);
- GL11.glBindTexture(GL11.GL_TEXTURE_2D, texID);
-
- Display.makeCurrent();
- } catch (LWJGLException e) {
- e.printStackTrace();
- System.exit(-1);
- }
-
- return pbuffer;
- }
-
- void enable() {
- super.enable();
-
- // Put the renderer contents to the texture
- pbuffer.releaseTexImage(Pbuffer.FRONT_LEFT_BUFFER);
- }
-
- void updateTexture() {
- // Bind the texture after rendering.
- pbuffer.bindTexImage(Pbuffer.FRONT_LEFT_BUFFER);
- }
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.test.opengl.pbuffers;
+
+import org.lwjgl.LWJGLException;
+import org.lwjgl.opengl.Display;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.Pbuffer;
+import org.lwjgl.opengl.PixelFormat;
+import org.lwjgl.opengl.RenderTexture;
+
+final class UniqueRendererRTT extends TextureRenderer {
+
+ UniqueRendererRTT(final int width, final int height, final int texID) {
+ super(width, height, texID);
+ }
+
+ // Initialize texture renderer
+ protected Pbuffer init(final int width, final int height, final int texID) {
+ Pbuffer pbuffer = null;
+
+ try {
+ final RenderTexture rt = new RenderTexture(true, false, false, false, RenderTexture.RENDER_TEXTURE_2D, 0);
+ pbuffer = new Pbuffer(width, height, new PixelFormat(16, 0, 0, 0, 0), rt, null);
+
+ // Initialise state of the pbuffer context.
+ pbuffer.makeCurrent();
+
+ PbufferTest.initGLState(width, height, 0.5f);
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, texID);
+
+ Display.makeCurrent();
+ } catch (LWJGLException e) {
+ e.printStackTrace();
+ System.exit(-1);
+ }
+
+ return pbuffer;
+ }
+
+ void enable() {
+ super.enable();
+
+ // Put the renderer contents to the texture
+ pbuffer.releaseTexImage(Pbuffer.FRONT_LEFT_BUFFER);
+ }
+
+ void updateTexture() {
+ // Bind the texture after rendering.
+ pbuffer.bindTexImage(Pbuffer.FRONT_LEFT_BUFFER);
+ }
+
+}
diff --git a/src/java/org/lwjgl/test/opengl/shaders/Shader.java b/src/java/org/lwjgl/test/opengl/shaders/Shader.java
index 1117851..26497d8 100644
--- a/src/java/org/lwjgl/test/opengl/shaders/Shader.java
+++ b/src/java/org/lwjgl/test/opengl/shaders/Shader.java
@@ -1,148 +1,148 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-/*
- * Created by LWJGL.
- * User: spasi
- * Date: 2004-03-30
- * Time: 8:41:42 pm
- */
-package org.lwjgl.test.opengl.shaders;
-
-import org.lwjgl.BufferUtils;
-import org.lwjgl.opengl.ARBProgram;
-import org.lwjgl.opengl.ARBShaderObjects;
-import org.lwjgl.opengl.GL11;
-
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.ByteBuffer;
-
-abstract class Shader {
-
- protected static ByteBuffer fileBuffer = BufferUtils.createByteBuffer(1024 * 10);
-
- protected Shader() {
- }
-
- abstract void render();
-
- abstract void cleanup();
-
- protected static String getShaderText(String file) {
- String shader = null;
-
- try {
- ClassLoader loader = ShadersTest.class.getClassLoader();
- InputStream inputStream = loader.getResourceAsStream("org/lwjgl/test/opengl/shaders/" + file);
-
- if ( inputStream == null )
- ShadersTest.kill("A shader source file could not be found: " + file);
-
- BufferedInputStream stream = new BufferedInputStream(inputStream);
-
- byte character;
- while ( (character = (byte)stream.read()) != -1 )
- fileBuffer.put(character);
-
- stream.close();
-
- fileBuffer.flip();
-
- byte[] array = new byte[fileBuffer.remaining()];
- fileBuffer.get(array);
- shader = new String(array);
-
- fileBuffer.clear();
- } catch (IOException e) {
- ShadersTest.kill("Failed to read the shader source file: " + file, e);
- }
-
- return shader;
- }
-
- protected static void checkProgramError(String programFile, String programSource) {
- if ( GL11.glGetError() == GL11.GL_INVALID_OPERATION ) {
- final int errorPos = GL11.glGetInteger(ARBProgram.GL_PROGRAM_ERROR_POSITION_ARB);
- int lineStart = 0;
- int lineEnd = -1;
- for ( int i = 0; i < programSource.length(); i++ ) {
- if ( programSource.charAt(i) == '\n' ) {
- if ( i <= errorPos ) {
- lineStart = i + 1;
- } else {
- lineEnd = i;
- break;
- }
- }
- }
-
- if ( lineEnd == -1 )
- lineEnd = programSource.length();
-
- ShadersTest.kill("Low-level program error in file: " + programFile
- + "\n\tError line: " + programSource.substring(lineStart, lineEnd)
- + "\n\tError message: " + GL11.glGetString(ARBProgram.GL_PROGRAM_ERROR_STRING_ARB));
- }
- }
-
- protected static int getUniformLocation(int ID, String name) {
- final int location = ARBShaderObjects.glGetUniformLocationARB(ID, name);
-
- if ( location == -1 )
- throw new IllegalArgumentException("The uniform \"" + name + "\" does not exist in the Shader Program.");
-
- return location;
- }
-
- protected static void printShaderObjectInfoLog(String file, int ID) {
- final int logLength = ARBShaderObjects.glGetObjectParameteriARB(ID, ARBShaderObjects.GL_OBJECT_INFO_LOG_LENGTH_ARB);
- if ( logLength <= 1 )
- return;
-
- System.out.println("\nInfo Log of Shader Object: " + file);
- System.out.println("--------------------------");
- System.out.println(ARBShaderObjects.glGetInfoLogARB(ID, logLength));
-
- }
-
- protected static void printShaderProgramInfoLog(int ID) {
- final int logLength = ARBShaderObjects.glGetObjectParameteriARB(ID, ARBShaderObjects.GL_OBJECT_INFO_LOG_LENGTH_ARB);
- if ( logLength <= 1 )
- return;
-
- System.out.println("\nShader Program Info Log: ");
- System.out.println("--------------------------");
- System.out.println(ARBShaderObjects.glGetInfoLogARB(ID, logLength));
- }
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+/*
+ * Created by LWJGL.
+ * User: spasi
+ * Date: 2004-03-30
+ * Time: 8:41:42 pm
+ */
+package org.lwjgl.test.opengl.shaders;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.opengl.ARBProgram;
+import org.lwjgl.opengl.ARBShaderObjects;
+import org.lwjgl.opengl.GL11;
+
+import java.io.BufferedInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.ByteBuffer;
+
+abstract class Shader {
+
+ protected static ByteBuffer fileBuffer = BufferUtils.createByteBuffer(1024 * 10);
+
+ protected Shader() {
+ }
+
+ abstract void render();
+
+ abstract void cleanup();
+
+ protected static String getShaderText(String file) {
+ String shader = null;
+
+ try {
+ ClassLoader loader = ShadersTest.class.getClassLoader();
+ InputStream inputStream = loader.getResourceAsStream("org/lwjgl/test/opengl/shaders/" + file);
+
+ if ( inputStream == null )
+ ShadersTest.kill("A shader source file could not be found: " + file);
+
+ BufferedInputStream stream = new BufferedInputStream(inputStream);
+
+ byte character;
+ while ( (character = (byte)stream.read()) != -1 )
+ fileBuffer.put(character);
+
+ stream.close();
+
+ fileBuffer.flip();
+
+ byte[] array = new byte[fileBuffer.remaining()];
+ fileBuffer.get(array);
+ shader = new String(array);
+
+ fileBuffer.clear();
+ } catch (IOException e) {
+ ShadersTest.kill("Failed to read the shader source file: " + file, e);
+ }
+
+ return shader;
+ }
+
+ protected static void checkProgramError(String programFile, String programSource) {
+ if ( GL11.glGetError() == GL11.GL_INVALID_OPERATION ) {
+ final int errorPos = GL11.glGetInteger(ARBProgram.GL_PROGRAM_ERROR_POSITION_ARB);
+ int lineStart = 0;
+ int lineEnd = -1;
+ for ( int i = 0; i < programSource.length(); i++ ) {
+ if ( programSource.charAt(i) == '\n' ) {
+ if ( i <= errorPos ) {
+ lineStart = i + 1;
+ } else {
+ lineEnd = i;
+ break;
+ }
+ }
+ }
+
+ if ( lineEnd == -1 )
+ lineEnd = programSource.length();
+
+ ShadersTest.kill("Low-level program error in file: " + programFile
+ + "\n\tError line: " + programSource.substring(lineStart, lineEnd)
+ + "\n\tError message: " + GL11.glGetString(ARBProgram.GL_PROGRAM_ERROR_STRING_ARB));
+ }
+ }
+
+ protected static int getUniformLocation(int ID, String name) {
+ final int location = ARBShaderObjects.glGetUniformLocationARB(ID, name);
+
+ if ( location == -1 )
+ throw new IllegalArgumentException("The uniform \"" + name + "\" does not exist in the Shader Program.");
+
+ return location;
+ }
+
+ protected static void printShaderObjectInfoLog(String file, int ID) {
+ final int logLength = ARBShaderObjects.glGetObjectParameteriARB(ID, ARBShaderObjects.GL_OBJECT_INFO_LOG_LENGTH_ARB);
+ if ( logLength <= 1 )
+ return;
+
+ System.out.println("\nInfo Log of Shader Object: " + file);
+ System.out.println("--------------------------");
+ System.out.println(ARBShaderObjects.glGetInfoLogARB(ID, logLength));
+
+ }
+
+ protected static void printShaderProgramInfoLog(int ID) {
+ final int logLength = ARBShaderObjects.glGetObjectParameteriARB(ID, ARBShaderObjects.GL_OBJECT_INFO_LOG_LENGTH_ARB);
+ if ( logLength <= 1 )
+ return;
+
+ System.out.println("\nShader Program Info Log: ");
+ System.out.println("--------------------------");
+ System.out.println(ARBShaderObjects.glGetInfoLogARB(ID, logLength));
+ }
+
+}
diff --git a/src/java/org/lwjgl/test/opengl/shaders/ShaderFP.java b/src/java/org/lwjgl/test/opengl/shaders/ShaderFP.java
index e68d8ff..ea99701 100644
--- a/src/java/org/lwjgl/test/opengl/shaders/ShaderFP.java
+++ b/src/java/org/lwjgl/test/opengl/shaders/ShaderFP.java
@@ -1,107 +1,107 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-/*
- * Created by LWJGL.
- * User: spasi
- * Date: 2004-03-30
- * Time: 9:55:38 pm
- */
-
-package org.lwjgl.test.opengl.shaders;
-
-import org.lwjgl.opengl.ARBFragmentProgram;
-import org.lwjgl.opengl.ARBProgram;
-import org.lwjgl.opengl.ARBVertexProgram;
-import org.lwjgl.opengl.GL11;
-
-final class ShaderFP extends Shader {
-
- final String vpFile;
- final String vpSource;
-
- final int vpID;
-
- final String fpFile;
- final String fpSource;
-
- final int fpID;
-
- ShaderFP(final String vpShaderFile, final String fpShaderFile) {
- // Initialize the vertex program.
- vpFile = vpShaderFile;
- vpSource = getShaderText(vpShaderFile);
-
- vpID = ARBProgram.glGenProgramsARB();
-
- ARBProgram.glBindProgramARB(ARBVertexProgram.GL_VERTEX_PROGRAM_ARB, vpID);
- ARBProgram.glProgramStringARB(ARBVertexProgram.GL_VERTEX_PROGRAM_ARB, ARBProgram.GL_PROGRAM_FORMAT_ASCII_ARB, vpSource);
-
- checkProgramError(vpFile, vpSource);
-
- // Initialize the fragment program.
- fpFile = fpShaderFile;
- fpSource = getShaderText(fpShaderFile);
-
- fpID = ARBProgram.glGenProgramsARB();
-
- ARBProgram.glBindProgramARB(ARBFragmentProgram.GL_FRAGMENT_PROGRAM_ARB, fpID);
- ARBProgram.glProgramStringARB(ARBFragmentProgram.GL_FRAGMENT_PROGRAM_ARB, ARBProgram.GL_PROGRAM_FORMAT_ASCII_ARB, fpSource);
-
- checkProgramError(fpFile, fpSource);
- }
-
- void render() {
- GL11.glEnable(ARBVertexProgram.GL_VERTEX_PROGRAM_ARB);
- ARBProgram.glBindProgramARB(ARBVertexProgram.GL_VERTEX_PROGRAM_ARB, vpID);
-
- GL11.glEnable(ARBFragmentProgram.GL_FRAGMENT_PROGRAM_ARB);
- ARBProgram.glBindProgramARB(ARBFragmentProgram.GL_FRAGMENT_PROGRAM_ARB, fpID);
-
- ARBProgram.glProgramLocalParameter4fARB(ARBVertexProgram.GL_VERTEX_PROGRAM_ARB, 0,
- ShadersTest.getSin(), ShadersTest.getSpecularity() * 8.0f, 0.0f, 0.0f);
-
- ARBProgram.glProgramLocalParameter4fARB(ARBFragmentProgram.GL_FRAGMENT_PROGRAM_ARB, 0,
- ShadersTest.getSin(), ShadersTest.getSpecularity() * 8.0f,
- -ShadersTest.getDisplayWidth() * 0.5f, -ShadersTest.getDisplayHeight() * 0.5f);
-
- ShadersTest.renderObject();
-
- GL11.glDisable(ARBVertexProgram.GL_VERTEX_PROGRAM_ARB);
- GL11.glDisable(ARBFragmentProgram.GL_FRAGMENT_PROGRAM_ARB);
- }
-
- void cleanup() {
- ARBProgram.glDeleteProgramsARB(vpID);
- ARBProgram.glDeleteProgramsARB(fpID);
- }
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+/*
+ * Created by LWJGL.
+ * User: spasi
+ * Date: 2004-03-30
+ * Time: 9:55:38 pm
+ */
+
+package org.lwjgl.test.opengl.shaders;
+
+import org.lwjgl.opengl.ARBFragmentProgram;
+import org.lwjgl.opengl.ARBProgram;
+import org.lwjgl.opengl.ARBVertexProgram;
+import org.lwjgl.opengl.GL11;
+
+final class ShaderFP extends Shader {
+
+ final String vpFile;
+ final String vpSource;
+
+ final int vpID;
+
+ final String fpFile;
+ final String fpSource;
+
+ final int fpID;
+
+ ShaderFP(final String vpShaderFile, final String fpShaderFile) {
+ // Initialize the vertex program.
+ vpFile = vpShaderFile;
+ vpSource = getShaderText(vpShaderFile);
+
+ vpID = ARBProgram.glGenProgramsARB();
+
+ ARBProgram.glBindProgramARB(ARBVertexProgram.GL_VERTEX_PROGRAM_ARB, vpID);
+ ARBProgram.glProgramStringARB(ARBVertexProgram.GL_VERTEX_PROGRAM_ARB, ARBProgram.GL_PROGRAM_FORMAT_ASCII_ARB, vpSource);
+
+ checkProgramError(vpFile, vpSource);
+
+ // Initialize the fragment program.
+ fpFile = fpShaderFile;
+ fpSource = getShaderText(fpShaderFile);
+
+ fpID = ARBProgram.glGenProgramsARB();
+
+ ARBProgram.glBindProgramARB(ARBFragmentProgram.GL_FRAGMENT_PROGRAM_ARB, fpID);
+ ARBProgram.glProgramStringARB(ARBFragmentProgram.GL_FRAGMENT_PROGRAM_ARB, ARBProgram.GL_PROGRAM_FORMAT_ASCII_ARB, fpSource);
+
+ checkProgramError(fpFile, fpSource);
+ }
+
+ void render() {
+ GL11.glEnable(ARBVertexProgram.GL_VERTEX_PROGRAM_ARB);
+ ARBProgram.glBindProgramARB(ARBVertexProgram.GL_VERTEX_PROGRAM_ARB, vpID);
+
+ GL11.glEnable(ARBFragmentProgram.GL_FRAGMENT_PROGRAM_ARB);
+ ARBProgram.glBindProgramARB(ARBFragmentProgram.GL_FRAGMENT_PROGRAM_ARB, fpID);
+
+ ARBProgram.glProgramLocalParameter4fARB(ARBVertexProgram.GL_VERTEX_PROGRAM_ARB, 0,
+ ShadersTest.getSin(), ShadersTest.getSpecularity() * 8.0f, 0.0f, 0.0f);
+
+ ARBProgram.glProgramLocalParameter4fARB(ARBFragmentProgram.GL_FRAGMENT_PROGRAM_ARB, 0,
+ ShadersTest.getSin(), ShadersTest.getSpecularity() * 8.0f,
+ -ShadersTest.getDisplayWidth() * 0.5f, -ShadersTest.getDisplayHeight() * 0.5f);
+
+ ShadersTest.renderObject();
+
+ GL11.glDisable(ARBVertexProgram.GL_VERTEX_PROGRAM_ARB);
+ GL11.glDisable(ARBFragmentProgram.GL_FRAGMENT_PROGRAM_ARB);
+ }
+
+ void cleanup() {
+ ARBProgram.glDeleteProgramsARB(vpID);
+ ARBProgram.glDeleteProgramsARB(fpID);
+ }
+
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/test/opengl/shaders/ShaderFSH.java b/src/java/org/lwjgl/test/opengl/shaders/ShaderFSH.java
index a69f48f..a90b917 100644
--- a/src/java/org/lwjgl/test/opengl/shaders/ShaderFSH.java
+++ b/src/java/org/lwjgl/test/opengl/shaders/ShaderFSH.java
@@ -1,127 +1,127 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-/*
- * Created by LWJGL.
- * User: spasi
- * Date: 2004-03-30
- * Time: 9:55:38 pm
- */
-
-package org.lwjgl.test.opengl.shaders;
-
-import org.lwjgl.opengl.ARBFragmentShader;
-import org.lwjgl.opengl.ARBShaderObjects;
-import org.lwjgl.opengl.ARBVertexShader;
-import org.lwjgl.opengl.GL11;
-
-final class ShaderFSH extends Shader {
-
- final String vshFile;
- final String vshSource;
-
- final int vshID;
-
- final String fshFile;
- final String fshSource;
-
- final int fshID;
-
- final int programID;
-
- final int uniformLocation;
-
- ShaderFSH(final String vshFile, final String fshFile) {
- // Initialize the vertex shader.
- this.vshFile = vshFile;
- vshSource = getShaderText(vshFile);
-
- vshID = ARBShaderObjects.glCreateShaderObjectARB(ARBVertexShader.GL_VERTEX_SHADER_ARB);
- ARBShaderObjects.glShaderSourceARB(vshID, vshSource);
- ARBShaderObjects.glCompileShaderARB(vshID);
-
- printShaderObjectInfoLog(this.vshFile, vshID);
-
- if ( ARBShaderObjects.glGetObjectParameteriARB(vshID, ARBShaderObjects.GL_OBJECT_COMPILE_STATUS_ARB) == GL11.GL_FALSE )
- ShadersTest.kill("A compilation error occured in a vertex shader.");
-
- // Initialize the fragment shader.
- this.fshFile = fshFile;
- fshSource = getShaderText(fshFile);
-
- fshID = ARBShaderObjects.glCreateShaderObjectARB(ARBFragmentShader.GL_FRAGMENT_SHADER_ARB);
- ARBShaderObjects.glShaderSourceARB(fshID, fshSource);
- ARBShaderObjects.glCompileShaderARB(fshID);
-
- printShaderObjectInfoLog(this.fshFile, fshID);
-
- if ( ARBShaderObjects.glGetObjectParameteriARB(fshID, ARBShaderObjects.GL_OBJECT_COMPILE_STATUS_ARB) == GL11.GL_FALSE )
- ShadersTest.kill("A compilation error occured in a fragment shader.");
-
- // Initialize the shader program.
- programID = ARBShaderObjects.glCreateProgramObjectARB();
-
- ARBShaderObjects.glAttachObjectARB(programID, vshID);
- ARBShaderObjects.glAttachObjectARB(programID, fshID);
-
- ARBShaderObjects.glLinkProgramARB(programID);
-
- printShaderProgramInfoLog(programID);
-
- if ( ARBShaderObjects.glGetObjectParameteriARB(programID, ARBShaderObjects.GL_OBJECT_LINK_STATUS_ARB) == GL11.GL_FALSE )
- ShadersTest.kill("A linking error occured in a shader program.");
-
- uniformLocation = getUniformLocation(programID, "UNIFORMS");
- }
-
- void render() {
- ARBShaderObjects.glUseProgramObjectARB(programID);
-
- ARBShaderObjects.glUniform4fARB(uniformLocation,
- ShadersTest.getSin(), ShadersTest.getSpecularity() * 8.0f,
- -ShadersTest.getDisplayWidth() * 0.5f, -ShadersTest.getDisplayHeight() * 0.5f);
-
- ShadersTest.renderObject();
-
- ARBShaderObjects.glUseProgramObjectARB(0);
- }
-
- void cleanup() {
- ARBShaderObjects.glDetachObjectARB(programID, vshID);
- ARBShaderObjects.glDetachObjectARB(programID, fshID);
-
- ARBShaderObjects.glDeleteObjectARB(vshID);
- ARBShaderObjects.glDeleteObjectARB(fshID);
-
- ARBShaderObjects.glDeleteObjectARB(programID);
- }
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+/*
+ * Created by LWJGL.
+ * User: spasi
+ * Date: 2004-03-30
+ * Time: 9:55:38 pm
+ */
+
+package org.lwjgl.test.opengl.shaders;
+
+import org.lwjgl.opengl.ARBFragmentShader;
+import org.lwjgl.opengl.ARBShaderObjects;
+import org.lwjgl.opengl.ARBVertexShader;
+import org.lwjgl.opengl.GL11;
+
+final class ShaderFSH extends Shader {
+
+ final String vshFile;
+ final String vshSource;
+
+ final int vshID;
+
+ final String fshFile;
+ final String fshSource;
+
+ final int fshID;
+
+ final int programID;
+
+ final int uniformLocation;
+
+ ShaderFSH(final String vshFile, final String fshFile) {
+ // Initialize the vertex shader.
+ this.vshFile = vshFile;
+ vshSource = getShaderText(vshFile);
+
+ vshID = ARBShaderObjects.glCreateShaderObjectARB(ARBVertexShader.GL_VERTEX_SHADER_ARB);
+ ARBShaderObjects.glShaderSourceARB(vshID, vshSource);
+ ARBShaderObjects.glCompileShaderARB(vshID);
+
+ printShaderObjectInfoLog(this.vshFile, vshID);
+
+ if ( ARBShaderObjects.glGetObjectParameteriARB(vshID, ARBShaderObjects.GL_OBJECT_COMPILE_STATUS_ARB) == GL11.GL_FALSE )
+ ShadersTest.kill("A compilation error occured in a vertex shader.");
+
+ // Initialize the fragment shader.
+ this.fshFile = fshFile;
+ fshSource = getShaderText(fshFile);
+
+ fshID = ARBShaderObjects.glCreateShaderObjectARB(ARBFragmentShader.GL_FRAGMENT_SHADER_ARB);
+ ARBShaderObjects.glShaderSourceARB(fshID, fshSource);
+ ARBShaderObjects.glCompileShaderARB(fshID);
+
+ printShaderObjectInfoLog(this.fshFile, fshID);
+
+ if ( ARBShaderObjects.glGetObjectParameteriARB(fshID, ARBShaderObjects.GL_OBJECT_COMPILE_STATUS_ARB) == GL11.GL_FALSE )
+ ShadersTest.kill("A compilation error occured in a fragment shader.");
+
+ // Initialize the shader program.
+ programID = ARBShaderObjects.glCreateProgramObjectARB();
+
+ ARBShaderObjects.glAttachObjectARB(programID, vshID);
+ ARBShaderObjects.glAttachObjectARB(programID, fshID);
+
+ ARBShaderObjects.glLinkProgramARB(programID);
+
+ printShaderProgramInfoLog(programID);
+
+ if ( ARBShaderObjects.glGetObjectParameteriARB(programID, ARBShaderObjects.GL_OBJECT_LINK_STATUS_ARB) == GL11.GL_FALSE )
+ ShadersTest.kill("A linking error occured in a shader program.");
+
+ uniformLocation = getUniformLocation(programID, "UNIFORMS");
+ }
+
+ void render() {
+ ARBShaderObjects.glUseProgramObjectARB(programID);
+
+ ARBShaderObjects.glUniform4fARB(uniformLocation,
+ ShadersTest.getSin(), ShadersTest.getSpecularity() * 8.0f,
+ -ShadersTest.getDisplayWidth() * 0.5f, -ShadersTest.getDisplayHeight() * 0.5f);
+
+ ShadersTest.renderObject();
+
+ ARBShaderObjects.glUseProgramObjectARB(0);
+ }
+
+ void cleanup() {
+ ARBShaderObjects.glDetachObjectARB(programID, vshID);
+ ARBShaderObjects.glDetachObjectARB(programID, fshID);
+
+ ARBShaderObjects.glDeleteObjectARB(vshID);
+ ARBShaderObjects.glDeleteObjectARB(fshID);
+
+ ARBShaderObjects.glDeleteObjectARB(programID);
+ }
+
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/test/opengl/shaders/ShaderUNI.java b/src/java/org/lwjgl/test/opengl/shaders/ShaderUNI.java
index a50278c..f5a9e41 100644
--- a/src/java/org/lwjgl/test/opengl/shaders/ShaderUNI.java
+++ b/src/java/org/lwjgl/test/opengl/shaders/ShaderUNI.java
@@ -1,164 +1,164 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-/*
- * Created by LWJGL.
- * User: spasi
- * Date: 2009-12-04
- */
-
-package org.lwjgl.test.opengl.shaders;
-
-import org.lwjgl.BufferUtils;
-import org.lwjgl.opengl.*;
-
-import java.nio.FloatBuffer;
-import java.nio.IntBuffer;
-
-final class ShaderUNI extends Shader {
-
- final String file;
- final String source;
-
- final int shaderID;
- final int programID;
-
- final int bufferID;
- final FloatBuffer buffer;
-
- final int uniformA_index;
- final int uniformA_offset;
-
- final int uniformB_index;
- final int uniformB_offset;
-
- ShaderUNI(final String shaderFile) {
- file = shaderFile;
- source = getShaderText(shaderFile);
-
- shaderID = GL20.glCreateShader(GL20.GL_VERTEX_SHADER);
- GL20.glShaderSource(shaderID, source);
- GL20.glCompileShader(shaderID);
-
- printShaderObjectInfoLog(file, shaderID);
-
- if ( GL20.glGetShader(shaderID, GL20.GL_COMPILE_STATUS) == GL11.GL_FALSE )
- ShadersTest.kill("A compilation error occured in a vertex shader.");
-
- programID = GL20.glCreateProgram();
-
- GL20.glAttachShader(programID, shaderID);
- GL20.glLinkProgram(programID);
-
- printShaderProgramInfoLog(programID);
-
- if ( GL20.glGetProgram(programID, GL20.GL_LINK_STATUS) == GL11.GL_FALSE )
- ShadersTest.kill("A linking error occured in a shader program.");
-
- final String[] uniformNames = { "uniformA", "uniformB" };
-
- // Get uniform block index and data size
- final int blockIndex = ARBUniformBufferObject.glGetUniformBlockIndex(programID, "test");
- final int blockSize = ARBUniformBufferObject.glGetActiveUniformBlock(programID, blockIndex, ARBUniformBufferObject.GL_UNIFORM_BLOCK_DATA_SIZE);
-
- System.out.println("blockSize = " + blockSize);
-
- // Create uniform buffer object and allocate a ByteBuffer
- bufferID = GL15.glGenBuffers();
- GL15.glBindBuffer(ARBUniformBufferObject.GL_UNIFORM_BUFFER, bufferID);
- GL15.glBufferData(ARBUniformBufferObject.GL_UNIFORM_BUFFER, blockSize, GL15.GL_DYNAMIC_DRAW);
- buffer = BufferUtils.createFloatBuffer(blockSize);
-
- // Attach UBO and associate uniform block to binding point 0
- ARBUniformBufferObject.glBindBufferBase(ARBUniformBufferObject.GL_UNIFORM_BUFFER, 0, bufferID);
- ARBUniformBufferObject.glUniformBlockBinding(programID, blockIndex, 0);
-
- // Get uniform information
- IntBuffer indexes = BufferUtils.createIntBuffer(uniformNames.length);
- IntBuffer params = BufferUtils.createIntBuffer(uniformNames.length);
-
- ARBUniformBufferObject.glGetUniformIndices(programID, uniformNames, indexes);
- uniformA_index = indexes.get(0);
- uniformB_index = indexes.get(1);
-
- ARBUniformBufferObject.glGetActiveUniforms(programID, indexes, ARBUniformBufferObject.GL_UNIFORM_OFFSET, params);
- uniformA_offset = params.get(0);
- uniformB_offset = params.get(1);
-
- System.out.println("\nuniformA index = " + uniformA_index);
- System.out.println("uniformB index = " + uniformB_index);
-
- System.out.println("\nuniformA offset = " + uniformA_offset + " - should be 0 for std140");
- System.out.println("uniformB offset = " + uniformB_offset + " - should be 16 for std140");
-
- Util.checkGLError();
- }
-
- void render() {
- GL20.glUseProgram(programID);
-
- //* -- std140 layout
- // Uniform A
- buffer.put(0, ShadersTest.getSin()).put(1, ShadersTest.getSpecularity() * 8.0f);
- // Uniform B - str140 alignment at 16 bytes
- buffer.put(4, 0.0f).put(5, 0.7f).put(6, 0.0f);
-
- GL15.glBindBuffer(ARBUniformBufferObject.GL_UNIFORM_BUFFER, bufferID);
- GL15.glBufferData(ARBUniformBufferObject.GL_UNIFORM_BUFFER, buffer, GL15.GL_DYNAMIC_DRAW);
- //*/
-
- /* -- non-std140 layout
- // Uniform A
- buffer.put(ShadersTest.getSin()).put(ShadersTest.getSpecularity() * 8.0f);
- buffer.flip();
- GL15.glBufferSubData(ARBUniformBufferObject.GL_UNIFORM_BUFFER, uniformA_offset, buffer);
- // Uniform B
- buffer.clear();
- buffer.put(0.0f).put(0.7f).put(0.0f);
- buffer.flip();
- GL15.glBufferSubData(ARBUniformBufferObject.GL_UNIFORM_BUFFER, uniformB_offset, buffer);
- //*/
-
- ShadersTest.renderObject();
-
- GL20.glUseProgram(0);
- }
-
- void cleanup() {
- GL15.glDeleteBuffers(bufferID);
-
- GL20.glDetachShader(programID, shaderID);
-
- GL20.glDeleteShader(shaderID);
- GL20.glDeleteProgram(programID);
- }
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+/*
+ * Created by LWJGL.
+ * User: spasi
+ * Date: 2009-12-04
+ */
+
+package org.lwjgl.test.opengl.shaders;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.opengl.*;
+
+import java.nio.FloatBuffer;
+import java.nio.IntBuffer;
+
+final class ShaderUNI extends Shader {
+
+ final String file;
+ final String source;
+
+ final int shaderID;
+ final int programID;
+
+ final int bufferID;
+ final FloatBuffer buffer;
+
+ final int uniformA_index;
+ final int uniformA_offset;
+
+ final int uniformB_index;
+ final int uniformB_offset;
+
+ ShaderUNI(final String shaderFile) {
+ file = shaderFile;
+ source = getShaderText(shaderFile);
+
+ shaderID = GL20.glCreateShader(GL20.GL_VERTEX_SHADER);
+ GL20.glShaderSource(shaderID, source);
+ GL20.glCompileShader(shaderID);
+
+ printShaderObjectInfoLog(file, shaderID);
+
+ if ( GL20.glGetShader(shaderID, GL20.GL_COMPILE_STATUS) == GL11.GL_FALSE )
+ ShadersTest.kill("A compilation error occured in a vertex shader.");
+
+ programID = GL20.glCreateProgram();
+
+ GL20.glAttachShader(programID, shaderID);
+ GL20.glLinkProgram(programID);
+
+ printShaderProgramInfoLog(programID);
+
+ if ( GL20.glGetProgram(programID, GL20.GL_LINK_STATUS) == GL11.GL_FALSE )
+ ShadersTest.kill("A linking error occured in a shader program.");
+
+ final String[] uniformNames = { "uniformA", "uniformB" };
+
+ // Get uniform block index and data size
+ final int blockIndex = ARBUniformBufferObject.glGetUniformBlockIndex(programID, "test");
+ final int blockSize = ARBUniformBufferObject.glGetActiveUniformBlock(programID, blockIndex, ARBUniformBufferObject.GL_UNIFORM_BLOCK_DATA_SIZE);
+
+ System.out.println("blockSize = " + blockSize);
+
+ // Create uniform buffer object and allocate a ByteBuffer
+ bufferID = GL15.glGenBuffers();
+ GL15.glBindBuffer(ARBUniformBufferObject.GL_UNIFORM_BUFFER, bufferID);
+ GL15.glBufferData(ARBUniformBufferObject.GL_UNIFORM_BUFFER, blockSize, GL15.GL_DYNAMIC_DRAW);
+ buffer = BufferUtils.createFloatBuffer(blockSize);
+
+ // Attach UBO and associate uniform block to binding point 0
+ ARBUniformBufferObject.glBindBufferBase(ARBUniformBufferObject.GL_UNIFORM_BUFFER, 0, bufferID);
+ ARBUniformBufferObject.glUniformBlockBinding(programID, blockIndex, 0);
+
+ // Get uniform information
+ IntBuffer indexes = BufferUtils.createIntBuffer(uniformNames.length);
+ IntBuffer params = BufferUtils.createIntBuffer(uniformNames.length);
+
+ ARBUniformBufferObject.glGetUniformIndices(programID, uniformNames, indexes);
+ uniformA_index = indexes.get(0);
+ uniformB_index = indexes.get(1);
+
+ ARBUniformBufferObject.glGetActiveUniforms(programID, indexes, ARBUniformBufferObject.GL_UNIFORM_OFFSET, params);
+ uniformA_offset = params.get(0);
+ uniformB_offset = params.get(1);
+
+ System.out.println("\nuniformA index = " + uniformA_index);
+ System.out.println("uniformB index = " + uniformB_index);
+
+ System.out.println("\nuniformA offset = " + uniformA_offset + " - should be 0 for std140");
+ System.out.println("uniformB offset = " + uniformB_offset + " - should be 16 for std140");
+
+ Util.checkGLError();
+ }
+
+ void render() {
+ GL20.glUseProgram(programID);
+
+ //* -- std140 layout
+ // Uniform A
+ buffer.put(0, ShadersTest.getSin()).put(1, ShadersTest.getSpecularity() * 8.0f);
+ // Uniform B - str140 alignment at 16 bytes
+ buffer.put(4, 0.0f).put(5, 0.7f).put(6, 0.0f);
+
+ GL15.glBindBuffer(ARBUniformBufferObject.GL_UNIFORM_BUFFER, bufferID);
+ GL15.glBufferData(ARBUniformBufferObject.GL_UNIFORM_BUFFER, buffer, GL15.GL_DYNAMIC_DRAW);
+ //*/
+
+ /* -- non-std140 layout
+ // Uniform A
+ buffer.put(ShadersTest.getSin()).put(ShadersTest.getSpecularity() * 8.0f);
+ buffer.flip();
+ GL15.glBufferSubData(ARBUniformBufferObject.GL_UNIFORM_BUFFER, uniformA_offset, buffer);
+ // Uniform B
+ buffer.clear();
+ buffer.put(0.0f).put(0.7f).put(0.0f);
+ buffer.flip();
+ GL15.glBufferSubData(ARBUniformBufferObject.GL_UNIFORM_BUFFER, uniformB_offset, buffer);
+ //*/
+
+ ShadersTest.renderObject();
+
+ GL20.glUseProgram(0);
+ }
+
+ void cleanup() {
+ GL15.glDeleteBuffers(bufferID);
+
+ GL20.glDetachShader(programID, shaderID);
+
+ GL20.glDeleteShader(shaderID);
+ GL20.glDeleteProgram(programID);
+ }
+
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/test/opengl/shaders/ShaderVP.java b/src/java/org/lwjgl/test/opengl/shaders/ShaderVP.java
index 72876be..024eac4 100644
--- a/src/java/org/lwjgl/test/opengl/shaders/ShaderVP.java
+++ b/src/java/org/lwjgl/test/opengl/shaders/ShaderVP.java
@@ -1,80 +1,80 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-/*
- * Created by LWJGL.
- * User: spasi
- * Date: 2004-03-30
- * Time: 9:55:38 pm
- */
-
-package org.lwjgl.test.opengl.shaders;
-
-import org.lwjgl.opengl.ARBProgram;
-import org.lwjgl.opengl.ARBVertexProgram;
-import org.lwjgl.opengl.GL11;
-
-final class ShaderVP extends Shader {
-
- final String file;
- final String source;
-
- final int ID;
-
- ShaderVP(final String shaderFile) {
- file = shaderFile;
- source = getShaderText(shaderFile);
-
- ID = ARBProgram.glGenProgramsARB();
-
- ARBProgram.glBindProgramARB(ARBVertexProgram.GL_VERTEX_PROGRAM_ARB, ID);
- ARBProgram.glProgramStringARB(ARBVertexProgram.GL_VERTEX_PROGRAM_ARB, ARBProgram.GL_PROGRAM_FORMAT_ASCII_ARB, source);
-
- checkProgramError(file, source);
- }
-
- void render() {
- GL11.glEnable(ARBVertexProgram.GL_VERTEX_PROGRAM_ARB);
- ARBProgram.glBindProgramARB(ARBVertexProgram.GL_VERTEX_PROGRAM_ARB, ID);
-
- ARBProgram.glProgramLocalParameter4fARB(ARBVertexProgram.GL_VERTEX_PROGRAM_ARB, 0,
- ShadersTest.getSin(), ShadersTest.getSpecularity() * 8.0f, 0.0f, 0.0f);
-
- ShadersTest.renderObject();
-
- GL11.glDisable(ARBVertexProgram.GL_VERTEX_PROGRAM_ARB);
- }
-
- void cleanup() {
- ARBProgram.glDeleteProgramsARB(ID);
- }
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+/*
+ * Created by LWJGL.
+ * User: spasi
+ * Date: 2004-03-30
+ * Time: 9:55:38 pm
+ */
+
+package org.lwjgl.test.opengl.shaders;
+
+import org.lwjgl.opengl.ARBProgram;
+import org.lwjgl.opengl.ARBVertexProgram;
+import org.lwjgl.opengl.GL11;
+
+final class ShaderVP extends Shader {
+
+ final String file;
+ final String source;
+
+ final int ID;
+
+ ShaderVP(final String shaderFile) {
+ file = shaderFile;
+ source = getShaderText(shaderFile);
+
+ ID = ARBProgram.glGenProgramsARB();
+
+ ARBProgram.glBindProgramARB(ARBVertexProgram.GL_VERTEX_PROGRAM_ARB, ID);
+ ARBProgram.glProgramStringARB(ARBVertexProgram.GL_VERTEX_PROGRAM_ARB, ARBProgram.GL_PROGRAM_FORMAT_ASCII_ARB, source);
+
+ checkProgramError(file, source);
+ }
+
+ void render() {
+ GL11.glEnable(ARBVertexProgram.GL_VERTEX_PROGRAM_ARB);
+ ARBProgram.glBindProgramARB(ARBVertexProgram.GL_VERTEX_PROGRAM_ARB, ID);
+
+ ARBProgram.glProgramLocalParameter4fARB(ARBVertexProgram.GL_VERTEX_PROGRAM_ARB, 0,
+ ShadersTest.getSin(), ShadersTest.getSpecularity() * 8.0f, 0.0f, 0.0f);
+
+ ShadersTest.renderObject();
+
+ GL11.glDisable(ARBVertexProgram.GL_VERTEX_PROGRAM_ARB);
+ }
+
+ void cleanup() {
+ ARBProgram.glDeleteProgramsARB(ID);
+ }
+
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/test/opengl/shaders/ShaderVSH.java b/src/java/org/lwjgl/test/opengl/shaders/ShaderVSH.java
index 53fc35e..3130154 100644
--- a/src/java/org/lwjgl/test/opengl/shaders/ShaderVSH.java
+++ b/src/java/org/lwjgl/test/opengl/shaders/ShaderVSH.java
@@ -1,98 +1,98 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-/*
- * Created by LWJGL.
- * User: spasi
- * Date: 2004-03-30
- * Time: 9:55:38 pm
- */
-
-package org.lwjgl.test.opengl.shaders;
-
-import org.lwjgl.opengl.ARBShaderObjects;
-import org.lwjgl.opengl.ARBVertexShader;
-import org.lwjgl.opengl.GL11;
-
-final class ShaderVSH extends Shader {
-
- final String file;
- final String source;
-
- final int shaderID;
- final int programID;
-
- final int uniformLocation;
-
- ShaderVSH(final String shaderFile) {
- file = shaderFile;
- source = getShaderText(shaderFile);
-
- shaderID = ARBShaderObjects.glCreateShaderObjectARB(ARBVertexShader.GL_VERTEX_SHADER_ARB);
- ARBShaderObjects.glShaderSourceARB(shaderID, source);
- ARBShaderObjects.glCompileShaderARB(shaderID);
-
- printShaderObjectInfoLog(file, shaderID);
-
- if ( ARBShaderObjects.glGetObjectParameteriARB(shaderID, ARBShaderObjects.GL_OBJECT_COMPILE_STATUS_ARB) == GL11.GL_FALSE )
- ShadersTest.kill("A compilation error occured in a vertex shader.");
-
- programID = ARBShaderObjects.glCreateProgramObjectARB();
-
- ARBShaderObjects.glAttachObjectARB(programID, shaderID);
- ARBShaderObjects.glLinkProgramARB(programID);
-
- printShaderProgramInfoLog(programID);
-
- if ( ARBShaderObjects.glGetObjectParameteriARB(programID, ARBShaderObjects.GL_OBJECT_LINK_STATUS_ARB) == GL11.GL_FALSE )
- ShadersTest.kill("A linking error occured in a shader program.");
-
- uniformLocation = getUniformLocation(programID, "UNIFORMS");
- }
-
- void render() {
- ARBShaderObjects.glUseProgramObjectARB(programID);
-
- ARBShaderObjects.glUniform2fARB(uniformLocation, ShadersTest.getSin(), ShadersTest.getSpecularity() * 8.0f);
-
- ShadersTest.renderObject();
-
- ARBShaderObjects.glUseProgramObjectARB(0);
- }
-
- void cleanup() {
- ARBShaderObjects.glDetachObjectARB(programID, shaderID);
-
- ARBShaderObjects.glDeleteObjectARB(shaderID);
- ARBShaderObjects.glDeleteObjectARB(programID);
- }
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+/*
+ * Created by LWJGL.
+ * User: spasi
+ * Date: 2004-03-30
+ * Time: 9:55:38 pm
+ */
+
+package org.lwjgl.test.opengl.shaders;
+
+import org.lwjgl.opengl.ARBShaderObjects;
+import org.lwjgl.opengl.ARBVertexShader;
+import org.lwjgl.opengl.GL11;
+
+final class ShaderVSH extends Shader {
+
+ final String file;
+ final String source;
+
+ final int shaderID;
+ final int programID;
+
+ final int uniformLocation;
+
+ ShaderVSH(final String shaderFile) {
+ file = shaderFile;
+ source = getShaderText(shaderFile);
+
+ shaderID = ARBShaderObjects.glCreateShaderObjectARB(ARBVertexShader.GL_VERTEX_SHADER_ARB);
+ ARBShaderObjects.glShaderSourceARB(shaderID, source);
+ ARBShaderObjects.glCompileShaderARB(shaderID);
+
+ printShaderObjectInfoLog(file, shaderID);
+
+ if ( ARBShaderObjects.glGetObjectParameteriARB(shaderID, ARBShaderObjects.GL_OBJECT_COMPILE_STATUS_ARB) == GL11.GL_FALSE )
+ ShadersTest.kill("A compilation error occured in a vertex shader.");
+
+ programID = ARBShaderObjects.glCreateProgramObjectARB();
+
+ ARBShaderObjects.glAttachObjectARB(programID, shaderID);
+ ARBShaderObjects.glLinkProgramARB(programID);
+
+ printShaderProgramInfoLog(programID);
+
+ if ( ARBShaderObjects.glGetObjectParameteriARB(programID, ARBShaderObjects.GL_OBJECT_LINK_STATUS_ARB) == GL11.GL_FALSE )
+ ShadersTest.kill("A linking error occured in a shader program.");
+
+ uniformLocation = getUniformLocation(programID, "UNIFORMS");
+ }
+
+ void render() {
+ ARBShaderObjects.glUseProgramObjectARB(programID);
+
+ ARBShaderObjects.glUniform2fARB(uniformLocation, ShadersTest.getSin(), ShadersTest.getSpecularity() * 8.0f);
+
+ ShadersTest.renderObject();
+
+ ARBShaderObjects.glUseProgramObjectARB(0);
+ }
+
+ void cleanup() {
+ ARBShaderObjects.glDetachObjectARB(programID, shaderID);
+
+ ARBShaderObjects.glDeleteObjectARB(shaderID);
+ ARBShaderObjects.glDeleteObjectARB(programID);
+ }
+
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/test/opengl/shaders/ShadersTest.java b/src/java/org/lwjgl/test/opengl/shaders/ShadersTest.java
index 4cdb311..e7a977e 100644
--- a/src/java/org/lwjgl/test/opengl/shaders/ShadersTest.java
+++ b/src/java/org/lwjgl/test/opengl/shaders/ShadersTest.java
@@ -1,345 +1,345 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-/*
- * Created by LWJGL.
- * User: spasi
- * Date: 2004-03-30
- * Time: 8:41:42 pm
- */
-
-package org.lwjgl.test.opengl.shaders;
-
-import java.nio.FloatBuffer;
-
-import org.lwjgl.BufferUtils;
-import org.lwjgl.LWJGLException;
-import org.lwjgl.Sys;
-import org.lwjgl.input.Keyboard;
-import org.lwjgl.input.Mouse;
-import org.lwjgl.opengl.*;
-import org.lwjgl.util.glu.GLU;
-import org.lwjgl.util.glu.Sphere;
-
-public final class ShadersTest {
-
- private static DisplayMode displayMode;
-
- private static boolean run = true;
-
- private static final FloatBuffer vectorBuffer = BufferUtils.createFloatBuffer(4);
-
- private static Sphere sphere;
-
- private static Shader shader;
-
- private static float frameTime;
-
- private static float angle;
- private static float sin;
- private static int specularity = 4;
-
- private ShadersTest() {
- }
-
- public static void main(String[] args) {
- initialize(args);
-
- long frameStart;
- long lastFrameTime = 0;
-
- while ( run ) {
- if (!Display.isVisible() )
- Thread.yield();
- else {
- // This is the current frame time.
- frameStart = Sys.getTime();
-
- // How many seconds passed since last frame.
- frameTime = (float)((frameStart - lastFrameTime) / (double)Sys.getTimerResolution());
-
- lastFrameTime = frameStart;
-
- //angle += frameTime * 90.0f;
- angle += 0.1f;
- sin = (float)Math.sin(Math.toRadians(angle));
-
- handleIO();
-
- GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
-
- if ( shader != null )
- shader.render();
- else
- renderObject();
-
- // Restore camera position.
- GL11.glPopMatrix();
- GL11.glPushMatrix();
- }
-
- Display.update();
-
- if ( Display.isCloseRequested() )
- break;
- }
-
- cleanup();
- System.exit(0);
- }
-
- private static void initialize(String[] args) {
- if ( args.length != 1 )
- argsError();
-
- try {
- DisplayMode[] modes = Display.getAvailableDisplayModes();
-
- DisplayMode displayMode;
-
- displayMode = chooseMode(modes, 1024, 768);
- if ( displayMode == null )
- displayMode = chooseMode(modes, 800, 600);
- if ( displayMode == null )
- displayMode = chooseMode(modes, 640, 480);
- if ( displayMode == null )
- kill("Failed to set an appropriate display mode.");
-
- System.out.println("Setting display mode to: " + displayMode);
- Display.setDisplayMode(displayMode);
- Display.create(new PixelFormat(8, 24, 0), "UNI".equalsIgnoreCase(args[0]) ? new ContextAttribs(3, 1) : null);
- ShadersTest.displayMode = displayMode;
- } catch (LWJGLException e) {
- kill(e.getMessage());
- }
-
- final ContextCapabilities caps = GLContext.getCapabilities();
-
- if ( "NONE".equalsIgnoreCase(args[0]) ) {
- shader = null;
- } else if ( "VP".equalsIgnoreCase(args[0]) ) {
- if ( !caps.GL_ARB_vertex_program )
- kill("The ARB_vertex_program extension is not supported.");
-
- shader = new ShaderVP("shaderVP.vp");
- } else if ( "FP".equalsIgnoreCase(args[0]) ) {
- if ( !caps.GL_ARB_vertex_program )
- kill("The ARB_vertex_program extension is not supported.");
- if ( !caps.GL_ARB_fragment_program )
- kill("The ARB_fragment_program extension is not supported.");
-
- shader = new ShaderFP("shaderFP.vp", "shaderFP.fp");
- } else if ( "VSH".equalsIgnoreCase(args[0]) ) {
- if ( !caps.GL_ARB_vertex_shader )
- kill("The ARB_vertex_shader extension is not supported.");
-
- shader = new ShaderVSH("shaderVSH.vsh");
- } else if ( "FSH".equalsIgnoreCase(args[0]) ) {
- if ( !caps.GL_ARB_vertex_shader )
- kill("The ARB_vertex_shader extension is not supported.");
- if ( !caps.GL_ARB_fragment_shader )
- kill("The ARB_fragment_shader extension is not supported.");
-
- shader = new ShaderFSH("shaderFSH.vsh", "shaderFSH.fsh");
- } else if ("UNI".equalsIgnoreCase(args[0]) ) {
- if ( !(caps.OpenGL31 || caps.GL_ARB_uniform_buffer_object) )
- kill("Neither OpenGL version 3.1 nor ARB_uniform_buffer_object are supported.");
-
- shader = new ShaderUNI("shaderUNI.vsh");
- } else {
- argsError();
- }
-
- GL11.glViewport(0, 0, displayMode.getWidth(), displayMode.getHeight());
-
- GL11.glMatrixMode(GL11.GL_PROJECTION);
- GL11.glLoadIdentity();
- GLU.gluPerspective(45, displayMode.getWidth() / (float)displayMode.getHeight(), 1.0f, 10.0f);
-
- GL11.glMatrixMode(GL11.GL_MODELVIEW);
- GL11.glLoadIdentity();
-
- // Setup camera position.
- GL11.glTranslatef(0.0f, 0.0f, -4.0f);
- GL11.glRotatef(15.0f, 1.0f, 0.0f, 0.0f);
- GL11.glPushMatrix();
-
- GL11.glClearDepth(1.0f);
- GL11.glDepthFunc(GL11.GL_LEQUAL);
-
- GL11.glHint(GL11.GL_PERSPECTIVE_CORRECTION_HINT, GL11.GL_NICEST);
-
- GL11.glFrontFace(GL11.GL_CCW);
- GL11.glPolygonMode(GL11.GL_FRONT, GL11.GL_FILL);
-
- GL11.glCullFace(GL11.GL_BACK);
- GL11.glEnable(GL11.GL_CULL_FACE);
-
- GL11.glAlphaFunc(GL11.GL_NOTEQUAL, 0.0f);
- GL11.glEnable(GL11.GL_ALPHA_TEST);
-
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
- GL11.glEnable(GL11.GL_BLEND);
-
- // Setup lighting for when we have fixed function fragment rendering.
- GL11.glShadeModel(GL11.GL_SMOOTH);
-
- if ( shader == null ) {
- GL11.glEnable(GL11.GL_LIGHTING);
- GL11.glEnable(GL11.GL_LIGHT0);
- }
-
- vectorBuffer.clear();
- vectorBuffer.put(1.0f).put(1.0f).put(1.0f).put(1.0f);
- vectorBuffer.clear();
- GL11.glLight(GL11.GL_LIGHT0, GL11.GL_DIFFUSE, vectorBuffer);
-
- vectorBuffer.put(1.0f).put(1.0f).put(1.0f).put(1.0f);
- vectorBuffer.clear();
- GL11.glLight(GL11.GL_LIGHT0, GL11.GL_AMBIENT, vectorBuffer);
-
- vectorBuffer.put(1.0f).put(1.0f).put(0.5f).put(1.0f);
- vectorBuffer.clear();
- GL11.glLight(GL11.GL_LIGHT0, GL11.GL_SPECULAR, vectorBuffer);
-
- vectorBuffer.put(-1.0f / 3.0f).put(1.0f / 3.0f).put(1.0f / 3.0f).put(0.0f); // Infinite
- vectorBuffer.clear();
- GL11.glLight(GL11.GL_LIGHT0, GL11.GL_POSITION, vectorBuffer);
-
- vectorBuffer.put(0.2f).put(0.2f).put(0.2f).put(1.0f);
- vectorBuffer.clear();
- GL11.glLightModel(GL11.GL_LIGHT_MODEL_AMBIENT, vectorBuffer);
-
- sphere = new Sphere();
- }
-
- private static void handleIO() {
- if ( Keyboard.getNumKeyboardEvents() != 0 ) {
- while ( Keyboard.next() ) {
- if ( Keyboard.getEventKeyState() )
- continue;
-
- switch ( Keyboard.getEventKey() ) {
- case Keyboard.KEY_EQUALS:
- if ( specularity < 8 )
- specularity++;
- break;
- case Keyboard.KEY_MINUS:
- if ( specularity > 1 )
- specularity--;
- break;
- case Keyboard.KEY_ESCAPE:
- run = false;
- break;
- }
- }
- }
-
- while ( Mouse.next() ) ;
- }
-
- static int getDisplayWidth() {
- return displayMode.getWidth();
- }
-
- static int getDisplayHeight() {
- return displayMode.getHeight();
- }
-
- static float getSin() {
- return sin;
- }
-
- static int getSpecularity() {
- return specularity;
- }
-
- static void renderObject() {
- GL11.glColor3b((byte)255, (byte)255, (byte)255);
- sphere.draw(1.0f, 32, 32);
- }
-
- private static DisplayMode chooseMode(DisplayMode[] modes, int width, int height) {
- DisplayMode bestMode = null;
-
- for ( int i = 0; i < modes.length; i++ ) {
- DisplayMode mode = modes[i];
- if ( mode.getWidth() == width && mode.getHeight() == height && mode.getFrequency() <= 85 ) {
- if ( bestMode == null || (mode.getBitsPerPixel() >= bestMode.getBitsPerPixel() && mode.getFrequency() > bestMode.getFrequency()) )
- bestMode = mode;
- }
- }
-
- return bestMode;
- }
-
- private static void cleanup() {
- // This is not necessary, just showing how to properly delete a program/shader.
- if ( shader != null )
- shader.cleanup();
-
- if ( Display.isCreated() )
- Display.destroy();
- }
-
- private static void argsError() {
- System.out.println("\nInvalid program arguments.");
- System.out.println("\nUsage: ShadersTest <shaderType>, where <shaderType> argument can be one of the following:\n");
- System.out.println("none\t- Use fixed function rendering.");
- System.out.println("vp\t- Use ARB_vertex_program (low-level) only.");
- System.out.println("vsh\t- Use ARB_vertex_shader (GLSL) only.");
- System.out.println("fp\t- Use ARB_vertex_program + ARB_fragment_program (low-level).");
- System.out.println("fsh\t- Use ARB_vertex_shader + ARB_fragment_shader (GLSL).");
- System.out.println("uni\t- Use ARB_uniform_buffer_object to update shader uniforms (GLSL).");
-
- cleanup();
- System.exit(-1);
- }
-
- static void kill(String reason) {
- System.out.println("The ShaderTest program was terminated because an error occured.\n");
- System.out.println("Reason: " + (reason == null ? "Unknown" : reason));
-
- cleanup();
- System.exit(-1);
- }
-
- static void kill(String reason, Throwable t) {
- System.out.println("The ShaderTest program was terminated because an exception occured.\n");
- System.out.println("Reason: " + reason == null ? "Unknown" : reason);
-
- System.out.println("Exception message: " + t.getMessage());
-
- cleanup();
- System.exit(-1);
- }
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+/*
+ * Created by LWJGL.
+ * User: spasi
+ * Date: 2004-03-30
+ * Time: 8:41:42 pm
+ */
+
+package org.lwjgl.test.opengl.shaders;
+
+import java.nio.FloatBuffer;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.LWJGLException;
+import org.lwjgl.Sys;
+import org.lwjgl.input.Keyboard;
+import org.lwjgl.input.Mouse;
+import org.lwjgl.opengl.*;
+import org.lwjgl.util.glu.GLU;
+import org.lwjgl.util.glu.Sphere;
+
+public final class ShadersTest {
+
+ private static DisplayMode displayMode;
+
+ private static boolean run = true;
+
+ private static final FloatBuffer vectorBuffer = BufferUtils.createFloatBuffer(4);
+
+ private static Sphere sphere;
+
+ private static Shader shader;
+
+ private static float frameTime;
+
+ private static float angle;
+ private static float sin;
+ private static int specularity = 4;
+
+ private ShadersTest() {
+ }
+
+ public static void main(String[] args) {
+ initialize(args);
+
+ long frameStart;
+ long lastFrameTime = 0;
+
+ while ( run ) {
+ if (!Display.isVisible() )
+ Thread.yield();
+ else {
+ // This is the current frame time.
+ frameStart = Sys.getTime();
+
+ // How many seconds passed since last frame.
+ frameTime = (float)((frameStart - lastFrameTime) / (double)Sys.getTimerResolution());
+
+ lastFrameTime = frameStart;
+
+ //angle += frameTime * 90.0f;
+ angle += 0.1f;
+ sin = (float)Math.sin(Math.toRadians(angle));
+
+ handleIO();
+
+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
+
+ if ( shader != null )
+ shader.render();
+ else
+ renderObject();
+
+ // Restore camera position.
+ GL11.glPopMatrix();
+ GL11.glPushMatrix();
+ }
+
+ Display.update();
+
+ if ( Display.isCloseRequested() )
+ break;
+ }
+
+ cleanup();
+ System.exit(0);
+ }
+
+ private static void initialize(String[] args) {
+ if ( args.length != 1 )
+ argsError();
+
+ try {
+ DisplayMode[] modes = Display.getAvailableDisplayModes();
+
+ DisplayMode displayMode;
+
+ displayMode = chooseMode(modes, 1024, 768);
+ if ( displayMode == null )
+ displayMode = chooseMode(modes, 800, 600);
+ if ( displayMode == null )
+ displayMode = chooseMode(modes, 640, 480);
+ if ( displayMode == null )
+ kill("Failed to set an appropriate display mode.");
+
+ System.out.println("Setting display mode to: " + displayMode);
+ Display.setDisplayMode(displayMode);
+ Display.create(new PixelFormat(8, 24, 0), "UNI".equalsIgnoreCase(args[0]) ? new ContextAttribs(3, 1) : null);
+ ShadersTest.displayMode = displayMode;
+ } catch (LWJGLException e) {
+ kill(e.getMessage());
+ }
+
+ final ContextCapabilities caps = GLContext.getCapabilities();
+
+ if ( "NONE".equalsIgnoreCase(args[0]) ) {
+ shader = null;
+ } else if ( "VP".equalsIgnoreCase(args[0]) ) {
+ if ( !caps.GL_ARB_vertex_program )
+ kill("The ARB_vertex_program extension is not supported.");
+
+ shader = new ShaderVP("shaderVP.vp");
+ } else if ( "FP".equalsIgnoreCase(args[0]) ) {
+ if ( !caps.GL_ARB_vertex_program )
+ kill("The ARB_vertex_program extension is not supported.");
+ if ( !caps.GL_ARB_fragment_program )
+ kill("The ARB_fragment_program extension is not supported.");
+
+ shader = new ShaderFP("shaderFP.vp", "shaderFP.fp");
+ } else if ( "VSH".equalsIgnoreCase(args[0]) ) {
+ if ( !caps.GL_ARB_vertex_shader )
+ kill("The ARB_vertex_shader extension is not supported.");
+
+ shader = new ShaderVSH("shaderVSH.vsh");
+ } else if ( "FSH".equalsIgnoreCase(args[0]) ) {
+ if ( !caps.GL_ARB_vertex_shader )
+ kill("The ARB_vertex_shader extension is not supported.");
+ if ( !caps.GL_ARB_fragment_shader )
+ kill("The ARB_fragment_shader extension is not supported.");
+
+ shader = new ShaderFSH("shaderFSH.vsh", "shaderFSH.fsh");
+ } else if ("UNI".equalsIgnoreCase(args[0]) ) {
+ if ( !(caps.OpenGL31 || caps.GL_ARB_uniform_buffer_object) )
+ kill("Neither OpenGL version 3.1 nor ARB_uniform_buffer_object are supported.");
+
+ shader = new ShaderUNI("shaderUNI.vsh");
+ } else {
+ argsError();
+ }
+
+ GL11.glViewport(0, 0, displayMode.getWidth(), displayMode.getHeight());
+
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+ GL11.glLoadIdentity();
+ GLU.gluPerspective(45, displayMode.getWidth() / (float)displayMode.getHeight(), 1.0f, 10.0f);
+
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ GL11.glLoadIdentity();
+
+ // Setup camera position.
+ GL11.glTranslatef(0.0f, 0.0f, -4.0f);
+ GL11.glRotatef(15.0f, 1.0f, 0.0f, 0.0f);
+ GL11.glPushMatrix();
+
+ GL11.glClearDepth(1.0f);
+ GL11.glDepthFunc(GL11.GL_LEQUAL);
+
+ GL11.glHint(GL11.GL_PERSPECTIVE_CORRECTION_HINT, GL11.GL_NICEST);
+
+ GL11.glFrontFace(GL11.GL_CCW);
+ GL11.glPolygonMode(GL11.GL_FRONT, GL11.GL_FILL);
+
+ GL11.glCullFace(GL11.GL_BACK);
+ GL11.glEnable(GL11.GL_CULL_FACE);
+
+ GL11.glAlphaFunc(GL11.GL_NOTEQUAL, 0.0f);
+ GL11.glEnable(GL11.GL_ALPHA_TEST);
+
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ GL11.glEnable(GL11.GL_BLEND);
+
+ // Setup lighting for when we have fixed function fragment rendering.
+ GL11.glShadeModel(GL11.GL_SMOOTH);
+
+ if ( shader == null ) {
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glEnable(GL11.GL_LIGHT0);
+ }
+
+ vectorBuffer.clear();
+ vectorBuffer.put(1.0f).put(1.0f).put(1.0f).put(1.0f);
+ vectorBuffer.clear();
+ GL11.glLight(GL11.GL_LIGHT0, GL11.GL_DIFFUSE, vectorBuffer);
+
+ vectorBuffer.put(1.0f).put(1.0f).put(1.0f).put(1.0f);
+ vectorBuffer.clear();
+ GL11.glLight(GL11.GL_LIGHT0, GL11.GL_AMBIENT, vectorBuffer);
+
+ vectorBuffer.put(1.0f).put(1.0f).put(0.5f).put(1.0f);
+ vectorBuffer.clear();
+ GL11.glLight(GL11.GL_LIGHT0, GL11.GL_SPECULAR, vectorBuffer);
+
+ vectorBuffer.put(-1.0f / 3.0f).put(1.0f / 3.0f).put(1.0f / 3.0f).put(0.0f); // Infinite
+ vectorBuffer.clear();
+ GL11.glLight(GL11.GL_LIGHT0, GL11.GL_POSITION, vectorBuffer);
+
+ vectorBuffer.put(0.2f).put(0.2f).put(0.2f).put(1.0f);
+ vectorBuffer.clear();
+ GL11.glLightModel(GL11.GL_LIGHT_MODEL_AMBIENT, vectorBuffer);
+
+ sphere = new Sphere();
+ }
+
+ private static void handleIO() {
+ if ( Keyboard.getNumKeyboardEvents() != 0 ) {
+ while ( Keyboard.next() ) {
+ if ( Keyboard.getEventKeyState() )
+ continue;
+
+ switch ( Keyboard.getEventKey() ) {
+ case Keyboard.KEY_EQUALS:
+ if ( specularity < 8 )
+ specularity++;
+ break;
+ case Keyboard.KEY_MINUS:
+ if ( specularity > 1 )
+ specularity--;
+ break;
+ case Keyboard.KEY_ESCAPE:
+ run = false;
+ break;
+ }
+ }
+ }
+
+ while ( Mouse.next() ) ;
+ }
+
+ static int getDisplayWidth() {
+ return displayMode.getWidth();
+ }
+
+ static int getDisplayHeight() {
+ return displayMode.getHeight();
+ }
+
+ static float getSin() {
+ return sin;
+ }
+
+ static int getSpecularity() {
+ return specularity;
+ }
+
+ static void renderObject() {
+ GL11.glColor3b((byte)255, (byte)255, (byte)255);
+ sphere.draw(1.0f, 32, 32);
+ }
+
+ private static DisplayMode chooseMode(DisplayMode[] modes, int width, int height) {
+ DisplayMode bestMode = null;
+
+ for ( int i = 0; i < modes.length; i++ ) {
+ DisplayMode mode = modes[i];
+ if ( mode.getWidth() == width && mode.getHeight() == height && mode.getFrequency() <= 85 ) {
+ if ( bestMode == null || (mode.getBitsPerPixel() >= bestMode.getBitsPerPixel() && mode.getFrequency() > bestMode.getFrequency()) )
+ bestMode = mode;
+ }
+ }
+
+ return bestMode;
+ }
+
+ private static void cleanup() {
+ // This is not necessary, just showing how to properly delete a program/shader.
+ if ( shader != null )
+ shader.cleanup();
+
+ if ( Display.isCreated() )
+ Display.destroy();
+ }
+
+ private static void argsError() {
+ System.out.println("\nInvalid program arguments.");
+ System.out.println("\nUsage: ShadersTest <shaderType>, where <shaderType> argument can be one of the following:\n");
+ System.out.println("none\t- Use fixed function rendering.");
+ System.out.println("vp\t- Use ARB_vertex_program (low-level) only.");
+ System.out.println("vsh\t- Use ARB_vertex_shader (GLSL) only.");
+ System.out.println("fp\t- Use ARB_vertex_program + ARB_fragment_program (low-level).");
+ System.out.println("fsh\t- Use ARB_vertex_shader + ARB_fragment_shader (GLSL).");
+ System.out.println("uni\t- Use ARB_uniform_buffer_object to update shader uniforms (GLSL).");
+
+ cleanup();
+ System.exit(-1);
+ }
+
+ static void kill(String reason) {
+ System.out.println("The ShaderTest program was terminated because an error occured.\n");
+ System.out.println("Reason: " + (reason == null ? "Unknown" : reason));
+
+ cleanup();
+ System.exit(-1);
+ }
+
+ static void kill(String reason, Throwable t) {
+ System.out.println("The ShaderTest program was terminated because an exception occured.\n");
+ System.out.println("Reason: " + reason == null ? "Unknown" : reason);
+
+ System.out.println("Exception message: " + t.getMessage());
+
+ cleanup();
+ System.exit(-1);
+ }
+
+}
diff --git a/src/java/org/lwjgl/test/opengl/shaders/shaderFP.fp b/src/java/org/lwjgl/test/opengl/shaders/shaderFP.fp
index bf11274..65c3ed2 100644
--- a/src/java/org/lwjgl/test/opengl/shaders/shaderFP.fp
+++ b/src/java/org/lwjgl/test/opengl/shaders/shaderFP.fp
@@ -1,40 +1,40 @@
-!!ARBfp1.0
-OPTION ARB_precision_hint_fastest;
-
-ATTRIB winPos = fragment.position;
-ATTRIB iDots = fragment.texcoord[0];
-
-PARAM ambience = state.lightmodel.ambient;
-
-PARAM specularColor = state.light[0].specular;
-
-PARAM UNIFORMS = program.local[0];
-
-TEMP temp;
-
-OUTPUT oColor = result.color;
-
-# Offset window-space fragment position.
-ADD temp.xyz, winPos, UNIFORMS.zwxx;
-# Normalize position.
-DP3 temp.w, temp, temp;
-RSQ temp.w, temp.w;
-MUL temp.xy, temp, temp.w;
-
-# Multiply with current sin.
-MUL temp.xy, temp, UNIFORMS.x;
-# {-1..1} => {0..1}
-MAD temp.xy, temp, 0.5, 0.5;
-# Intensify colors.
-MUL temp.xy, temp, 2.0;
-MOV temp.z, 1.0;
-
-# Accumulate color contributions.
-MAD temp.xyz, iDots.x, temp, ambience;
-# Calculate <specular dot product>^<specular exponent>
-POW temp.w, iDots.y, UNIFORMS.y;
-MAD oColor.xyz, temp.w, specularColor, temp;
-
-MOV oColor.w, 1.0;
-
+!!ARBfp1.0
+OPTION ARB_precision_hint_fastest;
+
+ATTRIB winPos = fragment.position;
+ATTRIB iDots = fragment.texcoord[0];
+
+PARAM ambience = state.lightmodel.ambient;
+
+PARAM specularColor = state.light[0].specular;
+
+PARAM UNIFORMS = program.local[0];
+
+TEMP temp;
+
+OUTPUT oColor = result.color;
+
+# Offset window-space fragment position.
+ADD temp.xyz, winPos, UNIFORMS.zwxx;
+# Normalize position.
+DP3 temp.w, temp, temp;
+RSQ temp.w, temp.w;
+MUL temp.xy, temp, temp.w;
+
+# Multiply with current sin.
+MUL temp.xy, temp, UNIFORMS.x;
+# {-1..1} => {0..1}
+MAD temp.xy, temp, 0.5, 0.5;
+# Intensify colors.
+MUL temp.xy, temp, 2.0;
+MOV temp.z, 1.0;
+
+# Accumulate color contributions.
+MAD temp.xyz, iDots.x, temp, ambience;
+# Calculate <specular dot product>^<specular exponent>
+POW temp.w, iDots.y, UNIFORMS.y;
+MAD oColor.xyz, temp.w, specularColor, temp;
+
+MOV oColor.w, 1.0;
+
END
\ No newline at end of file
diff --git a/src/java/org/lwjgl/test/opengl/shaders/shaderFP.vp b/src/java/org/lwjgl/test/opengl/shaders/shaderFP.vp
index 8b14a96..d6407f9 100644
--- a/src/java/org/lwjgl/test/opengl/shaders/shaderFP.vp
+++ b/src/java/org/lwjgl/test/opengl/shaders/shaderFP.vp
@@ -1,37 +1,37 @@
-!!ARBvp1.0
-
-ATTRIB iPos = vertex.position;
-ATTRIB iNormal = vertex.normal;
-
-PARAM mvp[4] = { state.matrix.mvp };
-PARAM mvIT[4] = { state.matrix.modelview.invtrans };
-
-PARAM lightDir = state.light[0].position;
-PARAM halfDir = state.light[0].half;
-
-PARAM UNIFORMS = program.local[0];
-
-TEMP normal, dots;
-
-OUTPUT oPos = result.position;
-OUTPUT oDots = result.texcoord[0];
-
-# Transform the vertex to clip coordinates.
-DP4 oPos.x, mvp[0], iPos;
-DP4 oPos.y, mvp[1], iPos;
-DP4 oPos.z, mvp[2], iPos;
-DP4 oPos.w, mvp[3], iPos;
-
-# Transform the normal to eye coordinates.
-DP3 normal.x, mvIT[0], iNormal;
-DP3 normal.y, mvIT[1], iNormal;
-DP3 normal.z, mvIT[2], iNormal;
-
-# Compute diffuse and specular dot products and clamp them.
-DP3 dots.x, normal, lightDir;
-MAX oDots.x, dots.x, 0.0;
-
-DP3 dots.y, normal, halfDir;
-MAX oDots.y, dots.y, 0.0;
-
+!!ARBvp1.0
+
+ATTRIB iPos = vertex.position;
+ATTRIB iNormal = vertex.normal;
+
+PARAM mvp[4] = { state.matrix.mvp };
+PARAM mvIT[4] = { state.matrix.modelview.invtrans };
+
+PARAM lightDir = state.light[0].position;
+PARAM halfDir = state.light[0].half;
+
+PARAM UNIFORMS = program.local[0];
+
+TEMP normal, dots;
+
+OUTPUT oPos = result.position;
+OUTPUT oDots = result.texcoord[0];
+
+# Transform the vertex to clip coordinates.
+DP4 oPos.x, mvp[0], iPos;
+DP4 oPos.y, mvp[1], iPos;
+DP4 oPos.z, mvp[2], iPos;
+DP4 oPos.w, mvp[3], iPos;
+
+# Transform the normal to eye coordinates.
+DP3 normal.x, mvIT[0], iNormal;
+DP3 normal.y, mvIT[1], iNormal;
+DP3 normal.z, mvIT[2], iNormal;
+
+# Compute diffuse and specular dot products and clamp them.
+DP3 dots.x, normal, lightDir;
+MAX oDots.x, dots.x, 0.0;
+
+DP3 dots.y, normal, halfDir;
+MAX oDots.y, dots.y, 0.0;
+
END
\ No newline at end of file
diff --git a/src/java/org/lwjgl/test/opengl/shaders/shaderFSH.fsh b/src/java/org/lwjgl/test/opengl/shaders/shaderFSH.fsh
index 99567c2..dd51029 100644
--- a/src/java/org/lwjgl/test/opengl/shaders/shaderFSH.fsh
+++ b/src/java/org/lwjgl/test/opengl/shaders/shaderFSH.fsh
@@ -1,21 +1,21 @@
-uniform vec4 UNIFORMS;
-
-varying vec2 dots;
-
-void main(void) {
- // Offset window-space fragment position.
- vec3 color2D = vec3(gl_FragCoord + UNIFORMS.zwxx);
-
- // Normalize position.
- // Multiply with current sin.
- color2D.xy = normalize(color2D).xy * UNIFORMS.x;
- // {-1..1} => {0..1} & Intensify colors.
- color2D.xy = (vec2(color2D) * 0.5 + 0.5) * 2.0;
- color2D.z = 1.0;
-
- // Accumulate color contributions.
- // Hardcoded ambience and specular color, due to buggy drivers.
- color2D = dots.x * color2D + vec3(0.2, 0.2, 0.2);
- gl_FragColor.rgb = pow(dots.y, UNIFORMS.y) * vec3(1.0, 1.0, 0.5) + color2D;
- gl_FragColor.a = 1.0;
+uniform vec4 UNIFORMS;
+
+varying vec2 dots;
+
+void main(void) {
+ // Offset window-space fragment position.
+ vec3 color2D = vec3(gl_FragCoord + UNIFORMS.zwxx);
+
+ // Normalize position.
+ // Multiply with current sin.
+ color2D.xy = normalize(color2D).xy * UNIFORMS.x;
+ // {-1..1} => {0..1} & Intensify colors.
+ color2D.xy = (vec2(color2D) * 0.5 + 0.5) * 2.0;
+ color2D.z = 1.0;
+
+ // Accumulate color contributions.
+ // Hardcoded ambience and specular color, due to buggy drivers.
+ color2D = dots.x * color2D + vec3(0.2, 0.2, 0.2);
+ gl_FragColor.rgb = pow(dots.y, UNIFORMS.y) * vec3(1.0, 1.0, 0.5) + color2D;
+ gl_FragColor.a = 1.0;
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/test/opengl/shaders/shaderFSH.vsh b/src/java/org/lwjgl/test/opengl/shaders/shaderFSH.vsh
index 4fc5db3..242ba9f 100644
--- a/src/java/org/lwjgl/test/opengl/shaders/shaderFSH.vsh
+++ b/src/java/org/lwjgl/test/opengl/shaders/shaderFSH.vsh
@@ -1,13 +1,13 @@
-uniform vec4 UNIFORMS;
-
-varying vec2 dots;
-
-void main(void) {
- gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
-
- vec3 normal = gl_NormalMatrix * gl_Normal;
-
- // Pass the dot products to the fragment shader.
- dots.x = max(dot(normal, vec3(gl_LightSource[0].position)), 0.0);
- dots.y = max(dot(normal, vec3(gl_LightSource[0].halfVector)), 0.0);
+uniform vec4 UNIFORMS;
+
+varying vec2 dots;
+
+void main(void) {
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ vec3 normal = gl_NormalMatrix * gl_Normal;
+
+ // Pass the dot products to the fragment shader.
+ dots.x = max(dot(normal, vec3(gl_LightSource[0].position)), 0.0);
+ dots.y = max(dot(normal, vec3(gl_LightSource[0].halfVector)), 0.0);
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/test/opengl/shaders/shaderUNI.vsh b/src/java/org/lwjgl/test/opengl/shaders/shaderUNI.vsh
index d1fbd74..757e257 100644
--- a/src/java/org/lwjgl/test/opengl/shaders/shaderUNI.vsh
+++ b/src/java/org/lwjgl/test/opengl/shaders/shaderUNI.vsh
@@ -1,28 +1,28 @@
-#version 140
-#extension GL_ARB_uniform_buffer_object : enable
-
-layout(std140) uniform test {
- vec2 uniformA;
- vec3 uniformB;
-};
-
-void main(void) {
- gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
-
- vec3 normal = gl_NormalMatrix * gl_Normal;
-
- float diffuseDot = max(dot(normal, vec3(gl_LightSource[0].position)), 0.0);
- float specularDot = max(dot(normal, vec3(gl_LightSource[0].halfVector)), 0.0);
- specularDot = pow(specularDot, uniformA.y);
-
- // Normalize position, to get a {-1..1} value for each vertex.
- // Multiply with current sin.
- vec3 color3D = normalize(vec3(gl_Vertex)) * uniformA.x;
- // {-1..1} => {0..1} & Intensify colors.
- color3D = (color3D * 0.5 + 0.5) * 2.0;
-
- // Accumulate color contributions.
- color3D = diffuseDot * (uniformB + color3D) + vec3(gl_LightModel.ambient);
- gl_FrontColor.rgb = specularDot * vec3(gl_LightSource[0].specular) + color3D;
- gl_FrontColor.a = 1.0;
+#version 140
+#extension GL_ARB_uniform_buffer_object : enable
+
+layout(std140) uniform test {
+ vec2 uniformA;
+ vec3 uniformB;
+};
+
+void main(void) {
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ vec3 normal = gl_NormalMatrix * gl_Normal;
+
+ float diffuseDot = max(dot(normal, vec3(gl_LightSource[0].position)), 0.0);
+ float specularDot = max(dot(normal, vec3(gl_LightSource[0].halfVector)), 0.0);
+ specularDot = pow(specularDot, uniformA.y);
+
+ // Normalize position, to get a {-1..1} value for each vertex.
+ // Multiply with current sin.
+ vec3 color3D = normalize(vec3(gl_Vertex)) * uniformA.x;
+ // {-1..1} => {0..1} & Intensify colors.
+ color3D = (color3D * 0.5 + 0.5) * 2.0;
+
+ // Accumulate color contributions.
+ color3D = diffuseDot * (uniformB + color3D) + vec3(gl_LightModel.ambient);
+ gl_FrontColor.rgb = specularDot * vec3(gl_LightSource[0].specular) + color3D;
+ gl_FrontColor.a = 1.0;
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/test/opengl/shaders/shaderVP.vp b/src/java/org/lwjgl/test/opengl/shaders/shaderVP.vp
index a410222..efb5ed1 100644
--- a/src/java/org/lwjgl/test/opengl/shaders/shaderVP.vp
+++ b/src/java/org/lwjgl/test/opengl/shaders/shaderVP.vp
@@ -1,59 +1,59 @@
-!!ARBvp1.0
-
-ATTRIB iPos = vertex.position;
-ATTRIB iNormal = vertex.normal;
-
-PARAM mvp[4] = { state.matrix.mvp };
-PARAM mvIT[4] = { state.matrix.modelview.invtrans };
-
-PARAM ambience = state.lightmodel.ambient;
-
-PARAM lightDir = state.light[0].position;
-PARAM halfDir = state.light[0].half;
-PARAM diffuseColor = state.light[0].diffuse;
-PARAM specularColor = state.light[0].specular;
-
-PARAM UNIFORMS = program.local[0];
-
-TEMP temp, temp2, normal, dots;
-
-OUTPUT oPos = result.position;
-OUTPUT oColor = result.color;
-
-# Transform the vertex to clip coordinates.
-DP4 oPos.x, mvp[0], iPos;
-DP4 oPos.y, mvp[1], iPos;
-DP4 oPos.z, mvp[2], iPos;
-DP4 oPos.w, mvp[3], iPos;
-
-# Transform the normal to eye coordinates.
-DP3 normal.x, mvIT[0], iNormal;
-DP3 normal.y, mvIT[1], iNormal;
-DP3 normal.z, mvIT[2], iNormal;
-
-# Compute diffuse and specular dot products and use LIT to compute
-# lighting coefficients.
-DP3 dots.x, normal, lightDir;
-DP3 dots.y, normal, halfDir;
-MOV dots.w, UNIFORMS.y;
-LIT dots, dots;
-
-# Normalize position, to get a {-1..1} value for each vertex.
-DP3 temp.w, iPos, iPos;
-RSQ temp.w, temp.w;
-MUL temp.xyz, iPos, temp.w;
-
-# Multiply with current sin.
-MUL temp.xyz, temp, UNIFORMS.x;
-# {-1..1} => {0..1}
-MAD temp.xyz, temp, 0.5, 0.5;
-# Intensify colors.
-MUL temp.xyz, temp, 2.0;
-
-# Accumulate color contributions.
-MAD temp.xyz, dots.y, temp, ambience;
-MAD oColor.xyz, dots.z, specularColor, temp;
-MOV oColor.w, 1.0;
-
-
+!!ARBvp1.0
+
+ATTRIB iPos = vertex.position;
+ATTRIB iNormal = vertex.normal;
+
+PARAM mvp[4] = { state.matrix.mvp };
+PARAM mvIT[4] = { state.matrix.modelview.invtrans };
+
+PARAM ambience = state.lightmodel.ambient;
+
+PARAM lightDir = state.light[0].position;
+PARAM halfDir = state.light[0].half;
+PARAM diffuseColor = state.light[0].diffuse;
+PARAM specularColor = state.light[0].specular;
+
+PARAM UNIFORMS = program.local[0];
+
+TEMP temp, temp2, normal, dots;
+
+OUTPUT oPos = result.position;
+OUTPUT oColor = result.color;
+
+# Transform the vertex to clip coordinates.
+DP4 oPos.x, mvp[0], iPos;
+DP4 oPos.y, mvp[1], iPos;
+DP4 oPos.z, mvp[2], iPos;
+DP4 oPos.w, mvp[3], iPos;
+
+# Transform the normal to eye coordinates.
+DP3 normal.x, mvIT[0], iNormal;
+DP3 normal.y, mvIT[1], iNormal;
+DP3 normal.z, mvIT[2], iNormal;
+
+# Compute diffuse and specular dot products and use LIT to compute
+# lighting coefficients.
+DP3 dots.x, normal, lightDir;
+DP3 dots.y, normal, halfDir;
+MOV dots.w, UNIFORMS.y;
+LIT dots, dots;
+
+# Normalize position, to get a {-1..1} value for each vertex.
+DP3 temp.w, iPos, iPos;
+RSQ temp.w, temp.w;
+MUL temp.xyz, iPos, temp.w;
+
+# Multiply with current sin.
+MUL temp.xyz, temp, UNIFORMS.x;
+# {-1..1} => {0..1}
+MAD temp.xyz, temp, 0.5, 0.5;
+# Intensify colors.
+MUL temp.xyz, temp, 2.0;
+
+# Accumulate color contributions.
+MAD temp.xyz, dots.y, temp, ambience;
+MAD oColor.xyz, dots.z, specularColor, temp;
+MOV oColor.w, 1.0;
+
+
END
\ No newline at end of file
diff --git a/src/java/org/lwjgl/test/opengl/shaders/shaderVSH.vsh b/src/java/org/lwjgl/test/opengl/shaders/shaderVSH.vsh
index c34ae1b..3516b3f 100644
--- a/src/java/org/lwjgl/test/opengl/shaders/shaderVSH.vsh
+++ b/src/java/org/lwjgl/test/opengl/shaders/shaderVSH.vsh
@@ -1,22 +1,22 @@
-uniform vec2 UNIFORMS;
-
-void main(void) {
- gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
-
- vec3 normal = gl_NormalMatrix * gl_Normal;
-
- float diffuseDot = max(dot(normal, vec3(gl_LightSource[0].position)), 0.0);
- float specularDot = max(dot(normal, vec3(gl_LightSource[0].halfVector)), 0.0);
- specularDot = pow(specularDot, UNIFORMS.y);
-
- // Normalize position, to get a {-1..1} value for each vertex.
- // Multiply with current sin.
- vec3 color3D = normalize(vec3(gl_Vertex)) * UNIFORMS.x;
- // {-1..1} => {0..1} & Intensify colors.
- color3D = (color3D * 0.5 + 0.5) * 2.0;
-
- // Accumulate color contributions.
- color3D = diffuseDot * color3D + vec3(gl_LightModel.ambient);
- gl_FrontColor.rgb = specularDot * vec3(gl_LightSource[0].specular) + color3D;
- gl_FrontColor.a = 1.0;
+uniform vec2 UNIFORMS;
+
+void main(void) {
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ vec3 normal = gl_NormalMatrix * gl_Normal;
+
+ float diffuseDot = max(dot(normal, vec3(gl_LightSource[0].position)), 0.0);
+ float specularDot = max(dot(normal, vec3(gl_LightSource[0].halfVector)), 0.0);
+ specularDot = pow(specularDot, UNIFORMS.y);
+
+ // Normalize position, to get a {-1..1} value for each vertex.
+ // Multiply with current sin.
+ vec3 color3D = normalize(vec3(gl_Vertex)) * UNIFORMS.x;
+ // {-1..1} => {0..1} & Intensify colors.
+ color3D = (color3D * 0.5 + 0.5) * 2.0;
+
+ // Accumulate color contributions.
+ color3D = diffuseDot * color3D + vec3(gl_LightModel.ambient);
+ gl_FrontColor.rgb = specularDot * vec3(gl_LightSource[0].specular) + color3D;
+ gl_FrontColor.a = 1.0;
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/util/Color.java b/src/java/org/lwjgl/util/Color.java
index 87e5ab0..e9899c9 100644
--- a/src/java/org/lwjgl/util/Color.java
+++ b/src/java/org/lwjgl/util/Color.java
@@ -1,494 +1,494 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util;
-import java.io.Serializable;
-import java.nio.ByteBuffer;
-
-/**
- * A mutable Color class
- * @author $Author: matzon $
- * @version $Revision: 2983 $
- * $Id: Color.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public final class Color implements ReadableColor, Serializable, WritableColor {
-
- static final long serialVersionUID = 1L;
-
- /** Color components, publicly accessible */
- private byte red, green, blue, alpha;
-
- /**
- * Constructor for Color.
- */
- public Color() {
- this(0, 0, 0, 255);
- }
-
- /**
- * Constructor for Color. Alpha defaults to 255.
- */
- public Color(int r, int g, int b) {
- this(r, g, b, 255);
- }
-
- /**
- * Constructor for Color. Alpha defaults to 255.
- */
- public Color(byte r, byte g, byte b) {
- this(r, g, b, (byte) 255);
- }
-
- /**
- * Constructor for Color.
- */
- public Color(int r, int g, int b, int a) {
- set(r, g, b, a);
- }
-
- /**
- * Constructor for Color.
- */
- public Color(byte r, byte g, byte b, byte a) {
- set(r, g, b, a);
- }
-
- /**
- * Constructor for Color
- */
- public Color(ReadableColor c) {
- setColor(c);
- }
-
- /**
- * Set a color
- */
- public void set(int r, int g, int b, int a) {
- red = (byte) r;
- green = (byte) g;
- blue = (byte) b;
- alpha = (byte) a;
- }
-
- /**
- * Set a color
- */
- public void set(byte r, byte g, byte b, byte a) {
- this.red = r;
- this.green = g;
- this.blue = b;
- this.alpha = a;
- }
-
- /**
- * Set a color
- */
- public void set(int r, int g, int b) {
- set(r, g, b, 255);
- }
-
- /**
- * Set a color
- */
- public void set(byte r, byte g, byte b) {
- set(r, g, b, (byte) 255);
- }
-
- /**
- * Accessor
- */
- public int getRed() {
- return red & 0xFF;
- }
-
- /**
- * Accessor
- */
- public int getGreen() {
- return green & 0xFF;
- }
-
- /**
- * Accessor
- */
- public int getBlue() {
- return blue & 0xFF;
- }
-
- /**
- * Accessor
- */
- public int getAlpha() {
- return alpha & 0xFF;
- }
-
- /**
- * Set the Red component
- */
- public void setRed(int red) {
- this.red = (byte) red;
- }
-
- /**
- * Set the Green component
- */
- public void setGreen(int green) {
- this.green = (byte) green;
- }
-
- /**
- * Set the Blue component
- */
- public void setBlue(int blue) {
- this.blue = (byte) blue;
- }
-
- /**
- * Set the Alpha component
- */
- public void setAlpha(int alpha) {
- this.alpha = (byte) alpha;
- }
-
- /**
- * Set the Red component
- */
- public void setRed(byte red) {
- this.red = red;
- }
-
- /**
- * Set the Green component
- */
- public void setGreen(byte green) {
- this.green = green;
- }
-
- /**
- * Set the Blue component
- */
- public void setBlue(byte blue) {
- this.blue = blue;
- }
-
- /**
- * Set the Alpha component
- */
- public void setAlpha(byte alpha) {
- this.alpha = alpha;
- }
-
- /**
- * Stringify
- */
- public String toString() {
- return "Color [" + getRed() + ", " + getGreen() + ", " + getBlue() + ", " + getAlpha() + "]";
- }
-
- /**
- * Equals
- */
- public boolean equals(Object o) {
- return (o != null)
- && (o instanceof ReadableColor)
- && (((ReadableColor) o).getRed() == this.getRed())
- && (((ReadableColor) o).getGreen() == this.getGreen())
- && (((ReadableColor) o).getBlue() == this.getBlue())
- && (((ReadableColor) o).getAlpha() == this.getAlpha());
- }
-
- /**
- * Hashcode
- */
- public int hashCode() {
- return (red << 24) | (green << 16) | (blue << 8) | alpha;
- }
-
- /* (Overrides)
- * @see com.shavenpuppy.jglib.ReadableColor#getAlphaByte()
- */
- public byte getAlphaByte() {
- return alpha;
- }
-
- /* (Overrides)
- * @see com.shavenpuppy.jglib.ReadableColor#getBlueByte()
- */
- public byte getBlueByte() {
- return blue;
- }
-
- /* (Overrides)
- * @see com.shavenpuppy.jglib.ReadableColor#getGreenByte()
- */
- public byte getGreenByte() {
- return green;
- }
-
- /* (Overrides)
- * @see com.shavenpuppy.jglib.ReadableColor#getRedByte()
- */
- public byte getRedByte() {
- return red;
- }
-
- /* (Overrides)
- * @see com.shavenpuppy.jglib.ReadableColor#writeRGBA(java.nio.ByteBuffer)
- */
- public void writeRGBA(ByteBuffer dest) {
- dest.put(red);
- dest.put(green);
- dest.put(blue);
- dest.put(alpha);
- }
-
- /* (Overrides)
- * @see com.shavenpuppy.jglib.ReadableColor#writeRGB(java.nio.ByteBuffer)
- */
- public void writeRGB(ByteBuffer dest) {
- dest.put(red);
- dest.put(green);
- dest.put(blue);
- }
-
- /* (Overrides)
- * @see com.shavenpuppy.jglib.ReadableColor#writeABGR(java.nio.ByteBuffer)
- */
- public void writeABGR(ByteBuffer dest) {
- dest.put(alpha);
- dest.put(blue);
- dest.put(green);
- dest.put(red);
- }
-
- /* (Overrides)
- * @see com.shavenpuppy.jglib.ReadableColor#writeARGB(java.nio.ByteBuffer)
- */
- public void writeARGB(ByteBuffer dest) {
- dest.put(alpha);
- dest.put(red);
- dest.put(green);
- dest.put(blue);
- }
-
- /* (Overrides)
- * @see com.shavenpuppy.jglib.ReadableColor#writeBGR(java.nio.ByteBuffer)
- */
- public void writeBGR(ByteBuffer dest) {
- dest.put(blue);
- dest.put(green);
- dest.put(red);
- }
-
- /* (Overrides)
- * @see com.shavenpuppy.jglib.ReadableColor#writeBGRA(java.nio.ByteBuffer)
- */
- public void writeBGRA(ByteBuffer dest) {
- dest.put(blue);
- dest.put(green);
- dest.put(red);
- dest.put(alpha);
- }
-
- /**
- * Read a color from a byte buffer
- * @param src The source buffer
- */
- public void readRGBA(ByteBuffer src) {
- red = src.get();
- green = src.get();
- blue = src.get();
- alpha = src.get();
- }
-
- /**
- * Read a color from a byte buffer
- * @param src The source buffer
- */
- public void readRGB(ByteBuffer src) {
- red = src.get();
- green = src.get();
- blue = src.get();
- }
-
- /**
- * Read a color from a byte buffer
- * @param src The source buffer
- */
- public void readARGB(ByteBuffer src) {
- alpha = src.get();
- red = src.get();
- green = src.get();
- blue = src.get();
- }
-
- /**
- * Read a color from a byte buffer
- * @param src The source buffer
- */
- public void readBGRA(ByteBuffer src) {
- blue = src.get();
- green = src.get();
- red = src.get();
- alpha = src.get();
- }
-
- /**
- * Read a color from a byte buffer
- * @param src The source buffer
- */
- public void readBGR(ByteBuffer src) {
- blue = src.get();
- green = src.get();
- red = src.get();
- }
-
- /**
- * Read a color from a byte buffer
- * @param src The source buffer
- */
- public void readABGR(ByteBuffer src) {
- alpha = src.get();
- blue = src.get();
- green = src.get();
- red = src.get();
- }
-
- /**
- * Set this color's color by copying another color
- * @param src The source color
- */
- public void setColor(ReadableColor src) {
- red = src.getRedByte();
- green = src.getGreenByte();
- blue = src.getBlueByte();
- alpha = src.getAlphaByte();
- }
-
- /**
- * HSB to RGB conversion, pinched from java.awt.Color.
- * @param hue (0..1.0f)
- * @param saturation (0..1.0f)
- * @param brightness (0..1.0f)
- */
- public void fromHSB(float hue, float saturation, float brightness) {
- if (saturation == 0.0F) {
- red = green = blue = (byte) (brightness * 255F + 0.5F);
- } else {
- float f3 = (hue - (float) Math.floor(hue)) * 6F;
- float f4 = f3 - (float) Math.floor(f3);
- float f5 = brightness * (1.0F - saturation);
- float f6 = brightness * (1.0F - saturation * f4);
- float f7 = brightness * (1.0F - saturation * (1.0F - f4));
- switch ((int) f3) {
- case 0 :
- red = (byte) (brightness * 255F + 0.5F);
- green = (byte) (f7 * 255F + 0.5F);
- blue = (byte) (f5 * 255F + 0.5F);
- break;
- case 1 :
- red = (byte) (f6 * 255F + 0.5F);
- green = (byte) (brightness * 255F + 0.5F);
- blue = (byte) (f5 * 255F + 0.5F);
- break;
- case 2 :
- red = (byte) (f5 * 255F + 0.5F);
- green = (byte) (brightness * 255F + 0.5F);
- blue = (byte) (f7 * 255F + 0.5F);
- break;
- case 3 :
- red = (byte) (f5 * 255F + 0.5F);
- green = (byte) (f6 * 255F + 0.5F);
- blue = (byte) (brightness * 255F + 0.5F);
- break;
- case 4 :
- red = (byte) (f7 * 255F + 0.5F);
- green = (byte) (f5 * 255F + 0.5F);
- blue = (byte) (brightness * 255F + 0.5F);
- break;
- case 5 :
- red = (byte) (brightness * 255F + 0.5F);
- green = (byte) (f5 * 255F + 0.5F);
- blue = (byte) (f6 * 255F + 0.5F);
- break;
- }
- }
- }
-
- /**
- * RGB to HSB conversion, pinched from java.awt.Color.
- * The HSB value is returned in dest[] if dest[] is supplied.
- * Values range from 0..1
- * @param dest Destination floats, or null
- * @return dest, or a new float array
- */
- public float[] toHSB(float dest[]) {
- int r = getRed();
- int g = getGreen();
- int b = getBlue();
- if (dest == null)
- dest = new float[3];
- int l = r <= g ? g : r;
- if (b > l)
- l = b;
- int i1 = r >= g ? g : r;
- if (b < i1)
- i1 = b;
- float brightness = l / 255F;
- float saturation;
- if (l != 0)
- saturation = (float) (l - i1) / (float) l;
- else
- saturation = 0.0F;
- float hue;
- if (saturation == 0.0F) {
- hue = 0.0F;
- } else {
- float f3 = (float) (l - r) / (float) (l - i1);
- float f4 = (float) (l - g) / (float) (l - i1);
- float f5 = (float) (l - b) / (float) (l - i1);
- if (r == l)
- hue = f5 - f4;
- else if (g == l)
- hue = (2.0F + f3) - f5;
- else
- hue = (4F + f4) - f3;
- hue /= 6F;
- if (hue < 0.0F)
- hue++;
- }
- dest[0] = hue;
- dest[1] = saturation;
- dest[2] = brightness;
- return dest;
- }
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util;
+import java.io.Serializable;
+import java.nio.ByteBuffer;
+
+/**
+ * A mutable Color class
+ * @author $Author: matzon $
+ * @version $Revision: 2983 $
+ * $Id: Color.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public final class Color implements ReadableColor, Serializable, WritableColor {
+
+ static final long serialVersionUID = 1L;
+
+ /** Color components, publicly accessible */
+ private byte red, green, blue, alpha;
+
+ /**
+ * Constructor for Color.
+ */
+ public Color() {
+ this(0, 0, 0, 255);
+ }
+
+ /**
+ * Constructor for Color. Alpha defaults to 255.
+ */
+ public Color(int r, int g, int b) {
+ this(r, g, b, 255);
+ }
+
+ /**
+ * Constructor for Color. Alpha defaults to 255.
+ */
+ public Color(byte r, byte g, byte b) {
+ this(r, g, b, (byte) 255);
+ }
+
+ /**
+ * Constructor for Color.
+ */
+ public Color(int r, int g, int b, int a) {
+ set(r, g, b, a);
+ }
+
+ /**
+ * Constructor for Color.
+ */
+ public Color(byte r, byte g, byte b, byte a) {
+ set(r, g, b, a);
+ }
+
+ /**
+ * Constructor for Color
+ */
+ public Color(ReadableColor c) {
+ setColor(c);
+ }
+
+ /**
+ * Set a color
+ */
+ public void set(int r, int g, int b, int a) {
+ red = (byte) r;
+ green = (byte) g;
+ blue = (byte) b;
+ alpha = (byte) a;
+ }
+
+ /**
+ * Set a color
+ */
+ public void set(byte r, byte g, byte b, byte a) {
+ this.red = r;
+ this.green = g;
+ this.blue = b;
+ this.alpha = a;
+ }
+
+ /**
+ * Set a color
+ */
+ public void set(int r, int g, int b) {
+ set(r, g, b, 255);
+ }
+
+ /**
+ * Set a color
+ */
+ public void set(byte r, byte g, byte b) {
+ set(r, g, b, (byte) 255);
+ }
+
+ /**
+ * Accessor
+ */
+ public int getRed() {
+ return red & 0xFF;
+ }
+
+ /**
+ * Accessor
+ */
+ public int getGreen() {
+ return green & 0xFF;
+ }
+
+ /**
+ * Accessor
+ */
+ public int getBlue() {
+ return blue & 0xFF;
+ }
+
+ /**
+ * Accessor
+ */
+ public int getAlpha() {
+ return alpha & 0xFF;
+ }
+
+ /**
+ * Set the Red component
+ */
+ public void setRed(int red) {
+ this.red = (byte) red;
+ }
+
+ /**
+ * Set the Green component
+ */
+ public void setGreen(int green) {
+ this.green = (byte) green;
+ }
+
+ /**
+ * Set the Blue component
+ */
+ public void setBlue(int blue) {
+ this.blue = (byte) blue;
+ }
+
+ /**
+ * Set the Alpha component
+ */
+ public void setAlpha(int alpha) {
+ this.alpha = (byte) alpha;
+ }
+
+ /**
+ * Set the Red component
+ */
+ public void setRed(byte red) {
+ this.red = red;
+ }
+
+ /**
+ * Set the Green component
+ */
+ public void setGreen(byte green) {
+ this.green = green;
+ }
+
+ /**
+ * Set the Blue component
+ */
+ public void setBlue(byte blue) {
+ this.blue = blue;
+ }
+
+ /**
+ * Set the Alpha component
+ */
+ public void setAlpha(byte alpha) {
+ this.alpha = alpha;
+ }
+
+ /**
+ * Stringify
+ */
+ public String toString() {
+ return "Color [" + getRed() + ", " + getGreen() + ", " + getBlue() + ", " + getAlpha() + "]";
+ }
+
+ /**
+ * Equals
+ */
+ public boolean equals(Object o) {
+ return (o != null)
+ && (o instanceof ReadableColor)
+ && (((ReadableColor) o).getRed() == this.getRed())
+ && (((ReadableColor) o).getGreen() == this.getGreen())
+ && (((ReadableColor) o).getBlue() == this.getBlue())
+ && (((ReadableColor) o).getAlpha() == this.getAlpha());
+ }
+
+ /**
+ * Hashcode
+ */
+ public int hashCode() {
+ return (red << 24) | (green << 16) | (blue << 8) | alpha;
+ }
+
+ /* (Overrides)
+ * @see com.shavenpuppy.jglib.ReadableColor#getAlphaByte()
+ */
+ public byte getAlphaByte() {
+ return alpha;
+ }
+
+ /* (Overrides)
+ * @see com.shavenpuppy.jglib.ReadableColor#getBlueByte()
+ */
+ public byte getBlueByte() {
+ return blue;
+ }
+
+ /* (Overrides)
+ * @see com.shavenpuppy.jglib.ReadableColor#getGreenByte()
+ */
+ public byte getGreenByte() {
+ return green;
+ }
+
+ /* (Overrides)
+ * @see com.shavenpuppy.jglib.ReadableColor#getRedByte()
+ */
+ public byte getRedByte() {
+ return red;
+ }
+
+ /* (Overrides)
+ * @see com.shavenpuppy.jglib.ReadableColor#writeRGBA(java.nio.ByteBuffer)
+ */
+ public void writeRGBA(ByteBuffer dest) {
+ dest.put(red);
+ dest.put(green);
+ dest.put(blue);
+ dest.put(alpha);
+ }
+
+ /* (Overrides)
+ * @see com.shavenpuppy.jglib.ReadableColor#writeRGB(java.nio.ByteBuffer)
+ */
+ public void writeRGB(ByteBuffer dest) {
+ dest.put(red);
+ dest.put(green);
+ dest.put(blue);
+ }
+
+ /* (Overrides)
+ * @see com.shavenpuppy.jglib.ReadableColor#writeABGR(java.nio.ByteBuffer)
+ */
+ public void writeABGR(ByteBuffer dest) {
+ dest.put(alpha);
+ dest.put(blue);
+ dest.put(green);
+ dest.put(red);
+ }
+
+ /* (Overrides)
+ * @see com.shavenpuppy.jglib.ReadableColor#writeARGB(java.nio.ByteBuffer)
+ */
+ public void writeARGB(ByteBuffer dest) {
+ dest.put(alpha);
+ dest.put(red);
+ dest.put(green);
+ dest.put(blue);
+ }
+
+ /* (Overrides)
+ * @see com.shavenpuppy.jglib.ReadableColor#writeBGR(java.nio.ByteBuffer)
+ */
+ public void writeBGR(ByteBuffer dest) {
+ dest.put(blue);
+ dest.put(green);
+ dest.put(red);
+ }
+
+ /* (Overrides)
+ * @see com.shavenpuppy.jglib.ReadableColor#writeBGRA(java.nio.ByteBuffer)
+ */
+ public void writeBGRA(ByteBuffer dest) {
+ dest.put(blue);
+ dest.put(green);
+ dest.put(red);
+ dest.put(alpha);
+ }
+
+ /**
+ * Read a color from a byte buffer
+ * @param src The source buffer
+ */
+ public void readRGBA(ByteBuffer src) {
+ red = src.get();
+ green = src.get();
+ blue = src.get();
+ alpha = src.get();
+ }
+
+ /**
+ * Read a color from a byte buffer
+ * @param src The source buffer
+ */
+ public void readRGB(ByteBuffer src) {
+ red = src.get();
+ green = src.get();
+ blue = src.get();
+ }
+
+ /**
+ * Read a color from a byte buffer
+ * @param src The source buffer
+ */
+ public void readARGB(ByteBuffer src) {
+ alpha = src.get();
+ red = src.get();
+ green = src.get();
+ blue = src.get();
+ }
+
+ /**
+ * Read a color from a byte buffer
+ * @param src The source buffer
+ */
+ public void readBGRA(ByteBuffer src) {
+ blue = src.get();
+ green = src.get();
+ red = src.get();
+ alpha = src.get();
+ }
+
+ /**
+ * Read a color from a byte buffer
+ * @param src The source buffer
+ */
+ public void readBGR(ByteBuffer src) {
+ blue = src.get();
+ green = src.get();
+ red = src.get();
+ }
+
+ /**
+ * Read a color from a byte buffer
+ * @param src The source buffer
+ */
+ public void readABGR(ByteBuffer src) {
+ alpha = src.get();
+ blue = src.get();
+ green = src.get();
+ red = src.get();
+ }
+
+ /**
+ * Set this color's color by copying another color
+ * @param src The source color
+ */
+ public void setColor(ReadableColor src) {
+ red = src.getRedByte();
+ green = src.getGreenByte();
+ blue = src.getBlueByte();
+ alpha = src.getAlphaByte();
+ }
+
+ /**
+ * HSB to RGB conversion, pinched from java.awt.Color.
+ * @param hue (0..1.0f)
+ * @param saturation (0..1.0f)
+ * @param brightness (0..1.0f)
+ */
+ public void fromHSB(float hue, float saturation, float brightness) {
+ if (saturation == 0.0F) {
+ red = green = blue = (byte) (brightness * 255F + 0.5F);
+ } else {
+ float f3 = (hue - (float) Math.floor(hue)) * 6F;
+ float f4 = f3 - (float) Math.floor(f3);
+ float f5 = brightness * (1.0F - saturation);
+ float f6 = brightness * (1.0F - saturation * f4);
+ float f7 = brightness * (1.0F - saturation * (1.0F - f4));
+ switch ((int) f3) {
+ case 0 :
+ red = (byte) (brightness * 255F + 0.5F);
+ green = (byte) (f7 * 255F + 0.5F);
+ blue = (byte) (f5 * 255F + 0.5F);
+ break;
+ case 1 :
+ red = (byte) (f6 * 255F + 0.5F);
+ green = (byte) (brightness * 255F + 0.5F);
+ blue = (byte) (f5 * 255F + 0.5F);
+ break;
+ case 2 :
+ red = (byte) (f5 * 255F + 0.5F);
+ green = (byte) (brightness * 255F + 0.5F);
+ blue = (byte) (f7 * 255F + 0.5F);
+ break;
+ case 3 :
+ red = (byte) (f5 * 255F + 0.5F);
+ green = (byte) (f6 * 255F + 0.5F);
+ blue = (byte) (brightness * 255F + 0.5F);
+ break;
+ case 4 :
+ red = (byte) (f7 * 255F + 0.5F);
+ green = (byte) (f5 * 255F + 0.5F);
+ blue = (byte) (brightness * 255F + 0.5F);
+ break;
+ case 5 :
+ red = (byte) (brightness * 255F + 0.5F);
+ green = (byte) (f5 * 255F + 0.5F);
+ blue = (byte) (f6 * 255F + 0.5F);
+ break;
+ }
+ }
+ }
+
+ /**
+ * RGB to HSB conversion, pinched from java.awt.Color.
+ * The HSB value is returned in dest[] if dest[] is supplied.
+ * Values range from 0..1
+ * @param dest Destination floats, or null
+ * @return dest, or a new float array
+ */
+ public float[] toHSB(float dest[]) {
+ int r = getRed();
+ int g = getGreen();
+ int b = getBlue();
+ if (dest == null)
+ dest = new float[3];
+ int l = r <= g ? g : r;
+ if (b > l)
+ l = b;
+ int i1 = r >= g ? g : r;
+ if (b < i1)
+ i1 = b;
+ float brightness = l / 255F;
+ float saturation;
+ if (l != 0)
+ saturation = (float) (l - i1) / (float) l;
+ else
+ saturation = 0.0F;
+ float hue;
+ if (saturation == 0.0F) {
+ hue = 0.0F;
+ } else {
+ float f3 = (float) (l - r) / (float) (l - i1);
+ float f4 = (float) (l - g) / (float) (l - i1);
+ float f5 = (float) (l - b) / (float) (l - i1);
+ if (r == l)
+ hue = f5 - f4;
+ else if (g == l)
+ hue = (2.0F + f3) - f5;
+ else
+ hue = (4F + f4) - f3;
+ hue /= 6F;
+ if (hue < 0.0F)
+ hue++;
+ }
+ dest[0] = hue;
+ dest[1] = saturation;
+ dest[2] = brightness;
+ return dest;
+ }
+
+}
diff --git a/src/java/org/lwjgl/util/Dimension.java b/src/java/org/lwjgl/util/Dimension.java
index a77b253..bb4b0ae 100644
--- a/src/java/org/lwjgl/util/Dimension.java
+++ b/src/java/org/lwjgl/util/Dimension.java
@@ -1,156 +1,156 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util;
-
-import java.io.Serializable;
-
-/**
- * A 2D integer Dimension class, which looks remarkably like an AWT one.
- * @author $Author: matzon $
- * @version $Revision: 2983 $
- * $Id: Dimension.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public final class Dimension implements Serializable, ReadableDimension, WritableDimension {
-
- static final long serialVersionUID = 1L;
-
- /** The dimensions! */
- private int width, height;
-
- /**
- * Constructor for Dimension.
- */
- public Dimension() {
- super();
- }
-
- /**
- * Constructor for Dimension.
- */
- public Dimension(int w, int h) {
- this.width = w;
- this.height = h;
- }
-
- /**
- * Constructor for Dimension.
- */
- public Dimension(ReadableDimension d) {
- setSize(d);
- }
-
- public void setSize(int w, int h) {
- this.width = w;
- this.height = h;
- }
-
- public void setSize(ReadableDimension d) {
- this.width = d.getWidth();
- this.height = d.getHeight();
- }
-
- /* (Overrides)
- * @see com.shavenpuppy.jglib.ReadableDimension#getSize(com.shavenpuppy.jglib.Dimension)
- */
- public void getSize(WritableDimension dest) {
- dest.setSize(this);
- }
-
- /**
- * Checks whether two dimension objects have equal values.
- */
- public boolean equals(Object obj) {
- if (obj instanceof ReadableDimension) {
- ReadableDimension d = (ReadableDimension) obj;
- return (width == d.getWidth()) && (height == d.getHeight());
- }
- return false;
- }
-
- /**
- * Returns the hash code for this <code>Dimension</code>.
- *
- * @return a hash code for this <code>Dimension</code>
- */
- public int hashCode() {
- int sum = width + height;
- return sum * (sum + 1) / 2 + width;
- }
-
- /**
- * Returns a string representation of the values of this
- * <code>Dimension</code> object's <code>height</code> and
- * <code>width</code> fields. This method is intended to be used only
- * for debugging purposes, and the content and format of the returned
- * string may vary between implementations. The returned string may be
- * empty but may not be <code>null</code>.
- *
- * @return a string representation of this <code>Dimension</code>
- * object
- */
- public String toString() {
- return getClass().getName() + "[width=" + width + ",height=" + height + "]";
- }
-
- /**
- * Gets the height.
- * @return Returns a int
- */
- public int getHeight() {
- return height;
- }
-
- /**
- * Sets the height.
- * @param height The height to set
- */
- public void setHeight(int height) {
- this.height = height;
- }
-
- /**
- * Gets the width.
- * @return Returns a int
- */
- public int getWidth() {
- return width;
- }
-
- /**
- * Sets the width.
- * @param width The width to set
- */
- public void setWidth(int width) {
- this.width = width;
- }
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util;
+
+import java.io.Serializable;
+
+/**
+ * A 2D integer Dimension class, which looks remarkably like an AWT one.
+ * @author $Author: matzon $
+ * @version $Revision: 2983 $
+ * $Id: Dimension.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public final class Dimension implements Serializable, ReadableDimension, WritableDimension {
+
+ static final long serialVersionUID = 1L;
+
+ /** The dimensions! */
+ private int width, height;
+
+ /**
+ * Constructor for Dimension.
+ */
+ public Dimension() {
+ super();
+ }
+
+ /**
+ * Constructor for Dimension.
+ */
+ public Dimension(int w, int h) {
+ this.width = w;
+ this.height = h;
+ }
+
+ /**
+ * Constructor for Dimension.
+ */
+ public Dimension(ReadableDimension d) {
+ setSize(d);
+ }
+
+ public void setSize(int w, int h) {
+ this.width = w;
+ this.height = h;
+ }
+
+ public void setSize(ReadableDimension d) {
+ this.width = d.getWidth();
+ this.height = d.getHeight();
+ }
+
+ /* (Overrides)
+ * @see com.shavenpuppy.jglib.ReadableDimension#getSize(com.shavenpuppy.jglib.Dimension)
+ */
+ public void getSize(WritableDimension dest) {
+ dest.setSize(this);
+ }
+
+ /**
+ * Checks whether two dimension objects have equal values.
+ */
+ public boolean equals(Object obj) {
+ if (obj instanceof ReadableDimension) {
+ ReadableDimension d = (ReadableDimension) obj;
+ return (width == d.getWidth()) && (height == d.getHeight());
+ }
+ return false;
+ }
+
+ /**
+ * Returns the hash code for this <code>Dimension</code>.
+ *
+ * @return a hash code for this <code>Dimension</code>
+ */
+ public int hashCode() {
+ int sum = width + height;
+ return sum * (sum + 1) / 2 + width;
+ }
+
+ /**
+ * Returns a string representation of the values of this
+ * <code>Dimension</code> object's <code>height</code> and
+ * <code>width</code> fields. This method is intended to be used only
+ * for debugging purposes, and the content and format of the returned
+ * string may vary between implementations. The returned string may be
+ * empty but may not be <code>null</code>.
+ *
+ * @return a string representation of this <code>Dimension</code>
+ * object
+ */
+ public String toString() {
+ return getClass().getName() + "[width=" + width + ",height=" + height + "]";
+ }
+
+ /**
+ * Gets the height.
+ * @return Returns a int
+ */
+ public int getHeight() {
+ return height;
+ }
+
+ /**
+ * Sets the height.
+ * @param height The height to set
+ */
+ public void setHeight(int height) {
+ this.height = height;
+ }
+
+ /**
+ * Gets the width.
+ * @return Returns a int
+ */
+ public int getWidth() {
+ return width;
+ }
+
+ /**
+ * Sets the width.
+ * @param width The width to set
+ */
+ public void setWidth(int width) {
+ this.width = width;
+ }
+
+}
diff --git a/src/java/org/lwjgl/util/Display.java b/src/java/org/lwjgl/util/Display.java
index a340639..7996b11 100644
--- a/src/java/org/lwjgl/util/Display.java
+++ b/src/java/org/lwjgl/util/Display.java
@@ -1,246 +1,246 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Comparator;
-
-import org.lwjgl.LWJGLException;
-import org.lwjgl.LWJGLUtil;
-import org.lwjgl.opengl.DisplayMode;
-
-/**
- * Display initialization utility, that can be used to find display modes and pick
- * one for you based on your criteria.
- * @author $Author: matzon $
- * @version $Revision: 2983 $
- * $Id: Display.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public final class Display {
-
- private static final boolean DEBUG = false;
-
- /**
- * Determine the available display modes that match the specified minimum and maximum criteria.
- * If any given criterium is specified as -1 then it is ignored.
- *
- * @param minWidth the minimum display resolution in pixels
- * @param minHeight the minimum display resolution in pixels
- * @param maxWidth the maximum display resolution in pixels
- * @param maxHeight the maximum display resolution in pixels
- * @param minBPP the minimum bit depth per pixel
- * @param maxBPP the maximum bit depth per pixel
- * @param minFreq the minimum display frequency in Hz
- * @param maxFreq the maximum display frequency in Hz
- * @return an array of matching display modes
- */
- public static DisplayMode[] getAvailableDisplayModes(int minWidth, int minHeight, int maxWidth, int maxHeight, int minBPP, int maxBPP,
- int minFreq, int maxFreq) throws LWJGLException
- {
- // First get the available display modes
- DisplayMode[] modes = org.lwjgl.opengl.Display.getAvailableDisplayModes();
-
- if (LWJGLUtil.DEBUG || DEBUG) {
- System.out.println("Available screen modes:");
- for (int i = 0; i < modes.length; i ++) {
- System.out.println(modes[i]);
- }
- }
-
- ArrayList matches = new ArrayList(modes.length);
-
- for (int i = 0; i < modes.length; i ++) {
- assert modes[i] != null : ""+i+" "+modes.length;
- if (minWidth != -1 && modes[i].getWidth() < minWidth)
- continue;
- if (maxWidth != -1 && modes[i].getWidth() > maxWidth)
- continue;
- if (minHeight != -1 && modes[i].getHeight() < minHeight)
- continue;
- if (maxHeight != -1 && modes[i].getHeight() > maxHeight)
- continue;
- if (minBPP != -1 && modes[i].getBitsPerPixel() < minBPP)
- continue;
- if (maxBPP != -1 && modes[i].getBitsPerPixel() > maxBPP)
- continue;
- //if (modes[i].bpp == 24)
- // continue;
- if (modes[i].getFrequency() != 0) {
- if (minFreq != -1 && modes[i].getFrequency() < minFreq)
- continue;
- if (maxFreq != -1 && modes[i].getFrequency() > maxFreq)
- continue;
- }
- matches.add(modes[i]);
- }
-
- DisplayMode[] ret = new DisplayMode[matches.size()];
- matches.toArray(ret);
- if (LWJGLUtil.DEBUG && DEBUG) {
- System.out.println("Filtered screen modes:");
- for (int i = 0; i < ret.length; i ++) {
- System.out.println(ret[i]);
- }
- }
-
- return ret;
- }
-
- /**
- * Create the display by choosing from a list of display modes based on an order of preference.
- * You must supply a list of allowable display modes, probably by calling getAvailableDisplayModes(),
- * and an array with the order in which you would like them sorted in descending order.
- * This method attempts to create the topmost display mode; if that fails, it will try the next one,
- * and so on, until there are no modes left. If no mode is set at the end, an exception is thrown.
- * @param dm a list of display modes to choose from
- * @param param the names of the DisplayMode fields in the order in which you would like them sorted.
- * @return the chosen display mode
- * @throws NoSuchFieldException if one of the params is not a field in DisplayMode
- * @throws Exception if no display mode could be set
- * @see org.lwjgl.opengl.DisplayMode
- */
- public static DisplayMode setDisplayMode(DisplayMode[] dm, final String[] param) throws Exception {
-
- class FieldAccessor {
- final String fieldName;
- final int order;
- final int preferred;
- final boolean usePreferred;
- FieldAccessor(String fieldName, int order, int preferred, boolean usePreferred) {
- this.fieldName = fieldName;
- this.order = order;
- this.preferred = preferred;
- this.usePreferred = usePreferred;
- }
- int getInt(DisplayMode mode) {
- if ("width".equals(fieldName)) {
- return mode.getWidth();
- }
- if ("height".equals(fieldName)) {
- return mode.getHeight();
- }
- if ("freq".equals(fieldName)) {
- return mode.getFrequency();
- }
- if ("bpp".equals(fieldName)) {
- return mode.getBitsPerPixel();
- }
- throw new IllegalArgumentException("Unknown field "+fieldName);
- }
- }
-
- class Sorter implements Comparator {
-
- final FieldAccessor[] field;
-
- Sorter() {
- field = new FieldAccessor[param.length];
- for (int i = 0; i < field.length; i ++) {
- int idx = param[i].indexOf('=');
- if (idx > 0) {
- field[i] = new FieldAccessor(param[i].substring(0, idx), 0, Integer.parseInt(param[i].substring(idx + 1, param[i].length())), true);
- } else if (param[i].charAt(0) == '-') {
- field[i] = new FieldAccessor(param[i].substring(1), -1, 0, false);
- } else {
- field[i] = new FieldAccessor(param[i], 1, 0, false);
- }
- }
- }
-
- /**
- * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
- */
- public int compare(Object o1, Object o2) {
- DisplayMode dm1 = (DisplayMode) o1;
- DisplayMode dm2 = (DisplayMode) o2;
-
- for (int i = 0; i < field.length; i ++) {
- int f1 = field[i].getInt(dm1);
- int f2 = field[i].getInt(dm2);
-
- if (field[i].usePreferred && f1 != f2) {
- if (f1 == field[i].preferred)
- return -1;
- else if (f2 == field[i].preferred)
- return 1;
- else {
- // Score according to the difference between the values
- int absf1 = Math.abs(f1 - field[i].preferred);
- int absf2 = Math.abs(f2 - field[i].preferred);
- if (absf1 < absf2)
- return -1;
- else if (absf1 > absf2)
- return 1;
- else
- continue;
- }
- } else if (f1 < f2)
- return field[i].order;
- else if (f1 == f2)
- continue;
- else
- return -field[i].order;
- }
-
- return 0;
- }
- }
-
- // Sort the display modes
- Arrays.sort(dm, new Sorter());
-
- // Try them out in the appropriate order
- if (LWJGLUtil.DEBUG || DEBUG) {
- System.out.println("Sorted display modes:");
- for (int i = 0; i < dm.length; i ++) {
- System.out.println(dm[i]);
- }
- }
- for (int i = 0; i < dm.length; i ++) {
- try {
- if (LWJGLUtil.DEBUG || DEBUG)
- System.out.println("Attempting to set displaymode: "+dm[i]);
- org.lwjgl.opengl.Display.setDisplayMode(dm[i]);
- return dm[i];
- } catch (Exception e) {
- if (LWJGLUtil.DEBUG || DEBUG) {
- System.out.println("Failed to set display mode to "+dm[i]);
- e.printStackTrace();
- }
- }
- }
-
- throw new Exception("Failed to set display mode.");
- }
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Comparator;
+
+import org.lwjgl.LWJGLException;
+import org.lwjgl.LWJGLUtil;
+import org.lwjgl.opengl.DisplayMode;
+
+/**
+ * Display initialization utility, that can be used to find display modes and pick
+ * one for you based on your criteria.
+ * @author $Author: matzon $
+ * @version $Revision: 2983 $
+ * $Id: Display.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public final class Display {
+
+ private static final boolean DEBUG = false;
+
+ /**
+ * Determine the available display modes that match the specified minimum and maximum criteria.
+ * If any given criterium is specified as -1 then it is ignored.
+ *
+ * @param minWidth the minimum display resolution in pixels
+ * @param minHeight the minimum display resolution in pixels
+ * @param maxWidth the maximum display resolution in pixels
+ * @param maxHeight the maximum display resolution in pixels
+ * @param minBPP the minimum bit depth per pixel
+ * @param maxBPP the maximum bit depth per pixel
+ * @param minFreq the minimum display frequency in Hz
+ * @param maxFreq the maximum display frequency in Hz
+ * @return an array of matching display modes
+ */
+ public static DisplayMode[] getAvailableDisplayModes(int minWidth, int minHeight, int maxWidth, int maxHeight, int minBPP, int maxBPP,
+ int minFreq, int maxFreq) throws LWJGLException
+ {
+ // First get the available display modes
+ DisplayMode[] modes = org.lwjgl.opengl.Display.getAvailableDisplayModes();
+
+ if (LWJGLUtil.DEBUG || DEBUG) {
+ System.out.println("Available screen modes:");
+ for (int i = 0; i < modes.length; i ++) {
+ System.out.println(modes[i]);
+ }
+ }
+
+ ArrayList matches = new ArrayList(modes.length);
+
+ for (int i = 0; i < modes.length; i ++) {
+ assert modes[i] != null : ""+i+" "+modes.length;
+ if (minWidth != -1 && modes[i].getWidth() < minWidth)
+ continue;
+ if (maxWidth != -1 && modes[i].getWidth() > maxWidth)
+ continue;
+ if (minHeight != -1 && modes[i].getHeight() < minHeight)
+ continue;
+ if (maxHeight != -1 && modes[i].getHeight() > maxHeight)
+ continue;
+ if (minBPP != -1 && modes[i].getBitsPerPixel() < minBPP)
+ continue;
+ if (maxBPP != -1 && modes[i].getBitsPerPixel() > maxBPP)
+ continue;
+ //if (modes[i].bpp == 24)
+ // continue;
+ if (modes[i].getFrequency() != 0) {
+ if (minFreq != -1 && modes[i].getFrequency() < minFreq)
+ continue;
+ if (maxFreq != -1 && modes[i].getFrequency() > maxFreq)
+ continue;
+ }
+ matches.add(modes[i]);
+ }
+
+ DisplayMode[] ret = new DisplayMode[matches.size()];
+ matches.toArray(ret);
+ if (LWJGLUtil.DEBUG && DEBUG) {
+ System.out.println("Filtered screen modes:");
+ for (int i = 0; i < ret.length; i ++) {
+ System.out.println(ret[i]);
+ }
+ }
+
+ return ret;
+ }
+
+ /**
+ * Create the display by choosing from a list of display modes based on an order of preference.
+ * You must supply a list of allowable display modes, probably by calling getAvailableDisplayModes(),
+ * and an array with the order in which you would like them sorted in descending order.
+ * This method attempts to create the topmost display mode; if that fails, it will try the next one,
+ * and so on, until there are no modes left. If no mode is set at the end, an exception is thrown.
+ * @param dm a list of display modes to choose from
+ * @param param the names of the DisplayMode fields in the order in which you would like them sorted.
+ * @return the chosen display mode
+ * @throws NoSuchFieldException if one of the params is not a field in DisplayMode
+ * @throws Exception if no display mode could be set
+ * @see org.lwjgl.opengl.DisplayMode
+ */
+ public static DisplayMode setDisplayMode(DisplayMode[] dm, final String[] param) throws Exception {
+
+ class FieldAccessor {
+ final String fieldName;
+ final int order;
+ final int preferred;
+ final boolean usePreferred;
+ FieldAccessor(String fieldName, int order, int preferred, boolean usePreferred) {
+ this.fieldName = fieldName;
+ this.order = order;
+ this.preferred = preferred;
+ this.usePreferred = usePreferred;
+ }
+ int getInt(DisplayMode mode) {
+ if ("width".equals(fieldName)) {
+ return mode.getWidth();
+ }
+ if ("height".equals(fieldName)) {
+ return mode.getHeight();
+ }
+ if ("freq".equals(fieldName)) {
+ return mode.getFrequency();
+ }
+ if ("bpp".equals(fieldName)) {
+ return mode.getBitsPerPixel();
+ }
+ throw new IllegalArgumentException("Unknown field "+fieldName);
+ }
+ }
+
+ class Sorter implements Comparator {
+
+ final FieldAccessor[] field;
+
+ Sorter() {
+ field = new FieldAccessor[param.length];
+ for (int i = 0; i < field.length; i ++) {
+ int idx = param[i].indexOf('=');
+ if (idx > 0) {
+ field[i] = new FieldAccessor(param[i].substring(0, idx), 0, Integer.parseInt(param[i].substring(idx + 1, param[i].length())), true);
+ } else if (param[i].charAt(0) == '-') {
+ field[i] = new FieldAccessor(param[i].substring(1), -1, 0, false);
+ } else {
+ field[i] = new FieldAccessor(param[i], 1, 0, false);
+ }
+ }
+ }
+
+ /**
+ * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
+ */
+ public int compare(Object o1, Object o2) {
+ DisplayMode dm1 = (DisplayMode) o1;
+ DisplayMode dm2 = (DisplayMode) o2;
+
+ for (int i = 0; i < field.length; i ++) {
+ int f1 = field[i].getInt(dm1);
+ int f2 = field[i].getInt(dm2);
+
+ if (field[i].usePreferred && f1 != f2) {
+ if (f1 == field[i].preferred)
+ return -1;
+ else if (f2 == field[i].preferred)
+ return 1;
+ else {
+ // Score according to the difference between the values
+ int absf1 = Math.abs(f1 - field[i].preferred);
+ int absf2 = Math.abs(f2 - field[i].preferred);
+ if (absf1 < absf2)
+ return -1;
+ else if (absf1 > absf2)
+ return 1;
+ else
+ continue;
+ }
+ } else if (f1 < f2)
+ return field[i].order;
+ else if (f1 == f2)
+ continue;
+ else
+ return -field[i].order;
+ }
+
+ return 0;
+ }
+ }
+
+ // Sort the display modes
+ Arrays.sort(dm, new Sorter());
+
+ // Try them out in the appropriate order
+ if (LWJGLUtil.DEBUG || DEBUG) {
+ System.out.println("Sorted display modes:");
+ for (int i = 0; i < dm.length; i ++) {
+ System.out.println(dm[i]);
+ }
+ }
+ for (int i = 0; i < dm.length; i ++) {
+ try {
+ if (LWJGLUtil.DEBUG || DEBUG)
+ System.out.println("Attempting to set displaymode: "+dm[i]);
+ org.lwjgl.opengl.Display.setDisplayMode(dm[i]);
+ return dm[i];
+ } catch (Exception e) {
+ if (LWJGLUtil.DEBUG || DEBUG) {
+ System.out.println("Failed to set display mode to "+dm[i]);
+ e.printStackTrace();
+ }
+ }
+ }
+
+ throw new Exception("Failed to set display mode.");
+ }
+
+}
diff --git a/src/java/org/lwjgl/util/Point.java b/src/java/org/lwjgl/util/Point.java
index c9ccb8e..b1cb17f 100644
--- a/src/java/org/lwjgl/util/Point.java
+++ b/src/java/org/lwjgl/util/Point.java
@@ -1,170 +1,170 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util;
-
-import java.io.Serializable;
-
-/**
- * A 2D integer point class, which looks remarkably like an AWT one.
- * @author $Author: matzon $
- * @version $Revision: 2983 $
- * $Id: Point.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public final class Point implements ReadablePoint, WritablePoint, Serializable {
-
- static final long serialVersionUID = 1L;
-
- /** The location */
- private int x, y;
-
- /**
- * Constructor for Point.
- */
- public Point() {
- super();
- }
-
- /**
- * Constructor for Point.
- */
- public Point(int x, int y) {
- setLocation(x, y);
- }
-
- /**
- * Constructor for Point.
- */
- public Point(ReadablePoint p) {
- setLocation(p);
- }
-
- public void setLocation(int x, int y) {
- this.x = x;
- this.y = y;
- }
-
- public void setLocation(ReadablePoint p) {
- this.x = p.getX();
- this.y = p.getY();
- }
-
- public void setX(int x) {
- this.x = x;
- }
-
- public void setY(int y) {
- this.y = y;
- }
-
- /**
- * Translate a point.
- * @param dx The translation to apply
- * @param dy The translation to apply
- */
- public void translate(int dx, int dy) {
- this.x += dx;
- this.y += dy;
- }
-
- /**
- * Translate a point.
- * @param p The translation to apply
- */
- public void translate(ReadablePoint p) {
- this.x += p.getX();
- this.y += p.getY();
- }
-
- /**
- * Un-translate a point.
- * @param p The translation to apply
- */
- public void untranslate(ReadablePoint p) {
- this.x -= p.getX();
- this.y -= p.getY();
- }
-
- /**
- * Determines whether an instance of <code>Point2D</code> is equal
- * to this point. Two instances of <code>Point2D</code> are equal if
- * the values of their <code>x</code> and <code>y</code> member
- * fields, representing their position in the coordinate space, are
- * the same.
- * @param obj an object to be compared with this point
- * @return <code>true</code> if the object to be compared is
- * an instance of <code>Point</code> and has
- * the same values; <code>false</code> otherwise
- */
- public boolean equals(Object obj) {
- if (obj instanceof Point) {
- Point pt = (Point) obj;
- return (x == pt.x) && (y == pt.y);
- }
- return super.equals(obj);
- }
-
- /**
- * Returns a string representation of this point and its location
- * in the (<i>x</i>, <i>y</i>) coordinate space. This method is
- * intended to be used only for debugging purposes, and the content
- * and format of the returned string may vary between implementations.
- * The returned string may be empty but may not be <code>null</code>.
- *
- * @return a string representation of this point
- */
- public String toString() {
- return getClass().getName() + "[x=" + x + ",y=" + y + "]";
- }
-
- /**
- * Returns the hash code for this <code>Point</code>.
- *
- * @return a hash code for this <code>Point</code>
- */
- public int hashCode() {
- int sum = x + y;
- return sum * (sum + 1) / 2 + x;
- }
-
- public int getX() {
- return x;
- }
-
- public int getY() {
- return y;
- }
-
- public void getLocation(WritablePoint dest) {
- dest.setLocation(x, y);
- }
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util;
+
+import java.io.Serializable;
+
+/**
+ * A 2D integer point class, which looks remarkably like an AWT one.
+ * @author $Author: matzon $
+ * @version $Revision: 2983 $
+ * $Id: Point.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public final class Point implements ReadablePoint, WritablePoint, Serializable {
+
+ static final long serialVersionUID = 1L;
+
+ /** The location */
+ private int x, y;
+
+ /**
+ * Constructor for Point.
+ */
+ public Point() {
+ super();
+ }
+
+ /**
+ * Constructor for Point.
+ */
+ public Point(int x, int y) {
+ setLocation(x, y);
+ }
+
+ /**
+ * Constructor for Point.
+ */
+ public Point(ReadablePoint p) {
+ setLocation(p);
+ }
+
+ public void setLocation(int x, int y) {
+ this.x = x;
+ this.y = y;
+ }
+
+ public void setLocation(ReadablePoint p) {
+ this.x = p.getX();
+ this.y = p.getY();
+ }
+
+ public void setX(int x) {
+ this.x = x;
+ }
+
+ public void setY(int y) {
+ this.y = y;
+ }
+
+ /**
+ * Translate a point.
+ * @param dx The translation to apply
+ * @param dy The translation to apply
+ */
+ public void translate(int dx, int dy) {
+ this.x += dx;
+ this.y += dy;
+ }
+
+ /**
+ * Translate a point.
+ * @param p The translation to apply
+ */
+ public void translate(ReadablePoint p) {
+ this.x += p.getX();
+ this.y += p.getY();
+ }
+
+ /**
+ * Un-translate a point.
+ * @param p The translation to apply
+ */
+ public void untranslate(ReadablePoint p) {
+ this.x -= p.getX();
+ this.y -= p.getY();
+ }
+
+ /**
+ * Determines whether an instance of <code>Point2D</code> is equal
+ * to this point. Two instances of <code>Point2D</code> are equal if
+ * the values of their <code>x</code> and <code>y</code> member
+ * fields, representing their position in the coordinate space, are
+ * the same.
+ * @param obj an object to be compared with this point
+ * @return <code>true</code> if the object to be compared is
+ * an instance of <code>Point</code> and has
+ * the same values; <code>false</code> otherwise
+ */
+ public boolean equals(Object obj) {
+ if (obj instanceof Point) {
+ Point pt = (Point) obj;
+ return (x == pt.x) && (y == pt.y);
+ }
+ return super.equals(obj);
+ }
+
+ /**
+ * Returns a string representation of this point and its location
+ * in the (<i>x</i>, <i>y</i>) coordinate space. This method is
+ * intended to be used only for debugging purposes, and the content
+ * and format of the returned string may vary between implementations.
+ * The returned string may be empty but may not be <code>null</code>.
+ *
+ * @return a string representation of this point
+ */
+ public String toString() {
+ return getClass().getName() + "[x=" + x + ",y=" + y + "]";
+ }
+
+ /**
+ * Returns the hash code for this <code>Point</code>.
+ *
+ * @return a hash code for this <code>Point</code>
+ */
+ public int hashCode() {
+ int sum = x + y;
+ return sum * (sum + 1) / 2 + x;
+ }
+
+ public int getX() {
+ return x;
+ }
+
+ public int getY() {
+ return y;
+ }
+
+ public void getLocation(WritablePoint dest) {
+ dest.setLocation(x, y);
+ }
+
+}
diff --git a/src/java/org/lwjgl/util/ReadableColor.java b/src/java/org/lwjgl/util/ReadableColor.java
index 8127d45..ce0491d 100644
--- a/src/java/org/lwjgl/util/ReadableColor.java
+++ b/src/java/org/lwjgl/util/ReadableColor.java
@@ -1,146 +1,146 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util;
-
-import java.nio.ByteBuffer;
-
-/**
- * Readonly interface for Colors
- * @author $Author: matzon $
- * @version $Revision: 2983 $
- * $Id: ReadableColor.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public interface ReadableColor {
-
- /**
- * Return the red component (0..255)
- * @return int
- */
- public int getRed();
-
- /**
- * Return the red component (0..255)
- * @return int
- */
- public int getGreen();
-
- /**
- * Return the red component (0..255)
- * @return int
- */
- public int getBlue();
-
- /**
- * Return the red component (0..255)
- * @return int
- */
- public int getAlpha();
-
- /**
- * Return the red component
- * @return int
- */
- public byte getRedByte();
-
- /**
- * Return the red component
- * @return int
- */
- public byte getGreenByte();
-
- /**
- * Return the red component
- * @return int
- */
- public byte getBlueByte();
-
- /**
- * Return the red component
- * @return int
- */
- public byte getAlphaByte();
-
- /**
- * Write the RGBA color directly out to a ByteBuffer
- * @param dest the buffer to write to
- */
- public void writeRGBA(ByteBuffer dest);
-
- /**
- * Write the RGB color directly out to a ByteBuffer
- * @param dest the buffer to write to
- */
- public void writeRGB(ByteBuffer dest);
-
- /**
- * Write the ABGR color directly out to a ByteBuffer
- * @param dest the buffer to write to
- */
- public void writeABGR(ByteBuffer dest);
-
- /**
- * Write the BGR color directly out to a ByteBuffer
- * @param dest the buffer to write to
- */
- public void writeBGR(ByteBuffer dest);
-
- /**
- * Write the BGRA color directly out to a ByteBuffer
- * @param dest the buffer to write to
- */
- public void writeBGRA(ByteBuffer dest);
-
- /**
- * Write the ARGB color directly out to a ByteBuffer
- * @param dest the buffer to write to
- */
- public void writeARGB(ByteBuffer dest);
-
- /*
- * Some standard colors
- */
- public static final ReadableColor RED = new Color(255, 0, 0);
- public static final ReadableColor ORANGE = new Color(255, 128, 0);
- public static final ReadableColor YELLOW = new Color(255, 255, 0);
- public static final ReadableColor GREEN = new Color(0, 255, 0);
- public static final ReadableColor CYAN = new Color(0, 255, 255);
- public static final ReadableColor BLUE = new Color(0, 0, 255);
- public static final ReadableColor PURPLE = new Color(255, 0, 255);
- public static final ReadableColor WHITE = new Color(255, 255, 255);
- public static final ReadableColor BLACK = new Color(0, 0, 0);
- public static final ReadableColor LTGREY = new Color(192, 192, 192);
- public static final ReadableColor DKGREY = new Color(64, 64, 64);
- public static final ReadableColor GREY = new Color(128, 128, 128);
-
-
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util;
+
+import java.nio.ByteBuffer;
+
+/**
+ * Readonly interface for Colors
+ * @author $Author: matzon $
+ * @version $Revision: 2983 $
+ * $Id: ReadableColor.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public interface ReadableColor {
+
+ /**
+ * Return the red component (0..255)
+ * @return int
+ */
+ public int getRed();
+
+ /**
+ * Return the red component (0..255)
+ * @return int
+ */
+ public int getGreen();
+
+ /**
+ * Return the red component (0..255)
+ * @return int
+ */
+ public int getBlue();
+
+ /**
+ * Return the red component (0..255)
+ * @return int
+ */
+ public int getAlpha();
+
+ /**
+ * Return the red component
+ * @return int
+ */
+ public byte getRedByte();
+
+ /**
+ * Return the red component
+ * @return int
+ */
+ public byte getGreenByte();
+
+ /**
+ * Return the red component
+ * @return int
+ */
+ public byte getBlueByte();
+
+ /**
+ * Return the red component
+ * @return int
+ */
+ public byte getAlphaByte();
+
+ /**
+ * Write the RGBA color directly out to a ByteBuffer
+ * @param dest the buffer to write to
+ */
+ public void writeRGBA(ByteBuffer dest);
+
+ /**
+ * Write the RGB color directly out to a ByteBuffer
+ * @param dest the buffer to write to
+ */
+ public void writeRGB(ByteBuffer dest);
+
+ /**
+ * Write the ABGR color directly out to a ByteBuffer
+ * @param dest the buffer to write to
+ */
+ public void writeABGR(ByteBuffer dest);
+
+ /**
+ * Write the BGR color directly out to a ByteBuffer
+ * @param dest the buffer to write to
+ */
+ public void writeBGR(ByteBuffer dest);
+
+ /**
+ * Write the BGRA color directly out to a ByteBuffer
+ * @param dest the buffer to write to
+ */
+ public void writeBGRA(ByteBuffer dest);
+
+ /**
+ * Write the ARGB color directly out to a ByteBuffer
+ * @param dest the buffer to write to
+ */
+ public void writeARGB(ByteBuffer dest);
+
+ /*
+ * Some standard colors
+ */
+ public static final ReadableColor RED = new Color(255, 0, 0);
+ public static final ReadableColor ORANGE = new Color(255, 128, 0);
+ public static final ReadableColor YELLOW = new Color(255, 255, 0);
+ public static final ReadableColor GREEN = new Color(0, 255, 0);
+ public static final ReadableColor CYAN = new Color(0, 255, 255);
+ public static final ReadableColor BLUE = new Color(0, 0, 255);
+ public static final ReadableColor PURPLE = new Color(255, 0, 255);
+ public static final ReadableColor WHITE = new Color(255, 255, 255);
+ public static final ReadableColor BLACK = new Color(0, 0, 0);
+ public static final ReadableColor LTGREY = new Color(192, 192, 192);
+ public static final ReadableColor DKGREY = new Color(64, 64, 64);
+ public static final ReadableColor GREY = new Color(128, 128, 128);
+
+
+
+}
diff --git a/src/java/org/lwjgl/util/ReadableDimension.java b/src/java/org/lwjgl/util/ReadableDimension.java
index 251be8c..a14a55f 100644
--- a/src/java/org/lwjgl/util/ReadableDimension.java
+++ b/src/java/org/lwjgl/util/ReadableDimension.java
@@ -1,60 +1,60 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util;
-
-/**
- * Readonly interface for Dimensions
- * @author $Author: matzon $
- * @version $Revision: 2983 $
- * $Id: ReadableDimension.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public interface ReadableDimension {
-
- /**
- * Get the width
- * @return int
- */
- public int getWidth();
-
- /**
- * Get the height
- * @return int
- */
- public int getHeight();
-
- /**
- * Copy this ReadableDimension into a destination Dimension
- * @param dest The destination
- */
- public void getSize(WritableDimension dest);
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util;
+
+/**
+ * Readonly interface for Dimensions
+ * @author $Author: matzon $
+ * @version $Revision: 2983 $
+ * $Id: ReadableDimension.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public interface ReadableDimension {
+
+ /**
+ * Get the width
+ * @return int
+ */
+ public int getWidth();
+
+ /**
+ * Get the height
+ * @return int
+ */
+ public int getHeight();
+
+ /**
+ * Copy this ReadableDimension into a destination Dimension
+ * @param dest The destination
+ */
+ public void getSize(WritableDimension dest);
+
+}
diff --git a/src/java/org/lwjgl/util/ReadablePoint.java b/src/java/org/lwjgl/util/ReadablePoint.java
index 4dea341..6b8a32d 100644
--- a/src/java/org/lwjgl/util/ReadablePoint.java
+++ b/src/java/org/lwjgl/util/ReadablePoint.java
@@ -1,57 +1,57 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util;
-
-/**
- * Readonly interface for Points
- * @author $Author: matzon $
- * @version $Revision: 2983 $
- * $Id: ReadablePoint.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public interface ReadablePoint {
-
- /**
- * @return int
- */
- public int getX();
-
- /**
- * @return int
- */
- public int getY();
-
- /**
- * Copy this ReadablePoint into a destination Point
- * @param dest The destination Point, or null, to create a new Point
- */
- public void getLocation(WritablePoint dest);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util;
+
+/**
+ * Readonly interface for Points
+ * @author $Author: matzon $
+ * @version $Revision: 2983 $
+ * $Id: ReadablePoint.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public interface ReadablePoint {
+
+ /**
+ * @return int
+ */
+ public int getX();
+
+ /**
+ * @return int
+ */
+ public int getY();
+
+ /**
+ * Copy this ReadablePoint into a destination Point
+ * @param dest The destination Point, or null, to create a new Point
+ */
+ public void getLocation(WritablePoint dest);
+}
diff --git a/src/java/org/lwjgl/util/ReadableRectangle.java b/src/java/org/lwjgl/util/ReadableRectangle.java
index 6e8fb32..22bad2f 100644
--- a/src/java/org/lwjgl/util/ReadableRectangle.java
+++ b/src/java/org/lwjgl/util/ReadableRectangle.java
@@ -1,48 +1,48 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util;
-
-/**
- * Readonly interface for Rectangles
- * @author $Author: matzon $
- * @version $Revision: 2983 $
- * $Id: ReadableRectangle.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public interface ReadableRectangle extends ReadableDimension, ReadablePoint {
-
- /**
- * Copy this readable rectangle's bounds into a destination Rectangle
- * @param dest The destination Rectangle, or null, to create a new Rectangle
- */
- public void getBounds(WritableRectangle dest);
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util;
+
+/**
+ * Readonly interface for Rectangles
+ * @author $Author: matzon $
+ * @version $Revision: 2983 $
+ * $Id: ReadableRectangle.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public interface ReadableRectangle extends ReadableDimension, ReadablePoint {
+
+ /**
+ * Copy this readable rectangle's bounds into a destination Rectangle
+ * @param dest The destination Rectangle, or null, to create a new Rectangle
+ */
+ public void getBounds(WritableRectangle dest);
+
+}
diff --git a/src/java/org/lwjgl/util/Rectangle.java b/src/java/org/lwjgl/util/Rectangle.java
index 357fbf6..d848fd7 100644
--- a/src/java/org/lwjgl/util/Rectangle.java
+++ b/src/java/org/lwjgl/util/Rectangle.java
@@ -1,581 +1,581 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util;
-
-import java.io.Serializable;
-
-/**
- * A 2D integer Rectangle class which looks remarkably like an AWT one.
- * @author $Author: matzon $
- * @version $Revision: 2983 $
- * $Id: Rectangle.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public final class Rectangle implements ReadableRectangle, WritableRectangle, Serializable {
-
- static final long serialVersionUID = 1L;
-
- /** Rectangle's bounds */
- private int x, y, width, height;
-
- /**
- * Constructor for Rectangle.
- */
- public Rectangle() {
- super();
- }
- /**
- * Constructor for Rectangle.
- */
- public Rectangle(int x, int y, int w, int h) {
- this.x = x;
- this.y = y;
- this.width = w;
- this.height = h;
- }
- /**
- * Constructor for Rectangle.
- */
- public Rectangle(ReadablePoint p, ReadableDimension d) {
- x = p.getX();
- y = p.getY();
- width = d.getWidth();
- height = d.getHeight();
- }
- /**
- * Constructor for Rectangle.
- */
- public Rectangle(ReadableRectangle r) {
- x = r.getX();
- y = r.getY();
- width = r.getWidth();
- height = r.getHeight();
- }
-
- public void setLocation(int x, int y) {
- this.x = x;
- this.y = y;
- }
-
- public void setLocation(ReadablePoint p) {
- this.x = p.getX();
- this.y = p.getY();
- }
-
- public void setSize(int w, int h) {
- this.width = w;
- this.height = h;
- }
-
- public void setSize(ReadableDimension d) {
- this.width = d.getWidth();
- this.height = d.getHeight();
- }
-
- public void setBounds(int x, int y, int w, int h) {
- this.x = x;
- this.y = y;
- this.width = w;
- this.height = h;
- }
-
- public void setBounds(ReadablePoint p, ReadableDimension d) {
- x = p.getX();
- y = p.getY();
- width = d.getWidth();
- height = d.getHeight();
- }
-
- public void setBounds(ReadableRectangle r) {
- x = r.getX();
- y = r.getY();
- width = r.getWidth();
- height = r.getHeight();
- }
-
- /* (Overrides)
- * @see com.shavenpuppy.jglib.ReadableRectangle#getBounds(com.shavenpuppy.jglib.Rectangle)
- */
- public void getBounds(WritableRectangle dest) {
- dest.setBounds(x, y, width, height);
- }
-
- /* (Overrides)
- * @see com.shavenpuppy.jglib.ReadablePoint#getLocation(com.shavenpuppy.jglib.Point)
- */
- public void getLocation(WritablePoint dest) {
- dest.setLocation(x, y);
- }
-
- /* (Overrides)
- * @see com.shavenpuppy.jglib.ReadableDimension#getSize(com.shavenpuppy.jglib.Dimension)
- */
- public void getSize(WritableDimension dest) {
- dest.setSize(width, height);
- }
-
- /**
- * Translate the rectangle by an amount.
- * @param x The translation amount on the x axis
- * @param y The translation amount on the y axis
- */
- public void translate(int x, int y) {
- this.x += x;
- this.y += y;
- }
-
- /**
- * Translate the rectangle by an amount.
- * @param point The translation amount
- */
- public void translate(ReadablePoint point) {
- this.x += point.getX();
- this.y += point.getY();
- }
-
- /**
- * Un-translate the rectangle by an amount.
- * @param point The translation amount
- */
- public void untranslate(ReadablePoint point) {
- this.x -= point.getX();
- this.y -= point.getY();
- }
-
- /**
- * Checks whether or not this <code>Rectangle</code> contains the
- * specified <code>Point</code>.
- * @param p the <code>Point</code> to test
- * @return <code>true</code> if the <code>Point</code>
- * (<i>x</i>, <i>y</i>) is inside this
- * <code>Rectangle</code>;
- * <code>false</code> otherwise.
- */
- public boolean contains(ReadablePoint p) {
- return contains(p.getX(), p.getY());
- }
-
- /**
- * Checks whether or not this <code>Rectangle</code> contains the
- * point at the specified location
- * (<i>x</i>, <i>y</i>).
- * @param X the specified x coordinate
- * @param Y the specified y coordinate
- * @return <code>true</code> if the point
- * (<i>x</i>, <i>y</i>) is inside this
- * <code>Rectangle</code>;
- * <code>false</code> otherwise.
- */
- public boolean contains(int X, int Y) {
- int w = this.width;
- int h = this.height;
- if ((w | h) < 0) {
- // At least one of the dimensions is negative...
- return false;
- }
- // Note: if either dimension is zero, tests below must return false...
- int x = this.x;
- int y = this.y;
- if (X < x || Y < y) {
- return false;
- }
- w += x;
- h += y;
- // overflow || intersect
- return ((w < x || w > X) && (h < y || h > Y));
- }
-
- /**
- * Checks whether or not this <code>Rectangle</code> entirely contains
- * the specified <code>Rectangle</code>.
- * @param r the specified <code>Rectangle</code>
- * @return <code>true</code> if the <code>Rectangle</code>
- * is contained entirely inside this <code>Rectangle</code>;
- * <code>false</code> otherwise.
- */
- public boolean contains(ReadableRectangle r) {
- return contains(r.getX(), r.getY(), r.getWidth(), r.getHeight());
- }
-
- /**
- * Checks whether this <code>Rectangle</code> entirely contains
- * the <code>Rectangle</code>
- * at the specified location (<i>X</i>, <i>Y</i>) with the
- * specified dimensions (<i>W</i>, <i>H</i>).
- * @param X the specified x coordinate
- * @param Y the specified y coordinate
- * @param W the width of the <code>Rectangle</code>
- * @param H the height of the <code>Rectangle</code>
- * @return <code>true</code> if the <code>Rectangle</code> specified by
- * (<i>X</i>, <i>Y</i>, <i>W</i>, <i>H</i>)
- * is entirely enclosed inside this <code>Rectangle</code>;
- * <code>false</code> otherwise.
- */
- public boolean contains(int X, int Y, int W, int H) {
- int w = this.width;
- int h = this.height;
- if ((w | h | W | H) < 0) {
- // At least one of the dimensions is negative...
- return false;
- }
- // Note: if any dimension is zero, tests below must return false...
- int x = this.x;
- int y = this.y;
- if (X < x || Y < y) {
- return false;
- }
- w += x;
- W += X;
- if (W <= X) {
- // X+W overflowed or W was zero, return false if...
- // either original w or W was zero or
- // x+w did not overflow or
- // the overflowed x+w is smaller than the overflowed X+W
- if (w >= x || W > w)
- return false;
- } else {
- // X+W did not overflow and W was not zero, return false if...
- // original w was zero or
- // x+w did not overflow and x+w is smaller than X+W
- if (w >= x && W > w)
- return false;
- }
- h += y;
- H += Y;
- if (H <= Y) {
- if (h >= y || H > h)
- return false;
- } else {
- if (h >= y && H > h)
- return false;
- }
- return true;
- }
-
- /**
- * Determines whether or not this <code>Rectangle</code> and the specified
- * <code>Rectangle</code> intersect. Two rectangles intersect if
- * their intersection is nonempty.
- *
- * @param r the specified <code>Rectangle</code>
- * @return <code>true</code> if the specified <code>Rectangle</code>
- * and this <code>Rectangle</code> intersect;
- * <code>false</code> otherwise.
- */
- public boolean intersects(ReadableRectangle r) {
- int tw = this.width;
- int th = this.height;
- int rw = r.getWidth();
- int rh = r.getHeight();
- if (rw <= 0 || rh <= 0 || tw <= 0 || th <= 0) {
- return false;
- }
- int tx = this.x;
- int ty = this.y;
- int rx = r.getX();
- int ry = r.getY();
- rw += rx;
- rh += ry;
- tw += tx;
- th += ty;
- // overflow || intersect
- return ((rw < rx || rw > tx) && (rh < ry || rh > ty) && (tw < tx || tw > rx) && (th < ty || th > ry));
- }
-
- /**
- * Computes the intersection of this <code>Rectangle</code> with the
- * specified <code>Rectangle</code>. Returns a new <code>Rectangle</code>
- * that represents the intersection of the two rectangles.
- * If the two rectangles do not intersect, the result will be
- * an empty rectangle.
- *
- * @param r the specified <code>Rectangle</code>
- * @return the largest <code>Rectangle</code> contained in both the
- * specified <code>Rectangle</code> and in
- * this <code>Rectangle</code>; or if the rectangles
- * do not intersect, an empty rectangle.
- */
- public Rectangle intersection(ReadableRectangle r, Rectangle dest) {
- int tx1 = this.x;
- int ty1 = this.y;
- int rx1 = r.getX();
- int ry1 = r.getY();
- long tx2 = tx1;
- tx2 += this.width;
- long ty2 = ty1;
- ty2 += this.height;
- long rx2 = rx1;
- rx2 += r.getWidth();
- long ry2 = ry1;
- ry2 += r.getHeight();
- if (tx1 < rx1)
- tx1 = rx1;
- if (ty1 < ry1)
- ty1 = ry1;
- if (tx2 > rx2)
- tx2 = rx2;
- if (ty2 > ry2)
- ty2 = ry2;
- tx2 -= tx1;
- ty2 -= ty1;
- // tx2,ty2 will never overflow (they will never be
- // larger than the smallest of the two source w,h)
- // they might underflow, though...
- if (tx2 < Integer.MIN_VALUE)
- tx2 = Integer.MIN_VALUE;
- if (ty2 < Integer.MIN_VALUE)
- ty2 = Integer.MIN_VALUE;
- if (dest == null)
- dest = new Rectangle(tx1, ty1, (int) tx2, (int) ty2);
- else
- dest.setBounds(tx1, ty1, (int) tx2, (int) ty2);
- return dest;
-
- }
-
- /**
- * Computes the union of this <code>Rectangle</code> with the
- * specified <code>Rectangle</code>. Returns a new
- * <code>Rectangle</code> that
- * represents the union of the two rectangles
- * @param r the specified <code>Rectangle</code>
- * @return the smallest <code>Rectangle</code> containing both
- * the specified <code>Rectangle</code> and this
- * <code>Rectangle</code>.
- */
- public WritableRectangle union(ReadableRectangle r, WritableRectangle dest) {
- int x1 = Math.min(x, r.getX());
- int x2 = Math.max(x + width, r.getX() + r.getWidth());
- int y1 = Math.min(y, r.getY());
- int y2 = Math.max(y + height, r.getY() + r.getHeight());
- dest.setBounds(x1, y1, x2 - x1, y2 - y1);
- return dest;
- }
-
- /**
- * Adds a point, specified by the integer arguments <code>newx</code>
- * and <code>newy</code>, to this <code>Rectangle</code>. The
- * resulting <code>Rectangle</code> is
- * the smallest <code>Rectangle</code> that contains both the
- * original <code>Rectangle</code> and the specified point.
- * <p>
- * After adding a point, a call to <code>contains</code> with the
- * added point as an argument does not necessarily return
- * <code>true</code>. The <code>contains</code> method does not
- * return <code>true</code> for points on the right or bottom
- * edges of a <code>Rectangle</code>. Therefore, if the added point
- * falls on the right or bottom edge of the enlarged
- * <code>Rectangle</code>, <code>contains</code> returns
- * <code>false</code> for that point.
- * @param newx the x coordinates of the new point
- * @param newy the y coordinates of the new point
- */
- public void add(int newx, int newy) {
- int x1 = Math.min(x, newx);
- int x2 = Math.max(x + width, newx);
- int y1 = Math.min(y, newy);
- int y2 = Math.max(y + height, newy);
- x = x1;
- y = y1;
- width = x2 - x1;
- height = y2 - y1;
- }
-
- /**
- * Adds the specified <code>Point</code> to this
- * <code>Rectangle</code>. The resulting <code>Rectangle</code>
- * is the smallest <code>Rectangle</code> that contains both the
- * original <code>Rectangle</code> and the specified
- * <code>Point</code>.
- * <p>
- * After adding a <code>Point</code>, a call to <code>contains</code>
- * with the added <code>Point</code> as an argument does not
- * necessarily return <code>true</code>. The <code>contains</code>
- * method does not return <code>true</code> for points on the right
- * or bottom edges of a <code>Rectangle</code>. Therefore if the added
- * <code>Point</code> falls on the right or bottom edge of the
- * enlarged <code>Rectangle</code>, <code>contains</code> returns
- * <code>false</code> for that <code>Point</code>.
- * @param pt the new <code>Point</code> to add to this
- * <code>Rectangle</code>
- */
- public void add(ReadablePoint pt) {
- add(pt.getX(), pt.getY());
- }
-
- /**
- * Adds a <code>Rectangle</code> to this <code>Rectangle</code>.
- * The resulting <code>Rectangle</code> is the union of the two
- * rectangles.
- * @param r the specified <code>Rectangle</code>
- */
- public void add(ReadableRectangle r) {
- int x1 = Math.min(x, r.getX());
- int x2 = Math.max(x + width, r.getX() + r.getWidth());
- int y1 = Math.min(y, r.getY());
- int y2 = Math.max(y + height, r.getY() + r.getHeight());
- x = x1;
- y = y1;
- width = x2 - x1;
- height = y2 - y1;
- }
-
- /**
- * Resizes the <code>Rectangle</code> both horizontally and vertically.
- * <p>
- * This method modifies the <code>Rectangle</code> so that it is
- * <code>h</code> units larger on both the left and right side,
- * and <code>v</code> units larger at both the top and bottom.
- * <p>
- * The new <code>Rectangle</code> has (<code>x - h</code>,
- * <code>y - v</code>) as its top-left corner, a
- * width of
- * <code>width</code> <code>+</code> <code>2h</code>,
- * and a height of
- * <code>height</code> <code>+</code> <code>2v</code>.
- * <p>
- * If negative values are supplied for <code>h</code> and
- * <code>v</code>, the size of the <code>Rectangle</code>
- * decreases accordingly.
- * The <code>grow</code> method does not check whether the resulting
- * values of <code>width</code> and <code>height</code> are
- * non-negative.
- * @param h the horizontal expansion
- * @param v the vertical expansion
- */
- public void grow(int h, int v) {
- x -= h;
- y -= v;
- width += h * 2;
- height += v * 2;
- }
-
- /**
- * Determines whether or not this <code>Rectangle</code> is empty. A
- * <code>Rectangle</code> is empty if its width or its height is less
- * than or equal to zero.
- * @return <code>true</code> if this <code>Rectangle</code> is empty;
- * <code>false</code> otherwise.
- */
- public boolean isEmpty() {
- return (width <= 0) || (height <= 0);
- }
- /**
- * Checks whether two rectangles are equal.
- * <p>
- * The result is <code>true</code> if and only if the argument is not
- * <code>null</code> and is a <code>Rectangle</code> object that has the
- * same top-left corner, width, and height as this <code>Rectangle</code>.
- * @param obj the <code>Object</code> to compare with
- * this <code>Rectangle</code>
- * @return <code>true</code> if the objects are equal;
- * <code>false</code> otherwise.
- */
- public boolean equals(Object obj) {
- if (obj instanceof Rectangle) {
- Rectangle r = (Rectangle) obj;
- return ((x == r.x) && (y == r.y) && (width == r.width) && (height == r.height));
- }
- return super.equals(obj);
- }
-
- /**
- * Debugging
- * @return a String
- */
- public String toString() {
- return getClass().getName() + "[x=" + x + ",y=" + y + ",width=" + width + ",height=" + height + "]";
- }
- /**
- * Gets the height.
- * @return Returns a int
- */
- public int getHeight() {
- return height;
- }
-
- /**
- * Sets the height.
- * @param height The height to set
- */
- public void setHeight(int height) {
- this.height = height;
- }
-
- /**
- * Gets the width.
- * @return Returns a int
- */
- public int getWidth() {
- return width;
- }
-
- /**
- * Sets the width.
- * @param width The width to set
- */
- public void setWidth(int width) {
- this.width = width;
- }
-
- /**
- * Gets the x.
- * @return Returns a int
- */
- public int getX() {
- return x;
- }
-
- /**
- * Sets the x.
- * @param x The x to set
- */
- public void setX(int x) {
- this.x = x;
- }
-
- /**
- * Gets the y.
- * @return Returns a int
- */
- public int getY() {
- return y;
- }
-
- /**
- * Sets the y.
- * @param y The y to set
- */
- public void setY(int y) {
- this.y = y;
- }
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util;
+
+import java.io.Serializable;
+
+/**
+ * A 2D integer Rectangle class which looks remarkably like an AWT one.
+ * @author $Author: matzon $
+ * @version $Revision: 2983 $
+ * $Id: Rectangle.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public final class Rectangle implements ReadableRectangle, WritableRectangle, Serializable {
+
+ static final long serialVersionUID = 1L;
+
+ /** Rectangle's bounds */
+ private int x, y, width, height;
+
+ /**
+ * Constructor for Rectangle.
+ */
+ public Rectangle() {
+ super();
+ }
+ /**
+ * Constructor for Rectangle.
+ */
+ public Rectangle(int x, int y, int w, int h) {
+ this.x = x;
+ this.y = y;
+ this.width = w;
+ this.height = h;
+ }
+ /**
+ * Constructor for Rectangle.
+ */
+ public Rectangle(ReadablePoint p, ReadableDimension d) {
+ x = p.getX();
+ y = p.getY();
+ width = d.getWidth();
+ height = d.getHeight();
+ }
+ /**
+ * Constructor for Rectangle.
+ */
+ public Rectangle(ReadableRectangle r) {
+ x = r.getX();
+ y = r.getY();
+ width = r.getWidth();
+ height = r.getHeight();
+ }
+
+ public void setLocation(int x, int y) {
+ this.x = x;
+ this.y = y;
+ }
+
+ public void setLocation(ReadablePoint p) {
+ this.x = p.getX();
+ this.y = p.getY();
+ }
+
+ public void setSize(int w, int h) {
+ this.width = w;
+ this.height = h;
+ }
+
+ public void setSize(ReadableDimension d) {
+ this.width = d.getWidth();
+ this.height = d.getHeight();
+ }
+
+ public void setBounds(int x, int y, int w, int h) {
+ this.x = x;
+ this.y = y;
+ this.width = w;
+ this.height = h;
+ }
+
+ public void setBounds(ReadablePoint p, ReadableDimension d) {
+ x = p.getX();
+ y = p.getY();
+ width = d.getWidth();
+ height = d.getHeight();
+ }
+
+ public void setBounds(ReadableRectangle r) {
+ x = r.getX();
+ y = r.getY();
+ width = r.getWidth();
+ height = r.getHeight();
+ }
+
+ /* (Overrides)
+ * @see com.shavenpuppy.jglib.ReadableRectangle#getBounds(com.shavenpuppy.jglib.Rectangle)
+ */
+ public void getBounds(WritableRectangle dest) {
+ dest.setBounds(x, y, width, height);
+ }
+
+ /* (Overrides)
+ * @see com.shavenpuppy.jglib.ReadablePoint#getLocation(com.shavenpuppy.jglib.Point)
+ */
+ public void getLocation(WritablePoint dest) {
+ dest.setLocation(x, y);
+ }
+
+ /* (Overrides)
+ * @see com.shavenpuppy.jglib.ReadableDimension#getSize(com.shavenpuppy.jglib.Dimension)
+ */
+ public void getSize(WritableDimension dest) {
+ dest.setSize(width, height);
+ }
+
+ /**
+ * Translate the rectangle by an amount.
+ * @param x The translation amount on the x axis
+ * @param y The translation amount on the y axis
+ */
+ public void translate(int x, int y) {
+ this.x += x;
+ this.y += y;
+ }
+
+ /**
+ * Translate the rectangle by an amount.
+ * @param point The translation amount
+ */
+ public void translate(ReadablePoint point) {
+ this.x += point.getX();
+ this.y += point.getY();
+ }
+
+ /**
+ * Un-translate the rectangle by an amount.
+ * @param point The translation amount
+ */
+ public void untranslate(ReadablePoint point) {
+ this.x -= point.getX();
+ this.y -= point.getY();
+ }
+
+ /**
+ * Checks whether or not this <code>Rectangle</code> contains the
+ * specified <code>Point</code>.
+ * @param p the <code>Point</code> to test
+ * @return <code>true</code> if the <code>Point</code>
+ * (<i>x</i>, <i>y</i>) is inside this
+ * <code>Rectangle</code>;
+ * <code>false</code> otherwise.
+ */
+ public boolean contains(ReadablePoint p) {
+ return contains(p.getX(), p.getY());
+ }
+
+ /**
+ * Checks whether or not this <code>Rectangle</code> contains the
+ * point at the specified location
+ * (<i>x</i>, <i>y</i>).
+ * @param X the specified x coordinate
+ * @param Y the specified y coordinate
+ * @return <code>true</code> if the point
+ * (<i>x</i>, <i>y</i>) is inside this
+ * <code>Rectangle</code>;
+ * <code>false</code> otherwise.
+ */
+ public boolean contains(int X, int Y) {
+ int w = this.width;
+ int h = this.height;
+ if ((w | h) < 0) {
+ // At least one of the dimensions is negative...
+ return false;
+ }
+ // Note: if either dimension is zero, tests below must return false...
+ int x = this.x;
+ int y = this.y;
+ if (X < x || Y < y) {
+ return false;
+ }
+ w += x;
+ h += y;
+ // overflow || intersect
+ return ((w < x || w > X) && (h < y || h > Y));
+ }
+
+ /**
+ * Checks whether or not this <code>Rectangle</code> entirely contains
+ * the specified <code>Rectangle</code>.
+ * @param r the specified <code>Rectangle</code>
+ * @return <code>true</code> if the <code>Rectangle</code>
+ * is contained entirely inside this <code>Rectangle</code>;
+ * <code>false</code> otherwise.
+ */
+ public boolean contains(ReadableRectangle r) {
+ return contains(r.getX(), r.getY(), r.getWidth(), r.getHeight());
+ }
+
+ /**
+ * Checks whether this <code>Rectangle</code> entirely contains
+ * the <code>Rectangle</code>
+ * at the specified location (<i>X</i>, <i>Y</i>) with the
+ * specified dimensions (<i>W</i>, <i>H</i>).
+ * @param X the specified x coordinate
+ * @param Y the specified y coordinate
+ * @param W the width of the <code>Rectangle</code>
+ * @param H the height of the <code>Rectangle</code>
+ * @return <code>true</code> if the <code>Rectangle</code> specified by
+ * (<i>X</i>, <i>Y</i>, <i>W</i>, <i>H</i>)
+ * is entirely enclosed inside this <code>Rectangle</code>;
+ * <code>false</code> otherwise.
+ */
+ public boolean contains(int X, int Y, int W, int H) {
+ int w = this.width;
+ int h = this.height;
+ if ((w | h | W | H) < 0) {
+ // At least one of the dimensions is negative...
+ return false;
+ }
+ // Note: if any dimension is zero, tests below must return false...
+ int x = this.x;
+ int y = this.y;
+ if (X < x || Y < y) {
+ return false;
+ }
+ w += x;
+ W += X;
+ if (W <= X) {
+ // X+W overflowed or W was zero, return false if...
+ // either original w or W was zero or
+ // x+w did not overflow or
+ // the overflowed x+w is smaller than the overflowed X+W
+ if (w >= x || W > w)
+ return false;
+ } else {
+ // X+W did not overflow and W was not zero, return false if...
+ // original w was zero or
+ // x+w did not overflow and x+w is smaller than X+W
+ if (w >= x && W > w)
+ return false;
+ }
+ h += y;
+ H += Y;
+ if (H <= Y) {
+ if (h >= y || H > h)
+ return false;
+ } else {
+ if (h >= y && H > h)
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Determines whether or not this <code>Rectangle</code> and the specified
+ * <code>Rectangle</code> intersect. Two rectangles intersect if
+ * their intersection is nonempty.
+ *
+ * @param r the specified <code>Rectangle</code>
+ * @return <code>true</code> if the specified <code>Rectangle</code>
+ * and this <code>Rectangle</code> intersect;
+ * <code>false</code> otherwise.
+ */
+ public boolean intersects(ReadableRectangle r) {
+ int tw = this.width;
+ int th = this.height;
+ int rw = r.getWidth();
+ int rh = r.getHeight();
+ if (rw <= 0 || rh <= 0 || tw <= 0 || th <= 0) {
+ return false;
+ }
+ int tx = this.x;
+ int ty = this.y;
+ int rx = r.getX();
+ int ry = r.getY();
+ rw += rx;
+ rh += ry;
+ tw += tx;
+ th += ty;
+ // overflow || intersect
+ return ((rw < rx || rw > tx) && (rh < ry || rh > ty) && (tw < tx || tw > rx) && (th < ty || th > ry));
+ }
+
+ /**
+ * Computes the intersection of this <code>Rectangle</code> with the
+ * specified <code>Rectangle</code>. Returns a new <code>Rectangle</code>
+ * that represents the intersection of the two rectangles.
+ * If the two rectangles do not intersect, the result will be
+ * an empty rectangle.
+ *
+ * @param r the specified <code>Rectangle</code>
+ * @return the largest <code>Rectangle</code> contained in both the
+ * specified <code>Rectangle</code> and in
+ * this <code>Rectangle</code>; or if the rectangles
+ * do not intersect, an empty rectangle.
+ */
+ public Rectangle intersection(ReadableRectangle r, Rectangle dest) {
+ int tx1 = this.x;
+ int ty1 = this.y;
+ int rx1 = r.getX();
+ int ry1 = r.getY();
+ long tx2 = tx1;
+ tx2 += this.width;
+ long ty2 = ty1;
+ ty2 += this.height;
+ long rx2 = rx1;
+ rx2 += r.getWidth();
+ long ry2 = ry1;
+ ry2 += r.getHeight();
+ if (tx1 < rx1)
+ tx1 = rx1;
+ if (ty1 < ry1)
+ ty1 = ry1;
+ if (tx2 > rx2)
+ tx2 = rx2;
+ if (ty2 > ry2)
+ ty2 = ry2;
+ tx2 -= tx1;
+ ty2 -= ty1;
+ // tx2,ty2 will never overflow (they will never be
+ // larger than the smallest of the two source w,h)
+ // they might underflow, though...
+ if (tx2 < Integer.MIN_VALUE)
+ tx2 = Integer.MIN_VALUE;
+ if (ty2 < Integer.MIN_VALUE)
+ ty2 = Integer.MIN_VALUE;
+ if (dest == null)
+ dest = new Rectangle(tx1, ty1, (int) tx2, (int) ty2);
+ else
+ dest.setBounds(tx1, ty1, (int) tx2, (int) ty2);
+ return dest;
+
+ }
+
+ /**
+ * Computes the union of this <code>Rectangle</code> with the
+ * specified <code>Rectangle</code>. Returns a new
+ * <code>Rectangle</code> that
+ * represents the union of the two rectangles
+ * @param r the specified <code>Rectangle</code>
+ * @return the smallest <code>Rectangle</code> containing both
+ * the specified <code>Rectangle</code> and this
+ * <code>Rectangle</code>.
+ */
+ public WritableRectangle union(ReadableRectangle r, WritableRectangle dest) {
+ int x1 = Math.min(x, r.getX());
+ int x2 = Math.max(x + width, r.getX() + r.getWidth());
+ int y1 = Math.min(y, r.getY());
+ int y2 = Math.max(y + height, r.getY() + r.getHeight());
+ dest.setBounds(x1, y1, x2 - x1, y2 - y1);
+ return dest;
+ }
+
+ /**
+ * Adds a point, specified by the integer arguments <code>newx</code>
+ * and <code>newy</code>, to this <code>Rectangle</code>. The
+ * resulting <code>Rectangle</code> is
+ * the smallest <code>Rectangle</code> that contains both the
+ * original <code>Rectangle</code> and the specified point.
+ * <p>
+ * After adding a point, a call to <code>contains</code> with the
+ * added point as an argument does not necessarily return
+ * <code>true</code>. The <code>contains</code> method does not
+ * return <code>true</code> for points on the right or bottom
+ * edges of a <code>Rectangle</code>. Therefore, if the added point
+ * falls on the right or bottom edge of the enlarged
+ * <code>Rectangle</code>, <code>contains</code> returns
+ * <code>false</code> for that point.
+ * @param newx the x coordinates of the new point
+ * @param newy the y coordinates of the new point
+ */
+ public void add(int newx, int newy) {
+ int x1 = Math.min(x, newx);
+ int x2 = Math.max(x + width, newx);
+ int y1 = Math.min(y, newy);
+ int y2 = Math.max(y + height, newy);
+ x = x1;
+ y = y1;
+ width = x2 - x1;
+ height = y2 - y1;
+ }
+
+ /**
+ * Adds the specified <code>Point</code> to this
+ * <code>Rectangle</code>. The resulting <code>Rectangle</code>
+ * is the smallest <code>Rectangle</code> that contains both the
+ * original <code>Rectangle</code> and the specified
+ * <code>Point</code>.
+ * <p>
+ * After adding a <code>Point</code>, a call to <code>contains</code>
+ * with the added <code>Point</code> as an argument does not
+ * necessarily return <code>true</code>. The <code>contains</code>
+ * method does not return <code>true</code> for points on the right
+ * or bottom edges of a <code>Rectangle</code>. Therefore if the added
+ * <code>Point</code> falls on the right or bottom edge of the
+ * enlarged <code>Rectangle</code>, <code>contains</code> returns
+ * <code>false</code> for that <code>Point</code>.
+ * @param pt the new <code>Point</code> to add to this
+ * <code>Rectangle</code>
+ */
+ public void add(ReadablePoint pt) {
+ add(pt.getX(), pt.getY());
+ }
+
+ /**
+ * Adds a <code>Rectangle</code> to this <code>Rectangle</code>.
+ * The resulting <code>Rectangle</code> is the union of the two
+ * rectangles.
+ * @param r the specified <code>Rectangle</code>
+ */
+ public void add(ReadableRectangle r) {
+ int x1 = Math.min(x, r.getX());
+ int x2 = Math.max(x + width, r.getX() + r.getWidth());
+ int y1 = Math.min(y, r.getY());
+ int y2 = Math.max(y + height, r.getY() + r.getHeight());
+ x = x1;
+ y = y1;
+ width = x2 - x1;
+ height = y2 - y1;
+ }
+
+ /**
+ * Resizes the <code>Rectangle</code> both horizontally and vertically.
+ * <p>
+ * This method modifies the <code>Rectangle</code> so that it is
+ * <code>h</code> units larger on both the left and right side,
+ * and <code>v</code> units larger at both the top and bottom.
+ * <p>
+ * The new <code>Rectangle</code> has (<code>x - h</code>,
+ * <code>y - v</code>) as its top-left corner, a
+ * width of
+ * <code>width</code> <code>+</code> <code>2h</code>,
+ * and a height of
+ * <code>height</code> <code>+</code> <code>2v</code>.
+ * <p>
+ * If negative values are supplied for <code>h</code> and
+ * <code>v</code>, the size of the <code>Rectangle</code>
+ * decreases accordingly.
+ * The <code>grow</code> method does not check whether the resulting
+ * values of <code>width</code> and <code>height</code> are
+ * non-negative.
+ * @param h the horizontal expansion
+ * @param v the vertical expansion
+ */
+ public void grow(int h, int v) {
+ x -= h;
+ y -= v;
+ width += h * 2;
+ height += v * 2;
+ }
+
+ /**
+ * Determines whether or not this <code>Rectangle</code> is empty. A
+ * <code>Rectangle</code> is empty if its width or its height is less
+ * than or equal to zero.
+ * @return <code>true</code> if this <code>Rectangle</code> is empty;
+ * <code>false</code> otherwise.
+ */
+ public boolean isEmpty() {
+ return (width <= 0) || (height <= 0);
+ }
+ /**
+ * Checks whether two rectangles are equal.
+ * <p>
+ * The result is <code>true</code> if and only if the argument is not
+ * <code>null</code> and is a <code>Rectangle</code> object that has the
+ * same top-left corner, width, and height as this <code>Rectangle</code>.
+ * @param obj the <code>Object</code> to compare with
+ * this <code>Rectangle</code>
+ * @return <code>true</code> if the objects are equal;
+ * <code>false</code> otherwise.
+ */
+ public boolean equals(Object obj) {
+ if (obj instanceof Rectangle) {
+ Rectangle r = (Rectangle) obj;
+ return ((x == r.x) && (y == r.y) && (width == r.width) && (height == r.height));
+ }
+ return super.equals(obj);
+ }
+
+ /**
+ * Debugging
+ * @return a String
+ */
+ public String toString() {
+ return getClass().getName() + "[x=" + x + ",y=" + y + ",width=" + width + ",height=" + height + "]";
+ }
+ /**
+ * Gets the height.
+ * @return Returns a int
+ */
+ public int getHeight() {
+ return height;
+ }
+
+ /**
+ * Sets the height.
+ * @param height The height to set
+ */
+ public void setHeight(int height) {
+ this.height = height;
+ }
+
+ /**
+ * Gets the width.
+ * @return Returns a int
+ */
+ public int getWidth() {
+ return width;
+ }
+
+ /**
+ * Sets the width.
+ * @param width The width to set
+ */
+ public void setWidth(int width) {
+ this.width = width;
+ }
+
+ /**
+ * Gets the x.
+ * @return Returns a int
+ */
+ public int getX() {
+ return x;
+ }
+
+ /**
+ * Sets the x.
+ * @param x The x to set
+ */
+ public void setX(int x) {
+ this.x = x;
+ }
+
+ /**
+ * Gets the y.
+ * @return Returns a int
+ */
+ public int getY() {
+ return y;
+ }
+
+ /**
+ * Sets the y.
+ * @param y The y to set
+ */
+ public void setY(int y) {
+ this.y = y;
+ }
+
+}
diff --git a/src/java/org/lwjgl/util/Renderable.java b/src/java/org/lwjgl/util/Renderable.java
index 61d3df7..9c79586 100644
--- a/src/java/org/lwjgl/util/Renderable.java
+++ b/src/java/org/lwjgl/util/Renderable.java
@@ -1,49 +1,49 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util;
-
-/**
- *
- * Simple interface to things that can be Rendered.
- *
- * @author $Author: matzon $
- * @version $Revision: 2983 $
- * $Id: Renderable.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public interface Renderable {
-
- /**
- * "Render" this thing. This will involve calls to the GL.
- */
- public void render();
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util;
+
+/**
+ *
+ * Simple interface to things that can be Rendered.
+ *
+ * @author $Author: matzon $
+ * @version $Revision: 2983 $
+ * $Id: Renderable.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public interface Renderable {
+
+ /**
+ * "Render" this thing. This will involve calls to the GL.
+ */
+ public void render();
+
+}
diff --git a/src/java/org/lwjgl/util/Timer.java b/src/java/org/lwjgl/util/Timer.java
index 9a4d25a..0b6de48 100644
--- a/src/java/org/lwjgl/util/Timer.java
+++ b/src/java/org/lwjgl/util/Timer.java
@@ -1,156 +1,156 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util;
-
-import org.lwjgl.Sys;
-
-/**
- *
- * A hires timer. This measures time in seconds as floating point values.
- * All Timers created are updated simultaneously by calling the static method
- * tick(). This ensures that within a single iteration of a game loop that
- * all timers are updated consistently with each other.
- *
- * @author cix_foo <cix_foo at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: Timer.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public class Timer {
-
- // Record the timer resolution on classload
- private static long resolution = Sys.getTimerResolution();
-
- // Every so often we will re-query the timer resolution
- private static final int QUERY_INTERVAL = 50; // in calls to tick()
- private static int queryCount = 0;
-
- // Globally keeps track of time for all instances of Timer
- private static long currentTime;
-
- // When the timer was started
- private long startTime;
-
- // The last time recorded by getTime()
- private long lastTime;
-
- // Whether the timer is paused
- private boolean paused;
-
- static {
- tick();
- }
-
- /**
- * Constructs a timer. The timer will be reset to 0.0 and resumed immediately.
- */
- public Timer() {
- reset();
- resume();
- }
-
- /**
- * @return the time in seconds, as a float
- */
- public float getTime() {
- if (!paused) {
- lastTime = currentTime - startTime;
- }
-
- return (float) ((double) lastTime / (double) resolution);
- }
- /**
- * @return whether this timer is paused
- */
- public boolean isPaused() {
- return paused;
- }
-
- /**
- * Pause the timer. Whilst paused the time will not change for this timer
- * when tick() is called.
- *
- * @see #resume()
- */
- public void pause() {
- paused = true;
- }
-
- /**
- * Reset the timer. Equivalent to set(0.0f);
- * @see #set(float)
- */
- public void reset() {
- set(0.0f);
- }
-
- /**
- * Resume the timer.
- * @see #pause()
- */
- public void resume() {
- paused = false;
- startTime = currentTime - lastTime;
- }
-
- /**
- * Set the time of this timer
- * @param newTime the new time, in seconds
- */
- public void set(float newTime) {
- long newTimeInTicks = (long) ((double) newTime * (double) resolution);
- startTime = currentTime - newTimeInTicks;
- lastTime = newTimeInTicks;
- }
-
- /**
- * Get the next time update from the system's hires timer. This method should
- * be called once per main loop iteration; all timers are updated simultaneously
- * from it.
- */
- public static void tick() {
- currentTime = Sys.getTime();
-
- // Periodically refresh the timer resolution:
- queryCount ++;
- if (queryCount > QUERY_INTERVAL) {
- queryCount = 0;
- resolution = Sys.getTimerResolution();
- }
- }
-
- /**
- * Debug output.
- */
- public String toString() {
- return "Timer[Time=" + getTime() + ", Paused=" + paused + "]";
- }
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util;
+
+import org.lwjgl.Sys;
+
+/**
+ *
+ * A hires timer. This measures time in seconds as floating point values.
+ * All Timers created are updated simultaneously by calling the static method
+ * tick(). This ensures that within a single iteration of a game loop that
+ * all timers are updated consistently with each other.
+ *
+ * @author cix_foo <cix_foo at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: Timer.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public class Timer {
+
+ // Record the timer resolution on classload
+ private static long resolution = Sys.getTimerResolution();
+
+ // Every so often we will re-query the timer resolution
+ private static final int QUERY_INTERVAL = 50; // in calls to tick()
+ private static int queryCount = 0;
+
+ // Globally keeps track of time for all instances of Timer
+ private static long currentTime;
+
+ // When the timer was started
+ private long startTime;
+
+ // The last time recorded by getTime()
+ private long lastTime;
+
+ // Whether the timer is paused
+ private boolean paused;
+
+ static {
+ tick();
+ }
+
+ /**
+ * Constructs a timer. The timer will be reset to 0.0 and resumed immediately.
+ */
+ public Timer() {
+ reset();
+ resume();
+ }
+
+ /**
+ * @return the time in seconds, as a float
+ */
+ public float getTime() {
+ if (!paused) {
+ lastTime = currentTime - startTime;
+ }
+
+ return (float) ((double) lastTime / (double) resolution);
+ }
+ /**
+ * @return whether this timer is paused
+ */
+ public boolean isPaused() {
+ return paused;
+ }
+
+ /**
+ * Pause the timer. Whilst paused the time will not change for this timer
+ * when tick() is called.
+ *
+ * @see #resume()
+ */
+ public void pause() {
+ paused = true;
+ }
+
+ /**
+ * Reset the timer. Equivalent to set(0.0f);
+ * @see #set(float)
+ */
+ public void reset() {
+ set(0.0f);
+ }
+
+ /**
+ * Resume the timer.
+ * @see #pause()
+ */
+ public void resume() {
+ paused = false;
+ startTime = currentTime - lastTime;
+ }
+
+ /**
+ * Set the time of this timer
+ * @param newTime the new time, in seconds
+ */
+ public void set(float newTime) {
+ long newTimeInTicks = (long) ((double) newTime * (double) resolution);
+ startTime = currentTime - newTimeInTicks;
+ lastTime = newTimeInTicks;
+ }
+
+ /**
+ * Get the next time update from the system's hires timer. This method should
+ * be called once per main loop iteration; all timers are updated simultaneously
+ * from it.
+ */
+ public static void tick() {
+ currentTime = Sys.getTime();
+
+ // Periodically refresh the timer resolution:
+ queryCount ++;
+ if (queryCount > QUERY_INTERVAL) {
+ queryCount = 0;
+ resolution = Sys.getTimerResolution();
+ }
+ }
+
+ /**
+ * Debug output.
+ */
+ public String toString() {
+ return "Timer[Time=" + getTime() + ", Paused=" + paused + "]";
+ }
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/util/WaveData.java b/src/java/org/lwjgl/util/WaveData.java
index 1f2dec4..d6928e7 100644
--- a/src/java/org/lwjgl/util/WaveData.java
+++ b/src/java/org/lwjgl/util/WaveData.java
@@ -1,253 +1,253 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util;
-
-import java.io.BufferedInputStream;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.nio.ShortBuffer;
-
-import javax.sound.sampled.AudioFormat;
-import javax.sound.sampled.AudioInputStream;
-import javax.sound.sampled.AudioSystem;
-
-import org.lwjgl.openal.AL10;
-
-/**
- *
- * Utitlity class for loading wavefiles.
- *
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 3274 $
- * $Id: WaveData.java 3274 2010-02-20 10:43:22Z matzon $
- */
-public class WaveData {
- /** actual wave data */
- public final ByteBuffer data;
-
- /** format type of data */
- public final int format;
-
- /** sample rate of data */
- public final int samplerate;
-
- /**
- * Creates a new WaveData
- *
- * @param data actual wavedata
- * @param format format of wave data
- * @param samplerate sample rate of data
- */
- private WaveData(ByteBuffer data, int format, int samplerate) {
- this.data = data;
- this.format = format;
- this.samplerate = samplerate;
- }
-
- /**
- * Disposes the wavedata
- */
- public void dispose() {
- data.clear();
- }
-
- /**
- * Creates a WaveData container from the specified url
- *
- * @param path URL to file
- * @return WaveData containing data, or null if a failure occured
- */
- public static WaveData create(URL path) {
- try {
- return create(
- AudioSystem.getAudioInputStream(
- new BufferedInputStream(path.openStream())));
- } catch (Exception e) {
- org.lwjgl.LWJGLUtil.log("Unable to create from: " + path + ", " + e.getMessage());
- return null;
- }
- }
-
- /**
- * Creates a WaveData container from the specified in the classpath
- *
- * @param path path to file (relative, and in classpath)
- * @return WaveData containing data, or null if a failure occured
- */
- public static WaveData create(String path) {
- return create(WaveData.class.getClassLoader().getResource(path));
- }
-
- /**
- * Creates a WaveData container from the specified inputstream
- *
- * @param is InputStream to read from
- * @return WaveData containing data, or null if a failure occured
- */
- public static WaveData create(InputStream is) {
- try {
- return create(
- AudioSystem.getAudioInputStream(is));
- } catch (Exception e) {
- org.lwjgl.LWJGLUtil.log("Unable to create from inputstream, " + e.getMessage());
- return null;
- }
- }
-
- /**
- * Creates a WaveData container from the specified bytes
- *
- * @param buffer array of bytes containing the complete wave file
- * @return WaveData containing data, or null if a failure occured
- */
- public static WaveData create(byte[] buffer) {
- try {
- return create(
- AudioSystem.getAudioInputStream(
- new BufferedInputStream(new ByteArrayInputStream(buffer))));
- } catch (Exception e) {
- org.lwjgl.LWJGLUtil.log("Unable to create from byte array, " + e.getMessage());
- return null;
- }
- }
-
- /**
- * Creates a WaveData container from the specified ByetBuffer.
- * If the buffer is backed by an array, it will be used directly,
- * else the contents of the buffer will be copied using get(byte[]).
- *
- * @param buffer ByteBuffer containing sound file
- * @return WaveData containing data, or null if a failure occured
- */
- public static WaveData create(ByteBuffer buffer) {
- try {
- byte[] bytes = null;
-
- if(buffer.hasArray()) {
- bytes = buffer.array();
- } else {
- bytes = new byte[buffer.capacity()];
- buffer.get(bytes);
- }
- return create(bytes);
- } catch (Exception e) {
- org.lwjgl.LWJGLUtil.log("Unable to create from ByteBuffer, " + e.getMessage());
- return null;
- }
- }
-
- /**
- * Creates a WaveData container from the specified stream
- *
- * @param ais AudioInputStream to read from
- * @return WaveData containing data, or null if a failure occured
- */
- public static WaveData create(AudioInputStream ais) {
- //get format of data
- AudioFormat audioformat = ais.getFormat();
-
- // get channels
- int channels = 0;
- if (audioformat.getChannels() == 1) {
- if (audioformat.getSampleSizeInBits() == 8) {
- channels = AL10.AL_FORMAT_MONO8;
- } else if (audioformat.getSampleSizeInBits() == 16) {
- channels = AL10.AL_FORMAT_MONO16;
- } else {
- assert false : "Illegal sample size";
- }
- } else if (audioformat.getChannels() == 2) {
- if (audioformat.getSampleSizeInBits() == 8) {
- channels = AL10.AL_FORMAT_STEREO8;
- } else if (audioformat.getSampleSizeInBits() == 16) {
- channels = AL10.AL_FORMAT_STEREO16;
- } else {
- assert false : "Illegal sample size";
- }
- } else {
- assert false : "Only mono or stereo is supported";
- }
-
- //read data into buffer
- ByteBuffer buffer = null;
- try {
- int available = ais.available();
- if(available <= 0) {
- available = ais.getFormat().getChannels() * (int) ais.getFrameLength() * ais.getFormat().getSampleSizeInBits() / 8;
- }
- byte[] buf = new byte[ais.available()];
- int read = 0, total = 0;
- while ((read = ais.read(buf, total, buf.length - total)) != -1
- && total < buf.length) {
- total += read;
- }
- buffer = convertAudioBytes(buf, audioformat.getSampleSizeInBits() == 16);
- } catch (IOException ioe) {
- return null;
- }
-
-
- //create our result
- WaveData wavedata =
- new WaveData(buffer, channels, (int) audioformat.getSampleRate());
-
- //close stream
- try {
- ais.close();
- } catch (IOException ioe) {
- }
-
- return wavedata;
- }
-
- private static ByteBuffer convertAudioBytes(byte[] audio_bytes, boolean two_bytes_data) {
- ByteBuffer dest = ByteBuffer.allocateDirect(audio_bytes.length);
- dest.order(ByteOrder.nativeOrder());
- ByteBuffer src = ByteBuffer.wrap(audio_bytes);
- src.order(ByteOrder.LITTLE_ENDIAN);
- if (two_bytes_data) {
- ShortBuffer dest_short = dest.asShortBuffer();
- ShortBuffer src_short = src.asShortBuffer();
- while (src_short.hasRemaining())
- dest_short.put(src_short.get());
- } else {
- while (src.hasRemaining())
- dest.put(src.get());
- }
- dest.rewind();
- return dest;
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util;
+
+import java.io.BufferedInputStream;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.ShortBuffer;
+
+import javax.sound.sampled.AudioFormat;
+import javax.sound.sampled.AudioInputStream;
+import javax.sound.sampled.AudioSystem;
+
+import org.lwjgl.openal.AL10;
+
+/**
+ *
+ * Utitlity class for loading wavefiles.
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 3274 $
+ * $Id: WaveData.java 3274 2010-02-20 10:43:22Z matzon $
+ */
+public class WaveData {
+ /** actual wave data */
+ public final ByteBuffer data;
+
+ /** format type of data */
+ public final int format;
+
+ /** sample rate of data */
+ public final int samplerate;
+
+ /**
+ * Creates a new WaveData
+ *
+ * @param data actual wavedata
+ * @param format format of wave data
+ * @param samplerate sample rate of data
+ */
+ private WaveData(ByteBuffer data, int format, int samplerate) {
+ this.data = data;
+ this.format = format;
+ this.samplerate = samplerate;
+ }
+
+ /**
+ * Disposes the wavedata
+ */
+ public void dispose() {
+ data.clear();
+ }
+
+ /**
+ * Creates a WaveData container from the specified url
+ *
+ * @param path URL to file
+ * @return WaveData containing data, or null if a failure occured
+ */
+ public static WaveData create(URL path) {
+ try {
+ return create(
+ AudioSystem.getAudioInputStream(
+ new BufferedInputStream(path.openStream())));
+ } catch (Exception e) {
+ org.lwjgl.LWJGLUtil.log("Unable to create from: " + path + ", " + e.getMessage());
+ return null;
+ }
+ }
+
+ /**
+ * Creates a WaveData container from the specified in the classpath
+ *
+ * @param path path to file (relative, and in classpath)
+ * @return WaveData containing data, or null if a failure occured
+ */
+ public static WaveData create(String path) {
+ return create(WaveData.class.getClassLoader().getResource(path));
+ }
+
+ /**
+ * Creates a WaveData container from the specified inputstream
+ *
+ * @param is InputStream to read from
+ * @return WaveData containing data, or null if a failure occured
+ */
+ public static WaveData create(InputStream is) {
+ try {
+ return create(
+ AudioSystem.getAudioInputStream(is));
+ } catch (Exception e) {
+ org.lwjgl.LWJGLUtil.log("Unable to create from inputstream, " + e.getMessage());
+ return null;
+ }
+ }
+
+ /**
+ * Creates a WaveData container from the specified bytes
+ *
+ * @param buffer array of bytes containing the complete wave file
+ * @return WaveData containing data, or null if a failure occured
+ */
+ public static WaveData create(byte[] buffer) {
+ try {
+ return create(
+ AudioSystem.getAudioInputStream(
+ new BufferedInputStream(new ByteArrayInputStream(buffer))));
+ } catch (Exception e) {
+ org.lwjgl.LWJGLUtil.log("Unable to create from byte array, " + e.getMessage());
+ return null;
+ }
+ }
+
+ /**
+ * Creates a WaveData container from the specified ByetBuffer.
+ * If the buffer is backed by an array, it will be used directly,
+ * else the contents of the buffer will be copied using get(byte[]).
+ *
+ * @param buffer ByteBuffer containing sound file
+ * @return WaveData containing data, or null if a failure occured
+ */
+ public static WaveData create(ByteBuffer buffer) {
+ try {
+ byte[] bytes = null;
+
+ if(buffer.hasArray()) {
+ bytes = buffer.array();
+ } else {
+ bytes = new byte[buffer.capacity()];
+ buffer.get(bytes);
+ }
+ return create(bytes);
+ } catch (Exception e) {
+ org.lwjgl.LWJGLUtil.log("Unable to create from ByteBuffer, " + e.getMessage());
+ return null;
+ }
+ }
+
+ /**
+ * Creates a WaveData container from the specified stream
+ *
+ * @param ais AudioInputStream to read from
+ * @return WaveData containing data, or null if a failure occured
+ */
+ public static WaveData create(AudioInputStream ais) {
+ //get format of data
+ AudioFormat audioformat = ais.getFormat();
+
+ // get channels
+ int channels = 0;
+ if (audioformat.getChannels() == 1) {
+ if (audioformat.getSampleSizeInBits() == 8) {
+ channels = AL10.AL_FORMAT_MONO8;
+ } else if (audioformat.getSampleSizeInBits() == 16) {
+ channels = AL10.AL_FORMAT_MONO16;
+ } else {
+ assert false : "Illegal sample size";
+ }
+ } else if (audioformat.getChannels() == 2) {
+ if (audioformat.getSampleSizeInBits() == 8) {
+ channels = AL10.AL_FORMAT_STEREO8;
+ } else if (audioformat.getSampleSizeInBits() == 16) {
+ channels = AL10.AL_FORMAT_STEREO16;
+ } else {
+ assert false : "Illegal sample size";
+ }
+ } else {
+ assert false : "Only mono or stereo is supported";
+ }
+
+ //read data into buffer
+ ByteBuffer buffer = null;
+ try {
+ int available = ais.available();
+ if(available <= 0) {
+ available = ais.getFormat().getChannels() * (int) ais.getFrameLength() * ais.getFormat().getSampleSizeInBits() / 8;
+ }
+ byte[] buf = new byte[ais.available()];
+ int read = 0, total = 0;
+ while ((read = ais.read(buf, total, buf.length - total)) != -1
+ && total < buf.length) {
+ total += read;
+ }
+ buffer = convertAudioBytes(buf, audioformat.getSampleSizeInBits() == 16);
+ } catch (IOException ioe) {
+ return null;
+ }
+
+
+ //create our result
+ WaveData wavedata =
+ new WaveData(buffer, channels, (int) audioformat.getSampleRate());
+
+ //close stream
+ try {
+ ais.close();
+ } catch (IOException ioe) {
+ }
+
+ return wavedata;
+ }
+
+ private static ByteBuffer convertAudioBytes(byte[] audio_bytes, boolean two_bytes_data) {
+ ByteBuffer dest = ByteBuffer.allocateDirect(audio_bytes.length);
+ dest.order(ByteOrder.nativeOrder());
+ ByteBuffer src = ByteBuffer.wrap(audio_bytes);
+ src.order(ByteOrder.LITTLE_ENDIAN);
+ if (two_bytes_data) {
+ ShortBuffer dest_short = dest.asShortBuffer();
+ ShortBuffer src_short = src.asShortBuffer();
+ while (src_short.hasRemaining())
+ dest_short.put(src_short.get());
+ } else {
+ while (src.hasRemaining())
+ dest.put(src.get());
+ }
+ dest.rewind();
+ return dest;
+ }
+}
diff --git a/src/java/org/lwjgl/util/WritableColor.java b/src/java/org/lwjgl/util/WritableColor.java
index d70983a..3c29e31 100644
--- a/src/java/org/lwjgl/util/WritableColor.java
+++ b/src/java/org/lwjgl/util/WritableColor.java
@@ -1,126 +1,126 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util;
-
-import java.nio.ByteBuffer;
-
-/**
- * Write interface for Colors
- * @author $Author: matzon $
- * @version $Revision: 2983 $
- * $Id: WritableColor.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public interface WritableColor {
- /**
- * Set a color
- */
- public void set(int r, int g, int b, int a);
- /**
- * Set a color
- */
- public void set(byte r, byte g, byte b, byte a);
- /**
- * Set a color
- */
- public void set(int r, int g, int b);
- /**
- * Set a color
- */
- public void set(byte r, byte g, byte b);
- /**
- * Set the Red component
- */
- public void setRed(int red);
- /**
- * Set the Green component
- */
- public void setGreen(int green);
- /**
- * Set the Blue component
- */
- public void setBlue(int blue);
- /**
- * Set the Alpha component
- */
- public void setAlpha(int alpha);
- /**
- * Set the Red component
- */
- public void setRed(byte red);
- /**
- * Set the Green component
- */
- public void setGreen(byte green);
- /**
- * Set the Blue component
- */
- public void setBlue(byte blue);
- /**
- * Set the Alpha component
- */
- public void setAlpha(byte alpha);
- /**
- * Read a color from a byte buffer
- * @param src The source buffer
- */
- public void readRGBA(ByteBuffer src);
- /**
- * Read a color from a byte buffer
- * @param src The source buffer
- */
- public void readRGB(ByteBuffer src);
- /**
- * Read a color from a byte buffer
- * @param src The source buffer
- */
- public void readARGB(ByteBuffer src);
- /**
- * Read a color from a byte buffer
- * @param src The source buffer
- */
- public void readBGRA(ByteBuffer src);
- /**
- * Read a color from a byte buffer
- * @param src The source buffer
- */
- public void readBGR(ByteBuffer src);
- /**
- * Read a color from a byte buffer
- * @param src The source buffer
- */
- public void readABGR(ByteBuffer src);
- /**
- * Set this color's color by copying another color
- * @param src The source color
- */
- public void setColor(ReadableColor src);
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util;
+
+import java.nio.ByteBuffer;
+
+/**
+ * Write interface for Colors
+ * @author $Author: matzon $
+ * @version $Revision: 2983 $
+ * $Id: WritableColor.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public interface WritableColor {
+ /**
+ * Set a color
+ */
+ public void set(int r, int g, int b, int a);
+ /**
+ * Set a color
+ */
+ public void set(byte r, byte g, byte b, byte a);
+ /**
+ * Set a color
+ */
+ public void set(int r, int g, int b);
+ /**
+ * Set a color
+ */
+ public void set(byte r, byte g, byte b);
+ /**
+ * Set the Red component
+ */
+ public void setRed(int red);
+ /**
+ * Set the Green component
+ */
+ public void setGreen(int green);
+ /**
+ * Set the Blue component
+ */
+ public void setBlue(int blue);
+ /**
+ * Set the Alpha component
+ */
+ public void setAlpha(int alpha);
+ /**
+ * Set the Red component
+ */
+ public void setRed(byte red);
+ /**
+ * Set the Green component
+ */
+ public void setGreen(byte green);
+ /**
+ * Set the Blue component
+ */
+ public void setBlue(byte blue);
+ /**
+ * Set the Alpha component
+ */
+ public void setAlpha(byte alpha);
+ /**
+ * Read a color from a byte buffer
+ * @param src The source buffer
+ */
+ public void readRGBA(ByteBuffer src);
+ /**
+ * Read a color from a byte buffer
+ * @param src The source buffer
+ */
+ public void readRGB(ByteBuffer src);
+ /**
+ * Read a color from a byte buffer
+ * @param src The source buffer
+ */
+ public void readARGB(ByteBuffer src);
+ /**
+ * Read a color from a byte buffer
+ * @param src The source buffer
+ */
+ public void readBGRA(ByteBuffer src);
+ /**
+ * Read a color from a byte buffer
+ * @param src The source buffer
+ */
+ public void readBGR(ByteBuffer src);
+ /**
+ * Read a color from a byte buffer
+ * @param src The source buffer
+ */
+ public void readABGR(ByteBuffer src);
+ /**
+ * Set this color's color by copying another color
+ * @param src The source color
+ */
+ public void setColor(ReadableColor src);
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/util/WritableDimension.java b/src/java/org/lwjgl/util/WritableDimension.java
index 6852012..a3ee3dc 100644
--- a/src/java/org/lwjgl/util/WritableDimension.java
+++ b/src/java/org/lwjgl/util/WritableDimension.java
@@ -1,54 +1,54 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util;
-
-/**
- * Write interface for Dimensions
- * @author $Author: matzon $
- * @version $Revision: 2983 $
- * $Id: WritableDimension.java 2983 2008-04-07 18:36:09Z matzon $
-
- */
-public interface WritableDimension {
- public void setSize(int w, int h);
- public void setSize(ReadableDimension d);
- /**
- * Sets the height.
- * @param height The height to set
- */
- public void setHeight(int height);
- /**
- * Sets the width.
- * @param width The width to set
- */
- public void setWidth(int width);
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util;
+
+/**
+ * Write interface for Dimensions
+ * @author $Author: matzon $
+ * @version $Revision: 2983 $
+ * $Id: WritableDimension.java 2983 2008-04-07 18:36:09Z matzon $
+
+ */
+public interface WritableDimension {
+ public void setSize(int w, int h);
+ public void setSize(ReadableDimension d);
+ /**
+ * Sets the height.
+ * @param height The height to set
+ */
+ public void setHeight(int height);
+ /**
+ * Sets the width.
+ * @param width The width to set
+ */
+ public void setWidth(int width);
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/util/WritablePoint.java b/src/java/org/lwjgl/util/WritablePoint.java
index 4b6c60a..705d257 100644
--- a/src/java/org/lwjgl/util/WritablePoint.java
+++ b/src/java/org/lwjgl/util/WritablePoint.java
@@ -1,45 +1,45 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util;
-
-/**
- * Write interface for Points
- * @author $Author: matzon $
- * @version $Revision: 2983 $
- * $Id: WritablePoint.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public interface WritablePoint {
- public void setLocation(int x, int y);
- public void setLocation(ReadablePoint p);
- public void setX(int x);
- public void setY(int y);
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util;
+
+/**
+ * Write interface for Points
+ * @author $Author: matzon $
+ * @version $Revision: 2983 $
+ * $Id: WritablePoint.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public interface WritablePoint {
+ public void setLocation(int x, int y);
+ public void setLocation(ReadablePoint p);
+ public void setX(int x);
+ public void setY(int y);
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/util/WritableRectangle.java b/src/java/org/lwjgl/util/WritableRectangle.java
index bc31371..8fb20dc 100644
--- a/src/java/org/lwjgl/util/WritableRectangle.java
+++ b/src/java/org/lwjgl/util/WritableRectangle.java
@@ -1,63 +1,63 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util;
-
-/**
- * Write interface for Rectangles
- * @author $Author: matzon $
- * @version $Revision: 2983 $
- * $Id: WritableRectangle.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public interface WritableRectangle extends WritablePoint, WritableDimension {
-
- /**
- * Sets the bounds of the rectangle
- * @param x Position of rectangle on x axis
- * @param y Position of rectangle on y axis
- * @param width Width of rectangle
- * @param height Height of rectangle
- */
- public void setBounds(int x, int y, int width, int height);
-
- /**
- * Sets the bounds of the rectangle
- * @param location
- * @param size
- */
- public void setBounds(ReadablePoint location, ReadableDimension size);
-
- /**
- * Sets the bounds of the rectangle
- * @param src
- */
- public void setBounds(ReadableRectangle src);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util;
+
+/**
+ * Write interface for Rectangles
+ * @author $Author: matzon $
+ * @version $Revision: 2983 $
+ * $Id: WritableRectangle.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public interface WritableRectangle extends WritablePoint, WritableDimension {
+
+ /**
+ * Sets the bounds of the rectangle
+ * @param x Position of rectangle on x axis
+ * @param y Position of rectangle on y axis
+ * @param width Width of rectangle
+ * @param height Height of rectangle
+ */
+ public void setBounds(int x, int y, int width, int height);
+
+ /**
+ * Sets the bounds of the rectangle
+ * @param location
+ * @param size
+ */
+ public void setBounds(ReadablePoint location, ReadableDimension size);
+
+ /**
+ * Sets the bounds of the rectangle
+ * @param src
+ */
+ public void setBounds(ReadableRectangle src);
+}
diff --git a/src/java/org/lwjgl/util/XPMFile.java b/src/java/org/lwjgl/util/XPMFile.java
index eefc685..7a598ed 100644
--- a/src/java/org/lwjgl/util/XPMFile.java
+++ b/src/java/org/lwjgl/util/XPMFile.java
@@ -1,302 +1,302 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util;
-
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.LineNumberReader;
-import java.util.HashMap;
-import java.util.StringTokenizer;
-
-/**
- * <p>
- * NOTE: This simple XPM reader does not support extensions nor hotspots
- * </p>
- *
- * @author Brian Matzon <brian at matzon.dk>
- * @author Jos Hirth
- * @version $Revision$
- * $Id$
- */
-
-public class XPMFile {
-
- /** Array of bytes (RGBA) */
- private byte bytes[] = null;
-
- private final static int WIDTH = 0;
-
- private final static int HEIGHT = 1;
-
- private final static int NUMBER_OF_COLORS = 2;
-
- private final static int CHARACTERS_PER_PIXEL = 3;
-
- private static int[] format = new int[4];
-
- /*
- * Private constructor, use load(String filename)
- */
- private XPMFile() {
- }
-
- /**
- * Loads the XPM file
- *
- * @param file
- * path to file
- * @return XPMFile loaded, or exception
- * @throws IOException
- * If any IO exceptions occurs while reading file
- */
- public static XPMFile load(String file) throws IOException {
- return load(new FileInputStream(new File(file)));
- }
-
- /**
- * Loads the XPM file
- *
- * @param is
- * InputStream to read file from
- * @return XPMFile loaded, or exception
- */
- public static XPMFile load(InputStream is) {
- XPMFile xFile = new XPMFile();
- xFile.readImage(is);
- return xFile;
- }
-
- /**
- * @return the height of the image.
- */
- public int getHeight() {
- return format[HEIGHT];
- }
-
- /**
- * @return the width of the image.
- */
- public int getWidth() {
- return format[WIDTH];
- }
-
- /**
- * @return The data of the image.
- */
- public byte[] getBytes() {
- return bytes;
- }
-
- /**
- * Read the image from the specified file.
- */
- private void readImage(InputStream is) {
- try {
- LineNumberReader reader = new LineNumberReader(
- new InputStreamReader(is));
- HashMap colors = new HashMap();
-
- format = parseFormat(nextLineOfInterest(reader));
-
- // setup color mapping
- for (int i = 0; i < format[NUMBER_OF_COLORS]; i++) {
- Object[] colorDefinition = parseColor(nextLineOfInterest(reader));
- colors.put(colorDefinition[0], colorDefinition[1]);
- }
-
- // read actual image (convert to RGBA)
- bytes = new byte[format[WIDTH] * format[HEIGHT] * 4];
- for (int i = 0; i < format[HEIGHT]; i++) {
- parseImageLine(nextLineOfInterest(reader), format, colors, i);
- }
- } catch (Exception e) {
- e.printStackTrace();
- throw new IllegalArgumentException("Unable to parse XPM File");
- }
- }
-
- /**
- * Finds the next interesting line of text.
- *
- * @param reader
- * The LineNumberReader to read from
- * @return The next interesting String (with stripped quotes)
- * @throws IOException
- * If any IO exceptions occurs while reading file
- */
- private String nextLineOfInterest(LineNumberReader reader)
- throws IOException {
- String ret;
- do {
- ret = reader.readLine();
- } while (!ret.startsWith("\""));
- // lacks sanity check
- return ret.substring(1, ret.lastIndexOf('\"'));
- }
-
- /**
- * Parses the format of the xpm file given a format string
- *
- * @param format
- * String to parse
- * @return Array specifying width, height, colors, characters per pixel
- */
- private int[] parseFormat(String format) {
- // format should look like this:
- // 16 16 122 2
-
- // tokenize it
- StringTokenizer st = new StringTokenizer(format);
-
- return new int[] { Integer.parseInt(st.nextToken()), /* width */
- Integer.parseInt(st.nextToken()), /* height */
- Integer.parseInt(st.nextToken()), /* colors */
- Integer.parseInt(st.nextToken()) /* chars per pixel */
- };
- }
-
- /**
- * Given a line defining a color/pixel, parses this into an array containing
- * a key and a color
- *
- * @param line
- * Line to parse
- * @return Array containing a key (String) and a color (Integer)
- */
- private Object[] parseColor(String line) {
- // line should look like this:
- // # c #0A0A0A
-
- // NOTE: will break if the color is something like "black" or "gray50"
- // etc (instead of #rrggbb).
-
- String key = line.substring(0, format[CHARACTERS_PER_PIXEL]);
- // since we always assume color as type we dont need to read it
- // String type = line.substring(format[CHARACTERS_PER_PIXEL] + 1,
- // format[CHARACTERS_PER_PIXEL] + 2);
- String color = line.substring(format[CHARACTERS_PER_PIXEL] + 4);
-
- // we always assume type is color, and supplied as #<r><g><b>
- return new Object[] { key, new Integer(Integer.parseInt(color, 16)) };
- }
-
- /**
- * Parses an Image line into its byte values
- *
- * @param line
- * Line of chars to parse
- * @param format
- * Format to expext it in
- * @param colors
- * Colors to lookup
- * @param index
- * current index into lines, we've reached
- */
- private void parseImageLine(String line, int[] format, HashMap colors,
- int index) {
- // offset for next line
- int offset = index * 4 * format[WIDTH];
-
- // read <format[CHARACTERS_PER_PIXEL]> characters <format[WIDTH]> times,
- // each iteration equals one pixel
- for (int i = 0; i < format[WIDTH]; i++) {
- String key = line
- .substring(
- i * format[CHARACTERS_PER_PIXEL],
- (i * format[CHARACTERS_PER_PIXEL] + format[CHARACTERS_PER_PIXEL]));
- Integer color = (Integer) colors.get(key);
- bytes[offset + (i * 4)] = (byte) ((color.intValue() & 0x00ff0000) >> 16);
- bytes[offset + ((i * 4) + 1)] = (byte) ((color.intValue() & 0x0000ff00) >> 8);
- bytes[offset + ((i * 4) + 2)] = (byte) ((color.intValue() & 0x000000ff) >> 0); // looks
- // better
- // :)
- bytes[offset + ((i * 4) + 3)] = (byte) 0xff; // always 0xff alpha
- }
- }
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- if (args.length != 1) {
- System.out.println("usage:\nXPMFile <file>");
- }
-
- try {
- String out = args[0].substring(0, args[0].indexOf(".")) + ".raw";
- XPMFile file = XPMFile.load(args[0]);
- BufferedOutputStream bos = new BufferedOutputStream(
- new FileOutputStream(new File(out)));
- bos.write(file.getBytes());
- bos.close();
-
- // showResult(file.getBytes());
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- /*
- private static void showResult(byte[] bytes) {
- final BufferedImage i = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
- int c = 0;
- for (int y = 0; y < 16; y++) {
- for (int x = 0; x < 16; x++) {
- i.setRGB(x, y, (bytes[c] << 16) + (bytes[c + 1] << 8) + (bytes[c + 2] << 0) + (bytes[c + 3] << 24));//+(128<<24));//
- c += 4;
- }
- }
-
- final Frame frame = new Frame("XPM Result");
- frame.add(new Canvas() {
-
- public void paint(Graphics g) {
- g.drawImage(i, 0, 0, frame);
- }
- });
-
- frame.addWindowListener(new WindowAdapter() {
-
- public void windowClosing(WindowEvent e) {
- frame.dispose();
- }
-
- });
-
- frame.setSize(100, 100);
- frame.setVisible(true);
- }*/
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util;
+
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.LineNumberReader;
+import java.util.HashMap;
+import java.util.StringTokenizer;
+
+/**
+ * <p>
+ * NOTE: This simple XPM reader does not support extensions nor hotspots
+ * </p>
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ * @author Jos Hirth
+ * @version $Revision$
+ * $Id$
+ */
+
+public class XPMFile {
+
+ /** Array of bytes (RGBA) */
+ private byte bytes[] = null;
+
+ private final static int WIDTH = 0;
+
+ private final static int HEIGHT = 1;
+
+ private final static int NUMBER_OF_COLORS = 2;
+
+ private final static int CHARACTERS_PER_PIXEL = 3;
+
+ private static int[] format = new int[4];
+
+ /*
+ * Private constructor, use load(String filename)
+ */
+ private XPMFile() {
+ }
+
+ /**
+ * Loads the XPM file
+ *
+ * @param file
+ * path to file
+ * @return XPMFile loaded, or exception
+ * @throws IOException
+ * If any IO exceptions occurs while reading file
+ */
+ public static XPMFile load(String file) throws IOException {
+ return load(new FileInputStream(new File(file)));
+ }
+
+ /**
+ * Loads the XPM file
+ *
+ * @param is
+ * InputStream to read file from
+ * @return XPMFile loaded, or exception
+ */
+ public static XPMFile load(InputStream is) {
+ XPMFile xFile = new XPMFile();
+ xFile.readImage(is);
+ return xFile;
+ }
+
+ /**
+ * @return the height of the image.
+ */
+ public int getHeight() {
+ return format[HEIGHT];
+ }
+
+ /**
+ * @return the width of the image.
+ */
+ public int getWidth() {
+ return format[WIDTH];
+ }
+
+ /**
+ * @return The data of the image.
+ */
+ public byte[] getBytes() {
+ return bytes;
+ }
+
+ /**
+ * Read the image from the specified file.
+ */
+ private void readImage(InputStream is) {
+ try {
+ LineNumberReader reader = new LineNumberReader(
+ new InputStreamReader(is));
+ HashMap colors = new HashMap();
+
+ format = parseFormat(nextLineOfInterest(reader));
+
+ // setup color mapping
+ for (int i = 0; i < format[NUMBER_OF_COLORS]; i++) {
+ Object[] colorDefinition = parseColor(nextLineOfInterest(reader));
+ colors.put(colorDefinition[0], colorDefinition[1]);
+ }
+
+ // read actual image (convert to RGBA)
+ bytes = new byte[format[WIDTH] * format[HEIGHT] * 4];
+ for (int i = 0; i < format[HEIGHT]; i++) {
+ parseImageLine(nextLineOfInterest(reader), format, colors, i);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new IllegalArgumentException("Unable to parse XPM File");
+ }
+ }
+
+ /**
+ * Finds the next interesting line of text.
+ *
+ * @param reader
+ * The LineNumberReader to read from
+ * @return The next interesting String (with stripped quotes)
+ * @throws IOException
+ * If any IO exceptions occurs while reading file
+ */
+ private String nextLineOfInterest(LineNumberReader reader)
+ throws IOException {
+ String ret;
+ do {
+ ret = reader.readLine();
+ } while (!ret.startsWith("\""));
+ // lacks sanity check
+ return ret.substring(1, ret.lastIndexOf('\"'));
+ }
+
+ /**
+ * Parses the format of the xpm file given a format string
+ *
+ * @param format
+ * String to parse
+ * @return Array specifying width, height, colors, characters per pixel
+ */
+ private int[] parseFormat(String format) {
+ // format should look like this:
+ // 16 16 122 2
+
+ // tokenize it
+ StringTokenizer st = new StringTokenizer(format);
+
+ return new int[] { Integer.parseInt(st.nextToken()), /* width */
+ Integer.parseInt(st.nextToken()), /* height */
+ Integer.parseInt(st.nextToken()), /* colors */
+ Integer.parseInt(st.nextToken()) /* chars per pixel */
+ };
+ }
+
+ /**
+ * Given a line defining a color/pixel, parses this into an array containing
+ * a key and a color
+ *
+ * @param line
+ * Line to parse
+ * @return Array containing a key (String) and a color (Integer)
+ */
+ private Object[] parseColor(String line) {
+ // line should look like this:
+ // # c #0A0A0A
+
+ // NOTE: will break if the color is something like "black" or "gray50"
+ // etc (instead of #rrggbb).
+
+ String key = line.substring(0, format[CHARACTERS_PER_PIXEL]);
+ // since we always assume color as type we dont need to read it
+ // String type = line.substring(format[CHARACTERS_PER_PIXEL] + 1,
+ // format[CHARACTERS_PER_PIXEL] + 2);
+ String color = line.substring(format[CHARACTERS_PER_PIXEL] + 4);
+
+ // we always assume type is color, and supplied as #<r><g><b>
+ return new Object[] { key, new Integer(Integer.parseInt(color, 16)) };
+ }
+
+ /**
+ * Parses an Image line into its byte values
+ *
+ * @param line
+ * Line of chars to parse
+ * @param format
+ * Format to expext it in
+ * @param colors
+ * Colors to lookup
+ * @param index
+ * current index into lines, we've reached
+ */
+ private void parseImageLine(String line, int[] format, HashMap colors,
+ int index) {
+ // offset for next line
+ int offset = index * 4 * format[WIDTH];
+
+ // read <format[CHARACTERS_PER_PIXEL]> characters <format[WIDTH]> times,
+ // each iteration equals one pixel
+ for (int i = 0; i < format[WIDTH]; i++) {
+ String key = line
+ .substring(
+ i * format[CHARACTERS_PER_PIXEL],
+ (i * format[CHARACTERS_PER_PIXEL] + format[CHARACTERS_PER_PIXEL]));
+ Integer color = (Integer) colors.get(key);
+ bytes[offset + (i * 4)] = (byte) ((color.intValue() & 0x00ff0000) >> 16);
+ bytes[offset + ((i * 4) + 1)] = (byte) ((color.intValue() & 0x0000ff00) >> 8);
+ bytes[offset + ((i * 4) + 2)] = (byte) ((color.intValue() & 0x000000ff) >> 0); // looks
+ // better
+ // :)
+ bytes[offset + ((i * 4) + 3)] = (byte) 0xff; // always 0xff alpha
+ }
+ }
+
+ /**
+ * @param args
+ */
+ public static void main(String[] args) {
+ if (args.length != 1) {
+ System.out.println("usage:\nXPMFile <file>");
+ }
+
+ try {
+ String out = args[0].substring(0, args[0].indexOf(".")) + ".raw";
+ XPMFile file = XPMFile.load(args[0]);
+ BufferedOutputStream bos = new BufferedOutputStream(
+ new FileOutputStream(new File(out)));
+ bos.write(file.getBytes());
+ bos.close();
+
+ // showResult(file.getBytes());
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ /*
+ private static void showResult(byte[] bytes) {
+ final BufferedImage i = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
+ int c = 0;
+ for (int y = 0; y < 16; y++) {
+ for (int x = 0; x < 16; x++) {
+ i.setRGB(x, y, (bytes[c] << 16) + (bytes[c + 1] << 8) + (bytes[c + 2] << 0) + (bytes[c + 3] << 24));//+(128<<24));//
+ c += 4;
+ }
+ }
+
+ final Frame frame = new Frame("XPM Result");
+ frame.add(new Canvas() {
+
+ public void paint(Graphics g) {
+ g.drawImage(i, 0, 0, frame);
+ }
+ });
+
+ frame.addWindowListener(new WindowAdapter() {
+
+ public void windowClosing(WindowEvent e) {
+ frame.dispose();
+ }
+
+ });
+
+ frame.setSize(100, 100);
+ frame.setVisible(true);
+ }*/
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/util/generator/ALTypeMap.java b/src/java/org/lwjgl/util/generator/ALTypeMap.java
index c64cbf9..69818ad 100644
--- a/src/java/org/lwjgl/util/generator/ALTypeMap.java
+++ b/src/java/org/lwjgl/util/generator/ALTypeMap.java
@@ -1,218 +1,218 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-package org.lwjgl.util.generator;
-
-/**
- *
- * The OpenAL specific generator behaviour
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: ALTypeMap.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import com.sun.mirror.declaration.*;
-import com.sun.mirror.type.*;
-
-import java.io.*;
-import java.util.*;
-import java.nio.*;
-
-public class ALTypeMap implements TypeMap {
- private static final Map<Class, PrimitiveType.Kind> native_types_to_primitive;
-
- static {
- native_types_to_primitive = new HashMap<Class, PrimitiveType.Kind>();
- native_types_to_primitive.put(ALboolean.class, PrimitiveType.Kind.BOOLEAN);
- native_types_to_primitive.put(ALbyte.class, PrimitiveType.Kind.BYTE);
- native_types_to_primitive.put(ALenum.class, PrimitiveType.Kind.INT);
- native_types_to_primitive.put(ALfloat.class, PrimitiveType.Kind.FLOAT);
- native_types_to_primitive.put(ALdouble.class, PrimitiveType.Kind.DOUBLE);
- native_types_to_primitive.put(ALint.class, PrimitiveType.Kind.INT);
- native_types_to_primitive.put(ALshort.class, PrimitiveType.Kind.SHORT);
- native_types_to_primitive.put(ALsizei.class, PrimitiveType.Kind.INT);
- native_types_to_primitive.put(ALubyte.class, PrimitiveType.Kind.BYTE);
- native_types_to_primitive.put(ALuint.class, PrimitiveType.Kind.INT);
- native_types_to_primitive.put(ALvoid.class, PrimitiveType.Kind.BYTE);
- }
-
- public PrimitiveType.Kind getPrimitiveTypeFromNativeType(Class native_type) {
- PrimitiveType.Kind kind = native_types_to_primitive.get(native_type);
- if (kind == null)
- throw new RuntimeException("Unsupported type " + native_type);
- return kind;
- }
-
- public Signedness getSignednessFromType(Class type) {
- if (ALuint.class.equals(type))
- return Signedness.UNSIGNED;
- else if (ALint.class.equals(type))
- return Signedness.SIGNED;
- else if (ALshort.class.equals(type))
- return Signedness.SIGNED;
- else if (ALbyte.class.equals(type))
- return Signedness.SIGNED;
- else
- return Signedness.NONE;
- }
-
- public String translateAnnotation(Class annotation_type) {
- if (annotation_type.equals(ALuint.class))
- return "i";
- else if (annotation_type.equals(ALint.class))
- return "i";
- else if (annotation_type.equals(ALshort.class))
- return "s";
- else if (annotation_type.equals(ALbyte.class))
- return "b";
- else if (annotation_type.equals(ALfloat.class))
- return "f";
- else if (annotation_type.equals(ALdouble.class))
- return "d";
- else if (annotation_type.equals(ALboolean.class) || annotation_type.equals(ALvoid.class))
- return "";
- else
- throw new RuntimeException(annotation_type + " is not allowed");
- }
-
- public Class getNativeTypeFromPrimitiveType(PrimitiveType.Kind kind) {
- Class type;
- switch (kind) {
- case INT:
- type = ALint.class;
- break;
- case FLOAT:
- type = ALfloat.class;
- break;
- case DOUBLE:
- type = ALdouble.class;
- break;
- case SHORT:
- type = ALshort.class;
- break;
- case BYTE:
- type = ALbyte.class;
- break;
- case BOOLEAN:
- type = ALboolean.class;
- break;
- default:
- throw new RuntimeException(kind + " is not allowed");
- }
- return type;
- }
-
- private static Class[] getValidBufferTypes(Class type) {
- if (type.equals(IntBuffer.class))
- return new Class[]{ALenum.class, ALint.class, ALsizei.class, ALuint.class};
- else if (type.equals(FloatBuffer.class))
- return new Class[]{ALfloat.class};
- else if (type.equals(ByteBuffer.class))
- return new Class[]{ALboolean.class, ALbyte.class, ALvoid.class};
- else if (type.equals(ShortBuffer.class))
- return new Class[]{ALshort.class};
- else if (type.equals(DoubleBuffer.class))
- return new Class[]{ALdouble.class};
- else
- return new Class[]{};
- }
-
- private static Class[] getValidPrimitiveTypes(Class type) {
- if (type.equals(int.class))
- return new Class[]{ALenum.class, ALint.class, ALsizei.class, ALuint.class};
- else if (type.equals(double.class))
- return new Class[]{ALdouble.class};
- else if (type.equals(float.class))
- return new Class[]{ALfloat.class};
- else if (type.equals(short.class))
- return new Class[]{ALshort.class};
- else if (type.equals(byte.class))
- return new Class[]{ALbyte.class};
- else if (type.equals(boolean.class))
- return new Class[]{ALboolean.class};
- else if (type.equals(void.class))
- return new Class[]{ALvoid.class};
- else
- return new Class[]{};
- }
-
- public String getErrorCheckMethodName() {
- return "Util.checkALError()";
- }
-
- public String getRegisterNativesFunctionName() {
- return "extal_InitializeClass";
- }
-
- public String getTypedefPrefix() {
- return "ALAPIENTRY";
- }
-
- public void printNativeIncludes(PrintWriter writer) {
- writer.println("#include \"extal.h\"");
- }
-
- public Class getStringElementType() {
- return ALubyte.class;
- }
-
- public Class[] getValidAnnotationTypes(Class type) {
- Class[] valid_types;
- if (Buffer.class.isAssignableFrom(type))
- valid_types = getValidBufferTypes(type);
- else if (type.isPrimitive())
- valid_types = getValidPrimitiveTypes(type);
- else if (type.equals(String.class))
- valid_types = new Class[]{ALubyte.class};
- else
- valid_types = new Class[]{};
- return valid_types;
- }
-
- public Class getVoidType() {
- return ALvoid.class;
- }
-
- public Class getInverseType(Class type) {
- if (ALuint.class.equals(type))
- return ALint.class;
- else if (ALint.class.equals(type))
- return ALuint.class;
- else
- return null;
- }
-
- public String getAutoTypeFromAnnotation(AnnotationMirror annotation) {
- return null;
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * The OpenAL specific generator behaviour
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: ALTypeMap.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import com.sun.mirror.declaration.*;
+import com.sun.mirror.type.*;
+
+import java.io.*;
+import java.util.*;
+import java.nio.*;
+
+public class ALTypeMap implements TypeMap {
+ private static final Map<Class, PrimitiveType.Kind> native_types_to_primitive;
+
+ static {
+ native_types_to_primitive = new HashMap<Class, PrimitiveType.Kind>();
+ native_types_to_primitive.put(ALboolean.class, PrimitiveType.Kind.BOOLEAN);
+ native_types_to_primitive.put(ALbyte.class, PrimitiveType.Kind.BYTE);
+ native_types_to_primitive.put(ALenum.class, PrimitiveType.Kind.INT);
+ native_types_to_primitive.put(ALfloat.class, PrimitiveType.Kind.FLOAT);
+ native_types_to_primitive.put(ALdouble.class, PrimitiveType.Kind.DOUBLE);
+ native_types_to_primitive.put(ALint.class, PrimitiveType.Kind.INT);
+ native_types_to_primitive.put(ALshort.class, PrimitiveType.Kind.SHORT);
+ native_types_to_primitive.put(ALsizei.class, PrimitiveType.Kind.INT);
+ native_types_to_primitive.put(ALubyte.class, PrimitiveType.Kind.BYTE);
+ native_types_to_primitive.put(ALuint.class, PrimitiveType.Kind.INT);
+ native_types_to_primitive.put(ALvoid.class, PrimitiveType.Kind.BYTE);
+ }
+
+ public PrimitiveType.Kind getPrimitiveTypeFromNativeType(Class native_type) {
+ PrimitiveType.Kind kind = native_types_to_primitive.get(native_type);
+ if (kind == null)
+ throw new RuntimeException("Unsupported type " + native_type);
+ return kind;
+ }
+
+ public Signedness getSignednessFromType(Class type) {
+ if (ALuint.class.equals(type))
+ return Signedness.UNSIGNED;
+ else if (ALint.class.equals(type))
+ return Signedness.SIGNED;
+ else if (ALshort.class.equals(type))
+ return Signedness.SIGNED;
+ else if (ALbyte.class.equals(type))
+ return Signedness.SIGNED;
+ else
+ return Signedness.NONE;
+ }
+
+ public String translateAnnotation(Class annotation_type) {
+ if (annotation_type.equals(ALuint.class))
+ return "i";
+ else if (annotation_type.equals(ALint.class))
+ return "i";
+ else if (annotation_type.equals(ALshort.class))
+ return "s";
+ else if (annotation_type.equals(ALbyte.class))
+ return "b";
+ else if (annotation_type.equals(ALfloat.class))
+ return "f";
+ else if (annotation_type.equals(ALdouble.class))
+ return "d";
+ else if (annotation_type.equals(ALboolean.class) || annotation_type.equals(ALvoid.class))
+ return "";
+ else
+ throw new RuntimeException(annotation_type + " is not allowed");
+ }
+
+ public Class getNativeTypeFromPrimitiveType(PrimitiveType.Kind kind) {
+ Class type;
+ switch (kind) {
+ case INT:
+ type = ALint.class;
+ break;
+ case FLOAT:
+ type = ALfloat.class;
+ break;
+ case DOUBLE:
+ type = ALdouble.class;
+ break;
+ case SHORT:
+ type = ALshort.class;
+ break;
+ case BYTE:
+ type = ALbyte.class;
+ break;
+ case BOOLEAN:
+ type = ALboolean.class;
+ break;
+ default:
+ throw new RuntimeException(kind + " is not allowed");
+ }
+ return type;
+ }
+
+ private static Class[] getValidBufferTypes(Class type) {
+ if (type.equals(IntBuffer.class))
+ return new Class[]{ALenum.class, ALint.class, ALsizei.class, ALuint.class};
+ else if (type.equals(FloatBuffer.class))
+ return new Class[]{ALfloat.class};
+ else if (type.equals(ByteBuffer.class))
+ return new Class[]{ALboolean.class, ALbyte.class, ALvoid.class};
+ else if (type.equals(ShortBuffer.class))
+ return new Class[]{ALshort.class};
+ else if (type.equals(DoubleBuffer.class))
+ return new Class[]{ALdouble.class};
+ else
+ return new Class[]{};
+ }
+
+ private static Class[] getValidPrimitiveTypes(Class type) {
+ if (type.equals(int.class))
+ return new Class[]{ALenum.class, ALint.class, ALsizei.class, ALuint.class};
+ else if (type.equals(double.class))
+ return new Class[]{ALdouble.class};
+ else if (type.equals(float.class))
+ return new Class[]{ALfloat.class};
+ else if (type.equals(short.class))
+ return new Class[]{ALshort.class};
+ else if (type.equals(byte.class))
+ return new Class[]{ALbyte.class};
+ else if (type.equals(boolean.class))
+ return new Class[]{ALboolean.class};
+ else if (type.equals(void.class))
+ return new Class[]{ALvoid.class};
+ else
+ return new Class[]{};
+ }
+
+ public String getErrorCheckMethodName() {
+ return "Util.checkALError()";
+ }
+
+ public String getRegisterNativesFunctionName() {
+ return "extal_InitializeClass";
+ }
+
+ public String getTypedefPrefix() {
+ return "ALAPIENTRY";
+ }
+
+ public void printNativeIncludes(PrintWriter writer) {
+ writer.println("#include \"extal.h\"");
+ }
+
+ public Class getStringElementType() {
+ return ALubyte.class;
+ }
+
+ public Class[] getValidAnnotationTypes(Class type) {
+ Class[] valid_types;
+ if (Buffer.class.isAssignableFrom(type))
+ valid_types = getValidBufferTypes(type);
+ else if (type.isPrimitive())
+ valid_types = getValidPrimitiveTypes(type);
+ else if (type.equals(String.class))
+ valid_types = new Class[]{ALubyte.class};
+ else
+ valid_types = new Class[]{};
+ return valid_types;
+ }
+
+ public Class getVoidType() {
+ return ALvoid.class;
+ }
+
+ public Class getInverseType(Class type) {
+ if (ALuint.class.equals(type))
+ return ALint.class;
+ else if (ALint.class.equals(type))
+ return ALuint.class;
+ else
+ return null;
+ }
+
+ public String getAutoTypeFromAnnotation(AnnotationMirror annotation) {
+ return null;
+ }
+}
diff --git a/src/java/org/lwjgl/util/generator/ALboolean.java b/src/java/org/lwjgl/util/generator/ALboolean.java
index 6c828b3..7c554f6 100644
--- a/src/java/org/lwjgl/util/generator/ALboolean.java
+++ b/src/java/org/lwjgl/util/generator/ALboolean.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: ALboolean.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface ALboolean {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: ALboolean.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface ALboolean {
+}
diff --git a/src/java/org/lwjgl/util/generator/ALbyte.java b/src/java/org/lwjgl/util/generator/ALbyte.java
index 9a632e7..0a49ce4 100644
--- a/src/java/org/lwjgl/util/generator/ALbyte.java
+++ b/src/java/org/lwjgl/util/generator/ALbyte.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: ALbyte.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface ALbyte {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: ALbyte.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface ALbyte {
+}
diff --git a/src/java/org/lwjgl/util/generator/ALdouble.java b/src/java/org/lwjgl/util/generator/ALdouble.java
index 9aa4f3c..f1c6e42 100644
--- a/src/java/org/lwjgl/util/generator/ALdouble.java
+++ b/src/java/org/lwjgl/util/generator/ALdouble.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: ALdouble.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface ALdouble {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: ALdouble.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface ALdouble {
+}
diff --git a/src/java/org/lwjgl/util/generator/ALenum.java b/src/java/org/lwjgl/util/generator/ALenum.java
index a12a633..a50b8df 100644
--- a/src/java/org/lwjgl/util/generator/ALenum.java
+++ b/src/java/org/lwjgl/util/generator/ALenum.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: ALenum.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface ALenum {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: ALenum.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface ALenum {
+}
diff --git a/src/java/org/lwjgl/util/generator/ALfloat.java b/src/java/org/lwjgl/util/generator/ALfloat.java
index 2777b66..dd2e5ca 100644
--- a/src/java/org/lwjgl/util/generator/ALfloat.java
+++ b/src/java/org/lwjgl/util/generator/ALfloat.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: ALfloat.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface ALfloat {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: ALfloat.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface ALfloat {
+}
diff --git a/src/java/org/lwjgl/util/generator/ALint.java b/src/java/org/lwjgl/util/generator/ALint.java
index db5db7c..2170b5e 100644
--- a/src/java/org/lwjgl/util/generator/ALint.java
+++ b/src/java/org/lwjgl/util/generator/ALint.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: ALint.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface ALint {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: ALint.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface ALint {
+}
diff --git a/src/java/org/lwjgl/util/generator/ALshort.java b/src/java/org/lwjgl/util/generator/ALshort.java
index b10c6fd..cd55ec1 100644
--- a/src/java/org/lwjgl/util/generator/ALshort.java
+++ b/src/java/org/lwjgl/util/generator/ALshort.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: ALshort.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface ALshort {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: ALshort.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface ALshort {
+}
diff --git a/src/java/org/lwjgl/util/generator/ALsizei.java b/src/java/org/lwjgl/util/generator/ALsizei.java
index 8b33f37..24b303a 100644
--- a/src/java/org/lwjgl/util/generator/ALsizei.java
+++ b/src/java/org/lwjgl/util/generator/ALsizei.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: ALsizei.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface ALsizei {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: ALsizei.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface ALsizei {
+}
diff --git a/src/java/org/lwjgl/util/generator/ALubyte.java b/src/java/org/lwjgl/util/generator/ALubyte.java
index 12767c5..1604a83 100644
--- a/src/java/org/lwjgl/util/generator/ALubyte.java
+++ b/src/java/org/lwjgl/util/generator/ALubyte.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: ALubyte.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface ALubyte {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: ALubyte.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface ALubyte {
+}
diff --git a/src/java/org/lwjgl/util/generator/ALuint.java b/src/java/org/lwjgl/util/generator/ALuint.java
index c242a9e..56e4e35 100644
--- a/src/java/org/lwjgl/util/generator/ALuint.java
+++ b/src/java/org/lwjgl/util/generator/ALuint.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: ALuint.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface ALuint {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: ALuint.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface ALuint {
+}
diff --git a/src/java/org/lwjgl/util/generator/ALvoid.java b/src/java/org/lwjgl/util/generator/ALvoid.java
index d1f7465..3b9ddfd 100644
--- a/src/java/org/lwjgl/util/generator/ALvoid.java
+++ b/src/java/org/lwjgl/util/generator/ALvoid.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: ALvoid.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface ALvoid {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: ALvoid.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface ALvoid {
+}
diff --git a/src/java/org/lwjgl/util/generator/Alternate.java b/src/java/org/lwjgl/util/generator/Alternate.java
index 67fe518..4145bb2 100644
--- a/src/java/org/lwjgl/util/generator/Alternate.java
+++ b/src/java/org/lwjgl/util/generator/Alternate.java
@@ -1,54 +1,54 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Target;
-
-/**
- * When a method is annonated with @Alternate, no native stub will be created and the Java method will be renamed to value().
- * This can be useful when we want to provide an alternate GL call with different arguments (created by different annotations)
- *
- * @author spasi <spasi at users.sourceforge.net>
- */
- at Target({ ElementType.METHOD })
-public @interface Alternate {
-
- /** This must match an existing GL method name. */
- String value();
-
- /** If true, an alternate Java->native call will be created. Useful when the alternate implementation uses different types. */
- boolean nativeAlt() default false;
-
- /** If true, the alternate method's name will be used for the Java call. */
- boolean javaAlt() default false;
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+/**
+ * When a method is annonated with @Alternate, no native stub will be created and the Java method will be renamed to value().
+ * This can be useful when we want to provide an alternate GL call with different arguments (created by different annotations)
+ *
+ * @author spasi <spasi at users.sourceforge.net>
+ */
+ at Target({ ElementType.METHOD })
+public @interface Alternate {
+
+ /** This must match an existing GL method name. */
+ String value();
+
+ /** If true, an alternate Java->native call will be created. Useful when the alternate implementation uses different types. */
+ boolean nativeAlt() default false;
+
+ /** If true, the alternate method's name will be used for the Java call. */
+ boolean javaAlt() default false;
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/util/generator/Auto.java b/src/java/org/lwjgl/util/generator/Auto.java
index e53a64f..bbc6575 100644
--- a/src/java/org/lwjgl/util/generator/Auto.java
+++ b/src/java/org/lwjgl/util/generator/Auto.java
@@ -1,48 +1,48 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * AutoType and AutoSize is annotated with @Auto.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: Auto.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at Target(ElementType.ANNOTATION_TYPE)
-public @interface Auto {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * AutoType and AutoSize is annotated with @Auto.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: Auto.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at Target(ElementType.ANNOTATION_TYPE)
+public @interface Auto {
+}
diff --git a/src/java/org/lwjgl/util/generator/AutoResultSize.java b/src/java/org/lwjgl/util/generator/AutoResultSize.java
index 4e3145f..ab43e8c 100644
--- a/src/java/org/lwjgl/util/generator/AutoResultSize.java
+++ b/src/java/org/lwjgl/util/generator/AutoResultSize.java
@@ -1,50 +1,50 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * AutoResultSize specifies the size of a returned Buffer
- * as an expression.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: AutoResultSize.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at Target(ElementType.METHOD)
-public @interface AutoResultSize {
- String value(); // The size as a java expression
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * AutoResultSize specifies the size of a returned Buffer
+ * as an expression.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: AutoResultSize.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at Target(ElementType.METHOD)
+public @interface AutoResultSize {
+ String value(); // The size as a java expression
+}
diff --git a/src/java/org/lwjgl/util/generator/AutoSize.java b/src/java/org/lwjgl/util/generator/AutoSize.java
index 621a48a..8ea4716 100644
--- a/src/java/org/lwjgl/util/generator/AutoSize.java
+++ b/src/java/org/lwjgl/util/generator/AutoSize.java
@@ -1,52 +1,52 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * AutoSize specifies that a parameter should be pre-computed
- * according to the remaining() of a Buffer parameter.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: AutoSize.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at Auto
- at Target(ElementType.PARAMETER)
-public @interface AutoSize {
- String value(); // The name of the Buffer parameter
- String expression() default ""; // This value is added after the argument
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * AutoSize specifies that a parameter should be pre-computed
+ * according to the remaining() of a Buffer parameter.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: AutoSize.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at Auto
+ at Target(ElementType.PARAMETER)
+public @interface AutoSize {
+ String value(); // The name of the Buffer parameter
+ String expression() default ""; // This value is added after the argument
+}
diff --git a/src/java/org/lwjgl/util/generator/AutoType.java b/src/java/org/lwjgl/util/generator/AutoType.java
index 93d094c..36da737 100644
--- a/src/java/org/lwjgl/util/generator/AutoType.java
+++ b/src/java/org/lwjgl/util/generator/AutoType.java
@@ -1,51 +1,51 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * Indicates that a parameter should be pre-computed according
- * to the type of a Buffer parameter.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: AutoType.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at Auto
- at Target(ElementType.PARAMETER)
-public @interface AutoType {
- String value(); // The parameter to get the type from
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * Indicates that a parameter should be pre-computed according
+ * to the type of a Buffer parameter.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: AutoType.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at Auto
+ at Target(ElementType.PARAMETER)
+public @interface AutoType {
+ String value(); // The parameter to get the type from
+}
diff --git a/src/java/org/lwjgl/util/generator/BufferKind.java b/src/java/org/lwjgl/util/generator/BufferKind.java
index 42c2c1a..bd7090c 100644
--- a/src/java/org/lwjgl/util/generator/BufferKind.java
+++ b/src/java/org/lwjgl/util/generator/BufferKind.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3279 $
- * $Id: BufferKind.java 3279 2010-03-11 21:06:49Z spasi $
- */
-
-public enum BufferKind {
- UnpackPBO,
- PackPBO,
- ElementVBO,
- ArrayVBO,
- IndirectBO
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3279 $
+ * $Id: BufferKind.java 3279 2010-03-11 21:06:49Z spasi $
+ */
+
+public enum BufferKind {
+ UnpackPBO,
+ PackPBO,
+ ElementVBO,
+ ArrayVBO,
+ IndirectBO
+}
diff --git a/src/java/org/lwjgl/util/generator/BufferObject.java b/src/java/org/lwjgl/util/generator/BufferObject.java
index b886aff..1eebb3b 100644
--- a/src/java/org/lwjgl/util/generator/BufferObject.java
+++ b/src/java/org/lwjgl/util/generator/BufferObject.java
@@ -1,50 +1,50 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * This annotation implies that a Buffer parameter can be an
- * integer VBO/PBO offset.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: BufferObject.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at Target(ElementType.PARAMETER)
-public @interface BufferObject {
- BufferKind value();
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * This annotation implies that a Buffer parameter can be an
+ * integer VBO/PBO offset.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: BufferObject.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at Target(ElementType.PARAMETER)
+public @interface BufferObject {
+ BufferKind value();
+}
diff --git a/src/java/org/lwjgl/util/generator/CachedReference.java b/src/java/org/lwjgl/util/generator/CachedReference.java
index ee7b910..386b2bd 100644
--- a/src/java/org/lwjgl/util/generator/CachedReference.java
+++ b/src/java/org/lwjgl/util/generator/CachedReference.java
@@ -1,54 +1,54 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * This annotation indicates that a buffer parameter is cached by
- * OpenGL.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: CachedReference.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at Target(ElementType.PARAMETER)
-public @interface CachedReference {
- /** If set then this will be used as array index for accessing the stored reference. */
- String index() default "";
-
- /** If set then this name will be used for the reference and the reference field will not be auto generated in References. */
- String name() default "";
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * This annotation indicates that a buffer parameter is cached by
+ * OpenGL.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: CachedReference.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at Target(ElementType.PARAMETER)
+public @interface CachedReference {
+ /** If set then this will be used as array index for accessing the stored reference. */
+ String index() default "";
+
+ /** If set then this name will be used for the reference and the reference field will not be auto generated in References. */
+ String name() default "";
+}
diff --git a/src/java/org/lwjgl/util/generator/CachedResult.java b/src/java/org/lwjgl/util/generator/CachedResult.java
index 7de1f77..0b04eba 100644
--- a/src/java/org/lwjgl/util/generator/CachedResult.java
+++ b/src/java/org/lwjgl/util/generator/CachedResult.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3262 $
- * $Id: CachedResult.java 3262 2010-01-04 18:47:49Z spasi $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at Target(ElementType.METHOD)
-public @interface CachedResult {
- boolean isRange() default false;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3262 $
+ * $Id: CachedResult.java 3262 2010-01-04 18:47:49Z spasi $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at Target(ElementType.METHOD)
+public @interface CachedResult {
+ boolean isRange() default false;
+}
diff --git a/src/java/org/lwjgl/util/generator/Check.java b/src/java/org/lwjgl/util/generator/Check.java
index 1c177e3..45b6eff 100644
--- a/src/java/org/lwjgl/util/generator/Check.java
+++ b/src/java/org/lwjgl/util/generator/Check.java
@@ -1,48 +1,48 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: Check.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at Target(ElementType.PARAMETER)
-public @interface Check {
- String value() default "";
- boolean canBeNull() default false;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: Check.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at Target(ElementType.PARAMETER)
+public @interface Check {
+ String value() default "";
+ boolean canBeNull() default false;
+}
diff --git a/src/java/org/lwjgl/util/generator/Code.java b/src/java/org/lwjgl/util/generator/Code.java
index 8e9e878..cbf193a 100644
--- a/src/java/org/lwjgl/util/generator/Code.java
+++ b/src/java/org/lwjgl/util/generator/Code.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: Code.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at Target(ElementType.METHOD)
-public @interface Code {
- String value();
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: Code.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at Target(ElementType.METHOD)
+public @interface Code {
+ String value();
+}
diff --git a/src/java/org/lwjgl/util/generator/Const.java b/src/java/org/lwjgl/util/generator/Const.java
index c8193d6..19d8fe8 100644
--- a/src/java/org/lwjgl/util/generator/Const.java
+++ b/src/java/org/lwjgl/util/generator/Const.java
@@ -1,46 +1,46 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: Const.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface Const {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: Const.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface Const {
+}
diff --git a/src/java/org/lwjgl/util/generator/Constant.java b/src/java/org/lwjgl/util/generator/Constant.java
index 07d0afa..4d38595 100644
--- a/src/java/org/lwjgl/util/generator/Constant.java
+++ b/src/java/org/lwjgl/util/generator/Constant.java
@@ -1,49 +1,49 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3287 $
- * $Id: Constant.java 3287 2010-03-14 23:24:40Z spasi $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at Target(ElementType.PARAMETER)
-public @interface Constant {
- String value();
- /** If true, the original parameter will not be removed from the method. */
- boolean keepParam() default false;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3287 $
+ * $Id: Constant.java 3287 2010-03-14 23:24:40Z spasi $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at Target(ElementType.PARAMETER)
+public @interface Constant {
+ String value();
+ /** If true, the original parameter will not be removed from the method. */
+ boolean keepParam() default false;
+}
diff --git a/src/java/org/lwjgl/util/generator/ContextCapabilitiesGenerator.java b/src/java/org/lwjgl/util/generator/ContextCapabilitiesGenerator.java
index 36232ca..4feba92 100644
--- a/src/java/org/lwjgl/util/generator/ContextCapabilitiesGenerator.java
+++ b/src/java/org/lwjgl/util/generator/ContextCapabilitiesGenerator.java
@@ -1,293 +1,293 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-package org.lwjgl.util.generator;
-
-import java.io.PrintWriter;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.EnumSet;
-import java.util.Iterator;
-
-import com.sun.mirror.declaration.InterfaceDeclaration;
-import com.sun.mirror.declaration.MethodDeclaration;
-import com.sun.mirror.type.InterfaceType;
-
-/**
- * Generator visitor for the context capabilities generator tool
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3316 $
- * $Id: ContextCapabilitiesGenerator.java 3316 2010-04-09 23:57:40Z spasi $
- */
-public class ContextCapabilitiesGenerator {
-
- private final static String STUBS_LOADED_NAME = "loaded_stubs";
- private final static String ALL_INIT_METHOD_NAME = "initAllStubs";
- private final static String POINTER_INITIALIZER_POSTFIX = "_initNativeFunctionAddresses";
- private final static String CACHED_EXTS_VAR_NAME = "supported_extensions";
- private final static String PROFILE_MASK_VAR_NAME = "profileMask";
- private final static String EXTENSION_PREFIX = "GL_";
- private final static String CORE_PREFIX = "Open";
-
- public static void generateClassPrologue(PrintWriter writer, boolean context_specific, boolean generate_error_checks) {
- writer.println("public class " + Utils.CONTEXT_CAPS_CLASS_NAME + " {");
- writer.println("\tstatic final boolean DEBUG = " + Boolean.toString(generate_error_checks) + ";");
- writer.println("\tfinal StateTracker tracker = new StateTracker();");
- writer.println("\tfinal IntBuffer scratch_int_buffer = BufferUtils.createIntBuffer(16);");
- writer.println();
- if ( !context_specific ) {
- writer.println("\tprivate static boolean " + STUBS_LOADED_NAME + " = false;");
- }
- }
-
- public static void generateInitializerPrologue(PrintWriter writer) {
- writer.println("\t" + Utils.CONTEXT_CAPS_CLASS_NAME + "(boolean forwardCompatible) throws LWJGLException {");
- writer.println("\t\tSet " + CACHED_EXTS_VAR_NAME + " = " + ALL_INIT_METHOD_NAME + "(forwardCompatible);");
- }
-
- private static String translateFieldName(String interface_name) {
- if ( interface_name.startsWith("GL") )
- return CORE_PREFIX + interface_name;
- else
- return EXTENSION_PREFIX + interface_name;
- }
-
- public static void generateSuperClassAdds(PrintWriter writer, InterfaceDeclaration d) {
- Collection<InterfaceType> super_interfaces = d.getSuperinterfaces();
- if ( super_interfaces.size() > 1 )
- throw new RuntimeException(d + " extends more than one other interface");
- if ( super_interfaces.size() == 1 ) {
- InterfaceType super_interface = super_interfaces.iterator().next();
- writer.print("\t\tif (" + CACHED_EXTS_VAR_NAME + ".contains(\"");
- writer.println(translateFieldName(d.getSimpleName()) + "\"))");
- writer.print("\t\t\t");
- generateAddExtension(writer, super_interface.getDeclaration());
- }
- }
-
- public static void generateInitializer(PrintWriter writer, InterfaceDeclaration d) {
- String translated_field_name = translateFieldName(d.getSimpleName());
- writer.print("\t\tthis." + translated_field_name + " = ");
- writer.print(CACHED_EXTS_VAR_NAME + ".contains(\"");
- writer.print(translated_field_name + "\")");
- Collection<InterfaceType> super_interfaces = d.getSuperinterfaces();
- if ( super_interfaces.size() > 1 )
- throw new RuntimeException(d + " extends more than one other interface");
- if ( super_interfaces.size() == 1 ) {
- InterfaceType super_interface = super_interfaces.iterator().next();
- writer.println();
- writer.print("\t\t\t&& " + CACHED_EXTS_VAR_NAME + ".contains(\"");
- writer.print(translateFieldName(super_interface.getDeclaration().getSimpleName()) + "\")");
- }
- writer.println(";");
- }
-
- private static String getAddressesInitializerName(String class_name) {
- return class_name + POINTER_INITIALIZER_POSTFIX;
- }
-
- public static void generateInitStubsPrologue(PrintWriter writer, boolean context_specific) {
- writer.println("\tprivate Set " + ALL_INIT_METHOD_NAME + "(boolean forwardCompatible) throws LWJGLException {");
-
- // Load the basic pointers we need to detect OpenGL version and supported extensions.
- writer.println("\t\tGL11_glGetError_pointer = GLContext.getFunctionAddress(\"glGetError\");");
- writer.println("\t\tGL11_glGetString_pointer = GLContext.getFunctionAddress(\"glGetString\");");
-
- // Initialize GL11.glGetIntegerv and GL30.glGetStringi here, in case we have created an OpenGL 3.0 context.
- // (they will be used in GLContext.getSupportedExtensions)
- writer.println("\t\tGL11_glGetIntegerv_pointer = GLContext.getFunctionAddress(\"glGetIntegerv\");");
- writer.println("\t\tGL30_glGetStringi_pointer = GLContext.getFunctionAddress(\"glGetStringi\");");
-
- // Get the supported extensions set.
- writer.println("\t\tGLContext.setCapabilities(this);");
- writer.println("\t\tSet " + CACHED_EXTS_VAR_NAME + " = new HashSet(256);");
- writer.println("\t\tint " + PROFILE_MASK_VAR_NAME + " = GLContext.getSupportedExtensions(" + CACHED_EXTS_VAR_NAME + ");");
-
- // Force forward compatible mode when OpenGL version is 3.1 or higher and ARB_compatibility is not available.
- writer.println("\t\tif ( supported_extensions.contains(\"OpenGL31\") && !(supported_extensions.contains(\"GL_ARB_compatibility\") || (profileMask & GL32.GL_CONTEXT_COMPATIBILITY_PROFILE_BIT) != 0) )");
- writer.println("\t\t\tforwardCompatible = true;");
-
- if ( !context_specific ) {
- writer.println("\t\tif (" + STUBS_LOADED_NAME + ")");
- writer.println("\t\t\treturn GLContext.getSupportedExtensions();");
- writer.println("\t\torg.lwjgl.opengl.GL11." + Utils.STUB_INITIALIZER_NAME + "();");
- } else {
- writer.println("\t\tif (!" + getAddressesInitializerName("GL11") + "(forwardCompatible))");
- writer.println("\t\t\tthrow new LWJGLException(\"GL11 not supported\");");
- }
- }
-
- public static void generateInitStubsEpilogue(PrintWriter writer, boolean context_specific) {
- if ( !context_specific ) {
- writer.println("\t\t" + STUBS_LOADED_NAME + " = true;");
- }
- writer.println("\t\treturn " + CACHED_EXTS_VAR_NAME + ";");
- writer.println("\t}");
- }
-
- public static void generateUnloadStubs(PrintWriter writer, InterfaceDeclaration d) {
- if ( d.getMethods().size() > 0 ) {
- writer.print("\t\tGLContext.resetNativeStubs(" + Utils.getSimpleClassName(d));
- writer.println(".class);");
- }
- }
-
- public static void generateInitStubs(PrintWriter writer, InterfaceDeclaration d, boolean context_specific) {
- if ( d.getMethods().size() > 0 ) {
- if ( context_specific ) {
- if ( d.getAnnotation(ForceInit.class) != null )
- writer.println("\t\t" + CACHED_EXTS_VAR_NAME + ".add(\"" + translateFieldName(d.getSimpleName()) + "\");");
- writer.print("\t\tif (" + CACHED_EXTS_VAR_NAME + ".contains(\"");
- writer.print(translateFieldName(d.getSimpleName()) + "\")");
- writer.print(" && !" + getAddressesInitializerName(d.getSimpleName()) + "(");
- if ( d.getAnnotation(DeprecatedGL.class) != null )
- writer.print("forwardCompatible");
- if ( d.getAnnotation(Dependent.class) != null ) {
- if ( d.getAnnotation(DeprecatedGL.class) != null )
- writer.print(",");
- writer.print("supported_extensions");
- }
- writer.println("))");
- //writer.print("\t\t\t" + CACHED_EXTS_VAR_NAME + ".remove(\"");
- writer.print("\t\t\tremove(" + CACHED_EXTS_VAR_NAME + ", \"");
- writer.println(translateFieldName(d.getSimpleName()) + "\");");
- } else {
- writer.print("\t\tGLContext." + Utils.STUB_INITIALIZER_NAME + "(" + Utils.getSimpleClassName(d));
- writer.println(".class, " + CACHED_EXTS_VAR_NAME + ", \"" + translateFieldName(d.getSimpleName()) + "\");");
- }
- }
- }
-
- private static void generateAddExtension(PrintWriter writer, InterfaceDeclaration d) {
- writer.print(CACHED_EXTS_VAR_NAME + ".add(\"");
- writer.println(translateFieldName(d.getSimpleName()) + "\");");
- }
-
- public static void generateAddressesInitializers(PrintWriter writer, InterfaceDeclaration d) {
- Iterator<? extends MethodDeclaration> methods = d.getMethods().iterator();
- if ( !methods.hasNext() )
- return;
-
- writer.print("\tprivate boolean " + getAddressesInitializerName(d.getSimpleName()) + "(");
-
- boolean optional;
- boolean deprecated = d.getAnnotation(DeprecatedGL.class) != null;
- Dependent dependent = d.getAnnotation(Dependent.class);
- if ( deprecated )
- writer.print("boolean forwardCompatible");
- if ( dependent != null ) {
- if ( deprecated )
- writer.print(",");
- writer.print("Set supported_extensions");
- }
-
- writer.println(") {");
- writer.println("\t\treturn ");
-
- boolean first = true;
- while ( methods.hasNext() ) {
- MethodDeclaration method = methods.next();
- if ( method.getAnnotation(Alternate.class) != null )
- continue;
-
- if ( !first )
- writer.println(" &");
- else
- first = false;
-
- optional = method.getAnnotation(Optional.class) != null;
- deprecated = method.getAnnotation(DeprecatedGL.class) != null;
- dependent = method.getAnnotation(Dependent.class);
-
- writer.print("\t\t\t(");
- if ( optional )
- writer.print('(');
- if ( deprecated )
- writer.print("forwardCompatible || ");
- if ( dependent != null ) {
- if ( dependent.value().indexOf(',') == -1 )
- writer.print("!supported_extensions.contains(\"" + dependent.value() + "\") || ");
- else {
- writer.print("!(false");
- for ( String extension : dependent.value().split(",") )
- writer.print(" || supported_extensions.contains(\"" + extension + "\")");
- writer.print(") || ");
- }
- }
- if ( deprecated || dependent != null )
- writer.print('(');
- writer.print(Utils.getFunctionAddressName(d, method) + " = ");
- PlatformDependent platform_dependent = method.getAnnotation(PlatformDependent.class);
- if ( platform_dependent != null ) {
- EnumSet<Platform> platform_set = EnumSet.copyOf(Arrays.asList(platform_dependent.value()));
- writer.print("GLContext.getPlatformSpecificFunctionAddress(\"");
- writer.print(Platform.ALL.getPrefix() + "\", ");
- writer.print("new String[]{");
- Iterator<Platform> platforms = platform_set.iterator();
- while ( platforms.hasNext() ) {
- writer.print("\"" + platforms.next().getOSPrefix() + "\"");
- if ( platforms.hasNext() )
- writer.print(", ");
- }
- writer.print("}, new String[]{");
- platforms = platform_set.iterator();
- while ( platforms.hasNext() ) {
- writer.print("\"" + platforms.next().getPrefix() + "\"");
- if ( platforms.hasNext() )
- writer.print(", ");
- }
- writer.print("}, ");
- } else
- writer.print("GLContext.getFunctionAddress(");
- writer.print("\"" + method.getSimpleName() + "\")) != 0");
- if ( deprecated || dependent != null )
- writer.print(')');
- if ( optional )
- writer.print(" || true)");
- }
- writer.println(";");
- writer.println("\t}");
- writer.println();
- }
-
- public static void generateSymbolAddresses(PrintWriter writer, InterfaceDeclaration d) {
- for ( MethodDeclaration method : d.getMethods() ) {
- if ( method.getAnnotation(Alternate.class) == null )
- writer.println("\tlong " + Utils.getFunctionAddressName(d, method) + ";");
- }
- }
-
- public static void generateField(PrintWriter writer, InterfaceDeclaration d) {
- writer.println("\tpublic final boolean " + translateFieldName(d.getSimpleName()) + ";");
- }
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+package org.lwjgl.util.generator;
+
+import java.io.PrintWriter;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.EnumSet;
+import java.util.Iterator;
+
+import com.sun.mirror.declaration.InterfaceDeclaration;
+import com.sun.mirror.declaration.MethodDeclaration;
+import com.sun.mirror.type.InterfaceType;
+
+/**
+ * Generator visitor for the context capabilities generator tool
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3316 $
+ * $Id: ContextCapabilitiesGenerator.java 3316 2010-04-09 23:57:40Z spasi $
+ */
+public class ContextCapabilitiesGenerator {
+
+ private final static String STUBS_LOADED_NAME = "loaded_stubs";
+ private final static String ALL_INIT_METHOD_NAME = "initAllStubs";
+ private final static String POINTER_INITIALIZER_POSTFIX = "_initNativeFunctionAddresses";
+ private final static String CACHED_EXTS_VAR_NAME = "supported_extensions";
+ private final static String PROFILE_MASK_VAR_NAME = "profileMask";
+ private final static String EXTENSION_PREFIX = "GL_";
+ private final static String CORE_PREFIX = "Open";
+
+ public static void generateClassPrologue(PrintWriter writer, boolean context_specific, boolean generate_error_checks) {
+ writer.println("public class " + Utils.CONTEXT_CAPS_CLASS_NAME + " {");
+ writer.println("\tstatic final boolean DEBUG = " + Boolean.toString(generate_error_checks) + ";");
+ writer.println("\tfinal StateTracker tracker = new StateTracker();");
+ writer.println("\tfinal IntBuffer scratch_int_buffer = BufferUtils.createIntBuffer(16);");
+ writer.println();
+ if ( !context_specific ) {
+ writer.println("\tprivate static boolean " + STUBS_LOADED_NAME + " = false;");
+ }
+ }
+
+ public static void generateInitializerPrologue(PrintWriter writer) {
+ writer.println("\t" + Utils.CONTEXT_CAPS_CLASS_NAME + "(boolean forwardCompatible) throws LWJGLException {");
+ writer.println("\t\tSet " + CACHED_EXTS_VAR_NAME + " = " + ALL_INIT_METHOD_NAME + "(forwardCompatible);");
+ }
+
+ private static String translateFieldName(String interface_name) {
+ if ( interface_name.startsWith("GL") )
+ return CORE_PREFIX + interface_name;
+ else
+ return EXTENSION_PREFIX + interface_name;
+ }
+
+ public static void generateSuperClassAdds(PrintWriter writer, InterfaceDeclaration d) {
+ Collection<InterfaceType> super_interfaces = d.getSuperinterfaces();
+ if ( super_interfaces.size() > 1 )
+ throw new RuntimeException(d + " extends more than one other interface");
+ if ( super_interfaces.size() == 1 ) {
+ InterfaceType super_interface = super_interfaces.iterator().next();
+ writer.print("\t\tif (" + CACHED_EXTS_VAR_NAME + ".contains(\"");
+ writer.println(translateFieldName(d.getSimpleName()) + "\"))");
+ writer.print("\t\t\t");
+ generateAddExtension(writer, super_interface.getDeclaration());
+ }
+ }
+
+ public static void generateInitializer(PrintWriter writer, InterfaceDeclaration d) {
+ String translated_field_name = translateFieldName(d.getSimpleName());
+ writer.print("\t\tthis." + translated_field_name + " = ");
+ writer.print(CACHED_EXTS_VAR_NAME + ".contains(\"");
+ writer.print(translated_field_name + "\")");
+ Collection<InterfaceType> super_interfaces = d.getSuperinterfaces();
+ if ( super_interfaces.size() > 1 )
+ throw new RuntimeException(d + " extends more than one other interface");
+ if ( super_interfaces.size() == 1 ) {
+ InterfaceType super_interface = super_interfaces.iterator().next();
+ writer.println();
+ writer.print("\t\t\t&& " + CACHED_EXTS_VAR_NAME + ".contains(\"");
+ writer.print(translateFieldName(super_interface.getDeclaration().getSimpleName()) + "\")");
+ }
+ writer.println(";");
+ }
+
+ private static String getAddressesInitializerName(String class_name) {
+ return class_name + POINTER_INITIALIZER_POSTFIX;
+ }
+
+ public static void generateInitStubsPrologue(PrintWriter writer, boolean context_specific) {
+ writer.println("\tprivate Set " + ALL_INIT_METHOD_NAME + "(boolean forwardCompatible) throws LWJGLException {");
+
+ // Load the basic pointers we need to detect OpenGL version and supported extensions.
+ writer.println("\t\tGL11_glGetError_pointer = GLContext.getFunctionAddress(\"glGetError\");");
+ writer.println("\t\tGL11_glGetString_pointer = GLContext.getFunctionAddress(\"glGetString\");");
+
+ // Initialize GL11.glGetIntegerv and GL30.glGetStringi here, in case we have created an OpenGL 3.0 context.
+ // (they will be used in GLContext.getSupportedExtensions)
+ writer.println("\t\tGL11_glGetIntegerv_pointer = GLContext.getFunctionAddress(\"glGetIntegerv\");");
+ writer.println("\t\tGL30_glGetStringi_pointer = GLContext.getFunctionAddress(\"glGetStringi\");");
+
+ // Get the supported extensions set.
+ writer.println("\t\tGLContext.setCapabilities(this);");
+ writer.println("\t\tSet " + CACHED_EXTS_VAR_NAME + " = new HashSet(256);");
+ writer.println("\t\tint " + PROFILE_MASK_VAR_NAME + " = GLContext.getSupportedExtensions(" + CACHED_EXTS_VAR_NAME + ");");
+
+ // Force forward compatible mode when OpenGL version is 3.1 or higher and ARB_compatibility is not available.
+ writer.println("\t\tif ( supported_extensions.contains(\"OpenGL31\") && !(supported_extensions.contains(\"GL_ARB_compatibility\") || (profileMask & GL32.GL_CONTEXT_COMPATIBILITY_PROFILE_BIT) != 0) )");
+ writer.println("\t\t\tforwardCompatible = true;");
+
+ if ( !context_specific ) {
+ writer.println("\t\tif (" + STUBS_LOADED_NAME + ")");
+ writer.println("\t\t\treturn GLContext.getSupportedExtensions();");
+ writer.println("\t\torg.lwjgl.opengl.GL11." + Utils.STUB_INITIALIZER_NAME + "();");
+ } else {
+ writer.println("\t\tif (!" + getAddressesInitializerName("GL11") + "(forwardCompatible))");
+ writer.println("\t\t\tthrow new LWJGLException(\"GL11 not supported\");");
+ }
+ }
+
+ public static void generateInitStubsEpilogue(PrintWriter writer, boolean context_specific) {
+ if ( !context_specific ) {
+ writer.println("\t\t" + STUBS_LOADED_NAME + " = true;");
+ }
+ writer.println("\t\treturn " + CACHED_EXTS_VAR_NAME + ";");
+ writer.println("\t}");
+ }
+
+ public static void generateUnloadStubs(PrintWriter writer, InterfaceDeclaration d) {
+ if ( d.getMethods().size() > 0 ) {
+ writer.print("\t\tGLContext.resetNativeStubs(" + Utils.getSimpleClassName(d));
+ writer.println(".class);");
+ }
+ }
+
+ public static void generateInitStubs(PrintWriter writer, InterfaceDeclaration d, boolean context_specific) {
+ if ( d.getMethods().size() > 0 ) {
+ if ( context_specific ) {
+ if ( d.getAnnotation(ForceInit.class) != null )
+ writer.println("\t\t" + CACHED_EXTS_VAR_NAME + ".add(\"" + translateFieldName(d.getSimpleName()) + "\");");
+ writer.print("\t\tif (" + CACHED_EXTS_VAR_NAME + ".contains(\"");
+ writer.print(translateFieldName(d.getSimpleName()) + "\")");
+ writer.print(" && !" + getAddressesInitializerName(d.getSimpleName()) + "(");
+ if ( d.getAnnotation(DeprecatedGL.class) != null )
+ writer.print("forwardCompatible");
+ if ( d.getAnnotation(Dependent.class) != null ) {
+ if ( d.getAnnotation(DeprecatedGL.class) != null )
+ writer.print(",");
+ writer.print("supported_extensions");
+ }
+ writer.println("))");
+ //writer.print("\t\t\t" + CACHED_EXTS_VAR_NAME + ".remove(\"");
+ writer.print("\t\t\tremove(" + CACHED_EXTS_VAR_NAME + ", \"");
+ writer.println(translateFieldName(d.getSimpleName()) + "\");");
+ } else {
+ writer.print("\t\tGLContext." + Utils.STUB_INITIALIZER_NAME + "(" + Utils.getSimpleClassName(d));
+ writer.println(".class, " + CACHED_EXTS_VAR_NAME + ", \"" + translateFieldName(d.getSimpleName()) + "\");");
+ }
+ }
+ }
+
+ private static void generateAddExtension(PrintWriter writer, InterfaceDeclaration d) {
+ writer.print(CACHED_EXTS_VAR_NAME + ".add(\"");
+ writer.println(translateFieldName(d.getSimpleName()) + "\");");
+ }
+
+ public static void generateAddressesInitializers(PrintWriter writer, InterfaceDeclaration d) {
+ Iterator<? extends MethodDeclaration> methods = d.getMethods().iterator();
+ if ( !methods.hasNext() )
+ return;
+
+ writer.print("\tprivate boolean " + getAddressesInitializerName(d.getSimpleName()) + "(");
+
+ boolean optional;
+ boolean deprecated = d.getAnnotation(DeprecatedGL.class) != null;
+ Dependent dependent = d.getAnnotation(Dependent.class);
+ if ( deprecated )
+ writer.print("boolean forwardCompatible");
+ if ( dependent != null ) {
+ if ( deprecated )
+ writer.print(",");
+ writer.print("Set supported_extensions");
+ }
+
+ writer.println(") {");
+ writer.println("\t\treturn ");
+
+ boolean first = true;
+ while ( methods.hasNext() ) {
+ MethodDeclaration method = methods.next();
+ if ( method.getAnnotation(Alternate.class) != null )
+ continue;
+
+ if ( !first )
+ writer.println(" &");
+ else
+ first = false;
+
+ optional = method.getAnnotation(Optional.class) != null;
+ deprecated = method.getAnnotation(DeprecatedGL.class) != null;
+ dependent = method.getAnnotation(Dependent.class);
+
+ writer.print("\t\t\t(");
+ if ( optional )
+ writer.print('(');
+ if ( deprecated )
+ writer.print("forwardCompatible || ");
+ if ( dependent != null ) {
+ if ( dependent.value().indexOf(',') == -1 )
+ writer.print("!supported_extensions.contains(\"" + dependent.value() + "\") || ");
+ else {
+ writer.print("!(false");
+ for ( String extension : dependent.value().split(",") )
+ writer.print(" || supported_extensions.contains(\"" + extension + "\")");
+ writer.print(") || ");
+ }
+ }
+ if ( deprecated || dependent != null )
+ writer.print('(');
+ writer.print(Utils.getFunctionAddressName(d, method) + " = ");
+ PlatformDependent platform_dependent = method.getAnnotation(PlatformDependent.class);
+ if ( platform_dependent != null ) {
+ EnumSet<Platform> platform_set = EnumSet.copyOf(Arrays.asList(platform_dependent.value()));
+ writer.print("GLContext.getPlatformSpecificFunctionAddress(\"");
+ writer.print(Platform.ALL.getPrefix() + "\", ");
+ writer.print("new String[]{");
+ Iterator<Platform> platforms = platform_set.iterator();
+ while ( platforms.hasNext() ) {
+ writer.print("\"" + platforms.next().getOSPrefix() + "\"");
+ if ( platforms.hasNext() )
+ writer.print(", ");
+ }
+ writer.print("}, new String[]{");
+ platforms = platform_set.iterator();
+ while ( platforms.hasNext() ) {
+ writer.print("\"" + platforms.next().getPrefix() + "\"");
+ if ( platforms.hasNext() )
+ writer.print(", ");
+ }
+ writer.print("}, ");
+ } else
+ writer.print("GLContext.getFunctionAddress(");
+ writer.print("\"" + method.getSimpleName() + "\")) != 0");
+ if ( deprecated || dependent != null )
+ writer.print(')');
+ if ( optional )
+ writer.print(" || true)");
+ }
+ writer.println(";");
+ writer.println("\t}");
+ writer.println();
+ }
+
+ public static void generateSymbolAddresses(PrintWriter writer, InterfaceDeclaration d) {
+ for ( MethodDeclaration method : d.getMethods() ) {
+ if ( method.getAnnotation(Alternate.class) == null )
+ writer.println("\tlong " + Utils.getFunctionAddressName(d, method) + ";");
+ }
+ }
+
+ public static void generateField(PrintWriter writer, InterfaceDeclaration d) {
+ writer.println("\tpublic final boolean " + translateFieldName(d.getSimpleName()) + ";");
+ }
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/util/generator/ContextGeneratorProcessorFactory.java b/src/java/org/lwjgl/util/generator/ContextGeneratorProcessorFactory.java
index 88813b9..a987ca9 100644
--- a/src/java/org/lwjgl/util/generator/ContextGeneratorProcessorFactory.java
+++ b/src/java/org/lwjgl/util/generator/ContextGeneratorProcessorFactory.java
@@ -1,189 +1,189 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-package org.lwjgl.util.generator;
-
-import static java.util.Collections.unmodifiableCollection;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Map;
-import java.util.Set;
-
-import com.sun.mirror.apt.AnnotationProcessor;
-import com.sun.mirror.apt.AnnotationProcessorEnvironment;
-import com.sun.mirror.apt.AnnotationProcessorFactory;
-import com.sun.mirror.apt.AnnotationProcessors;
-import com.sun.mirror.apt.Filer;
-import com.sun.mirror.apt.RoundCompleteEvent;
-import com.sun.mirror.apt.RoundCompleteListener;
-import com.sun.mirror.declaration.AnnotationTypeDeclaration;
-import com.sun.mirror.declaration.InterfaceDeclaration;
-import com.sun.mirror.declaration.TypeDeclaration;
-import com.sun.mirror.util.DeclarationFilter;
-
-/**
- *
- * Generator tool for creating the ContexCapabilities class
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3316 $
- * $Id: ContextGeneratorProcessorFactory.java 3316 2010-04-09 23:57:40Z spasi $
- */
-public class ContextGeneratorProcessorFactory implements AnnotationProcessorFactory, RoundCompleteListener {
- private static boolean first_round = true;
-
- // Process any set of annotations
- private static final Collection<String> supportedAnnotations =
- unmodifiableCollection(Arrays.asList("*"));
-
- public Collection<String> supportedAnnotationTypes() {
- return supportedAnnotations;
- }
-
- public Collection<String> supportedOptions() {
- return unmodifiableCollection(Arrays.asList("-Acontextspecific", "-Ageneratechecks"));
- }
-
- public void roundComplete(RoundCompleteEvent event) {
- first_round = false;
- }
-
- public AnnotationProcessor getProcessorFor(Set<AnnotationTypeDeclaration> atds, AnnotationProcessorEnvironment env) {
- // Only process the initial types, not the generated ones
- if (first_round) {
- env.addListener(this);
- return new GeneratorProcessor(env);
- } else
- return AnnotationProcessors.NO_OP;
- }
-
- private static class GeneratorProcessor implements AnnotationProcessor {
- private final AnnotationProcessorEnvironment env;
-
- GeneratorProcessor(AnnotationProcessorEnvironment env) {
- this.env = env;
- }
-
- public void process() {
- Map<String, String> options = env.getOptions();
- boolean generate_error_checks = options.containsKey("-Ageneratechecks");
- boolean context_specific = options.containsKey("-Acontextspecific");
- try {
- generateContextCapabilitiesSource(context_specific, generate_error_checks);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
-
- private void generateContextCapabilitiesSource(boolean context_specific, boolean generate_error_checks) throws IOException {
- PrintWriter writer = env.getFiler().createTextFile(Filer.Location.SOURCE_TREE, "org.lwjgl.opengl", new File(Utils.CONTEXT_CAPS_CLASS_NAME + ".java"), null);
- writer.println("/* MACHINE GENERATED FILE, DO NOT EDIT */");
- writer.println();
- writer.println("package org.lwjgl.opengl;");
- writer.println();
- writer.println("import org.lwjgl.LWJGLException;");
- writer.println("import org.lwjgl.LWJGLUtil;");
- writer.println("import org.lwjgl.BufferUtils;");
- writer.println("import java.util.Set;");
- writer.println("import java.util.HashSet;");
- writer.println("import java.nio.IntBuffer;");
- writer.println();
- ContextCapabilitiesGenerator.generateClassPrologue(writer, context_specific, generate_error_checks);
- DeclarationFilter filter = DeclarationFilter.getFilter(InterfaceDeclaration.class);
- Collection<TypeDeclaration> interface_decls = filter.filter(env.getSpecifiedTypeDeclarations());
- for (TypeDeclaration typedecl : interface_decls) {
- InterfaceDeclaration interface_decl = (InterfaceDeclaration)typedecl;
- if (Utils.isFinal(interface_decl))
- ContextCapabilitiesGenerator.generateField(writer, interface_decl);
- }
- writer.println();
- for (TypeDeclaration typedecl : interface_decls) {
- InterfaceDeclaration interface_decl = (InterfaceDeclaration)typedecl;
- ContextCapabilitiesGenerator.generateSymbolAddresses(writer, interface_decl);
- }
- writer.println();
- if (context_specific) {
- for (TypeDeclaration typedecl : interface_decls) {
- InterfaceDeclaration interface_decl = (InterfaceDeclaration)typedecl;
- ContextCapabilitiesGenerator.generateAddressesInitializers(writer, interface_decl);
- }
- writer.println();
- }
-
- writer.println("\tprivate static void remove(Set supported_extensions, String extension) {");
- writer.println("\t\tLWJGLUtil.log(extension + \" was reported as available but an entry point is missing\");");
- writer.println("\t\tsupported_extensions.remove(extension);");
- writer.println("\t}\n");
-
- ContextCapabilitiesGenerator.generateInitStubsPrologue(writer, context_specific);
- for (TypeDeclaration typedecl : interface_decls) {
- InterfaceDeclaration interface_decl = (InterfaceDeclaration)typedecl;
- ContextCapabilitiesGenerator.generateSuperClassAdds(writer, interface_decl);
- }
- for (TypeDeclaration typedecl : interface_decls) {
- InterfaceDeclaration interface_decl = (InterfaceDeclaration)typedecl;
- String simple_name = interface_decl.getSimpleName();
- if (simple_name.equals("GL11"))
- continue;
- ContextCapabilitiesGenerator.generateInitStubs(writer, interface_decl, context_specific);
- }
- ContextCapabilitiesGenerator.generateInitStubsEpilogue(writer, context_specific);
- writer.println();
- writer.println("\tstatic void unloadAllStubs() {");
- if (!context_specific) {
- writer.println("\t\tif (!loaded_stubs)");
- writer.println("\t\t\treturn;");
- for (TypeDeclaration typedecl : interface_decls) {
- InterfaceDeclaration interface_decl = (InterfaceDeclaration)typedecl;
- ContextCapabilitiesGenerator.generateUnloadStubs(writer, interface_decl);
- }
- writer.println("\t\tloaded_stubs = false;");
- }
- writer.println("\t}");
- writer.println();
- ContextCapabilitiesGenerator.generateInitializerPrologue(writer);
- for (TypeDeclaration typedecl : interface_decls) {
- InterfaceDeclaration interface_decl = (InterfaceDeclaration)typedecl;
- if (Utils.isFinal(interface_decl))
- ContextCapabilitiesGenerator.generateInitializer(writer, interface_decl);
- }
- writer.println("\t\ttracker.init();");
- writer.println("\t}");
- writer.println("}");
- writer.close();
- }
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+package org.lwjgl.util.generator;
+
+import static java.util.Collections.unmodifiableCollection;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Map;
+import java.util.Set;
+
+import com.sun.mirror.apt.AnnotationProcessor;
+import com.sun.mirror.apt.AnnotationProcessorEnvironment;
+import com.sun.mirror.apt.AnnotationProcessorFactory;
+import com.sun.mirror.apt.AnnotationProcessors;
+import com.sun.mirror.apt.Filer;
+import com.sun.mirror.apt.RoundCompleteEvent;
+import com.sun.mirror.apt.RoundCompleteListener;
+import com.sun.mirror.declaration.AnnotationTypeDeclaration;
+import com.sun.mirror.declaration.InterfaceDeclaration;
+import com.sun.mirror.declaration.TypeDeclaration;
+import com.sun.mirror.util.DeclarationFilter;
+
+/**
+ *
+ * Generator tool for creating the ContexCapabilities class
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3316 $
+ * $Id: ContextGeneratorProcessorFactory.java 3316 2010-04-09 23:57:40Z spasi $
+ */
+public class ContextGeneratorProcessorFactory implements AnnotationProcessorFactory, RoundCompleteListener {
+ private static boolean first_round = true;
+
+ // Process any set of annotations
+ private static final Collection<String> supportedAnnotations =
+ unmodifiableCollection(Arrays.asList("*"));
+
+ public Collection<String> supportedAnnotationTypes() {
+ return supportedAnnotations;
+ }
+
+ public Collection<String> supportedOptions() {
+ return unmodifiableCollection(Arrays.asList("-Acontextspecific", "-Ageneratechecks"));
+ }
+
+ public void roundComplete(RoundCompleteEvent event) {
+ first_round = false;
+ }
+
+ public AnnotationProcessor getProcessorFor(Set<AnnotationTypeDeclaration> atds, AnnotationProcessorEnvironment env) {
+ // Only process the initial types, not the generated ones
+ if (first_round) {
+ env.addListener(this);
+ return new GeneratorProcessor(env);
+ } else
+ return AnnotationProcessors.NO_OP;
+ }
+
+ private static class GeneratorProcessor implements AnnotationProcessor {
+ private final AnnotationProcessorEnvironment env;
+
+ GeneratorProcessor(AnnotationProcessorEnvironment env) {
+ this.env = env;
+ }
+
+ public void process() {
+ Map<String, String> options = env.getOptions();
+ boolean generate_error_checks = options.containsKey("-Ageneratechecks");
+ boolean context_specific = options.containsKey("-Acontextspecific");
+ try {
+ generateContextCapabilitiesSource(context_specific, generate_error_checks);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private void generateContextCapabilitiesSource(boolean context_specific, boolean generate_error_checks) throws IOException {
+ PrintWriter writer = env.getFiler().createTextFile(Filer.Location.SOURCE_TREE, "org.lwjgl.opengl", new File(Utils.CONTEXT_CAPS_CLASS_NAME + ".java"), null);
+ writer.println("/* MACHINE GENERATED FILE, DO NOT EDIT */");
+ writer.println();
+ writer.println("package org.lwjgl.opengl;");
+ writer.println();
+ writer.println("import org.lwjgl.LWJGLException;");
+ writer.println("import org.lwjgl.LWJGLUtil;");
+ writer.println("import org.lwjgl.BufferUtils;");
+ writer.println("import java.util.Set;");
+ writer.println("import java.util.HashSet;");
+ writer.println("import java.nio.IntBuffer;");
+ writer.println();
+ ContextCapabilitiesGenerator.generateClassPrologue(writer, context_specific, generate_error_checks);
+ DeclarationFilter filter = DeclarationFilter.getFilter(InterfaceDeclaration.class);
+ Collection<TypeDeclaration> interface_decls = filter.filter(env.getSpecifiedTypeDeclarations());
+ for (TypeDeclaration typedecl : interface_decls) {
+ InterfaceDeclaration interface_decl = (InterfaceDeclaration)typedecl;
+ if (Utils.isFinal(interface_decl))
+ ContextCapabilitiesGenerator.generateField(writer, interface_decl);
+ }
+ writer.println();
+ for (TypeDeclaration typedecl : interface_decls) {
+ InterfaceDeclaration interface_decl = (InterfaceDeclaration)typedecl;
+ ContextCapabilitiesGenerator.generateSymbolAddresses(writer, interface_decl);
+ }
+ writer.println();
+ if (context_specific) {
+ for (TypeDeclaration typedecl : interface_decls) {
+ InterfaceDeclaration interface_decl = (InterfaceDeclaration)typedecl;
+ ContextCapabilitiesGenerator.generateAddressesInitializers(writer, interface_decl);
+ }
+ writer.println();
+ }
+
+ writer.println("\tprivate static void remove(Set supported_extensions, String extension) {");
+ writer.println("\t\tLWJGLUtil.log(extension + \" was reported as available but an entry point is missing\");");
+ writer.println("\t\tsupported_extensions.remove(extension);");
+ writer.println("\t}\n");
+
+ ContextCapabilitiesGenerator.generateInitStubsPrologue(writer, context_specific);
+ for (TypeDeclaration typedecl : interface_decls) {
+ InterfaceDeclaration interface_decl = (InterfaceDeclaration)typedecl;
+ ContextCapabilitiesGenerator.generateSuperClassAdds(writer, interface_decl);
+ }
+ for (TypeDeclaration typedecl : interface_decls) {
+ InterfaceDeclaration interface_decl = (InterfaceDeclaration)typedecl;
+ String simple_name = interface_decl.getSimpleName();
+ if (simple_name.equals("GL11"))
+ continue;
+ ContextCapabilitiesGenerator.generateInitStubs(writer, interface_decl, context_specific);
+ }
+ ContextCapabilitiesGenerator.generateInitStubsEpilogue(writer, context_specific);
+ writer.println();
+ writer.println("\tstatic void unloadAllStubs() {");
+ if (!context_specific) {
+ writer.println("\t\tif (!loaded_stubs)");
+ writer.println("\t\t\treturn;");
+ for (TypeDeclaration typedecl : interface_decls) {
+ InterfaceDeclaration interface_decl = (InterfaceDeclaration)typedecl;
+ ContextCapabilitiesGenerator.generateUnloadStubs(writer, interface_decl);
+ }
+ writer.println("\t\tloaded_stubs = false;");
+ }
+ writer.println("\t}");
+ writer.println();
+ ContextCapabilitiesGenerator.generateInitializerPrologue(writer);
+ for (TypeDeclaration typedecl : interface_decls) {
+ InterfaceDeclaration interface_decl = (InterfaceDeclaration)typedecl;
+ if (Utils.isFinal(interface_decl))
+ ContextCapabilitiesGenerator.generateInitializer(writer, interface_decl);
+ }
+ writer.println("\t\ttracker.init();");
+ writer.println("\t}");
+ writer.println("}");
+ writer.close();
+ }
+ }
+}
diff --git a/src/java/org/lwjgl/util/generator/Dependent.java b/src/java/org/lwjgl/util/generator/Dependent.java
index 1741823..3a99207 100644
--- a/src/java/org/lwjgl/util/generator/Dependent.java
+++ b/src/java/org/lwjgl/util/generator/Dependent.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- * Use this annotation on extensions with functionality that depends on the presence of other extensions.
- * Functions in such extensions marked with this annotation will only be loaded if the specified extension is present.
- *
- * @author spasi <spasi at users.sourceforge.net>
- */
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Target;
-
- at Target({ ElementType.TYPE, ElementType.METHOD })
-public @interface Dependent {
- String value() default "";
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ * Use this annotation on extensions with functionality that depends on the presence of other extensions.
+ * Functions in such extensions marked with this annotation will only be loaded if the specified extension is present.
+ *
+ * @author spasi <spasi at users.sourceforge.net>
+ */
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+ at Target({ ElementType.TYPE, ElementType.METHOD })
+public @interface Dependent {
+ String value() default "";
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/util/generator/DeprecatedGL.java b/src/java/org/lwjgl/util/generator/DeprecatedGL.java
index 4789d98..835730a 100644
--- a/src/java/org/lwjgl/util/generator/DeprecatedGL.java
+++ b/src/java/org/lwjgl/util/generator/DeprecatedGL.java
@@ -1,46 +1,46 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- * Use this annotation on extensions with deprecated functionality.
- * Functions in such extensions marked with this annotation will not be loaded in a forward compatible context.
- *
- * @author spasi <spasi at users.sourceforge.net>
- */
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Target;
-
- at Target({ ElementType.TYPE, ElementType.METHOD })
-public @interface DeprecatedGL {
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ * Use this annotation on extensions with deprecated functionality.
+ * Functions in such extensions marked with this annotation will not be loaded in a forward compatible context.
+ *
+ * @author spasi <spasi at users.sourceforge.net>
+ */
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+ at Target({ ElementType.TYPE, ElementType.METHOD })
+public @interface DeprecatedGL {
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/util/generator/Extension.java b/src/java/org/lwjgl/util/generator/Extension.java
index 2b9e5fa..fb074b2 100644
--- a/src/java/org/lwjgl/util/generator/Extension.java
+++ b/src/java/org/lwjgl/util/generator/Extension.java
@@ -1,49 +1,49 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: Extension.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at Target(ElementType.TYPE)
-public @interface Extension {
- String className() default "";
- boolean isFinal() default true;
- String postfix();
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: Extension.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at Target(ElementType.TYPE)
+public @interface Extension {
+ String className() default "";
+ boolean isFinal() default true;
+ String postfix();
+}
diff --git a/src/java/org/lwjgl/util/generator/FieldsGenerator.java b/src/java/org/lwjgl/util/generator/FieldsGenerator.java
index 42649f8..689390b 100644
--- a/src/java/org/lwjgl/util/generator/FieldsGenerator.java
+++ b/src/java/org/lwjgl/util/generator/FieldsGenerator.java
@@ -1,78 +1,78 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-package org.lwjgl.util.generator;
-
-import com.sun.mirror.declaration.*;
-import com.sun.mirror.type.*;
-
-import java.io.*;
-import java.util.*;
-
-public class FieldsGenerator {
- private static void validateField(FieldDeclaration field) {
- Collection<Modifier> modifiers = field.getModifiers();
- if (modifiers.size() != 3 || !modifiers.contains(Modifier.PUBLIC) || !modifiers.contains(Modifier.STATIC) ||
- !modifiers.contains(Modifier.FINAL))
- throw new RuntimeException("Field " + field.getSimpleName() + " is not declared public static final");
- TypeMirror field_type = field.getType();
- if (!(field_type instanceof PrimitiveType))
- throw new RuntimeException("Field " + field.getSimpleName() + " is not a primitive type");
- PrimitiveType field_type_prim = (PrimitiveType)field_type;
- if (field_type_prim.getKind() != PrimitiveType.Kind.INT && field_type_prim.getKind() != PrimitiveType.Kind.LONG)
- throw new RuntimeException("Field " + field.getSimpleName() + " is not of type 'int' or 'long'");
- Object field_value = field.getConstantValue();
- if (field_value == null)
- throw new RuntimeException("Field " + field.getSimpleName() + " has no initial value");
- }
-
- private static void generateField(PrintWriter writer, FieldDeclaration field) {
- validateField(field);
-
- Object value = field.getConstantValue();
- String field_value_string;
- if ( value.getClass().equals(Integer.class) )
- field_value_string = Integer.toHexString((Integer)field.getConstantValue());
- else
- field_value_string = Long.toHexString((Long)field.getConstantValue()) + 'l';
-
- Utils.printDocComment(writer, field);
- // Print field declaration
- writer.println("\tpublic static final " + field.getType().toString() + " " + field.getSimpleName() + " = 0x" + field_value_string + ";");
- }
-
- public static void generateFields(PrintWriter writer, Collection<FieldDeclaration> fields) {
- for (FieldDeclaration field : fields)
- generateField(writer, field);
- }
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+package org.lwjgl.util.generator;
+
+import com.sun.mirror.declaration.*;
+import com.sun.mirror.type.*;
+
+import java.io.*;
+import java.util.*;
+
+public class FieldsGenerator {
+ private static void validateField(FieldDeclaration field) {
+ Collection<Modifier> modifiers = field.getModifiers();
+ if (modifiers.size() != 3 || !modifiers.contains(Modifier.PUBLIC) || !modifiers.contains(Modifier.STATIC) ||
+ !modifiers.contains(Modifier.FINAL))
+ throw new RuntimeException("Field " + field.getSimpleName() + " is not declared public static final");
+ TypeMirror field_type = field.getType();
+ if (!(field_type instanceof PrimitiveType))
+ throw new RuntimeException("Field " + field.getSimpleName() + " is not a primitive type");
+ PrimitiveType field_type_prim = (PrimitiveType)field_type;
+ if (field_type_prim.getKind() != PrimitiveType.Kind.INT && field_type_prim.getKind() != PrimitiveType.Kind.LONG)
+ throw new RuntimeException("Field " + field.getSimpleName() + " is not of type 'int' or 'long'");
+ Object field_value = field.getConstantValue();
+ if (field_value == null)
+ throw new RuntimeException("Field " + field.getSimpleName() + " has no initial value");
+ }
+
+ private static void generateField(PrintWriter writer, FieldDeclaration field) {
+ validateField(field);
+
+ Object value = field.getConstantValue();
+ String field_value_string;
+ if ( value.getClass().equals(Integer.class) )
+ field_value_string = Integer.toHexString((Integer)field.getConstantValue());
+ else
+ field_value_string = Long.toHexString((Long)field.getConstantValue()) + 'l';
+
+ Utils.printDocComment(writer, field);
+ // Print field declaration
+ writer.println("\tpublic static final " + field.getType().toString() + " " + field.getSimpleName() + " = 0x" + field_value_string + ";");
+ }
+
+ public static void generateFields(PrintWriter writer, Collection<FieldDeclaration> fields) {
+ for (FieldDeclaration field : fields)
+ generateField(writer, field);
+ }
+
+}
diff --git a/src/java/org/lwjgl/util/generator/ForceInit.java b/src/java/org/lwjgl/util/generator/ForceInit.java
index 7173f6e..eaec42c 100644
--- a/src/java/org/lwjgl/util/generator/ForceInit.java
+++ b/src/java/org/lwjgl/util/generator/ForceInit.java
@@ -1,45 +1,45 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- * Extensions marked with ForceInit will be initialized by LWJGL even if not exposed in the GL_EXTENSIONS string.
- *
- * @author spasi
- */
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Target;
-
- at Target({ ElementType.TYPE })
-public @interface ForceInit {
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ * Extensions marked with ForceInit will be initialized by LWJGL even if not exposed in the GL_EXTENSIONS string.
+ *
+ * @author spasi
+ */
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+ at Target({ ElementType.TYPE })
+public @interface ForceInit {
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/util/generator/GLTypeMap.java b/src/java/org/lwjgl/util/generator/GLTypeMap.java
index 0a61351..8e68ee0 100644
--- a/src/java/org/lwjgl/util/generator/GLTypeMap.java
+++ b/src/java/org/lwjgl/util/generator/GLTypeMap.java
@@ -1,299 +1,299 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-package org.lwjgl.util.generator;
-
-/**
- *
- * OpenGL sepcific generator behaviour
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3287 $
- * $Id: GLTypeMap.java 3287 2010-03-14 23:24:40Z spasi $
- */
-
-import org.lwjgl.opengl.PointerWrapper;
-
-import java.io.PrintWriter;
-import java.nio.*;
-import java.util.HashMap;
-import java.util.Map;
-
-import com.sun.mirror.declaration.AnnotationMirror;
-import com.sun.mirror.type.PrimitiveType;
-
-public class GLTypeMap implements TypeMap {
-
- private static final Map<Class, PrimitiveType.Kind> native_types_to_primitive;
-
- static {
- native_types_to_primitive = new HashMap<Class, PrimitiveType.Kind>();
- native_types_to_primitive.put(GLbitfield.class, PrimitiveType.Kind.INT);
- native_types_to_primitive.put(GLcharARB.class, PrimitiveType.Kind.BYTE);
- native_types_to_primitive.put(GLclampf.class, PrimitiveType.Kind.FLOAT);
- native_types_to_primitive.put(GLfloat.class, PrimitiveType.Kind.FLOAT);
- native_types_to_primitive.put(GLint.class, PrimitiveType.Kind.INT);
- native_types_to_primitive.put(GLshort.class, PrimitiveType.Kind.SHORT);
- native_types_to_primitive.put(GLsizeiptr.class, PrimitiveType.Kind.LONG);
- native_types_to_primitive.put(GLuint.class, PrimitiveType.Kind.INT);
- native_types_to_primitive.put(GLboolean.class, PrimitiveType.Kind.BOOLEAN);
- native_types_to_primitive.put(GLchar.class, PrimitiveType.Kind.BYTE);
- native_types_to_primitive.put(GLdouble.class, PrimitiveType.Kind.DOUBLE);
- native_types_to_primitive.put(GLhalf.class, PrimitiveType.Kind.SHORT);
- native_types_to_primitive.put(GLintptrARB.class, PrimitiveType.Kind.LONG);
- native_types_to_primitive.put(GLsizei.class, PrimitiveType.Kind.INT);
- native_types_to_primitive.put(GLushort.class, PrimitiveType.Kind.SHORT);
- native_types_to_primitive.put(GLbyte.class, PrimitiveType.Kind.BYTE);
- native_types_to_primitive.put(GLclampd.class, PrimitiveType.Kind.DOUBLE);
- native_types_to_primitive.put(GLenum.class, PrimitiveType.Kind.INT);
- native_types_to_primitive.put(GLhandleARB.class, PrimitiveType.Kind.INT);
- native_types_to_primitive.put(GLintptr.class, PrimitiveType.Kind.LONG);
- native_types_to_primitive.put(GLsizeiptrARB.class, PrimitiveType.Kind.LONG);
- native_types_to_primitive.put(GLubyte.class, PrimitiveType.Kind.BYTE);
- native_types_to_primitive.put(GLvoid.class, PrimitiveType.Kind.BYTE);
- native_types_to_primitive.put(GLint64EXT.class, PrimitiveType.Kind.LONG);
- native_types_to_primitive.put(GLuint64EXT.class, PrimitiveType.Kind.LONG);
- native_types_to_primitive.put(GLint64.class, PrimitiveType.Kind.LONG);
- native_types_to_primitive.put(GLuint64.class, PrimitiveType.Kind.LONG);
- }
-
- public PrimitiveType.Kind getPrimitiveTypeFromNativeType(Class native_type) {
- PrimitiveType.Kind kind = native_types_to_primitive.get(native_type);
- if ( kind == null )
- throw new RuntimeException("Unsupported type " + native_type);
- return kind;
- }
-
- public String getErrorCheckMethodName() {
- return "Util.checkGLError()";
- }
-
- public String getRegisterNativesFunctionName() {
- return "extgl_InitializeClass";
- }
-
- public Signedness getSignednessFromType(Class type) {
- if ( GLuint.class.equals(type) )
- return Signedness.UNSIGNED;
- else if ( GLint.class.equals(type) )
- return Signedness.SIGNED;
- else if ( GLushort.class.equals(type) )
- return Signedness.UNSIGNED;
- else if ( GLshort.class.equals(type) )
- return Signedness.SIGNED;
- else if ( GLubyte.class.equals(type) )
- return Signedness.UNSIGNED;
- else if ( GLbyte.class.equals(type) )
- return Signedness.SIGNED;
- else if ( GLuint64EXT.class.equals(type) )
- return Signedness.UNSIGNED;
- else if ( GLint64EXT.class.equals(type) )
- return Signedness.SIGNED;
- else if ( GLuint64.class.equals(type) )
- return Signedness.UNSIGNED;
- else if ( GLint64.class.equals(type) )
- return Signedness.SIGNED;
- else
- return Signedness.NONE;
- }
-
- public String translateAnnotation(Class annotation_type) {
- if ( annotation_type.equals(GLuint.class) || annotation_type.equals(GLint.class) )
- return "i";
- else if ( annotation_type.equals(GLushort.class) || annotation_type.equals(GLshort.class) )
- return "s";
- else if ( annotation_type.equals(GLubyte.class) || annotation_type.equals(GLbyte.class) )
- return "b";
- else if ( annotation_type.equals(GLfloat.class) )
- return "f";
- else if ( annotation_type.equals(GLdouble.class) )
- return "d";
- else if ( annotation_type.equals(GLhalf.class) )
- return "h";
- else if ( annotation_type.equals(GLuint64EXT.class) || annotation_type.equals(GLint64EXT.class) || annotation_type.equals(GLuint64.class) || annotation_type.equals(GLint64.class) )
- return "i64";
- else if ( annotation_type.equals(GLboolean.class) || annotation_type.equals(GLvoid.class) )
- return "";
- else
- throw new RuntimeException(annotation_type + " is not allowed");
- }
-
- public Class getNativeTypeFromPrimitiveType(PrimitiveType.Kind kind) {
- Class type;
- switch ( kind ) {
- case INT:
- type = GLint.class;
- break;
- case DOUBLE:
- type = GLdouble.class;
- break;
- case FLOAT:
- type = GLfloat.class;
- break;
- case SHORT:
- type = GLshort.class;
- break;
- case BYTE:
- type = GLbyte.class;
- break;
- case LONG:
- type = GLint64EXT.class;
- break;
- case BOOLEAN:
- type = GLboolean.class;
- break;
- default:
- throw new RuntimeException(kind + " is not allowed");
- }
- return type;
- }
-
- public Class getVoidType() {
- return GLvoid.class;
- }
-
- public Class getStringElementType() {
- return GLubyte.class;
- }
-
- private static Class[] getValidBufferTypes(Class type) {
- if ( type.equals(IntBuffer.class) )
- return new Class[] { GLbitfield.class, GLenum.class, GLhandleARB.class, GLint.class,
- GLsizei.class, GLuint.class, GLvoid.class };
- else if ( type.equals(FloatBuffer.class) )
- return new Class[] { GLclampf.class, GLfloat.class };
- else if ( type.equals(ByteBuffer.class) )
- return new Class[] { GLboolean.class, GLbyte.class, GLcharARB.class, GLchar.class, GLubyte.class, GLvoid.class };
- else if ( type.equals(ShortBuffer.class) )
- return new Class[] { GLhalf.class, GLshort.class, GLushort.class };
- else if ( type.equals(DoubleBuffer.class) )
- return new Class[] { GLclampd.class, GLdouble.class };
- else if ( type.equals(LongBuffer.class) )
- return new Class[] { GLint64EXT.class, GLuint64EXT.class, GLint64.class, GLuint64.class };
- else
- return new Class[] { };
- }
-
- private static Class[] getValidPrimitiveTypes(Class type) {
- if ( type.equals(long.class) )
- return new Class[] { GLintptrARB.class, GLuint.class, GLintptr.class, GLsizeiptrARB.class, GLsizeiptr.class, GLint64EXT.class, GLuint64EXT.class, GLint64.class, GLuint64.class };
- else if ( type.equals(int.class) )
- return new Class[] { GLbitfield.class, GLenum.class, GLhandleARB.class, GLint.class, GLuint.class,
- GLsizei.class };
- else if ( type.equals(double.class) )
- return new Class[] { GLclampd.class, GLdouble.class };
- else if ( type.equals(float.class) )
- return new Class[] { GLclampf.class, GLfloat.class };
- else if ( type.equals(short.class) )
- return new Class[] { GLhalf.class, GLshort.class, GLushort.class };
- else if ( type.equals(byte.class) )
- return new Class[] { GLbyte.class, GLcharARB.class, GLchar.class, GLubyte.class };
- else if ( type.equals(boolean.class) )
- return new Class[] { GLboolean.class };
- else if ( type.equals(void.class) )
- return new Class[] { GLvoid.class, GLreturn.class };
- else
- return new Class[] { };
- }
-
- public String getTypedefPrefix() {
- return "APIENTRY";
- }
-
- public void printNativeIncludes(PrintWriter writer) {
- writer.println("#include \"extgl.h\"");
- }
-
- public Class[] getValidAnnotationTypes(Class type) {
- Class[] valid_types;
- if ( Buffer.class.isAssignableFrom(type) )
- valid_types = getValidBufferTypes(type);
- else if ( type.isPrimitive() )
- valid_types = getValidPrimitiveTypes(type);
- else if ( String.class.equals(type) )
- valid_types = new Class[] { GLubyte.class };
- else if ( PointerWrapper.class.isAssignableFrom(type) )
- valid_types = new Class[] { GLpointer.class };
- else if (void.class.equals(type) )
- valid_types = new Class[] { GLreturn.class };
- else
- valid_types = new Class[] { };
- return valid_types;
- }
-
- public Class getInverseType(Class type) {
- if ( GLuint.class.equals(type) )
- return GLint.class;
- else if ( GLint.class.equals(type) )
- return GLuint.class;
- else if ( GLushort.class.equals(type) )
- return GLshort.class;
- else if ( GLshort.class.equals(type) )
- return GLushort.class;
- else if ( GLubyte.class.equals(type) )
- return GLbyte.class;
- else if ( GLbyte.class.equals(type) )
- return GLubyte.class;
- else if ( GLuint64EXT.class.equals(type) )
- return GLint64EXT.class;
- else if ( GLint64EXT.class.equals(type) )
- return GLuint64EXT.class;
- else if ( GLuint64.class.equals(type) )
- return GLint64.class;
- else if ( GLint64.class.equals(type) )
- return GLuint64.class;
- else
- return null;
- }
-
- public String getAutoTypeFromAnnotation(AnnotationMirror annotation) {
- Class annotation_class = NativeTypeTranslator.getClassFromType(annotation.getAnnotationType());
- if ( annotation_class.equals(GLint.class) )
- return "GL11.GL_INT";
- else if ( annotation_class.equals(GLbyte.class) )
- return "GL11.GL_BYTE";
- else if ( annotation_class.equals(GLshort.class) )
- return "GL11.GL_SHORT";
- if ( annotation_class.equals(GLuint.class) )
- return "GL11.GL_UNSIGNED_INT";
- else if ( annotation_class.equals(GLubyte.class) )
- return "GL11.GL_UNSIGNED_BYTE";
- else if ( annotation_class.equals(GLushort.class) )
- return "GL11.GL_UNSIGNED_SHORT";
- else if ( annotation_class.equals(GLfloat.class) )
- return "GL11.GL_FLOAT";
- else if ( annotation_class.equals(GLdouble.class) )
- return "GL11.GL_DOUBLE";
- else
- return null;
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * OpenGL sepcific generator behaviour
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3287 $
+ * $Id: GLTypeMap.java 3287 2010-03-14 23:24:40Z spasi $
+ */
+
+import org.lwjgl.opengl.PointerWrapper;
+
+import java.io.PrintWriter;
+import java.nio.*;
+import java.util.HashMap;
+import java.util.Map;
+
+import com.sun.mirror.declaration.AnnotationMirror;
+import com.sun.mirror.type.PrimitiveType;
+
+public class GLTypeMap implements TypeMap {
+
+ private static final Map<Class, PrimitiveType.Kind> native_types_to_primitive;
+
+ static {
+ native_types_to_primitive = new HashMap<Class, PrimitiveType.Kind>();
+ native_types_to_primitive.put(GLbitfield.class, PrimitiveType.Kind.INT);
+ native_types_to_primitive.put(GLcharARB.class, PrimitiveType.Kind.BYTE);
+ native_types_to_primitive.put(GLclampf.class, PrimitiveType.Kind.FLOAT);
+ native_types_to_primitive.put(GLfloat.class, PrimitiveType.Kind.FLOAT);
+ native_types_to_primitive.put(GLint.class, PrimitiveType.Kind.INT);
+ native_types_to_primitive.put(GLshort.class, PrimitiveType.Kind.SHORT);
+ native_types_to_primitive.put(GLsizeiptr.class, PrimitiveType.Kind.LONG);
+ native_types_to_primitive.put(GLuint.class, PrimitiveType.Kind.INT);
+ native_types_to_primitive.put(GLboolean.class, PrimitiveType.Kind.BOOLEAN);
+ native_types_to_primitive.put(GLchar.class, PrimitiveType.Kind.BYTE);
+ native_types_to_primitive.put(GLdouble.class, PrimitiveType.Kind.DOUBLE);
+ native_types_to_primitive.put(GLhalf.class, PrimitiveType.Kind.SHORT);
+ native_types_to_primitive.put(GLintptrARB.class, PrimitiveType.Kind.LONG);
+ native_types_to_primitive.put(GLsizei.class, PrimitiveType.Kind.INT);
+ native_types_to_primitive.put(GLushort.class, PrimitiveType.Kind.SHORT);
+ native_types_to_primitive.put(GLbyte.class, PrimitiveType.Kind.BYTE);
+ native_types_to_primitive.put(GLclampd.class, PrimitiveType.Kind.DOUBLE);
+ native_types_to_primitive.put(GLenum.class, PrimitiveType.Kind.INT);
+ native_types_to_primitive.put(GLhandleARB.class, PrimitiveType.Kind.INT);
+ native_types_to_primitive.put(GLintptr.class, PrimitiveType.Kind.LONG);
+ native_types_to_primitive.put(GLsizeiptrARB.class, PrimitiveType.Kind.LONG);
+ native_types_to_primitive.put(GLubyte.class, PrimitiveType.Kind.BYTE);
+ native_types_to_primitive.put(GLvoid.class, PrimitiveType.Kind.BYTE);
+ native_types_to_primitive.put(GLint64EXT.class, PrimitiveType.Kind.LONG);
+ native_types_to_primitive.put(GLuint64EXT.class, PrimitiveType.Kind.LONG);
+ native_types_to_primitive.put(GLint64.class, PrimitiveType.Kind.LONG);
+ native_types_to_primitive.put(GLuint64.class, PrimitiveType.Kind.LONG);
+ }
+
+ public PrimitiveType.Kind getPrimitiveTypeFromNativeType(Class native_type) {
+ PrimitiveType.Kind kind = native_types_to_primitive.get(native_type);
+ if ( kind == null )
+ throw new RuntimeException("Unsupported type " + native_type);
+ return kind;
+ }
+
+ public String getErrorCheckMethodName() {
+ return "Util.checkGLError()";
+ }
+
+ public String getRegisterNativesFunctionName() {
+ return "extgl_InitializeClass";
+ }
+
+ public Signedness getSignednessFromType(Class type) {
+ if ( GLuint.class.equals(type) )
+ return Signedness.UNSIGNED;
+ else if ( GLint.class.equals(type) )
+ return Signedness.SIGNED;
+ else if ( GLushort.class.equals(type) )
+ return Signedness.UNSIGNED;
+ else if ( GLshort.class.equals(type) )
+ return Signedness.SIGNED;
+ else if ( GLubyte.class.equals(type) )
+ return Signedness.UNSIGNED;
+ else if ( GLbyte.class.equals(type) )
+ return Signedness.SIGNED;
+ else if ( GLuint64EXT.class.equals(type) )
+ return Signedness.UNSIGNED;
+ else if ( GLint64EXT.class.equals(type) )
+ return Signedness.SIGNED;
+ else if ( GLuint64.class.equals(type) )
+ return Signedness.UNSIGNED;
+ else if ( GLint64.class.equals(type) )
+ return Signedness.SIGNED;
+ else
+ return Signedness.NONE;
+ }
+
+ public String translateAnnotation(Class annotation_type) {
+ if ( annotation_type.equals(GLuint.class) || annotation_type.equals(GLint.class) )
+ return "i";
+ else if ( annotation_type.equals(GLushort.class) || annotation_type.equals(GLshort.class) )
+ return "s";
+ else if ( annotation_type.equals(GLubyte.class) || annotation_type.equals(GLbyte.class) )
+ return "b";
+ else if ( annotation_type.equals(GLfloat.class) )
+ return "f";
+ else if ( annotation_type.equals(GLdouble.class) )
+ return "d";
+ else if ( annotation_type.equals(GLhalf.class) )
+ return "h";
+ else if ( annotation_type.equals(GLuint64EXT.class) || annotation_type.equals(GLint64EXT.class) || annotation_type.equals(GLuint64.class) || annotation_type.equals(GLint64.class) )
+ return "i64";
+ else if ( annotation_type.equals(GLboolean.class) || annotation_type.equals(GLvoid.class) )
+ return "";
+ else
+ throw new RuntimeException(annotation_type + " is not allowed");
+ }
+
+ public Class getNativeTypeFromPrimitiveType(PrimitiveType.Kind kind) {
+ Class type;
+ switch ( kind ) {
+ case INT:
+ type = GLint.class;
+ break;
+ case DOUBLE:
+ type = GLdouble.class;
+ break;
+ case FLOAT:
+ type = GLfloat.class;
+ break;
+ case SHORT:
+ type = GLshort.class;
+ break;
+ case BYTE:
+ type = GLbyte.class;
+ break;
+ case LONG:
+ type = GLint64EXT.class;
+ break;
+ case BOOLEAN:
+ type = GLboolean.class;
+ break;
+ default:
+ throw new RuntimeException(kind + " is not allowed");
+ }
+ return type;
+ }
+
+ public Class getVoidType() {
+ return GLvoid.class;
+ }
+
+ public Class getStringElementType() {
+ return GLubyte.class;
+ }
+
+ private static Class[] getValidBufferTypes(Class type) {
+ if ( type.equals(IntBuffer.class) )
+ return new Class[] { GLbitfield.class, GLenum.class, GLhandleARB.class, GLint.class,
+ GLsizei.class, GLuint.class, GLvoid.class };
+ else if ( type.equals(FloatBuffer.class) )
+ return new Class[] { GLclampf.class, GLfloat.class };
+ else if ( type.equals(ByteBuffer.class) )
+ return new Class[] { GLboolean.class, GLbyte.class, GLcharARB.class, GLchar.class, GLubyte.class, GLvoid.class };
+ else if ( type.equals(ShortBuffer.class) )
+ return new Class[] { GLhalf.class, GLshort.class, GLushort.class };
+ else if ( type.equals(DoubleBuffer.class) )
+ return new Class[] { GLclampd.class, GLdouble.class };
+ else if ( type.equals(LongBuffer.class) )
+ return new Class[] { GLint64EXT.class, GLuint64EXT.class, GLint64.class, GLuint64.class };
+ else
+ return new Class[] { };
+ }
+
+ private static Class[] getValidPrimitiveTypes(Class type) {
+ if ( type.equals(long.class) )
+ return new Class[] { GLintptrARB.class, GLuint.class, GLintptr.class, GLsizeiptrARB.class, GLsizeiptr.class, GLint64EXT.class, GLuint64EXT.class, GLint64.class, GLuint64.class };
+ else if ( type.equals(int.class) )
+ return new Class[] { GLbitfield.class, GLenum.class, GLhandleARB.class, GLint.class, GLuint.class,
+ GLsizei.class };
+ else if ( type.equals(double.class) )
+ return new Class[] { GLclampd.class, GLdouble.class };
+ else if ( type.equals(float.class) )
+ return new Class[] { GLclampf.class, GLfloat.class };
+ else if ( type.equals(short.class) )
+ return new Class[] { GLhalf.class, GLshort.class, GLushort.class };
+ else if ( type.equals(byte.class) )
+ return new Class[] { GLbyte.class, GLcharARB.class, GLchar.class, GLubyte.class };
+ else if ( type.equals(boolean.class) )
+ return new Class[] { GLboolean.class };
+ else if ( type.equals(void.class) )
+ return new Class[] { GLvoid.class, GLreturn.class };
+ else
+ return new Class[] { };
+ }
+
+ public String getTypedefPrefix() {
+ return "APIENTRY";
+ }
+
+ public void printNativeIncludes(PrintWriter writer) {
+ writer.println("#include \"extgl.h\"");
+ }
+
+ public Class[] getValidAnnotationTypes(Class type) {
+ Class[] valid_types;
+ if ( Buffer.class.isAssignableFrom(type) )
+ valid_types = getValidBufferTypes(type);
+ else if ( type.isPrimitive() )
+ valid_types = getValidPrimitiveTypes(type);
+ else if ( String.class.equals(type) )
+ valid_types = new Class[] { GLubyte.class };
+ else if ( PointerWrapper.class.isAssignableFrom(type) )
+ valid_types = new Class[] { GLpointer.class };
+ else if (void.class.equals(type) )
+ valid_types = new Class[] { GLreturn.class };
+ else
+ valid_types = new Class[] { };
+ return valid_types;
+ }
+
+ public Class getInverseType(Class type) {
+ if ( GLuint.class.equals(type) )
+ return GLint.class;
+ else if ( GLint.class.equals(type) )
+ return GLuint.class;
+ else if ( GLushort.class.equals(type) )
+ return GLshort.class;
+ else if ( GLshort.class.equals(type) )
+ return GLushort.class;
+ else if ( GLubyte.class.equals(type) )
+ return GLbyte.class;
+ else if ( GLbyte.class.equals(type) )
+ return GLubyte.class;
+ else if ( GLuint64EXT.class.equals(type) )
+ return GLint64EXT.class;
+ else if ( GLint64EXT.class.equals(type) )
+ return GLuint64EXT.class;
+ else if ( GLuint64.class.equals(type) )
+ return GLint64.class;
+ else if ( GLint64.class.equals(type) )
+ return GLuint64.class;
+ else
+ return null;
+ }
+
+ public String getAutoTypeFromAnnotation(AnnotationMirror annotation) {
+ Class annotation_class = NativeTypeTranslator.getClassFromType(annotation.getAnnotationType());
+ if ( annotation_class.equals(GLint.class) )
+ return "GL11.GL_INT";
+ else if ( annotation_class.equals(GLbyte.class) )
+ return "GL11.GL_BYTE";
+ else if ( annotation_class.equals(GLshort.class) )
+ return "GL11.GL_SHORT";
+ if ( annotation_class.equals(GLuint.class) )
+ return "GL11.GL_UNSIGNED_INT";
+ else if ( annotation_class.equals(GLubyte.class) )
+ return "GL11.GL_UNSIGNED_BYTE";
+ else if ( annotation_class.equals(GLushort.class) )
+ return "GL11.GL_UNSIGNED_SHORT";
+ else if ( annotation_class.equals(GLfloat.class) )
+ return "GL11.GL_FLOAT";
+ else if ( annotation_class.equals(GLdouble.class) )
+ return "GL11.GL_DOUBLE";
+ else
+ return null;
+ }
+}
diff --git a/src/java/org/lwjgl/util/generator/GLbitfield.java b/src/java/org/lwjgl/util/generator/GLbitfield.java
index 4522a5e..0e20c4d 100644
--- a/src/java/org/lwjgl/util/generator/GLbitfield.java
+++ b/src/java/org/lwjgl/util/generator/GLbitfield.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: GLbitfield.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface GLbitfield {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: GLbitfield.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface GLbitfield {
+}
diff --git a/src/java/org/lwjgl/util/generator/GLboolean.java b/src/java/org/lwjgl/util/generator/GLboolean.java
index b685412..0a850bd 100644
--- a/src/java/org/lwjgl/util/generator/GLboolean.java
+++ b/src/java/org/lwjgl/util/generator/GLboolean.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: GLboolean.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface GLboolean {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: GLboolean.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface GLboolean {
+}
diff --git a/src/java/org/lwjgl/util/generator/GLbyte.java b/src/java/org/lwjgl/util/generator/GLbyte.java
index ab3c473..f8edad6 100644
--- a/src/java/org/lwjgl/util/generator/GLbyte.java
+++ b/src/java/org/lwjgl/util/generator/GLbyte.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: GLbyte.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface GLbyte {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: GLbyte.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface GLbyte {
+}
diff --git a/src/java/org/lwjgl/util/generator/GLchar.java b/src/java/org/lwjgl/util/generator/GLchar.java
index 9263c83..0b640fb 100644
--- a/src/java/org/lwjgl/util/generator/GLchar.java
+++ b/src/java/org/lwjgl/util/generator/GLchar.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: GLchar.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface GLchar {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: GLchar.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface GLchar {
+}
diff --git a/src/java/org/lwjgl/util/generator/GLcharARB.java b/src/java/org/lwjgl/util/generator/GLcharARB.java
index 285e5d6..5491e8c 100644
--- a/src/java/org/lwjgl/util/generator/GLcharARB.java
+++ b/src/java/org/lwjgl/util/generator/GLcharARB.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: GLcharARB.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface GLcharARB {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: GLcharARB.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface GLcharARB {
+}
diff --git a/src/java/org/lwjgl/util/generator/GLclampd.java b/src/java/org/lwjgl/util/generator/GLclampd.java
index 429b49f..44c3dad 100644
--- a/src/java/org/lwjgl/util/generator/GLclampd.java
+++ b/src/java/org/lwjgl/util/generator/GLclampd.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: GLclampd.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface GLclampd {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: GLclampd.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface GLclampd {
+}
diff --git a/src/java/org/lwjgl/util/generator/GLclampf.java b/src/java/org/lwjgl/util/generator/GLclampf.java
index 356cea8..0f05c23 100644
--- a/src/java/org/lwjgl/util/generator/GLclampf.java
+++ b/src/java/org/lwjgl/util/generator/GLclampf.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: GLclampf.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface GLclampf {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: GLclampf.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface GLclampf {
+}
diff --git a/src/java/org/lwjgl/util/generator/GLdouble.java b/src/java/org/lwjgl/util/generator/GLdouble.java
index b3622ec..c274e9d 100644
--- a/src/java/org/lwjgl/util/generator/GLdouble.java
+++ b/src/java/org/lwjgl/util/generator/GLdouble.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: GLdouble.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface GLdouble {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: GLdouble.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface GLdouble {
+}
diff --git a/src/java/org/lwjgl/util/generator/GLenum.java b/src/java/org/lwjgl/util/generator/GLenum.java
index f7f68d8..3d6021c 100644
--- a/src/java/org/lwjgl/util/generator/GLenum.java
+++ b/src/java/org/lwjgl/util/generator/GLenum.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: GLenum.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface GLenum {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: GLenum.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface GLenum {
+}
diff --git a/src/java/org/lwjgl/util/generator/GLfloat.java b/src/java/org/lwjgl/util/generator/GLfloat.java
index fe351a9..de73dc7 100644
--- a/src/java/org/lwjgl/util/generator/GLfloat.java
+++ b/src/java/org/lwjgl/util/generator/GLfloat.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: GLfloat.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface GLfloat {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: GLfloat.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface GLfloat {
+}
diff --git a/src/java/org/lwjgl/util/generator/GLhalf.java b/src/java/org/lwjgl/util/generator/GLhalf.java
index bf54627..d9ad0e6 100644
--- a/src/java/org/lwjgl/util/generator/GLhalf.java
+++ b/src/java/org/lwjgl/util/generator/GLhalf.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: GLhalf.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface GLhalf {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: GLhalf.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface GLhalf {
+}
diff --git a/src/java/org/lwjgl/util/generator/GLhandleARB.java b/src/java/org/lwjgl/util/generator/GLhandleARB.java
index e4c388d..76322e9 100644
--- a/src/java/org/lwjgl/util/generator/GLhandleARB.java
+++ b/src/java/org/lwjgl/util/generator/GLhandleARB.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: GLhandleARB.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface GLhandleARB {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: GLhandleARB.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface GLhandleARB {
+}
diff --git a/src/java/org/lwjgl/util/generator/GLint.java b/src/java/org/lwjgl/util/generator/GLint.java
index 8321875..83febca 100644
--- a/src/java/org/lwjgl/util/generator/GLint.java
+++ b/src/java/org/lwjgl/util/generator/GLint.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: GLint.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface GLint {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: GLint.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface GLint {
+}
diff --git a/src/java/org/lwjgl/util/generator/GLint64.java b/src/java/org/lwjgl/util/generator/GLint64.java
index 75fc705..564f620 100644
--- a/src/java/org/lwjgl/util/generator/GLint64.java
+++ b/src/java/org/lwjgl/util/generator/GLint64.java
@@ -1,40 +1,40 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface GLint64 {
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface GLint64 {
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/util/generator/GLint64EXT.java b/src/java/org/lwjgl/util/generator/GLint64EXT.java
index 7c96212..ea24038 100644
--- a/src/java/org/lwjgl/util/generator/GLint64EXT.java
+++ b/src/java/org/lwjgl/util/generator/GLint64EXT.java
@@ -1,40 +1,40 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface GLint64EXT {
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface GLint64EXT {
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/util/generator/GLintptr.java b/src/java/org/lwjgl/util/generator/GLintptr.java
index fa8afe1..864d71a 100644
--- a/src/java/org/lwjgl/util/generator/GLintptr.java
+++ b/src/java/org/lwjgl/util/generator/GLintptr.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: GLintptr.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface GLintptr {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: GLintptr.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface GLintptr {
+}
diff --git a/src/java/org/lwjgl/util/generator/GLintptrARB.java b/src/java/org/lwjgl/util/generator/GLintptrARB.java
index f88a54a..02da8f6 100644
--- a/src/java/org/lwjgl/util/generator/GLintptrARB.java
+++ b/src/java/org/lwjgl/util/generator/GLintptrARB.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: GLintptrARB.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface GLintptrARB {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: GLintptrARB.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface GLintptrARB {
+}
diff --git a/src/java/org/lwjgl/util/generator/GLpointer.java b/src/java/org/lwjgl/util/generator/GLpointer.java
index d42f590..d11370e 100644
--- a/src/java/org/lwjgl/util/generator/GLpointer.java
+++ b/src/java/org/lwjgl/util/generator/GLpointer.java
@@ -1,43 +1,43 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- * @author spasi <spasi at users.sourceforge.net>
- */
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface GLpointer {
- String value(); // The native pointer type.
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ * @author spasi <spasi at users.sourceforge.net>
+ */
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface GLpointer {
+ String value(); // The native pointer type.
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/util/generator/GLreturn.java b/src/java/org/lwjgl/util/generator/GLreturn.java
index 51fd9e8..3db89bc 100644
--- a/src/java/org/lwjgl/util/generator/GLreturn.java
+++ b/src/java/org/lwjgl/util/generator/GLreturn.java
@@ -1,55 +1,55 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- * When a method is annonated with @GLreturn, the specified output Buffer parameter
- * will be used to return a single value. The primitive type will match the Buffer type.
- * String will be returned if the Buffer is a ByteBuffer annotated with @GLchar.
- *
- * @author spasi
- */
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Target;
-
- at NativeType
- at Target({ ElementType.METHOD })
-public @interface GLreturn {
- /** The Buffer parameter to use as the method result. */
- String value();
- /** The argument that specifies the maximum number of bytes that may be read (String results only). */
- String maxLength() default "";
- /** If true, the maxLength value is going to be used when creating the String. */
- boolean forceMaxLength() default false;
- ///** If we use the byte buffer for another parameter, an offset must be used. */
- //String offset() default "";
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ * When a method is annonated with @GLreturn, the specified output Buffer parameter
+ * will be used to return a single value. The primitive type will match the Buffer type.
+ * String will be returned if the Buffer is a ByteBuffer annotated with @GLchar.
+ *
+ * @author spasi
+ */
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+ at NativeType
+ at Target({ ElementType.METHOD })
+public @interface GLreturn {
+ /** The Buffer parameter to use as the method result. */
+ String value();
+ /** The argument that specifies the maximum number of bytes that may be read (String results only). */
+ String maxLength() default "";
+ /** If true, the maxLength value is going to be used when creating the String. */
+ boolean forceMaxLength() default false;
+ ///** If we use the byte buffer for another parameter, an offset must be used. */
+ //String offset() default "";
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/util/generator/GLshort.java b/src/java/org/lwjgl/util/generator/GLshort.java
index 099f6e4..a23c01d 100644
--- a/src/java/org/lwjgl/util/generator/GLshort.java
+++ b/src/java/org/lwjgl/util/generator/GLshort.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: GLshort.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface GLshort {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: GLshort.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface GLshort {
+}
diff --git a/src/java/org/lwjgl/util/generator/GLsizei.java b/src/java/org/lwjgl/util/generator/GLsizei.java
index 8831151..74f5e9c 100644
--- a/src/java/org/lwjgl/util/generator/GLsizei.java
+++ b/src/java/org/lwjgl/util/generator/GLsizei.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: GLsizei.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface GLsizei {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: GLsizei.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface GLsizei {
+}
diff --git a/src/java/org/lwjgl/util/generator/GLsizeiptr.java b/src/java/org/lwjgl/util/generator/GLsizeiptr.java
index b5169a3..294caf1 100644
--- a/src/java/org/lwjgl/util/generator/GLsizeiptr.java
+++ b/src/java/org/lwjgl/util/generator/GLsizeiptr.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: GLsizeiptr.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface GLsizeiptr {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: GLsizeiptr.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface GLsizeiptr {
+}
diff --git a/src/java/org/lwjgl/util/generator/GLsizeiptrARB.java b/src/java/org/lwjgl/util/generator/GLsizeiptrARB.java
index 9a24cf0..6ae767b 100644
--- a/src/java/org/lwjgl/util/generator/GLsizeiptrARB.java
+++ b/src/java/org/lwjgl/util/generator/GLsizeiptrARB.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: GLsizeiptrARB.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface GLsizeiptrARB {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: GLsizeiptrARB.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface GLsizeiptrARB {
+}
diff --git a/src/java/org/lwjgl/util/generator/GLtime.java b/src/java/org/lwjgl/util/generator/GLtime.java
index 81506f1..039deb6 100644
--- a/src/java/org/lwjgl/util/generator/GLtime.java
+++ b/src/java/org/lwjgl/util/generator/GLtime.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- * Unsigned binary representing an absolute absolute or relative time interval.
- * Precision is nanoseconds but accuracy is implementation-dependent.
- *
- * @author spasi <spasi at users.sourceforge.net>
- */
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Target;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface GLtime {
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ * Unsigned binary representing an absolute absolute or relative time interval.
+ * Precision is nanoseconds but accuracy is implementation-dependent.
+ *
+ * @author spasi <spasi at users.sourceforge.net>
+ */
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface GLtime {
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/util/generator/GLubyte.java b/src/java/org/lwjgl/util/generator/GLubyte.java
index b093b91..9f613cd 100644
--- a/src/java/org/lwjgl/util/generator/GLubyte.java
+++ b/src/java/org/lwjgl/util/generator/GLubyte.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: GLubyte.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface GLubyte {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: GLubyte.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface GLubyte {
+}
diff --git a/src/java/org/lwjgl/util/generator/GLuint.java b/src/java/org/lwjgl/util/generator/GLuint.java
index 5a6adcc..707c394 100644
--- a/src/java/org/lwjgl/util/generator/GLuint.java
+++ b/src/java/org/lwjgl/util/generator/GLuint.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: GLuint.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface GLuint {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: GLuint.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface GLuint {
+}
diff --git a/src/java/org/lwjgl/util/generator/GLuint64.java b/src/java/org/lwjgl/util/generator/GLuint64.java
index 0cd089c..925986a 100644
--- a/src/java/org/lwjgl/util/generator/GLuint64.java
+++ b/src/java/org/lwjgl/util/generator/GLuint64.java
@@ -1,40 +1,40 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface GLuint64 {
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface GLuint64 {
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/util/generator/GLuint64EXT.java b/src/java/org/lwjgl/util/generator/GLuint64EXT.java
index 0eae8e6..9c61898 100644
--- a/src/java/org/lwjgl/util/generator/GLuint64EXT.java
+++ b/src/java/org/lwjgl/util/generator/GLuint64EXT.java
@@ -1,40 +1,40 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface GLuint64EXT {
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface GLuint64EXT {
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/util/generator/GLushort.java b/src/java/org/lwjgl/util/generator/GLushort.java
index 171f0ff..77b0fba 100644
--- a/src/java/org/lwjgl/util/generator/GLushort.java
+++ b/src/java/org/lwjgl/util/generator/GLushort.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: GLushort.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface GLushort {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: GLushort.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface GLushort {
+}
diff --git a/src/java/org/lwjgl/util/generator/GLvoid.java b/src/java/org/lwjgl/util/generator/GLvoid.java
index d5c3113..6fe6bde 100644
--- a/src/java/org/lwjgl/util/generator/GLvoid.java
+++ b/src/java/org/lwjgl/util/generator/GLvoid.java
@@ -1,50 +1,50 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3279 $
- * $Id: GLvoid.java 3279 2010-03-11 21:06:49Z spasi $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-import com.sun.mirror.type.PrimitiveType;
-
- at NativeType
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface GLvoid {
- PrimitiveType.Kind value() default PrimitiveType.Kind.BYTE;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3279 $
+ * $Id: GLvoid.java 3279 2010-03-11 21:06:49Z spasi $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+import com.sun.mirror.type.PrimitiveType;
+
+ at NativeType
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface GLvoid {
+ PrimitiveType.Kind value() default PrimitiveType.Kind.BYTE;
+}
diff --git a/src/java/org/lwjgl/util/generator/GenerateAutos.java b/src/java/org/lwjgl/util/generator/GenerateAutos.java
index de22669..531053b 100644
--- a/src/java/org/lwjgl/util/generator/GenerateAutos.java
+++ b/src/java/org/lwjgl/util/generator/GenerateAutos.java
@@ -1,46 +1,46 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: GenerateAutos.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at Target(ElementType.METHOD)
-public @interface GenerateAutos {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: GenerateAutos.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at Target(ElementType.METHOD)
+public @interface GenerateAutos {
+}
diff --git a/src/java/org/lwjgl/util/generator/GeneratorProcessorFactory.java b/src/java/org/lwjgl/util/generator/GeneratorProcessorFactory.java
index a57a208..4b129f5 100644
--- a/src/java/org/lwjgl/util/generator/GeneratorProcessorFactory.java
+++ b/src/java/org/lwjgl/util/generator/GeneratorProcessorFactory.java
@@ -1,157 +1,157 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-package org.lwjgl.util.generator;
-
-import com.sun.mirror.apt.*;
-import com.sun.mirror.declaration.*;
-
-import java.io.File;
-import java.io.FileFilter;
-import java.util.Collection;
-import java.util.Set;
-import java.util.Map;
-import java.util.Arrays;
-
-import static java.util.Collections.*;
-import static com.sun.mirror.util.DeclarationVisitors.*;
-
-/**
- *
- * Generator tool for creating the java classes and native code
- * from an annotated template java interface.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3289 $
- * $Id: GeneratorProcessorFactory.java 3289 2010-03-16 19:05:19Z spasi $
- */
-public class GeneratorProcessorFactory implements AnnotationProcessorFactory, RoundCompleteListener {
- private static boolean first_round = true;
-
- // Process any set of annotations
- private static final Collection<String> supportedAnnotations =
- unmodifiableCollection(Arrays.asList("*"));
-
- private static final Collection<String> supportedOptions =
- unmodifiableCollection(Arrays.asList("-Atypemap", "-Ageneratechecks", "-Acontextspecific"));
-
- public Collection<String> supportedAnnotationTypes() {
- return supportedAnnotations;
- }
-
- public Collection<String> supportedOptions() {
- return supportedOptions;
- }
-
- public void roundComplete(RoundCompleteEvent event) {
- first_round = false;
- }
-
- public AnnotationProcessor getProcessorFor(Set<AnnotationTypeDeclaration> atds, AnnotationProcessorEnvironment env) {
- // Only process the initial types, not the generated ones
- if (first_round) {
- env.addListener(this);
- return new GeneratorProcessor(env);
- } else
- return AnnotationProcessors.NO_OP;
- }
-
- private static class GeneratorProcessor implements AnnotationProcessor {
- private final AnnotationProcessorEnvironment env;
-
- GeneratorProcessor(AnnotationProcessorEnvironment env) {
- this.env = env;
- }
-
- public void process() {
- Map<String, String> options = env.getOptions();
- String typemap_classname = null;
- boolean generate_error_checks = options.containsKey("-Ageneratechecks");
- boolean context_specific = options.containsKey("-Acontextspecific");
- for (String k : options.keySet()) {
- int delimiter = k.indexOf('=');
- if (delimiter != -1) {
- if (k.startsWith("-Atypemap")) {
- typemap_classname = k.substring(delimiter + 1);
- }
- }
- }
- if (typemap_classname == null)
- throw new RuntimeException("No TypeMap class name specified with -Atypemap=<class-name>");
-
- TypeDeclaration lastFile = null;
- try {
- long generatorLM = getGeneratorLastModified();
- TypeMap type_map = (TypeMap)(Class.forName(typemap_classname).newInstance());
- for (TypeDeclaration typedecl : env.getSpecifiedTypeDeclarations()) {
- lastFile = typedecl;
- typedecl.accept(getDeclarationScanner(new GeneratorVisitor(env, type_map, generate_error_checks, context_specific, generatorLM), NO_OP));
- }
- } catch (Exception e) {
- if ( lastFile == null )
- throw new RuntimeException(e);
- else
- throw new RuntimeException("\n-- Failed to process template: " + lastFile.getQualifiedName() + " --", e);
- }
- }
-
- /**
- * Gets the time of the latest change on the Generator classes.
- *
- * @return time of the latest change
- */
- private static long getGeneratorLastModified() {
- final File pck = new File(System.getProperty("user.dir") + "/bin/org/lwjgl/util/generator");
- if ( !pck.exists() || !pck.isDirectory() )
- return Long.MAX_VALUE;
-
- final File[] classes = pck.listFiles(new FileFilter() {
- public boolean accept(final File pathname) {
- return pathname.isFile() && pathname.getName().endsWith(".class");
- }
- });
-
- if ( classes == null || classes.length == 0 )
- return Long.MAX_VALUE;
-
- long lastModified = 0;
-
- for ( File clazz : classes ) {
- long lm = clazz.lastModified();
- if ( lastModified < lm )
- lastModified = lm;
- }
-
- return lastModified;
- }
- }
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+package org.lwjgl.util.generator;
+
+import com.sun.mirror.apt.*;
+import com.sun.mirror.declaration.*;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.util.Collection;
+import java.util.Set;
+import java.util.Map;
+import java.util.Arrays;
+
+import static java.util.Collections.*;
+import static com.sun.mirror.util.DeclarationVisitors.*;
+
+/**
+ *
+ * Generator tool for creating the java classes and native code
+ * from an annotated template java interface.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3289 $
+ * $Id: GeneratorProcessorFactory.java 3289 2010-03-16 19:05:19Z spasi $
+ */
+public class GeneratorProcessorFactory implements AnnotationProcessorFactory, RoundCompleteListener {
+ private static boolean first_round = true;
+
+ // Process any set of annotations
+ private static final Collection<String> supportedAnnotations =
+ unmodifiableCollection(Arrays.asList("*"));
+
+ private static final Collection<String> supportedOptions =
+ unmodifiableCollection(Arrays.asList("-Atypemap", "-Ageneratechecks", "-Acontextspecific"));
+
+ public Collection<String> supportedAnnotationTypes() {
+ return supportedAnnotations;
+ }
+
+ public Collection<String> supportedOptions() {
+ return supportedOptions;
+ }
+
+ public void roundComplete(RoundCompleteEvent event) {
+ first_round = false;
+ }
+
+ public AnnotationProcessor getProcessorFor(Set<AnnotationTypeDeclaration> atds, AnnotationProcessorEnvironment env) {
+ // Only process the initial types, not the generated ones
+ if (first_round) {
+ env.addListener(this);
+ return new GeneratorProcessor(env);
+ } else
+ return AnnotationProcessors.NO_OP;
+ }
+
+ private static class GeneratorProcessor implements AnnotationProcessor {
+ private final AnnotationProcessorEnvironment env;
+
+ GeneratorProcessor(AnnotationProcessorEnvironment env) {
+ this.env = env;
+ }
+
+ public void process() {
+ Map<String, String> options = env.getOptions();
+ String typemap_classname = null;
+ boolean generate_error_checks = options.containsKey("-Ageneratechecks");
+ boolean context_specific = options.containsKey("-Acontextspecific");
+ for (String k : options.keySet()) {
+ int delimiter = k.indexOf('=');
+ if (delimiter != -1) {
+ if (k.startsWith("-Atypemap")) {
+ typemap_classname = k.substring(delimiter + 1);
+ }
+ }
+ }
+ if (typemap_classname == null)
+ throw new RuntimeException("No TypeMap class name specified with -Atypemap=<class-name>");
+
+ TypeDeclaration lastFile = null;
+ try {
+ long generatorLM = getGeneratorLastModified();
+ TypeMap type_map = (TypeMap)(Class.forName(typemap_classname).newInstance());
+ for (TypeDeclaration typedecl : env.getSpecifiedTypeDeclarations()) {
+ lastFile = typedecl;
+ typedecl.accept(getDeclarationScanner(new GeneratorVisitor(env, type_map, generate_error_checks, context_specific, generatorLM), NO_OP));
+ }
+ } catch (Exception e) {
+ if ( lastFile == null )
+ throw new RuntimeException(e);
+ else
+ throw new RuntimeException("\n-- Failed to process template: " + lastFile.getQualifiedName() + " --", e);
+ }
+ }
+
+ /**
+ * Gets the time of the latest change on the Generator classes.
+ *
+ * @return time of the latest change
+ */
+ private static long getGeneratorLastModified() {
+ final File pck = new File(System.getProperty("user.dir") + "/bin/org/lwjgl/util/generator");
+ if ( !pck.exists() || !pck.isDirectory() )
+ return Long.MAX_VALUE;
+
+ final File[] classes = pck.listFiles(new FileFilter() {
+ public boolean accept(final File pathname) {
+ return pathname.isFile() && pathname.getName().endsWith(".class");
+ }
+ });
+
+ if ( classes == null || classes.length == 0 )
+ return Long.MAX_VALUE;
+
+ long lastModified = 0;
+
+ for ( File clazz : classes ) {
+ long lm = clazz.lastModified();
+ if ( lastModified < lm )
+ lastModified = lm;
+ }
+
+ return lastModified;
+ }
+ }
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/util/generator/GeneratorVisitor.java b/src/java/org/lwjgl/util/generator/GeneratorVisitor.java
index 93f6b31..f9f171f 100644
--- a/src/java/org/lwjgl/util/generator/GeneratorVisitor.java
+++ b/src/java/org/lwjgl/util/generator/GeneratorVisitor.java
@@ -1,278 +1,278 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-package org.lwjgl.util.generator;
-
-import com.sun.mirror.apt.*;
-import com.sun.mirror.declaration.*;
-import com.sun.mirror.type.*;
-import com.sun.mirror.util.*;
-
-import java.util.*;
-
-import java.io.PrintWriter;
-import java.io.IOException;
-import java.io.File;
-
-import java.nio.*;
-
-/**
- *
- * Generator visitor for the generator tool
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3299 $
- * $Id: GeneratorVisitor.java 3299 2010-03-31 15:46:16Z spasi $
- */
-public class GeneratorVisitor extends SimpleDeclarationVisitor {
- private final AnnotationProcessorEnvironment env;
- private final TypeMap type_map;
- private final boolean generate_error_checks;
- private final boolean context_specific;
- private final long generatorLM;
-
- public GeneratorVisitor(AnnotationProcessorEnvironment env, TypeMap type_map, boolean generate_error_checks, boolean context_specific, long generatorLM) {
- this.env = env;
- this.type_map = type_map;
- this.generate_error_checks = generate_error_checks;
- this.context_specific = context_specific;
- this.generatorLM = generatorLM;
- }
-
- private void validateMethods(InterfaceDeclaration d) {
- for (MethodDeclaration method : d.getMethods())
- validateMethod(method);
- }
-
- private void validateMethod(MethodDeclaration method) {
- if (method.isVarArgs())
- throw new RuntimeException("Method " + method.getSimpleName() + " is variadic");
- Collection<Modifier> modifiers = method.getModifiers();
- if (!modifiers.contains(Modifier.PUBLIC))
- throw new RuntimeException("Method " + method.getSimpleName() + " is not public");
- if (method.getThrownTypes().size() > 0)
- throw new RuntimeException("Method " + method.getSimpleName() + " throws checked exceptions");
- validateParameters(method);
- StripPostfix strip_annotation = method.getAnnotation(StripPostfix.class);
- if (strip_annotation != null && method.getAnnotation(Alternate.class) == null) {
- String postfix_param_name = strip_annotation.value();
- ParameterDeclaration postfix_param = Utils.findParameter(method, postfix_param_name);
- if (Utils.isParameterMultiTyped(postfix_param))
- throw new RuntimeException("Postfix parameter can't be the same as a multityped parameter in method " + method);
- if (Utils.getNIOBufferType(postfix_param.getType()) == null)
- throw new RuntimeException("Postfix parameter type must be a nio Buffer");
- }
- if (Utils.getResultParameter(method) != null && !method.getReturnType().equals(env.getTypeUtils().getVoidType()))
- throw new RuntimeException(method + " return type is not void but a parameter is annotated with Result");
- if (method.getAnnotation(CachedResult.class) != null) {
- if (Utils.getNIOBufferType(Utils.getMethodReturnType(method)) == null)
- throw new RuntimeException(method + " return type is not a Buffer, but is annotated with CachedResult");
- if (method.getAnnotation(AutoResultSize.class) == null)
- throw new RuntimeException(method + " is annotated with CachedResult but misses an AutoResultSize annotation");
- }
- validateTypes(method, method.getAnnotationMirrors(), method.getReturnType());
- }
-
- private void validateType(MethodDeclaration method, Class annotation_type, Class type) {
- Class[] valid_types = type_map.getValidAnnotationTypes(type);
- for (int i = 0; i < valid_types.length; i++)
- if (valid_types[i].equals(annotation_type))
- return;
- throw new RuntimeException(type + " is annotated with invalid native type " + annotation_type +
- " in method " + method);
- }
-
- private void validateTypes(MethodDeclaration method, Collection<AnnotationMirror> annotations, TypeMirror type_mirror) {
- for (AnnotationMirror annotation : annotations) {
- NativeType native_type_annotation = NativeTypeTranslator.getAnnotation(annotation, NativeType.class);
- if (native_type_annotation != null) {
- Class annotation_type = NativeTypeTranslator.getClassFromType(annotation.getAnnotationType());
- Class type = Utils.getJavaType(type_mirror);
- if (Buffer.class.equals(type))
- continue;
- validateType(method, annotation_type, type);
- }
- }
- }
-
- private void validateParameters(MethodDeclaration method) {
- for (ParameterDeclaration param : method.getParameters()) {
- validateTypes(method, param.getAnnotationMirrors(), param.getType());
- Class<?> param_type = Utils.getJavaType(param.getType());
- if (Utils.getNIOBufferType(param.getType()) != null && param_type != CharSequence.class && param_type != CharSequence[].class) {
- Check parameter_check_annotation = param.getAnnotation(Check.class);
- NullTerminated null_terminated_annotation = param.getAnnotation(NullTerminated.class);
- if (parameter_check_annotation == null && null_terminated_annotation == null) {
- boolean found_auto_size_param = false;
- for (ParameterDeclaration inner_param : method.getParameters()) {
- AutoSize auto_size_annotation = inner_param.getAnnotation(AutoSize.class);
- if (auto_size_annotation != null &&
- auto_size_annotation.value().equals(param.getSimpleName())) {
- found_auto_size_param = true;
- break;
- }
- }
- if (!found_auto_size_param
- && param.getAnnotation(Result.class) == null
- && param.getAnnotation(Constant.class) == null
- && !Utils.isReturnParameter(method, param)
- )
- throw new RuntimeException(param + " has no Check, Result nor Constant annotation, is not the return parameter and no other parameter has" +
- " an @AutoSize annotation on it in method " + method);
- }
- if (param.getAnnotation(CachedReference.class) != null && param.getAnnotation(Result.class) != null)
- throw new RuntimeException(param + " can't be annotated with both CachedReference and Result");
- if (param.getAnnotation(BufferObject.class) != null && param.getAnnotation(Result.class) != null)
- throw new RuntimeException(param + " can't be annotated with both BufferObject and Result");
- //if (param.getAnnotation(Constant.class) != null)
- //throw new RuntimeException("Buffer parameter " + param + " cannot be Constant");
- } else {
- if (param.getAnnotation(BufferObject.class) != null)
- throw new RuntimeException(param + " type is not a buffer, but annotated as a BufferObject");
- if (param.getAnnotation(CachedReference.class) != null)
- throw new RuntimeException(param + " type is not a buffer, but annotated as a CachedReference");
- }
- }
- }
-
- private static void generateMethodsNativePointers(PrintWriter writer, Collection<? extends MethodDeclaration> methods) {
- for (MethodDeclaration method : methods) {
- if ( method.getAnnotation(Alternate.class) == null )
- generateMethodNativePointers(writer, method);
- }
- }
-
- private static void generateMethodNativePointers(PrintWriter writer, MethodDeclaration method) {
- writer.println("static " + Utils.getTypedefName(method) + " " + method.getSimpleName() + ";");
- }
-
- private void generateJavaSource(InterfaceDeclaration d, PrintWriter java_writer) throws IOException {
- java_writer.println("/* MACHINE GENERATED FILE, DO NOT EDIT */");
- java_writer.println();
- java_writer.println("package " + d.getPackage().getQualifiedName() + ";");
- java_writer.println();
- java_writer.println("import org.lwjgl.LWJGLException;");
- java_writer.println("import org.lwjgl.BufferChecks;");
- // DISABLED: indirect buffer support
- //java_writer.println("import org.lwjgl.NondirectBufferWrapper;");
- java_writer.println("import java.nio.*;");
- java_writer.println();
- Utils.printDocComment(java_writer, d);
- java_writer.print("public ");
- boolean is_final = Utils.isFinal(d);
- if (is_final)
- java_writer.write("final ");
- java_writer.print("class " + Utils.getSimpleClassName(d));
- Collection<InterfaceType> super_interfaces = d.getSuperinterfaces();
- if (super_interfaces.size() > 1)
- throw new RuntimeException(d + " extends more than one interface");
- if (super_interfaces.size() == 1) {
- InterfaceDeclaration super_interface = super_interfaces.iterator().next().getDeclaration();
- java_writer.print(" extends " + Utils.getSimpleClassName(super_interface));
- }
- java_writer.println(" {");
- FieldsGenerator.generateFields(java_writer, d.getFields());
- java_writer.println();
- if (is_final) {
- // Write private constructor to avoid instantiation
- java_writer.println("\tprivate " + Utils.getSimpleClassName(d) + "() {");
- java_writer.println("\t}");
- java_writer.println();
- }
- if (d.getMethods().size() > 0 && !context_specific)
- java_writer.println("\tstatic native void " + Utils.STUB_INITIALIZER_NAME + "() throws LWJGLException;");
- JavaMethodsGenerator.generateMethodsJava(env, type_map, java_writer, d, generate_error_checks, context_specific);
- java_writer.println("}");
- java_writer.close();
- String qualified_interface_name = Utils.getQualifiedClassName(d);
- env.getMessager().printNotice("Generated class " + qualified_interface_name);
- }
-
- private void generateNativeSource(InterfaceDeclaration d) throws IOException {
- String qualified_interface_name = Utils.getQualifiedClassName(d);
- String qualified_native_name = Utils.getNativeQualifiedName(qualified_interface_name)+ ".c";
- PrintWriter native_writer = env.getFiler().createTextFile(Filer.Location.CLASS_TREE, "", new File(qualified_native_name), "UTF-8");
- native_writer.println("/* MACHINE GENERATED FILE, DO NOT EDIT */");
- native_writer.println();
- native_writer.println("#include <jni.h>");
- type_map.printNativeIncludes(native_writer);
- native_writer.println();
- TypedefsGenerator.generateNativeTypedefs(type_map, native_writer, d.getMethods());
- native_writer.println();
- if (!context_specific) {
- generateMethodsNativePointers(native_writer, d.getMethods());
- native_writer.println();
- }
- NativeMethodStubsGenerator.generateNativeMethodStubs(env, type_map, native_writer, d, generate_error_checks, context_specific);
- if (!context_specific) {
- native_writer.print("JNIEXPORT void JNICALL " + Utils.getQualifiedNativeMethodName(qualified_interface_name, Utils.STUB_INITIALIZER_NAME));
- native_writer.println("(JNIEnv *env, jclass clazz) {");
- native_writer.println("\tJavaMethodAndExtFunction functions[] = {");
- RegisterStubsGenerator.generateMethodsNativeStubBind(native_writer, d, generate_error_checks, context_specific);
- native_writer.println("\t};");
- native_writer.println("\tint num_functions = NUMFUNCTIONS(functions);");
- native_writer.print("\t");
- native_writer.print(type_map.getRegisterNativesFunctionName());
- native_writer.println("(env, clazz, num_functions, functions);");
- native_writer.println("}");
- }
- native_writer.close();
- env.getMessager().printNotice("Generated C source " + qualified_interface_name);
- }
-
- public void visitInterfaceDeclaration(InterfaceDeclaration d) {
- File input = d.getPosition().file();
- File output = new File(env.getOptions().get("-s") + '/' + d.getPackage().getQualifiedName().replace('.', '/'), Utils.getSimpleClassName(d) + ".java");
-
- PrintWriter java_writer = null;
-
- try {
- // Skip this class if the output exists and the input has not been modified.
- if ( output.exists() && Math.max(input.lastModified(), generatorLM) < output.lastModified() )
- return;
-
- if (d.getMethods().size() > 0 || d.getFields().size() > 0) {
- validateMethods(d);
- java_writer = env.getFiler().createTextFile(Filer.Location.SOURCE_TREE, d.getPackage().getQualifiedName(), new File(Utils.getSimpleClassName(d) + ".java"), null);
- generateJavaSource(d, java_writer);
- }
- if (d.getMethods().size() > 0)
- generateNativeSource(d);
- } catch (Exception e) {
- // If anything goes wrong mid-gen, delete output to allow regen next time we run.
- if ( java_writer != null ) java_writer.close();
- if ( output.exists() ) output.delete();
-
- throw new RuntimeException(e);
- }
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+package org.lwjgl.util.generator;
+
+import com.sun.mirror.apt.*;
+import com.sun.mirror.declaration.*;
+import com.sun.mirror.type.*;
+import com.sun.mirror.util.*;
+
+import java.util.*;
+
+import java.io.PrintWriter;
+import java.io.IOException;
+import java.io.File;
+
+import java.nio.*;
+
+/**
+ *
+ * Generator visitor for the generator tool
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3299 $
+ * $Id: GeneratorVisitor.java 3299 2010-03-31 15:46:16Z spasi $
+ */
+public class GeneratorVisitor extends SimpleDeclarationVisitor {
+ private final AnnotationProcessorEnvironment env;
+ private final TypeMap type_map;
+ private final boolean generate_error_checks;
+ private final boolean context_specific;
+ private final long generatorLM;
+
+ public GeneratorVisitor(AnnotationProcessorEnvironment env, TypeMap type_map, boolean generate_error_checks, boolean context_specific, long generatorLM) {
+ this.env = env;
+ this.type_map = type_map;
+ this.generate_error_checks = generate_error_checks;
+ this.context_specific = context_specific;
+ this.generatorLM = generatorLM;
+ }
+
+ private void validateMethods(InterfaceDeclaration d) {
+ for (MethodDeclaration method : d.getMethods())
+ validateMethod(method);
+ }
+
+ private void validateMethod(MethodDeclaration method) {
+ if (method.isVarArgs())
+ throw new RuntimeException("Method " + method.getSimpleName() + " is variadic");
+ Collection<Modifier> modifiers = method.getModifiers();
+ if (!modifiers.contains(Modifier.PUBLIC))
+ throw new RuntimeException("Method " + method.getSimpleName() + " is not public");
+ if (method.getThrownTypes().size() > 0)
+ throw new RuntimeException("Method " + method.getSimpleName() + " throws checked exceptions");
+ validateParameters(method);
+ StripPostfix strip_annotation = method.getAnnotation(StripPostfix.class);
+ if (strip_annotation != null && method.getAnnotation(Alternate.class) == null) {
+ String postfix_param_name = strip_annotation.value();
+ ParameterDeclaration postfix_param = Utils.findParameter(method, postfix_param_name);
+ if (Utils.isParameterMultiTyped(postfix_param))
+ throw new RuntimeException("Postfix parameter can't be the same as a multityped parameter in method " + method);
+ if (Utils.getNIOBufferType(postfix_param.getType()) == null)
+ throw new RuntimeException("Postfix parameter type must be a nio Buffer");
+ }
+ if (Utils.getResultParameter(method) != null && !method.getReturnType().equals(env.getTypeUtils().getVoidType()))
+ throw new RuntimeException(method + " return type is not void but a parameter is annotated with Result");
+ if (method.getAnnotation(CachedResult.class) != null) {
+ if (Utils.getNIOBufferType(Utils.getMethodReturnType(method)) == null)
+ throw new RuntimeException(method + " return type is not a Buffer, but is annotated with CachedResult");
+ if (method.getAnnotation(AutoResultSize.class) == null)
+ throw new RuntimeException(method + " is annotated with CachedResult but misses an AutoResultSize annotation");
+ }
+ validateTypes(method, method.getAnnotationMirrors(), method.getReturnType());
+ }
+
+ private void validateType(MethodDeclaration method, Class annotation_type, Class type) {
+ Class[] valid_types = type_map.getValidAnnotationTypes(type);
+ for (int i = 0; i < valid_types.length; i++)
+ if (valid_types[i].equals(annotation_type))
+ return;
+ throw new RuntimeException(type + " is annotated with invalid native type " + annotation_type +
+ " in method " + method);
+ }
+
+ private void validateTypes(MethodDeclaration method, Collection<AnnotationMirror> annotations, TypeMirror type_mirror) {
+ for (AnnotationMirror annotation : annotations) {
+ NativeType native_type_annotation = NativeTypeTranslator.getAnnotation(annotation, NativeType.class);
+ if (native_type_annotation != null) {
+ Class annotation_type = NativeTypeTranslator.getClassFromType(annotation.getAnnotationType());
+ Class type = Utils.getJavaType(type_mirror);
+ if (Buffer.class.equals(type))
+ continue;
+ validateType(method, annotation_type, type);
+ }
+ }
+ }
+
+ private void validateParameters(MethodDeclaration method) {
+ for (ParameterDeclaration param : method.getParameters()) {
+ validateTypes(method, param.getAnnotationMirrors(), param.getType());
+ Class<?> param_type = Utils.getJavaType(param.getType());
+ if (Utils.getNIOBufferType(param.getType()) != null && param_type != CharSequence.class && param_type != CharSequence[].class) {
+ Check parameter_check_annotation = param.getAnnotation(Check.class);
+ NullTerminated null_terminated_annotation = param.getAnnotation(NullTerminated.class);
+ if (parameter_check_annotation == null && null_terminated_annotation == null) {
+ boolean found_auto_size_param = false;
+ for (ParameterDeclaration inner_param : method.getParameters()) {
+ AutoSize auto_size_annotation = inner_param.getAnnotation(AutoSize.class);
+ if (auto_size_annotation != null &&
+ auto_size_annotation.value().equals(param.getSimpleName())) {
+ found_auto_size_param = true;
+ break;
+ }
+ }
+ if (!found_auto_size_param
+ && param.getAnnotation(Result.class) == null
+ && param.getAnnotation(Constant.class) == null
+ && !Utils.isReturnParameter(method, param)
+ )
+ throw new RuntimeException(param + " has no Check, Result nor Constant annotation, is not the return parameter and no other parameter has" +
+ " an @AutoSize annotation on it in method " + method);
+ }
+ if (param.getAnnotation(CachedReference.class) != null && param.getAnnotation(Result.class) != null)
+ throw new RuntimeException(param + " can't be annotated with both CachedReference and Result");
+ if (param.getAnnotation(BufferObject.class) != null && param.getAnnotation(Result.class) != null)
+ throw new RuntimeException(param + " can't be annotated with both BufferObject and Result");
+ //if (param.getAnnotation(Constant.class) != null)
+ //throw new RuntimeException("Buffer parameter " + param + " cannot be Constant");
+ } else {
+ if (param.getAnnotation(BufferObject.class) != null)
+ throw new RuntimeException(param + " type is not a buffer, but annotated as a BufferObject");
+ if (param.getAnnotation(CachedReference.class) != null)
+ throw new RuntimeException(param + " type is not a buffer, but annotated as a CachedReference");
+ }
+ }
+ }
+
+ private static void generateMethodsNativePointers(PrintWriter writer, Collection<? extends MethodDeclaration> methods) {
+ for (MethodDeclaration method : methods) {
+ if ( method.getAnnotation(Alternate.class) == null )
+ generateMethodNativePointers(writer, method);
+ }
+ }
+
+ private static void generateMethodNativePointers(PrintWriter writer, MethodDeclaration method) {
+ writer.println("static " + Utils.getTypedefName(method) + " " + method.getSimpleName() + ";");
+ }
+
+ private void generateJavaSource(InterfaceDeclaration d, PrintWriter java_writer) throws IOException {
+ java_writer.println("/* MACHINE GENERATED FILE, DO NOT EDIT */");
+ java_writer.println();
+ java_writer.println("package " + d.getPackage().getQualifiedName() + ";");
+ java_writer.println();
+ java_writer.println("import org.lwjgl.LWJGLException;");
+ java_writer.println("import org.lwjgl.BufferChecks;");
+ // DISABLED: indirect buffer support
+ //java_writer.println("import org.lwjgl.NondirectBufferWrapper;");
+ java_writer.println("import java.nio.*;");
+ java_writer.println();
+ Utils.printDocComment(java_writer, d);
+ java_writer.print("public ");
+ boolean is_final = Utils.isFinal(d);
+ if (is_final)
+ java_writer.write("final ");
+ java_writer.print("class " + Utils.getSimpleClassName(d));
+ Collection<InterfaceType> super_interfaces = d.getSuperinterfaces();
+ if (super_interfaces.size() > 1)
+ throw new RuntimeException(d + " extends more than one interface");
+ if (super_interfaces.size() == 1) {
+ InterfaceDeclaration super_interface = super_interfaces.iterator().next().getDeclaration();
+ java_writer.print(" extends " + Utils.getSimpleClassName(super_interface));
+ }
+ java_writer.println(" {");
+ FieldsGenerator.generateFields(java_writer, d.getFields());
+ java_writer.println();
+ if (is_final) {
+ // Write private constructor to avoid instantiation
+ java_writer.println("\tprivate " + Utils.getSimpleClassName(d) + "() {");
+ java_writer.println("\t}");
+ java_writer.println();
+ }
+ if (d.getMethods().size() > 0 && !context_specific)
+ java_writer.println("\tstatic native void " + Utils.STUB_INITIALIZER_NAME + "() throws LWJGLException;");
+ JavaMethodsGenerator.generateMethodsJava(env, type_map, java_writer, d, generate_error_checks, context_specific);
+ java_writer.println("}");
+ java_writer.close();
+ String qualified_interface_name = Utils.getQualifiedClassName(d);
+ env.getMessager().printNotice("Generated class " + qualified_interface_name);
+ }
+
+ private void generateNativeSource(InterfaceDeclaration d) throws IOException {
+ String qualified_interface_name = Utils.getQualifiedClassName(d);
+ String qualified_native_name = Utils.getNativeQualifiedName(qualified_interface_name)+ ".c";
+ PrintWriter native_writer = env.getFiler().createTextFile(Filer.Location.CLASS_TREE, "", new File(qualified_native_name), "UTF-8");
+ native_writer.println("/* MACHINE GENERATED FILE, DO NOT EDIT */");
+ native_writer.println();
+ native_writer.println("#include <jni.h>");
+ type_map.printNativeIncludes(native_writer);
+ native_writer.println();
+ TypedefsGenerator.generateNativeTypedefs(type_map, native_writer, d.getMethods());
+ native_writer.println();
+ if (!context_specific) {
+ generateMethodsNativePointers(native_writer, d.getMethods());
+ native_writer.println();
+ }
+ NativeMethodStubsGenerator.generateNativeMethodStubs(env, type_map, native_writer, d, generate_error_checks, context_specific);
+ if (!context_specific) {
+ native_writer.print("JNIEXPORT void JNICALL " + Utils.getQualifiedNativeMethodName(qualified_interface_name, Utils.STUB_INITIALIZER_NAME));
+ native_writer.println("(JNIEnv *env, jclass clazz) {");
+ native_writer.println("\tJavaMethodAndExtFunction functions[] = {");
+ RegisterStubsGenerator.generateMethodsNativeStubBind(native_writer, d, generate_error_checks, context_specific);
+ native_writer.println("\t};");
+ native_writer.println("\tint num_functions = NUMFUNCTIONS(functions);");
+ native_writer.print("\t");
+ native_writer.print(type_map.getRegisterNativesFunctionName());
+ native_writer.println("(env, clazz, num_functions, functions);");
+ native_writer.println("}");
+ }
+ native_writer.close();
+ env.getMessager().printNotice("Generated C source " + qualified_interface_name);
+ }
+
+ public void visitInterfaceDeclaration(InterfaceDeclaration d) {
+ File input = d.getPosition().file();
+ File output = new File(env.getOptions().get("-s") + '/' + d.getPackage().getQualifiedName().replace('.', '/'), Utils.getSimpleClassName(d) + ".java");
+
+ PrintWriter java_writer = null;
+
+ try {
+ // Skip this class if the output exists and the input has not been modified.
+ if ( output.exists() && Math.max(input.lastModified(), generatorLM) < output.lastModified() )
+ return;
+
+ if (d.getMethods().size() > 0 || d.getFields().size() > 0) {
+ validateMethods(d);
+ java_writer = env.getFiler().createTextFile(Filer.Location.SOURCE_TREE, d.getPackage().getQualifiedName(), new File(Utils.getSimpleClassName(d) + ".java"), null);
+ generateJavaSource(d, java_writer);
+ }
+ if (d.getMethods().size() > 0)
+ generateNativeSource(d);
+ } catch (Exception e) {
+ // If anything goes wrong mid-gen, delete output to allow regen next time we run.
+ if ( java_writer != null ) java_writer.close();
+ if ( output.exists() ) output.delete();
+
+ throw new RuntimeException(e);
+ }
+ }
+}
diff --git a/src/java/org/lwjgl/util/generator/Indirect.java b/src/java/org/lwjgl/util/generator/Indirect.java
index 4bbbc01..b764e6e 100644
--- a/src/java/org/lwjgl/util/generator/Indirect.java
+++ b/src/java/org/lwjgl/util/generator/Indirect.java
@@ -1,49 +1,49 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * Implies that a parameter is indirect, and forces the native
- * stub to use the indirection operator '&' on it.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: Indirect.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at Target(ElementType.PARAMETER)
-public @interface Indirect {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * Implies that a parameter is indirect, and forces the native
+ * stub to use the indirection operator '&' on it.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: Indirect.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at Target(ElementType.PARAMETER)
+public @interface Indirect {
+}
diff --git a/src/java/org/lwjgl/util/generator/JNITypeTranslator.java b/src/java/org/lwjgl/util/generator/JNITypeTranslator.java
index c5d72bb..45901c6 100644
--- a/src/java/org/lwjgl/util/generator/JNITypeTranslator.java
+++ b/src/java/org/lwjgl/util/generator/JNITypeTranslator.java
@@ -1,130 +1,130 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-package org.lwjgl.util.generator;
-
-import com.sun.mirror.type.*;
-import com.sun.mirror.util.*;
-
-/**
- *
- * A TypeVisitor that translates TypeMirrors to JNI
- * type strings.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3281 $
- * $Id: JNITypeTranslator.java 3281 2010-03-12 21:55:13Z spasi $
- */
-public class JNITypeTranslator implements TypeVisitor {
- private final StringBuilder signature = new StringBuilder();
-
- public String getSignature() {
- return signature.toString();
- }
-
- public void visitAnnotationType(AnnotationType t) {
- throw new RuntimeException(t + " is not allowed");
- }
-
- public void visitArrayType(ArrayType t) {
- if ( "java.lang.CharSequence".equals(t.getComponentType().toString()) )
- signature.append("jobject");
- else
- throw new RuntimeException(t + " is not allowed");
- }
-
- public void visitClassType(ClassType t) {
- signature.append("jobject");
- }
-
- public void visitDeclaredType(DeclaredType t) {
- throw new RuntimeException(t + " is not allowed");
- }
-
- public void visitEnumType(EnumType t) {
- throw new RuntimeException(t + " is not allowed");
- }
-
- public void visitInterfaceType(InterfaceType t) {
- throw new RuntimeException(t + " is not allowed");
- }
-
- public void visitPrimitiveType(PrimitiveType t) {
- String type;
- switch (t.getKind()) {
- case LONG:
- type = "jlong";
- break;
- case INT:
- type = "jint";
- break;
- case FLOAT:
- type = "jfloat";
- break;
- case SHORT:
- type = "jshort";
- break;
- case BYTE:
- type = "jbyte";
- break;
- case DOUBLE:
- type = "jdouble";
- break;
- case BOOLEAN:
- type = "jboolean";
- break;
- default:
- throw new RuntimeException(t + " is not allowed");
- }
- signature.append(type);
- }
-
- public void visitReferenceType(ReferenceType t) {
- throw new RuntimeException(t + " is not allowed");
- }
-
- public void visitTypeMirror(TypeMirror t) {
- throw new RuntimeException(t + " is not allowed");
- }
-
- public void visitTypeVariable(TypeVariable t) {
- throw new RuntimeException(t + " is not allowed");
- }
-
- public void visitVoidType(VoidType t) {
- signature.append(t.toString());
- }
-
- public void visitWildcardType(WildcardType t) {
- throw new RuntimeException(t + " is not allowed");
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+package org.lwjgl.util.generator;
+
+import com.sun.mirror.type.*;
+import com.sun.mirror.util.*;
+
+/**
+ *
+ * A TypeVisitor that translates TypeMirrors to JNI
+ * type strings.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3281 $
+ * $Id: JNITypeTranslator.java 3281 2010-03-12 21:55:13Z spasi $
+ */
+public class JNITypeTranslator implements TypeVisitor {
+ private final StringBuilder signature = new StringBuilder();
+
+ public String getSignature() {
+ return signature.toString();
+ }
+
+ public void visitAnnotationType(AnnotationType t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public void visitArrayType(ArrayType t) {
+ if ( "java.lang.CharSequence".equals(t.getComponentType().toString()) )
+ signature.append("jobject");
+ else
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public void visitClassType(ClassType t) {
+ signature.append("jobject");
+ }
+
+ public void visitDeclaredType(DeclaredType t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public void visitEnumType(EnumType t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public void visitInterfaceType(InterfaceType t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public void visitPrimitiveType(PrimitiveType t) {
+ String type;
+ switch (t.getKind()) {
+ case LONG:
+ type = "jlong";
+ break;
+ case INT:
+ type = "jint";
+ break;
+ case FLOAT:
+ type = "jfloat";
+ break;
+ case SHORT:
+ type = "jshort";
+ break;
+ case BYTE:
+ type = "jbyte";
+ break;
+ case DOUBLE:
+ type = "jdouble";
+ break;
+ case BOOLEAN:
+ type = "jboolean";
+ break;
+ default:
+ throw new RuntimeException(t + " is not allowed");
+ }
+ signature.append(type);
+ }
+
+ public void visitReferenceType(ReferenceType t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public void visitTypeMirror(TypeMirror t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public void visitTypeVariable(TypeVariable t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public void visitVoidType(VoidType t) {
+ signature.append(t.toString());
+ }
+
+ public void visitWildcardType(WildcardType t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+}
diff --git a/src/java/org/lwjgl/util/generator/JavaMethodsGenerator.java b/src/java/org/lwjgl/util/generator/JavaMethodsGenerator.java
index 5f86429..cabbd90 100644
--- a/src/java/org/lwjgl/util/generator/JavaMethodsGenerator.java
+++ b/src/java/org/lwjgl/util/generator/JavaMethodsGenerator.java
@@ -1,593 +1,593 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-package org.lwjgl.util.generator;
-
-/**
- *
- * This class generates the methods in the generated java source files.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3293 $
- * $Id: JavaMethodsGenerator.java 3293 2010-03-23 12:43:44Z spasi $
- */
-
-import com.sun.mirror.apt.*;
-import com.sun.mirror.declaration.*;
-import com.sun.mirror.type.*;
-
-import java.io.*;
-import java.util.*;
-import java.nio.*;
-
-public class JavaMethodsGenerator {
- private final static String SAVED_PARAMETER_POSTFIX = "_saved";
-
- public static void generateMethodsJava(AnnotationProcessorEnvironment env, TypeMap type_map, PrintWriter writer, InterfaceDeclaration interface_decl, boolean generate_error_checks, boolean context_specific) {
- for (MethodDeclaration method : interface_decl.getMethods())
- generateMethodJava(env, type_map, writer, interface_decl, method, generate_error_checks, context_specific);
- }
-
- private static void generateMethodJava(AnnotationProcessorEnvironment env, TypeMap type_map, PrintWriter writer, InterfaceDeclaration interface_decl, MethodDeclaration method, boolean generate_error_checks, boolean context_specific) {
- writer.println();
- if (Utils.isMethodIndirect(generate_error_checks, context_specific, method)) {
- if (method.getAnnotation(GenerateAutos.class) != null) {
- printMethodWithMultiType(env, type_map, writer, interface_decl, method, TypeInfo.getDefaultTypeInfoMap(method), Mode.AUTOS, generate_error_checks, context_specific);
- }
- Collection<Map<ParameterDeclaration, TypeInfo>> cross_product = TypeInfo.getTypeInfoCrossProduct(type_map, method);
- for (Map<ParameterDeclaration, TypeInfo> typeinfos_instance : cross_product) {
- printMethodWithMultiType(env, type_map, writer, interface_decl, method, typeinfos_instance, Mode.NORMAL, generate_error_checks, context_specific);
- }
- }
- if ( method.getAnnotation(CachedResult.class) != null && !method.getAnnotation(CachedResult.class).isRange() ) {
- printMethodWithMultiType(env, type_map, writer, interface_decl, method, TypeInfo.getDefaultTypeInfoMap(method), Mode.CACHEDRESULT, generate_error_checks, context_specific);
- }
- Alternate alt_annotation = method.getAnnotation(Alternate.class);
- if ( alt_annotation == null || alt_annotation.nativeAlt() ) {
- if ( alt_annotation != null && method.getSimpleName().equals(alt_annotation.value()) )
- throw new RuntimeException("An alternate function with native code should have a different name than the main function.");
- printJavaNativeStub(writer, method, Mode.NORMAL, generate_error_checks, context_specific);
- if (Utils.hasMethodBufferObjectParameter(method)) {
- printMethodWithMultiType(env, type_map, writer, interface_decl, method, TypeInfo.getDefaultTypeInfoMap(method), Mode.BUFFEROBJECT, generate_error_checks, context_specific);
- printJavaNativeStub(writer, method, Mode.BUFFEROBJECT, generate_error_checks, context_specific);
- }
- }
- }
-
- private static void printJavaNativeStub(PrintWriter writer, MethodDeclaration method, Mode mode, boolean generate_error_checks, boolean context_specific) {
- if (Utils.isMethodIndirect(generate_error_checks, context_specific, method)) {
- writer.print("\tprivate static native ");
- } else {
- Utils.printDocComment(writer, method);
- writer.print("\tpublic static native ");
- }
- printResultType(writer, method, true);
- writer.print(" " + Utils.getSimpleNativeMethodName(method, generate_error_checks, context_specific));
- if (mode == Mode.BUFFEROBJECT)
- writer.print(Utils.BUFFER_OBJECT_METHOD_POSTFIX);
- writer.print("(");
- boolean first_parameter = generateParametersJava(writer, method, TypeInfo.getDefaultTypeInfoMap(method), true, mode);
- if (context_specific) {
- if (!first_parameter)
- writer.print(", ");
- writer.print("long " + Utils.FUNCTION_POINTER_VAR_NAME);
- }
- writer.println(");");
- }
-
- private static boolean generateParametersJava(PrintWriter writer, MethodDeclaration method, Map<ParameterDeclaration, TypeInfo> typeinfos_instance,
- boolean native_stub, Mode mode) {
- boolean first_parameter = true;
- for (ParameterDeclaration param : method.getParameters()) {
- AnnotationMirror auto_annotation_mirror = Utils.getParameterAutoAnnotation(param);
- boolean hide_auto_parameter = mode == Mode.NORMAL && !native_stub && auto_annotation_mirror != null;
- if (hide_auto_parameter) {
- AutoType auto_type_annotation = param.getAnnotation(AutoType.class);
- if (auto_type_annotation != null) {
- ParameterDeclaration auto_parameter = Utils.findParameter(method, auto_type_annotation.value());
- TypeInfo auto_param_type_info = typeinfos_instance.get(auto_parameter);
- if (auto_param_type_info.getSignedness() == Signedness.BOTH) {
- if (!first_parameter)
- writer.print(", ");
- first_parameter = false;
- writer.print("boolean " + TypeInfo.UNSIGNED_PARAMETER_NAME);
- }
- }
- } else if (
- param.getAnnotation(Result.class) == null
- && (native_stub || ((param.getAnnotation(Constant.class) == null || param.getAnnotation(Constant.class).keepParam()) && !Utils.isReturnParameter(method, param)))
- && (getAutoTypeParameter(method, param) == null || mode != Mode.AUTOS)
- )
- {
- TypeInfo type_info = typeinfos_instance.get(param);
- first_parameter = generateParameterJava(writer, param, type_info, native_stub, first_parameter, mode);
- }
- }
- CachedResult cached_result_annotation = method.getAnnotation(CachedResult.class);
- TypeMirror result_type = Utils.getMethodReturnType(method);
- if ((native_stub && Utils.getNIOBufferType(result_type) != null) || Utils.needResultSize(method)) {
- if (cached_result_annotation == null || !cached_result_annotation.isRange()) {
- if (!first_parameter)
- writer.print(", ");
- first_parameter = false;
- writer.print("long " + Utils.RESULT_SIZE_NAME);
- }
- }
- if (cached_result_annotation != null) {
- if (!first_parameter)
- writer.print(", ");
-
- if ( mode == Mode.CACHEDRESULT )
- writer.print("long " + Utils.CACHED_BUFFER_LENGTH_NAME + ", ");
-
- first_parameter = false;
- printResultType(writer, method, native_stub);
- writer.print(" " + Utils.CACHED_BUFFER_NAME);
- }
- return first_parameter;
- }
-
- private static boolean generateParameterJava(PrintWriter writer, ParameterDeclaration param, TypeInfo type_info, boolean native_stub, boolean first_parameter, Mode mode) {
- Class buffer_type = Utils.getNIOBufferType(param.getType());
- if (!first_parameter)
- writer.print(", ");
- BufferObject bo_annotation = param.getAnnotation(BufferObject.class);
- if (bo_annotation != null && mode == Mode.BUFFEROBJECT) {
- if (buffer_type == null)
- throw new RuntimeException("type of " + param + " is not a nio Buffer parameter but is annotated as buffer object");
- writer.print("long " + param.getSimpleName() + Utils.BUFFER_OBJECT_PARAMETER_POSTFIX);
- } else {
- if ( native_stub && param.getAnnotation(GLpointer.class) != null )
- writer.print("long");
- else {
- Class type = type_info.getType();
- if ( native_stub && (type == CharSequence.class || type == CharSequence[].class) )
- writer.print("ByteBuffer");
- else
- writer.print(type_info.getType().getSimpleName());
- }
- writer.print(" " + param.getSimpleName());
- if ( native_stub && buffer_type != null )
- writer.print(", int " + param.getSimpleName() + NativeMethodStubsGenerator.BUFFER_POSITION_POSTFIX);
- }
- return false;
- }
-
- private static void printBufferObjectCheck(PrintWriter writer, BufferKind kind, Mode mode) {
- String bo_check_method_name = kind.toString();
- writer.print("\t\t" + Utils.CHECKS_CLASS_NAME + ".ensure" + bo_check_method_name);
- if (mode == Mode.BUFFEROBJECT)
- writer.print("enabled");
- else
- writer.print("disabled");
- writer.println("(caps);");
- }
-
- private static void printBufferObjectChecks(PrintWriter writer, MethodDeclaration method, Mode mode) {
- EnumSet<BufferKind> check_set = EnumSet.noneOf(BufferKind.class);
- for (ParameterDeclaration param : method.getParameters()) {
- BufferObject bo_annotation = param.getAnnotation(BufferObject.class);
- if (bo_annotation != null)
- check_set.add(bo_annotation.value());
- }
- for (BufferKind kind : check_set)
- printBufferObjectCheck(writer, kind, mode);
- }
-
- private static void printMethodWithMultiType(AnnotationProcessorEnvironment env, TypeMap type_map, PrintWriter writer, InterfaceDeclaration interface_decl, MethodDeclaration method, Map<ParameterDeclaration, TypeInfo> typeinfos_instance, Mode mode, boolean generate_error_checks, boolean context_specific) {
- Utils.printDocComment(writer, method);
- writer.print("\tpublic static ");
- printResultType(writer, method, false);
- StripPostfix strip_annotation = method.getAnnotation(StripPostfix.class);
- String method_name;
- Alternate alt_annotation = method.getAnnotation(Alternate.class);
- method_name = alt_annotation == null || alt_annotation.javaAlt() ? method.getSimpleName() : alt_annotation.value();
- if (strip_annotation != null && mode == Mode.NORMAL)
- method_name = getPostfixStrippedName(type_map, interface_decl, method);
- writer.print(" " + method_name + "(");
- generateParametersJava(writer, method, typeinfos_instance, false, mode);
- TypeMirror result_type = Utils.getMethodReturnType(method);
- writer.println(") {");
- if (context_specific) {
- writer.println("\t\tContextCapabilities caps = GLContext.getCapabilities();");
- writer.print("\t\tlong " + Utils.FUNCTION_POINTER_VAR_NAME + " = caps.");
- writer.println(Utils.getFunctionAddressName(interface_decl, method, true) + ";");
- writer.print("\t\tBufferChecks.checkFunctionAddress(");
- writer.println(Utils.FUNCTION_POINTER_VAR_NAME + ");");
- }
- Code code_annotation = method.getAnnotation(Code.class);
- if (code_annotation != null)
- writer.println(code_annotation.value());
- printBufferObjectChecks(writer, method, mode);
- printParameterChecks(writer, method, typeinfos_instance, mode);
- printParameterCaching(writer, interface_decl, method, mode);
- writer.print("\t\t");
- boolean has_result = !result_type.equals(env.getTypeUtils().getVoidType());
- if (has_result) {
- printResultType(writer, method, false);
- writer.print(" " + Utils.RESULT_VAR_NAME + " = ");
-
- if ( method.getAnnotation(GLpointer.class) != null )
- writer.print("new " + method.getReturnType() + "(");
- }
- if ( method.getAnnotation(GLreturn.class) != null ) {
- has_result = true;
- Utils.printGLReturnPre(writer, method, method.getAnnotation(GLreturn.class));
- }
- writer.print(Utils.getSimpleNativeMethodName(method, generate_error_checks, context_specific));
- if (mode == Mode.BUFFEROBJECT)
- writer.print(Utils.BUFFER_OBJECT_METHOD_POSTFIX);
- writer.print("(");
- boolean first_parameter = printMethodCallArguments(writer, method, typeinfos_instance, mode);
- if (context_specific) {
- if (!first_parameter)
- writer.print(", ");
- writer.print(Utils.FUNCTION_POINTER_VAR_NAME);
- }
- if ( has_result && method.getAnnotation(GLpointer.class) != null )
- writer.print(")");
- writer.println(");");
- if (generate_error_checks && method.getAnnotation(NoErrorCheck.class) == null)
- writer.println("\t\t" + type_map.getErrorCheckMethodName() + ";");
- // DISABLED: indirect buffer support
- //printNondirectParameterCopies(writer, method, mode);
- if (has_result) {
- if ( method.getAnnotation(GLreturn.class) == null )
- writer.println("\t\treturn " + Utils.RESULT_VAR_NAME + ";");
- else
- Utils.printGLReturnPost(writer, method, method.getAnnotation(GLreturn.class));
- }
- writer.println("\t}");
- }
-
- private static String getExtensionPostfix(InterfaceDeclaration interface_decl) {
- String interface_simple_name = interface_decl.getSimpleName();
- Extension extension_annotation = interface_decl.getAnnotation(Extension.class);
- if (extension_annotation == null) {
- int underscore_index = interface_simple_name.indexOf("_");
- if (underscore_index != -1)
- return interface_simple_name.substring(0, underscore_index);
- else
- return "";
- } else
- return extension_annotation.postfix();
- }
-
- private static ParameterDeclaration getAutoTypeParameter(MethodDeclaration method, ParameterDeclaration target_parameter) {
- for (ParameterDeclaration param : method.getParameters()) {
- AnnotationMirror auto_annotation = Utils.getParameterAutoAnnotation(param);
- if (auto_annotation != null) {
- Class annotation_type = NativeTypeTranslator.getClassFromType(auto_annotation.getAnnotationType());
- String parameter_name;
- if (annotation_type.equals(AutoType.class))
- parameter_name = param.getAnnotation(AutoType.class).value();
- else if (annotation_type.equals(AutoSize.class))
- parameter_name = param.getAnnotation(AutoSize.class).value();
- else
- throw new RuntimeException("Unkown annotation type " + annotation_type);
- if (target_parameter.getSimpleName().equals(parameter_name))
- return param;
- }
- }
- return null;
- }
-
- private static boolean hasAnyParameterAutoTypeAnnotation(MethodDeclaration method, ParameterDeclaration target_param) {
- for (ParameterDeclaration param : method.getParameters()) {
- AutoType auto_type_annotation = param.getAnnotation(AutoType.class);
- if (auto_type_annotation != null) {
- ParameterDeclaration type_target_param = Utils.findParameter(method, auto_type_annotation.value());
- if (target_param.equals(type_target_param))
- return true;
- }
- }
- return false;
- }
-
- private static String getPostfixStrippedName(TypeMap type_map, InterfaceDeclaration interface_decl, MethodDeclaration method) {
- StripPostfix strip_annotation = method.getAnnotation(StripPostfix.class);
- ParameterDeclaration postfix_parameter = Utils.findParameter(method, strip_annotation.value());
- String postfix = strip_annotation.postfix();
- if ( "NULL".equals(postfix) ) {
- PostfixTranslator translator = new PostfixTranslator(type_map, postfix_parameter);
- postfix_parameter.getType().accept(translator);
- postfix = translator.getSignature();
- }
- String method_name;
- Alternate alt_annotation = method.getAnnotation(Alternate.class);
- method_name = alt_annotation == null || alt_annotation.javaAlt() ? method.getSimpleName() : alt_annotation.value();
-
- String extension_postfix = "NULL".equals(strip_annotation.extension()) ? getExtensionPostfix(interface_decl) : strip_annotation.extension();
- String result;
-
- if ( strip_annotation.hasPostfix() && method_name.endsWith(postfix + "v" + extension_postfix))
- result = method_name.substring(0, method_name.length() - (postfix.length() + 1 + extension_postfix.length()));
- else if ( strip_annotation.hasPostfix() && method_name.endsWith(postfix + extension_postfix))
- result = method_name.substring(0, method_name.length() - (postfix.length() + extension_postfix.length()));
- else if ( strip_annotation.hasPostfix() && method_name.endsWith(postfix + "i_v" + extension_postfix) )
- result = method_name.substring(0, method_name.length() - (postfix.length() + 3 + extension_postfix.length()));
- else if ( method_name.endsWith("i_v" + extension_postfix) )
- result = method_name.substring(0, method_name.length() - (3 + extension_postfix.length()));
- else if (method_name.endsWith("v" + extension_postfix))
- result = method_name.substring(0, method_name.length() - (1 + extension_postfix.length()));
- else
- throw new RuntimeException(method + " is specified as being postfix stripped on parameter " + postfix_parameter + ", but it's postfix is not '" + postfix + "' nor 'v'");
-
- return result + extension_postfix;
- }
-
- private static int getBufferElementSizeExponent(Class c) {
- if (IntBuffer.class.equals(c))
- return 2;
- else if (LongBuffer.class.equals(c))
- return 3;
- else if (DoubleBuffer.class.equals(c))
- return 3;
- else if (ShortBuffer.class.equals(c))
- return 1;
- else if (ByteBuffer.class.equals(c))
- return 0;
- else if (FloatBuffer.class.equals(c))
- return 2;
- else
- throw new RuntimeException(c + " is not allowed");
- }
-
- private static boolean printMethodCallArgument(PrintWriter writer, MethodDeclaration method, ParameterDeclaration param, Map<ParameterDeclaration, TypeInfo> typeinfos_instance, Mode mode, boolean first_parameter) {
- if (!first_parameter)
- writer.print(", ");
- AnnotationMirror auto_annotation = Utils.getParameterAutoAnnotation(param);
- Constant constant_annotation = param.getAnnotation(Constant.class);
- if (constant_annotation != null) {
- writer.print(constant_annotation.value());
- } else if (auto_annotation != null && mode == Mode.NORMAL) {
- Class param_type = NativeTypeTranslator.getClassFromType(auto_annotation.getAnnotationType());
- if (AutoType.class.equals(param_type)) {
- AutoType auto_type_annotation = param.getAnnotation(AutoType.class);
- String auto_parameter_name = auto_type_annotation.value();
- ParameterDeclaration auto_parameter = Utils.findParameter(method, auto_parameter_name);
- String auto_type = typeinfos_instance.get(auto_parameter).getAutoType();
- if (auto_type == null)
- throw new RuntimeException("No auto type for parameter " + param.getSimpleName() + " in method " + method);
- writer.print(auto_type);
- } else if (AutoSize.class.equals(param_type)) {
- AutoSize auto_type_annotation = param.getAnnotation(AutoSize.class);
- String auto_parameter_name = auto_type_annotation.value();
- ParameterDeclaration auto_target_param = Utils.findParameter(method, auto_parameter_name);
- TypeInfo auto_target_type_info = typeinfos_instance.get(auto_target_param);
- writer.print("(" + auto_parameter_name + ".remaining()");
- // Shift the remaining if the target parameter is multityped and there's no AutoType to track type
- boolean shift_remaining = !hasAnyParameterAutoTypeAnnotation(method, auto_target_param) && Utils.isParameterMultiTyped(auto_target_param);
- if (shift_remaining) {
- int shifting = getBufferElementSizeExponent(auto_target_type_info.getType());
- if (shifting > 0)
- writer.print(" << " + shifting);
- }
- writer.print(")");
- writer.print(auto_type_annotation.expression());
- } else
- throw new RuntimeException("Unknown auto annotation " + param_type);
- } else {
- if (mode == Mode.BUFFEROBJECT && param.getAnnotation(BufferObject.class) != null) {
- writer.print(param.getSimpleName() + Utils.BUFFER_OBJECT_PARAMETER_POSTFIX);
- } else {
- Class type = typeinfos_instance.get(param).getType();
- boolean hide_buffer = mode == Mode.AUTOS && getAutoTypeParameter(method, param) != null;
- if (hide_buffer)
- writer.print("null");
- else {
- if ( type == CharSequence.class || type == CharSequence[].class ) {
- final String offset = Utils.getStringOffset(method, param);
-
- writer.print("APIUtils.getBuffer");
- if ( param.getAnnotation(NullTerminated.class) != null )
- writer.print("NT");
- writer.print("(" + param.getSimpleName());
- if ( offset != null )
- writer.print(", " + offset);
- writer.print(")");
- hide_buffer = true;
- } else
- writer.print(param.getSimpleName());
- }
- Class buffer_type = Utils.getNIOBufferType(param.getType());
- if (buffer_type != null) {
- writer.print(", ");
- if (!hide_buffer) {
- TypeInfo type_info = typeinfos_instance.get(param);
- Check check_annotation = param.getAnnotation(Check.class);
- int shifting;
- if (Utils.getNIOBufferType(param.getType()).equals(Buffer.class))
- shifting = getBufferElementSizeExponent(type_info.getType());
- else
- shifting = 0;
- writer.print(param.getSimpleName());
- if (check_annotation != null && check_annotation.canBeNull())
- writer.print(" != null ? " + param.getSimpleName());
- writer.print(".position()");
- if (shifting > 0)
- writer.print(" << " + shifting);
- if (check_annotation != null && check_annotation.canBeNull())
- writer.print(" : 0");
- } else if ( type == CharSequence.class || type == CharSequence[].class ) {
- final String offset = Utils.getStringOffset(method, param);
- writer.print(offset == null ? "0" : offset);
- } else
- writer.print("0");
- } else if ( param.getAnnotation(GLpointer.class) != null ) {
- writer.print(".getPointer()");
- }
- }
- }
- return false;
- }
-
- private static boolean printMethodCallArguments(PrintWriter writer, MethodDeclaration method, Map<ParameterDeclaration, TypeInfo> typeinfos_instance, Mode mode) {
- boolean first_parameter = true;
- for (ParameterDeclaration param : method.getParameters())
- if (param.getAnnotation(Result.class) == null) {
- first_parameter = printMethodCallArgument(writer, method, param, typeinfos_instance, mode, first_parameter);
- }
- if (Utils.getNIOBufferType(Utils.getMethodReturnType(method)) != null) {
- if (method.getAnnotation(CachedResult.class) != null && method.getAnnotation(CachedResult.class).isRange()) {
- first_parameter = false;
- Utils.printExtraCallArguments(writer, method, "");
- } else {
- if (!first_parameter)
- writer.print(", ");
- first_parameter = false;
-
- String result_size_expression;
- if ( mode == Mode.CACHEDRESULT )
- result_size_expression = Utils.CACHED_BUFFER_LENGTH_NAME;
- else {
- AutoResultSize auto_result_size_annotation = method.getAnnotation(AutoResultSize.class);
- if (auto_result_size_annotation == null)
- result_size_expression = Utils.RESULT_SIZE_NAME;
- else
- result_size_expression = auto_result_size_annotation.value();
- }
- Utils.printExtraCallArguments(writer, method, result_size_expression);
- }
- }
- return first_parameter;
- }
-
- private static void printParameterCaching(PrintWriter writer, InterfaceDeclaration interface_decl, MethodDeclaration method, Mode mode) {
- for (ParameterDeclaration param : method.getParameters()) {
- Class java_type = Utils.getJavaType(param.getType());
- CachedReference cachedReference = param.getAnnotation(CachedReference.class);
- if (Buffer.class.isAssignableFrom(java_type) &&
- cachedReference != null &&
- (mode != Mode.BUFFEROBJECT || param.getAnnotation(BufferObject.class) == null) &&
- param.getAnnotation(Result.class) == null) {
- writer.print("\t\t" + Utils.CHECKS_CLASS_NAME + ".getReferences(caps).");
- if(cachedReference.name().length() > 0) {
- writer.print(cachedReference.name());
- } else {
- writer.print(Utils.getReferenceName(interface_decl, method, param));
- }
- if(cachedReference.index().length() > 0) {
- writer.print("[" + cachedReference.index() + "]");
- }
- writer.println(" = " + param.getSimpleName() + ";");
- }
- }
- }
-
- private static void printNondirectParameterCopies(PrintWriter writer, MethodDeclaration method, Mode mode) {
- for (ParameterDeclaration param : method.getParameters()) {
- Class java_type = Utils.getJavaType(param.getType());
- if (Utils.isAddressableType(java_type) &&
- (mode != Mode.BUFFEROBJECT || param.getAnnotation(BufferObject.class) == null) &&
- (mode != Mode.AUTOS || getAutoTypeParameter(method, param) == null) &&
- param.getAnnotation(Result.class) == null) {
- if (Buffer.class.isAssignableFrom(java_type)) {
- boolean out_parameter = param.getAnnotation(OutParameter.class) != null;
- if (out_parameter)
- writer.println("\t\tNondirectBufferWrapper.copy(" + param.getSimpleName() + ", " + param.getSimpleName() + SAVED_PARAMETER_POSTFIX + ");");
- }
- }
- }
- }
-
- private static void printParameterChecks(PrintWriter writer, MethodDeclaration method, Map<ParameterDeclaration, TypeInfo> typeinfos, Mode mode) {
- for (ParameterDeclaration param : method.getParameters()) {
- Class java_type = Utils.getJavaType(param.getType());
- if (Utils.isAddressableType(java_type) &&
- (mode != Mode.BUFFEROBJECT || param.getAnnotation(BufferObject.class) == null) &&
- (mode != Mode.AUTOS || getAutoTypeParameter(method, param) == null) &&
- param.getAnnotation(Result.class) == null &&
- !Utils.isReturnParameter(method, param) ) {
- String check_value = null;
- boolean can_be_null = false;
- Check check_annotation = param.getAnnotation(Check.class);
- if (check_annotation != null) {
- check_value = check_annotation.value();
- can_be_null = check_annotation.canBeNull();
- }
- NullTerminated null_terminated = param.getAnnotation(NullTerminated.class);
- if (Buffer.class.isAssignableFrom(java_type) && param.getAnnotation(Constant.class) == null) {
- boolean indirect_buffer_allowed = false && param.getAnnotation(CachedReference.class) == null; // DISABLED: indirect buffer support
- boolean out_parameter = param.getAnnotation(OutParameter.class) != null;
- TypeInfo typeinfo = typeinfos.get(param);
- printParameterCheck(writer, param.getSimpleName(), typeinfo.getType().getSimpleName(), check_value, can_be_null, null_terminated, indirect_buffer_allowed, out_parameter);
- } else if ( String.class.equals(java_type)) {
- if (!can_be_null)
- writer.println("\t\tBufferChecks.checkNotNull(" + param.getSimpleName() + ");");
- }
- }
- }
- if (method.getAnnotation(CachedResult.class) != null)
- printParameterCheck(writer, Utils.CACHED_BUFFER_NAME, null, null, true, null, false, false);
- }
-
- private static void printParameterCheck(PrintWriter writer, String name, String type, String check_value, boolean can_be_null, NullTerminated null_terminated, boolean indirect_buffer_allowed, boolean out_parameter) {
- if (indirect_buffer_allowed && out_parameter) {
- writer.println("\t\t" + type + " " + name + SAVED_PARAMETER_POSTFIX + " = " + name + ";");
- }
- if (can_be_null) {
- writer.println("\t\tif (" + name + " != null)");
- writer.print("\t");
- }
- if (indirect_buffer_allowed) {
- writer.print("\t\t" + name + " = NondirectBufferWrapper.wrap");
- if (out_parameter)
- writer.print("NoCopy");
- } else
- writer.print("\t\tBufferChecks.check");
- if (check_value != null && !"".equals(check_value) ) {
- writer.print("Buffer(" + name + ", " + check_value);
- } else {
- writer.print("Direct(" + name);
- }
- writer.println(");");
- if (null_terminated != null) {
- writer.print("\t\tBufferChecks.checkNullTerminated(");
- writer.print(name);
- if ( null_terminated.value().length() > 0 ) {
- writer.print(", ");
- writer.print(null_terminated.value());
- }
- writer.println(");");
- }
- }
-
- private static void printResultType(PrintWriter writer, MethodDeclaration method, boolean native_stub) {
- if ( native_stub && method.getAnnotation(GLpointer.class) != null )
- writer.print("long");
- else if ( !native_stub && method.getAnnotation(GLreturn.class) != null )
- writer.print(Utils.getMethodReturnType(method, method.getAnnotation(GLreturn.class), false));
- else
- writer.print(Utils.getMethodReturnType(method).toString());
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * This class generates the methods in the generated java source files.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3293 $
+ * $Id: JavaMethodsGenerator.java 3293 2010-03-23 12:43:44Z spasi $
+ */
+
+import com.sun.mirror.apt.*;
+import com.sun.mirror.declaration.*;
+import com.sun.mirror.type.*;
+
+import java.io.*;
+import java.util.*;
+import java.nio.*;
+
+public class JavaMethodsGenerator {
+ private final static String SAVED_PARAMETER_POSTFIX = "_saved";
+
+ public static void generateMethodsJava(AnnotationProcessorEnvironment env, TypeMap type_map, PrintWriter writer, InterfaceDeclaration interface_decl, boolean generate_error_checks, boolean context_specific) {
+ for (MethodDeclaration method : interface_decl.getMethods())
+ generateMethodJava(env, type_map, writer, interface_decl, method, generate_error_checks, context_specific);
+ }
+
+ private static void generateMethodJava(AnnotationProcessorEnvironment env, TypeMap type_map, PrintWriter writer, InterfaceDeclaration interface_decl, MethodDeclaration method, boolean generate_error_checks, boolean context_specific) {
+ writer.println();
+ if (Utils.isMethodIndirect(generate_error_checks, context_specific, method)) {
+ if (method.getAnnotation(GenerateAutos.class) != null) {
+ printMethodWithMultiType(env, type_map, writer, interface_decl, method, TypeInfo.getDefaultTypeInfoMap(method), Mode.AUTOS, generate_error_checks, context_specific);
+ }
+ Collection<Map<ParameterDeclaration, TypeInfo>> cross_product = TypeInfo.getTypeInfoCrossProduct(type_map, method);
+ for (Map<ParameterDeclaration, TypeInfo> typeinfos_instance : cross_product) {
+ printMethodWithMultiType(env, type_map, writer, interface_decl, method, typeinfos_instance, Mode.NORMAL, generate_error_checks, context_specific);
+ }
+ }
+ if ( method.getAnnotation(CachedResult.class) != null && !method.getAnnotation(CachedResult.class).isRange() ) {
+ printMethodWithMultiType(env, type_map, writer, interface_decl, method, TypeInfo.getDefaultTypeInfoMap(method), Mode.CACHEDRESULT, generate_error_checks, context_specific);
+ }
+ Alternate alt_annotation = method.getAnnotation(Alternate.class);
+ if ( alt_annotation == null || alt_annotation.nativeAlt() ) {
+ if ( alt_annotation != null && method.getSimpleName().equals(alt_annotation.value()) )
+ throw new RuntimeException("An alternate function with native code should have a different name than the main function.");
+ printJavaNativeStub(writer, method, Mode.NORMAL, generate_error_checks, context_specific);
+ if (Utils.hasMethodBufferObjectParameter(method)) {
+ printMethodWithMultiType(env, type_map, writer, interface_decl, method, TypeInfo.getDefaultTypeInfoMap(method), Mode.BUFFEROBJECT, generate_error_checks, context_specific);
+ printJavaNativeStub(writer, method, Mode.BUFFEROBJECT, generate_error_checks, context_specific);
+ }
+ }
+ }
+
+ private static void printJavaNativeStub(PrintWriter writer, MethodDeclaration method, Mode mode, boolean generate_error_checks, boolean context_specific) {
+ if (Utils.isMethodIndirect(generate_error_checks, context_specific, method)) {
+ writer.print("\tprivate static native ");
+ } else {
+ Utils.printDocComment(writer, method);
+ writer.print("\tpublic static native ");
+ }
+ printResultType(writer, method, true);
+ writer.print(" " + Utils.getSimpleNativeMethodName(method, generate_error_checks, context_specific));
+ if (mode == Mode.BUFFEROBJECT)
+ writer.print(Utils.BUFFER_OBJECT_METHOD_POSTFIX);
+ writer.print("(");
+ boolean first_parameter = generateParametersJava(writer, method, TypeInfo.getDefaultTypeInfoMap(method), true, mode);
+ if (context_specific) {
+ if (!first_parameter)
+ writer.print(", ");
+ writer.print("long " + Utils.FUNCTION_POINTER_VAR_NAME);
+ }
+ writer.println(");");
+ }
+
+ private static boolean generateParametersJava(PrintWriter writer, MethodDeclaration method, Map<ParameterDeclaration, TypeInfo> typeinfos_instance,
+ boolean native_stub, Mode mode) {
+ boolean first_parameter = true;
+ for (ParameterDeclaration param : method.getParameters()) {
+ AnnotationMirror auto_annotation_mirror = Utils.getParameterAutoAnnotation(param);
+ boolean hide_auto_parameter = mode == Mode.NORMAL && !native_stub && auto_annotation_mirror != null;
+ if (hide_auto_parameter) {
+ AutoType auto_type_annotation = param.getAnnotation(AutoType.class);
+ if (auto_type_annotation != null) {
+ ParameterDeclaration auto_parameter = Utils.findParameter(method, auto_type_annotation.value());
+ TypeInfo auto_param_type_info = typeinfos_instance.get(auto_parameter);
+ if (auto_param_type_info.getSignedness() == Signedness.BOTH) {
+ if (!first_parameter)
+ writer.print(", ");
+ first_parameter = false;
+ writer.print("boolean " + TypeInfo.UNSIGNED_PARAMETER_NAME);
+ }
+ }
+ } else if (
+ param.getAnnotation(Result.class) == null
+ && (native_stub || ((param.getAnnotation(Constant.class) == null || param.getAnnotation(Constant.class).keepParam()) && !Utils.isReturnParameter(method, param)))
+ && (getAutoTypeParameter(method, param) == null || mode != Mode.AUTOS)
+ )
+ {
+ TypeInfo type_info = typeinfos_instance.get(param);
+ first_parameter = generateParameterJava(writer, param, type_info, native_stub, first_parameter, mode);
+ }
+ }
+ CachedResult cached_result_annotation = method.getAnnotation(CachedResult.class);
+ TypeMirror result_type = Utils.getMethodReturnType(method);
+ if ((native_stub && Utils.getNIOBufferType(result_type) != null) || Utils.needResultSize(method)) {
+ if (cached_result_annotation == null || !cached_result_annotation.isRange()) {
+ if (!first_parameter)
+ writer.print(", ");
+ first_parameter = false;
+ writer.print("long " + Utils.RESULT_SIZE_NAME);
+ }
+ }
+ if (cached_result_annotation != null) {
+ if (!first_parameter)
+ writer.print(", ");
+
+ if ( mode == Mode.CACHEDRESULT )
+ writer.print("long " + Utils.CACHED_BUFFER_LENGTH_NAME + ", ");
+
+ first_parameter = false;
+ printResultType(writer, method, native_stub);
+ writer.print(" " + Utils.CACHED_BUFFER_NAME);
+ }
+ return first_parameter;
+ }
+
+ private static boolean generateParameterJava(PrintWriter writer, ParameterDeclaration param, TypeInfo type_info, boolean native_stub, boolean first_parameter, Mode mode) {
+ Class buffer_type = Utils.getNIOBufferType(param.getType());
+ if (!first_parameter)
+ writer.print(", ");
+ BufferObject bo_annotation = param.getAnnotation(BufferObject.class);
+ if (bo_annotation != null && mode == Mode.BUFFEROBJECT) {
+ if (buffer_type == null)
+ throw new RuntimeException("type of " + param + " is not a nio Buffer parameter but is annotated as buffer object");
+ writer.print("long " + param.getSimpleName() + Utils.BUFFER_OBJECT_PARAMETER_POSTFIX);
+ } else {
+ if ( native_stub && param.getAnnotation(GLpointer.class) != null )
+ writer.print("long");
+ else {
+ Class type = type_info.getType();
+ if ( native_stub && (type == CharSequence.class || type == CharSequence[].class) )
+ writer.print("ByteBuffer");
+ else
+ writer.print(type_info.getType().getSimpleName());
+ }
+ writer.print(" " + param.getSimpleName());
+ if ( native_stub && buffer_type != null )
+ writer.print(", int " + param.getSimpleName() + NativeMethodStubsGenerator.BUFFER_POSITION_POSTFIX);
+ }
+ return false;
+ }
+
+ private static void printBufferObjectCheck(PrintWriter writer, BufferKind kind, Mode mode) {
+ String bo_check_method_name = kind.toString();
+ writer.print("\t\t" + Utils.CHECKS_CLASS_NAME + ".ensure" + bo_check_method_name);
+ if (mode == Mode.BUFFEROBJECT)
+ writer.print("enabled");
+ else
+ writer.print("disabled");
+ writer.println("(caps);");
+ }
+
+ private static void printBufferObjectChecks(PrintWriter writer, MethodDeclaration method, Mode mode) {
+ EnumSet<BufferKind> check_set = EnumSet.noneOf(BufferKind.class);
+ for (ParameterDeclaration param : method.getParameters()) {
+ BufferObject bo_annotation = param.getAnnotation(BufferObject.class);
+ if (bo_annotation != null)
+ check_set.add(bo_annotation.value());
+ }
+ for (BufferKind kind : check_set)
+ printBufferObjectCheck(writer, kind, mode);
+ }
+
+ private static void printMethodWithMultiType(AnnotationProcessorEnvironment env, TypeMap type_map, PrintWriter writer, InterfaceDeclaration interface_decl, MethodDeclaration method, Map<ParameterDeclaration, TypeInfo> typeinfos_instance, Mode mode, boolean generate_error_checks, boolean context_specific) {
+ Utils.printDocComment(writer, method);
+ writer.print("\tpublic static ");
+ printResultType(writer, method, false);
+ StripPostfix strip_annotation = method.getAnnotation(StripPostfix.class);
+ String method_name;
+ Alternate alt_annotation = method.getAnnotation(Alternate.class);
+ method_name = alt_annotation == null || alt_annotation.javaAlt() ? method.getSimpleName() : alt_annotation.value();
+ if (strip_annotation != null && mode == Mode.NORMAL)
+ method_name = getPostfixStrippedName(type_map, interface_decl, method);
+ writer.print(" " + method_name + "(");
+ generateParametersJava(writer, method, typeinfos_instance, false, mode);
+ TypeMirror result_type = Utils.getMethodReturnType(method);
+ writer.println(") {");
+ if (context_specific) {
+ writer.println("\t\tContextCapabilities caps = GLContext.getCapabilities();");
+ writer.print("\t\tlong " + Utils.FUNCTION_POINTER_VAR_NAME + " = caps.");
+ writer.println(Utils.getFunctionAddressName(interface_decl, method, true) + ";");
+ writer.print("\t\tBufferChecks.checkFunctionAddress(");
+ writer.println(Utils.FUNCTION_POINTER_VAR_NAME + ");");
+ }
+ Code code_annotation = method.getAnnotation(Code.class);
+ if (code_annotation != null)
+ writer.println(code_annotation.value());
+ printBufferObjectChecks(writer, method, mode);
+ printParameterChecks(writer, method, typeinfos_instance, mode);
+ printParameterCaching(writer, interface_decl, method, mode);
+ writer.print("\t\t");
+ boolean has_result = !result_type.equals(env.getTypeUtils().getVoidType());
+ if (has_result) {
+ printResultType(writer, method, false);
+ writer.print(" " + Utils.RESULT_VAR_NAME + " = ");
+
+ if ( method.getAnnotation(GLpointer.class) != null )
+ writer.print("new " + method.getReturnType() + "(");
+ }
+ if ( method.getAnnotation(GLreturn.class) != null ) {
+ has_result = true;
+ Utils.printGLReturnPre(writer, method, method.getAnnotation(GLreturn.class));
+ }
+ writer.print(Utils.getSimpleNativeMethodName(method, generate_error_checks, context_specific));
+ if (mode == Mode.BUFFEROBJECT)
+ writer.print(Utils.BUFFER_OBJECT_METHOD_POSTFIX);
+ writer.print("(");
+ boolean first_parameter = printMethodCallArguments(writer, method, typeinfos_instance, mode);
+ if (context_specific) {
+ if (!first_parameter)
+ writer.print(", ");
+ writer.print(Utils.FUNCTION_POINTER_VAR_NAME);
+ }
+ if ( has_result && method.getAnnotation(GLpointer.class) != null )
+ writer.print(")");
+ writer.println(");");
+ if (generate_error_checks && method.getAnnotation(NoErrorCheck.class) == null)
+ writer.println("\t\t" + type_map.getErrorCheckMethodName() + ";");
+ // DISABLED: indirect buffer support
+ //printNondirectParameterCopies(writer, method, mode);
+ if (has_result) {
+ if ( method.getAnnotation(GLreturn.class) == null )
+ writer.println("\t\treturn " + Utils.RESULT_VAR_NAME + ";");
+ else
+ Utils.printGLReturnPost(writer, method, method.getAnnotation(GLreturn.class));
+ }
+ writer.println("\t}");
+ }
+
+ private static String getExtensionPostfix(InterfaceDeclaration interface_decl) {
+ String interface_simple_name = interface_decl.getSimpleName();
+ Extension extension_annotation = interface_decl.getAnnotation(Extension.class);
+ if (extension_annotation == null) {
+ int underscore_index = interface_simple_name.indexOf("_");
+ if (underscore_index != -1)
+ return interface_simple_name.substring(0, underscore_index);
+ else
+ return "";
+ } else
+ return extension_annotation.postfix();
+ }
+
+ private static ParameterDeclaration getAutoTypeParameter(MethodDeclaration method, ParameterDeclaration target_parameter) {
+ for (ParameterDeclaration param : method.getParameters()) {
+ AnnotationMirror auto_annotation = Utils.getParameterAutoAnnotation(param);
+ if (auto_annotation != null) {
+ Class annotation_type = NativeTypeTranslator.getClassFromType(auto_annotation.getAnnotationType());
+ String parameter_name;
+ if (annotation_type.equals(AutoType.class))
+ parameter_name = param.getAnnotation(AutoType.class).value();
+ else if (annotation_type.equals(AutoSize.class))
+ parameter_name = param.getAnnotation(AutoSize.class).value();
+ else
+ throw new RuntimeException("Unkown annotation type " + annotation_type);
+ if (target_parameter.getSimpleName().equals(parameter_name))
+ return param;
+ }
+ }
+ return null;
+ }
+
+ private static boolean hasAnyParameterAutoTypeAnnotation(MethodDeclaration method, ParameterDeclaration target_param) {
+ for (ParameterDeclaration param : method.getParameters()) {
+ AutoType auto_type_annotation = param.getAnnotation(AutoType.class);
+ if (auto_type_annotation != null) {
+ ParameterDeclaration type_target_param = Utils.findParameter(method, auto_type_annotation.value());
+ if (target_param.equals(type_target_param))
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private static String getPostfixStrippedName(TypeMap type_map, InterfaceDeclaration interface_decl, MethodDeclaration method) {
+ StripPostfix strip_annotation = method.getAnnotation(StripPostfix.class);
+ ParameterDeclaration postfix_parameter = Utils.findParameter(method, strip_annotation.value());
+ String postfix = strip_annotation.postfix();
+ if ( "NULL".equals(postfix) ) {
+ PostfixTranslator translator = new PostfixTranslator(type_map, postfix_parameter);
+ postfix_parameter.getType().accept(translator);
+ postfix = translator.getSignature();
+ }
+ String method_name;
+ Alternate alt_annotation = method.getAnnotation(Alternate.class);
+ method_name = alt_annotation == null || alt_annotation.javaAlt() ? method.getSimpleName() : alt_annotation.value();
+
+ String extension_postfix = "NULL".equals(strip_annotation.extension()) ? getExtensionPostfix(interface_decl) : strip_annotation.extension();
+ String result;
+
+ if ( strip_annotation.hasPostfix() && method_name.endsWith(postfix + "v" + extension_postfix))
+ result = method_name.substring(0, method_name.length() - (postfix.length() + 1 + extension_postfix.length()));
+ else if ( strip_annotation.hasPostfix() && method_name.endsWith(postfix + extension_postfix))
+ result = method_name.substring(0, method_name.length() - (postfix.length() + extension_postfix.length()));
+ else if ( strip_annotation.hasPostfix() && method_name.endsWith(postfix + "i_v" + extension_postfix) )
+ result = method_name.substring(0, method_name.length() - (postfix.length() + 3 + extension_postfix.length()));
+ else if ( method_name.endsWith("i_v" + extension_postfix) )
+ result = method_name.substring(0, method_name.length() - (3 + extension_postfix.length()));
+ else if (method_name.endsWith("v" + extension_postfix))
+ result = method_name.substring(0, method_name.length() - (1 + extension_postfix.length()));
+ else
+ throw new RuntimeException(method + " is specified as being postfix stripped on parameter " + postfix_parameter + ", but it's postfix is not '" + postfix + "' nor 'v'");
+
+ return result + extension_postfix;
+ }
+
+ private static int getBufferElementSizeExponent(Class c) {
+ if (IntBuffer.class.equals(c))
+ return 2;
+ else if (LongBuffer.class.equals(c))
+ return 3;
+ else if (DoubleBuffer.class.equals(c))
+ return 3;
+ else if (ShortBuffer.class.equals(c))
+ return 1;
+ else if (ByteBuffer.class.equals(c))
+ return 0;
+ else if (FloatBuffer.class.equals(c))
+ return 2;
+ else
+ throw new RuntimeException(c + " is not allowed");
+ }
+
+ private static boolean printMethodCallArgument(PrintWriter writer, MethodDeclaration method, ParameterDeclaration param, Map<ParameterDeclaration, TypeInfo> typeinfos_instance, Mode mode, boolean first_parameter) {
+ if (!first_parameter)
+ writer.print(", ");
+ AnnotationMirror auto_annotation = Utils.getParameterAutoAnnotation(param);
+ Constant constant_annotation = param.getAnnotation(Constant.class);
+ if (constant_annotation != null) {
+ writer.print(constant_annotation.value());
+ } else if (auto_annotation != null && mode == Mode.NORMAL) {
+ Class param_type = NativeTypeTranslator.getClassFromType(auto_annotation.getAnnotationType());
+ if (AutoType.class.equals(param_type)) {
+ AutoType auto_type_annotation = param.getAnnotation(AutoType.class);
+ String auto_parameter_name = auto_type_annotation.value();
+ ParameterDeclaration auto_parameter = Utils.findParameter(method, auto_parameter_name);
+ String auto_type = typeinfos_instance.get(auto_parameter).getAutoType();
+ if (auto_type == null)
+ throw new RuntimeException("No auto type for parameter " + param.getSimpleName() + " in method " + method);
+ writer.print(auto_type);
+ } else if (AutoSize.class.equals(param_type)) {
+ AutoSize auto_type_annotation = param.getAnnotation(AutoSize.class);
+ String auto_parameter_name = auto_type_annotation.value();
+ ParameterDeclaration auto_target_param = Utils.findParameter(method, auto_parameter_name);
+ TypeInfo auto_target_type_info = typeinfos_instance.get(auto_target_param);
+ writer.print("(" + auto_parameter_name + ".remaining()");
+ // Shift the remaining if the target parameter is multityped and there's no AutoType to track type
+ boolean shift_remaining = !hasAnyParameterAutoTypeAnnotation(method, auto_target_param) && Utils.isParameterMultiTyped(auto_target_param);
+ if (shift_remaining) {
+ int shifting = getBufferElementSizeExponent(auto_target_type_info.getType());
+ if (shifting > 0)
+ writer.print(" << " + shifting);
+ }
+ writer.print(")");
+ writer.print(auto_type_annotation.expression());
+ } else
+ throw new RuntimeException("Unknown auto annotation " + param_type);
+ } else {
+ if (mode == Mode.BUFFEROBJECT && param.getAnnotation(BufferObject.class) != null) {
+ writer.print(param.getSimpleName() + Utils.BUFFER_OBJECT_PARAMETER_POSTFIX);
+ } else {
+ Class type = typeinfos_instance.get(param).getType();
+ boolean hide_buffer = mode == Mode.AUTOS && getAutoTypeParameter(method, param) != null;
+ if (hide_buffer)
+ writer.print("null");
+ else {
+ if ( type == CharSequence.class || type == CharSequence[].class ) {
+ final String offset = Utils.getStringOffset(method, param);
+
+ writer.print("APIUtils.getBuffer");
+ if ( param.getAnnotation(NullTerminated.class) != null )
+ writer.print("NT");
+ writer.print("(" + param.getSimpleName());
+ if ( offset != null )
+ writer.print(", " + offset);
+ writer.print(")");
+ hide_buffer = true;
+ } else
+ writer.print(param.getSimpleName());
+ }
+ Class buffer_type = Utils.getNIOBufferType(param.getType());
+ if (buffer_type != null) {
+ writer.print(", ");
+ if (!hide_buffer) {
+ TypeInfo type_info = typeinfos_instance.get(param);
+ Check check_annotation = param.getAnnotation(Check.class);
+ int shifting;
+ if (Utils.getNIOBufferType(param.getType()).equals(Buffer.class))
+ shifting = getBufferElementSizeExponent(type_info.getType());
+ else
+ shifting = 0;
+ writer.print(param.getSimpleName());
+ if (check_annotation != null && check_annotation.canBeNull())
+ writer.print(" != null ? " + param.getSimpleName());
+ writer.print(".position()");
+ if (shifting > 0)
+ writer.print(" << " + shifting);
+ if (check_annotation != null && check_annotation.canBeNull())
+ writer.print(" : 0");
+ } else if ( type == CharSequence.class || type == CharSequence[].class ) {
+ final String offset = Utils.getStringOffset(method, param);
+ writer.print(offset == null ? "0" : offset);
+ } else
+ writer.print("0");
+ } else if ( param.getAnnotation(GLpointer.class) != null ) {
+ writer.print(".getPointer()");
+ }
+ }
+ }
+ return false;
+ }
+
+ private static boolean printMethodCallArguments(PrintWriter writer, MethodDeclaration method, Map<ParameterDeclaration, TypeInfo> typeinfos_instance, Mode mode) {
+ boolean first_parameter = true;
+ for (ParameterDeclaration param : method.getParameters())
+ if (param.getAnnotation(Result.class) == null) {
+ first_parameter = printMethodCallArgument(writer, method, param, typeinfos_instance, mode, first_parameter);
+ }
+ if (Utils.getNIOBufferType(Utils.getMethodReturnType(method)) != null) {
+ if (method.getAnnotation(CachedResult.class) != null && method.getAnnotation(CachedResult.class).isRange()) {
+ first_parameter = false;
+ Utils.printExtraCallArguments(writer, method, "");
+ } else {
+ if (!first_parameter)
+ writer.print(", ");
+ first_parameter = false;
+
+ String result_size_expression;
+ if ( mode == Mode.CACHEDRESULT )
+ result_size_expression = Utils.CACHED_BUFFER_LENGTH_NAME;
+ else {
+ AutoResultSize auto_result_size_annotation = method.getAnnotation(AutoResultSize.class);
+ if (auto_result_size_annotation == null)
+ result_size_expression = Utils.RESULT_SIZE_NAME;
+ else
+ result_size_expression = auto_result_size_annotation.value();
+ }
+ Utils.printExtraCallArguments(writer, method, result_size_expression);
+ }
+ }
+ return first_parameter;
+ }
+
+ private static void printParameterCaching(PrintWriter writer, InterfaceDeclaration interface_decl, MethodDeclaration method, Mode mode) {
+ for (ParameterDeclaration param : method.getParameters()) {
+ Class java_type = Utils.getJavaType(param.getType());
+ CachedReference cachedReference = param.getAnnotation(CachedReference.class);
+ if (Buffer.class.isAssignableFrom(java_type) &&
+ cachedReference != null &&
+ (mode != Mode.BUFFEROBJECT || param.getAnnotation(BufferObject.class) == null) &&
+ param.getAnnotation(Result.class) == null) {
+ writer.print("\t\t" + Utils.CHECKS_CLASS_NAME + ".getReferences(caps).");
+ if(cachedReference.name().length() > 0) {
+ writer.print(cachedReference.name());
+ } else {
+ writer.print(Utils.getReferenceName(interface_decl, method, param));
+ }
+ if(cachedReference.index().length() > 0) {
+ writer.print("[" + cachedReference.index() + "]");
+ }
+ writer.println(" = " + param.getSimpleName() + ";");
+ }
+ }
+ }
+
+ private static void printNondirectParameterCopies(PrintWriter writer, MethodDeclaration method, Mode mode) {
+ for (ParameterDeclaration param : method.getParameters()) {
+ Class java_type = Utils.getJavaType(param.getType());
+ if (Utils.isAddressableType(java_type) &&
+ (mode != Mode.BUFFEROBJECT || param.getAnnotation(BufferObject.class) == null) &&
+ (mode != Mode.AUTOS || getAutoTypeParameter(method, param) == null) &&
+ param.getAnnotation(Result.class) == null) {
+ if (Buffer.class.isAssignableFrom(java_type)) {
+ boolean out_parameter = param.getAnnotation(OutParameter.class) != null;
+ if (out_parameter)
+ writer.println("\t\tNondirectBufferWrapper.copy(" + param.getSimpleName() + ", " + param.getSimpleName() + SAVED_PARAMETER_POSTFIX + ");");
+ }
+ }
+ }
+ }
+
+ private static void printParameterChecks(PrintWriter writer, MethodDeclaration method, Map<ParameterDeclaration, TypeInfo> typeinfos, Mode mode) {
+ for (ParameterDeclaration param : method.getParameters()) {
+ Class java_type = Utils.getJavaType(param.getType());
+ if (Utils.isAddressableType(java_type) &&
+ (mode != Mode.BUFFEROBJECT || param.getAnnotation(BufferObject.class) == null) &&
+ (mode != Mode.AUTOS || getAutoTypeParameter(method, param) == null) &&
+ param.getAnnotation(Result.class) == null &&
+ !Utils.isReturnParameter(method, param) ) {
+ String check_value = null;
+ boolean can_be_null = false;
+ Check check_annotation = param.getAnnotation(Check.class);
+ if (check_annotation != null) {
+ check_value = check_annotation.value();
+ can_be_null = check_annotation.canBeNull();
+ }
+ NullTerminated null_terminated = param.getAnnotation(NullTerminated.class);
+ if (Buffer.class.isAssignableFrom(java_type) && param.getAnnotation(Constant.class) == null) {
+ boolean indirect_buffer_allowed = false && param.getAnnotation(CachedReference.class) == null; // DISABLED: indirect buffer support
+ boolean out_parameter = param.getAnnotation(OutParameter.class) != null;
+ TypeInfo typeinfo = typeinfos.get(param);
+ printParameterCheck(writer, param.getSimpleName(), typeinfo.getType().getSimpleName(), check_value, can_be_null, null_terminated, indirect_buffer_allowed, out_parameter);
+ } else if ( String.class.equals(java_type)) {
+ if (!can_be_null)
+ writer.println("\t\tBufferChecks.checkNotNull(" + param.getSimpleName() + ");");
+ }
+ }
+ }
+ if (method.getAnnotation(CachedResult.class) != null)
+ printParameterCheck(writer, Utils.CACHED_BUFFER_NAME, null, null, true, null, false, false);
+ }
+
+ private static void printParameterCheck(PrintWriter writer, String name, String type, String check_value, boolean can_be_null, NullTerminated null_terminated, boolean indirect_buffer_allowed, boolean out_parameter) {
+ if (indirect_buffer_allowed && out_parameter) {
+ writer.println("\t\t" + type + " " + name + SAVED_PARAMETER_POSTFIX + " = " + name + ";");
+ }
+ if (can_be_null) {
+ writer.println("\t\tif (" + name + " != null)");
+ writer.print("\t");
+ }
+ if (indirect_buffer_allowed) {
+ writer.print("\t\t" + name + " = NondirectBufferWrapper.wrap");
+ if (out_parameter)
+ writer.print("NoCopy");
+ } else
+ writer.print("\t\tBufferChecks.check");
+ if (check_value != null && !"".equals(check_value) ) {
+ writer.print("Buffer(" + name + ", " + check_value);
+ } else {
+ writer.print("Direct(" + name);
+ }
+ writer.println(");");
+ if (null_terminated != null) {
+ writer.print("\t\tBufferChecks.checkNullTerminated(");
+ writer.print(name);
+ if ( null_terminated.value().length() > 0 ) {
+ writer.print(", ");
+ writer.print(null_terminated.value());
+ }
+ writer.println(");");
+ }
+ }
+
+ private static void printResultType(PrintWriter writer, MethodDeclaration method, boolean native_stub) {
+ if ( native_stub && method.getAnnotation(GLpointer.class) != null )
+ writer.print("long");
+ else if ( !native_stub && method.getAnnotation(GLreturn.class) != null )
+ writer.print(Utils.getMethodReturnType(method, method.getAnnotation(GLreturn.class), false));
+ else
+ writer.print(Utils.getMethodReturnType(method).toString());
+ }
+}
diff --git a/src/java/org/lwjgl/util/generator/JavaTypeTranslator.java b/src/java/org/lwjgl/util/generator/JavaTypeTranslator.java
index 9d11a72..13d7d92 100644
--- a/src/java/org/lwjgl/util/generator/JavaTypeTranslator.java
+++ b/src/java/org/lwjgl/util/generator/JavaTypeTranslator.java
@@ -1,125 +1,125 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-package org.lwjgl.util.generator;
-
-import com.sun.mirror.type.*;
-import com.sun.mirror.util.*;
-
-/**
- *
- * A TypeVisitor that translates (annotated) TypeMirrors to
- * java types (represented by a Class)
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3287 $
- * $Id: JavaTypeTranslator.java 3287 2010-03-14 23:24:40Z spasi $
- */
-public class JavaTypeTranslator implements TypeVisitor {
- private Class type;
-
- public Class getType() {
- return type;
- }
-
- public void visitAnnotationType(AnnotationType t) {
- throw new RuntimeException(t + " is not allowed");
- }
-
- public void visitArrayType(ArrayType t) {
- if ( "java.lang.CharSequence".equals(t.getComponentType().toString()) )
- type = CharSequence[].class;
- else
- throw new RuntimeException(t + " is not allowed");
- }
-
- public static Class getPrimitiveClassFromKind(PrimitiveType.Kind kind) {
- switch ( kind ) {
- case LONG:
- return long.class;
- case INT:
- return int.class;
- case DOUBLE:
- return double.class;
- case FLOAT:
- return float.class;
- case SHORT:
- return short.class;
- case BYTE:
- return byte.class;
- case BOOLEAN:
- return boolean.class;
- default:
- throw new RuntimeException(kind + " is not allowed");
- }
- }
-
- public void visitPrimitiveType(PrimitiveType t) {
- type = getPrimitiveClassFromKind(t.getKind());
- }
-
- public void visitDeclaredType(DeclaredType t) {
- throw new RuntimeException(t + " is not allowed");
- }
-
- public void visitEnumType(EnumType t) {
- throw new RuntimeException(t + " is not allowed");
- }
-
- public void visitClassType(ClassType t) {
- type = NativeTypeTranslator.getClassFromType(t);
- }
-
- public void visitInterfaceType(InterfaceType t) {
- type = NativeTypeTranslator.getClassFromType(t);
- }
-
- public void visitReferenceType(ReferenceType t) {
- throw new RuntimeException(t + " is not allowed");
- }
-
- public void visitTypeMirror(TypeMirror t) {
- throw new RuntimeException(t + " is not allowed");
- }
-
- public void visitTypeVariable(TypeVariable t) {
- throw new RuntimeException(t + " is not allowed");
- }
-
- public void visitVoidType(VoidType t) {
- type = void.class;
- }
-
- public void visitWildcardType(WildcardType t) {
- throw new RuntimeException(t + " is not allowed");
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+package org.lwjgl.util.generator;
+
+import com.sun.mirror.type.*;
+import com.sun.mirror.util.*;
+
+/**
+ *
+ * A TypeVisitor that translates (annotated) TypeMirrors to
+ * java types (represented by a Class)
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3287 $
+ * $Id: JavaTypeTranslator.java 3287 2010-03-14 23:24:40Z spasi $
+ */
+public class JavaTypeTranslator implements TypeVisitor {
+ private Class type;
+
+ public Class getType() {
+ return type;
+ }
+
+ public void visitAnnotationType(AnnotationType t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public void visitArrayType(ArrayType t) {
+ if ( "java.lang.CharSequence".equals(t.getComponentType().toString()) )
+ type = CharSequence[].class;
+ else
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public static Class getPrimitiveClassFromKind(PrimitiveType.Kind kind) {
+ switch ( kind ) {
+ case LONG:
+ return long.class;
+ case INT:
+ return int.class;
+ case DOUBLE:
+ return double.class;
+ case FLOAT:
+ return float.class;
+ case SHORT:
+ return short.class;
+ case BYTE:
+ return byte.class;
+ case BOOLEAN:
+ return boolean.class;
+ default:
+ throw new RuntimeException(kind + " is not allowed");
+ }
+ }
+
+ public void visitPrimitiveType(PrimitiveType t) {
+ type = getPrimitiveClassFromKind(t.getKind());
+ }
+
+ public void visitDeclaredType(DeclaredType t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public void visitEnumType(EnumType t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public void visitClassType(ClassType t) {
+ type = NativeTypeTranslator.getClassFromType(t);
+ }
+
+ public void visitInterfaceType(InterfaceType t) {
+ type = NativeTypeTranslator.getClassFromType(t);
+ }
+
+ public void visitReferenceType(ReferenceType t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public void visitTypeMirror(TypeMirror t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public void visitTypeVariable(TypeVariable t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public void visitVoidType(VoidType t) {
+ type = void.class;
+ }
+
+ public void visitWildcardType(WildcardType t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+}
diff --git a/src/java/org/lwjgl/util/generator/Mode.java b/src/java/org/lwjgl/util/generator/Mode.java
index ffb6aa9..bffb07c 100644
--- a/src/java/org/lwjgl/util/generator/Mode.java
+++ b/src/java/org/lwjgl/util/generator/Mode.java
@@ -1,39 +1,39 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-public enum Mode {
- BUFFEROBJECT,
- AUTOS,
- CACHEDRESULT, // Used for generating a CachedResult method with an explicit length argument.
- NORMAL
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+public enum Mode {
+ BUFFEROBJECT,
+ AUTOS,
+ CACHEDRESULT, // Used for generating a CachedResult method with an explicit length argument.
+ NORMAL
+}
diff --git a/src/java/org/lwjgl/util/generator/NativeMethodStubsGenerator.java b/src/java/org/lwjgl/util/generator/NativeMethodStubsGenerator.java
index 10aa467..493777d 100644
--- a/src/java/org/lwjgl/util/generator/NativeMethodStubsGenerator.java
+++ b/src/java/org/lwjgl/util/generator/NativeMethodStubsGenerator.java
@@ -1,314 +1,314 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-package org.lwjgl.util.generator;
-
-/**
- *
- * This class generates the functions in the native source files.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3289 $
- * $Id: NativeMethodStubsGenerator.java 3289 2010-03-16 19:05:19Z spasi $
- */
-
-import com.sun.mirror.apt.*;
-import com.sun.mirror.declaration.*;
-import com.sun.mirror.type.*;
-
-import java.io.*;
-import java.util.*;
-import java.nio.*;
-
-public class NativeMethodStubsGenerator {
- private static final String BUFFER_ADDRESS_POSTFIX = "_address";
- public static final String BUFFER_POSITION_POSTFIX = "_position";
- private static final String STRING_LIST_POSTFIX = "_str";
-
- public static void generateNativeMethodStubs(AnnotationProcessorEnvironment env, TypeMap type_map, PrintWriter writer, InterfaceDeclaration d, boolean generate_error_checks, boolean context_specific) {
- for (MethodDeclaration method : d.getMethods()) {
- Alternate alt_annotation = method.getAnnotation(Alternate.class);
- if ( alt_annotation != null && !alt_annotation.nativeAlt() )
- continue;
- generateMethodStub(env, type_map, writer, Utils.getQualifiedClassName(d), method, Mode.NORMAL, generate_error_checks, context_specific);
- if (Utils.hasMethodBufferObjectParameter(method))
- generateMethodStub(env, type_map, writer, Utils.getQualifiedClassName(d), method, Mode.BUFFEROBJECT, generate_error_checks, context_specific);
- }
- }
-
- private static void generateParameters(PrintWriter writer, Collection<ParameterDeclaration> params, Mode mode) {
- for (ParameterDeclaration param : params)
- if (param.getAnnotation(Result.class) == null)
- generateParameter(writer, param, mode);
- }
-
- private static void generateParameter(PrintWriter writer, ParameterDeclaration param, Mode mode) {
- writer.print(", ");
- if (mode == Mode.BUFFEROBJECT && param.getAnnotation(BufferObject.class) != null) {
- writer.print("jlong " + param.getSimpleName() + Utils.BUFFER_OBJECT_PARAMETER_POSTFIX);
- } else if ( param.getAnnotation(GLpointer.class) != null ) {
- writer.print("jlong " + param.getSimpleName());
- } else {
- JNITypeTranslator translator = new JNITypeTranslator();
- param.getType().accept(translator);
- writer.print(translator.getSignature() + " " + param.getSimpleName());
- if (Utils.getNIOBufferType(param.getType()) != null)
- writer.print(", jint " + param.getSimpleName() + BUFFER_POSITION_POSTFIX);
- }
- }
-
- private static void generateMethodStub(AnnotationProcessorEnvironment env, TypeMap type_map, PrintWriter writer, String interface_name, MethodDeclaration method, Mode mode, boolean generate_error_checks, boolean context_specific) {
- if ( !context_specific && method.getAnnotation(Alternate.class) == null )
- writer.print("static ");
- else
- writer.print("JNIEXPORT ");
-
- TypeMirror result_type = Utils.getMethodReturnType(method);
-
- if ( method.getAnnotation(GLpointer.class) != null ) {
- writer.print("jlong");
- } else {
- JNITypeTranslator translator = new JNITypeTranslator();
- result_type.accept(translator);
- writer.print(translator.getSignature());
- }
- writer.print(" JNICALL ");
-
- writer.print(Utils.getQualifiedNativeMethodName(interface_name, method, generate_error_checks, context_specific));
- if (mode == Mode.BUFFEROBJECT)
- writer.print(Utils.BUFFER_OBJECT_METHOD_POSTFIX);
- writer.print("(JNIEnv *env, jclass clazz");
- generateParameters(writer, method.getParameters(), mode);
- if (Utils.getNIOBufferType(result_type) != null) {
- CachedResult cached_result_annotation = method.getAnnotation(CachedResult.class);
- if (cached_result_annotation == null || !cached_result_annotation.isRange())
- writer.print(", jlong " + Utils.RESULT_SIZE_NAME);
- if (cached_result_annotation != null)
- writer.print(", jobject " + Utils.CACHED_BUFFER_NAME);
- }
- if (context_specific) {
- writer.print(", jlong " + Utils.FUNCTION_POINTER_VAR_NAME);
- }
- writer.println(") {");
- generateBufferParameterAddresses(type_map, writer, method, mode);
- Alternate alt_annotation = method.getAnnotation(Alternate.class);
- if (context_specific) {
- String typedef_name = Utils.getTypedefName(method);
- writer.print("\t" + typedef_name + " " + (alt_annotation == null ? method.getSimpleName() : alt_annotation.value()));
- writer.print(" = (" + typedef_name + ")((intptr_t)");
- writer.println(Utils.FUNCTION_POINTER_VAR_NAME + ");");
- }
- generateStringListInits(writer, method.getParameters());
- writer.print("\t");
- if (!result_type.equals(env.getTypeUtils().getVoidType())) {
- Declaration return_declaration;
- ParameterDeclaration result_param = Utils.getResultParameter(method);
- if (result_param != null)
- return_declaration = result_param;
- else
- return_declaration = method;
- NativeTypeTranslator native_translator = new NativeTypeTranslator(type_map, return_declaration);
- result_type.accept(native_translator);
- writer.print(native_translator.getSignature() + " " + Utils.RESULT_VAR_NAME);
- if (result_param != null) {
- writer.println(";");
- writer.print("\t");
- } else
- writer.print(" = ");
- }
- writer.print((alt_annotation == null ? method.getSimpleName() : alt_annotation.value()) + "(");
- generateCallParameters(writer, type_map, method.getParameters());
- writer.print(")");
- writer.println(";");
- generateStringDeallocations(writer, method.getParameters());
- if (!result_type.equals(env.getTypeUtils().getVoidType())) {
- writer.print("\treturn ");
- Class java_result_type = Utils.getJavaType(result_type);
- if (Buffer.class.isAssignableFrom(java_result_type)) {
- if (method.getAnnotation(CachedResult.class) != null)
- writer.print("safeNewBufferCached(env, ");
- else
- writer.print("safeNewBuffer(env, ");
- } else if (String.class.equals(java_result_type)) {
- writer.print("NewStringNativeUnsigned(env, ");
- } else if ( method.getAnnotation(GLpointer.class) != null ) {
- writer.print("(intptr_t)");
- }
- writer.print(Utils.RESULT_VAR_NAME);
- if (Buffer.class.isAssignableFrom(java_result_type)) {
- writer.print(", ");
- if (method.getAnnotation(CachedResult.class) != null && method.getAnnotation(CachedResult.class).isRange())
- Utils.printExtraCallArguments(writer, method, method.getAnnotation(AutoResultSize.class).value());
- else
- Utils.printExtraCallArguments(writer, method, Utils.RESULT_SIZE_NAME);
- }
- if (Buffer.class.isAssignableFrom(java_result_type) ||
- String.class.equals(java_result_type))
- writer.print(")");
- writer.println(";");
- }
- writer.println("}");
- writer.println();
- }
-
- private static void generateCallParameters(PrintWriter writer, TypeMap type_map, Collection<ParameterDeclaration> params) {
- if (params.size() > 0) {
- Iterator<ParameterDeclaration> it = params.iterator();
- generateCallParameter(writer, type_map, it.next());
- while (it.hasNext()) {
- writer.print(", ");
- generateCallParameter(writer, type_map, it.next());
- }
- }
- }
-
- private static void generateCallParameter(PrintWriter writer, TypeMap type_map, ParameterDeclaration param) {
- boolean is_indirect = param.getAnnotation(Indirect.class) != null;
- if (is_indirect || param.getAnnotation(StringList.class) != null) {
- writer.print("(");
- NativeTypeTranslator translator = new NativeTypeTranslator(type_map, param);
- param.getType().accept(translator);
- writer.print(translator.getSignature());
- writer.print("*)");
- }
- if ( param.getAnnotation(GLpointer.class) != null )
- writer.print("(" + param.getAnnotation(GLpointer.class).value() + ")(intptr_t)");
- if (param.getAnnotation(Result.class) != null || is_indirect)
- writer.print("&");
- if (param.getAnnotation(Result.class) != null) {
- writer.print(Utils.RESULT_VAR_NAME);
- } else {
- writer.print(param.getSimpleName());
- if ( param.getAnnotation(StringList.class) != null )
- writer.print(STRING_LIST_POSTFIX);
- else if (Utils.isAddressableType(param.getType()))
- writer.print(BUFFER_ADDRESS_POSTFIX);
- }
- }
-
- private static void generateStringDeallocations(PrintWriter writer, Collection<ParameterDeclaration> params) {
- for (ParameterDeclaration param : params) {
- if (Utils.getJavaType(param.getType()).equals(String.class) &&
- param.getAnnotation(Result.class) == null)
- writer.println("\tfree(" + param.getSimpleName() + BUFFER_ADDRESS_POSTFIX + ");");
- else if (param.getAnnotation(StringList.class) != null ) // Free the string array mem
- writer.println("\tfree(" + param.getSimpleName() + STRING_LIST_POSTFIX + ");");
- }
- }
-
- private static void generateBufferParameterAddresses(TypeMap type_map, PrintWriter writer, MethodDeclaration method, Mode mode) {
- boolean loopDeclared = false;
- for (ParameterDeclaration param : method.getParameters())
- if (Utils.isAddressableType(param.getType()) && param.getAnnotation(Result.class) == null)
- loopDeclared = generateBufferParameterAddress(type_map, writer, method, param, mode, loopDeclared);
- }
-
- private static boolean generateBufferParameterAddress(TypeMap type_map, PrintWriter writer, MethodDeclaration method, ParameterDeclaration param, Mode mode, boolean loopDeclared) {
- NativeTypeTranslator translator = new NativeTypeTranslator(type_map, param);
- param.getType().accept(translator);
- writer.print("\t" + translator.getSignature() + param.getSimpleName());
- writer.print(BUFFER_ADDRESS_POSTFIX + " = ((");
- writer.print(translator.getSignature());
- Check check_annotation = param.getAnnotation(Check.class);
- writer.print(")");
- if (mode == Mode.BUFFEROBJECT && param.getAnnotation(BufferObject.class) != null) {
- writer.print("offsetToPointer(" + param.getSimpleName() + Utils.BUFFER_OBJECT_PARAMETER_POSTFIX + "))");
- } else {
- Class java_type = Utils.getJavaType(param.getType());
- if (Buffer.class.isAssignableFrom(java_type) || java_type.equals(CharSequence.class) || java_type.equals(CharSequence[].class)) {
- boolean explicitly_byte_sized = java_type.equals(Buffer.class) ||
- translator.getAnnotationType().equals(type_map.getVoidType());
- if (explicitly_byte_sized)
- writer.print("(((char *)");
- if (method.getAnnotation(GenerateAutos.class) != null || (check_annotation != null && check_annotation.canBeNull())) {
- writer.print("safeGetBufferAddress(env, " + param.getSimpleName());
- } else {
- writer.print("(*env)->GetDirectBufferAddress(env, " + param.getSimpleName());
- }
- writer.print("))");
- writer.print(" + " + param.getSimpleName() + BUFFER_POSITION_POSTFIX);
- if (explicitly_byte_sized)
- writer.print("))");
- } else if (java_type.equals(String.class)) {
- writer.print("GetStringNativeChars(env, " + param.getSimpleName() + "))");
- } else
- throw new RuntimeException("Illegal type " + java_type);
- }
- writer.println(";");
-
- if ( param.getAnnotation(StringList.class) != null ) {
- if ( Utils.getJavaType(param.getType()) != CharSequence[].class && (
- param.getAnnotation(GLchar.class) == null ||
- param.getAnnotation(NullTerminated.class) == null ||
- param.getAnnotation(NullTerminated.class).value().length() == 0
- )
- )
- throw new RuntimeException("StringList annotation can only be applied on null-terminated GLchar buffers.");
-
- if ( "_str".equals(param.getSimpleName()) )
- throw new RuntimeException("The name '_str' is not valid for arguments annotated with StringList");
-
- // Declare loop counters and allocate string array
- if ( !loopDeclared ) {
- writer.println("\tunsigned int _str_i;");
- writer.println("\tGLchar *_str_address;");
- loopDeclared = true;
- }
- writer.println("\tGLchar **" + param.getSimpleName() + STRING_LIST_POSTFIX + " = (GLchar **) malloc(" + param.getAnnotation(StringList.class).value() + "*sizeof(GLchar*));");
- }
- return loopDeclared;
- }
-
- private static void generateStringListInits(PrintWriter writer, Collection<ParameterDeclaration> params) {
- for ( ParameterDeclaration param : params ) {
- StringList stringList_annotation = param.getAnnotation(StringList.class);
- if ( stringList_annotation != null ) {
- String lengths = stringList_annotation.lengths();
-
- // Init vars
- writer.println("\t_str_i = 0;");
- writer.println("\t_str_address = (GLchar *)" + param.getSimpleName() + BUFFER_ADDRESS_POSTFIX + ";");
- // Fill string array with the string pointers
- writer.println("\twhile ( _str_i < " + stringList_annotation.value() + " ) {");
- if ( lengths.length() == 0 ) {
- writer.println("\t\t" + param.getSimpleName() + STRING_LIST_POSTFIX + "[_str_i++] = _str_address;");
- writer.println("\t\t_str_address += strlen(_str_address) + 1;");
- } else {
- writer.println("\t\t" + param.getSimpleName() + STRING_LIST_POSTFIX + "[_str_i] = _str_address;");
- writer.println("\t\t_str_address += " + lengths + BUFFER_ADDRESS_POSTFIX + "[_str_i++];");
- }
- writer.println("\t}");
- }
- }
- }
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * This class generates the functions in the native source files.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3289 $
+ * $Id: NativeMethodStubsGenerator.java 3289 2010-03-16 19:05:19Z spasi $
+ */
+
+import com.sun.mirror.apt.*;
+import com.sun.mirror.declaration.*;
+import com.sun.mirror.type.*;
+
+import java.io.*;
+import java.util.*;
+import java.nio.*;
+
+public class NativeMethodStubsGenerator {
+ private static final String BUFFER_ADDRESS_POSTFIX = "_address";
+ public static final String BUFFER_POSITION_POSTFIX = "_position";
+ private static final String STRING_LIST_POSTFIX = "_str";
+
+ public static void generateNativeMethodStubs(AnnotationProcessorEnvironment env, TypeMap type_map, PrintWriter writer, InterfaceDeclaration d, boolean generate_error_checks, boolean context_specific) {
+ for (MethodDeclaration method : d.getMethods()) {
+ Alternate alt_annotation = method.getAnnotation(Alternate.class);
+ if ( alt_annotation != null && !alt_annotation.nativeAlt() )
+ continue;
+ generateMethodStub(env, type_map, writer, Utils.getQualifiedClassName(d), method, Mode.NORMAL, generate_error_checks, context_specific);
+ if (Utils.hasMethodBufferObjectParameter(method))
+ generateMethodStub(env, type_map, writer, Utils.getQualifiedClassName(d), method, Mode.BUFFEROBJECT, generate_error_checks, context_specific);
+ }
+ }
+
+ private static void generateParameters(PrintWriter writer, Collection<ParameterDeclaration> params, Mode mode) {
+ for (ParameterDeclaration param : params)
+ if (param.getAnnotation(Result.class) == null)
+ generateParameter(writer, param, mode);
+ }
+
+ private static void generateParameter(PrintWriter writer, ParameterDeclaration param, Mode mode) {
+ writer.print(", ");
+ if (mode == Mode.BUFFEROBJECT && param.getAnnotation(BufferObject.class) != null) {
+ writer.print("jlong " + param.getSimpleName() + Utils.BUFFER_OBJECT_PARAMETER_POSTFIX);
+ } else if ( param.getAnnotation(GLpointer.class) != null ) {
+ writer.print("jlong " + param.getSimpleName());
+ } else {
+ JNITypeTranslator translator = new JNITypeTranslator();
+ param.getType().accept(translator);
+ writer.print(translator.getSignature() + " " + param.getSimpleName());
+ if (Utils.getNIOBufferType(param.getType()) != null)
+ writer.print(", jint " + param.getSimpleName() + BUFFER_POSITION_POSTFIX);
+ }
+ }
+
+ private static void generateMethodStub(AnnotationProcessorEnvironment env, TypeMap type_map, PrintWriter writer, String interface_name, MethodDeclaration method, Mode mode, boolean generate_error_checks, boolean context_specific) {
+ if ( !context_specific && method.getAnnotation(Alternate.class) == null )
+ writer.print("static ");
+ else
+ writer.print("JNIEXPORT ");
+
+ TypeMirror result_type = Utils.getMethodReturnType(method);
+
+ if ( method.getAnnotation(GLpointer.class) != null ) {
+ writer.print("jlong");
+ } else {
+ JNITypeTranslator translator = new JNITypeTranslator();
+ result_type.accept(translator);
+ writer.print(translator.getSignature());
+ }
+ writer.print(" JNICALL ");
+
+ writer.print(Utils.getQualifiedNativeMethodName(interface_name, method, generate_error_checks, context_specific));
+ if (mode == Mode.BUFFEROBJECT)
+ writer.print(Utils.BUFFER_OBJECT_METHOD_POSTFIX);
+ writer.print("(JNIEnv *env, jclass clazz");
+ generateParameters(writer, method.getParameters(), mode);
+ if (Utils.getNIOBufferType(result_type) != null) {
+ CachedResult cached_result_annotation = method.getAnnotation(CachedResult.class);
+ if (cached_result_annotation == null || !cached_result_annotation.isRange())
+ writer.print(", jlong " + Utils.RESULT_SIZE_NAME);
+ if (cached_result_annotation != null)
+ writer.print(", jobject " + Utils.CACHED_BUFFER_NAME);
+ }
+ if (context_specific) {
+ writer.print(", jlong " + Utils.FUNCTION_POINTER_VAR_NAME);
+ }
+ writer.println(") {");
+ generateBufferParameterAddresses(type_map, writer, method, mode);
+ Alternate alt_annotation = method.getAnnotation(Alternate.class);
+ if (context_specific) {
+ String typedef_name = Utils.getTypedefName(method);
+ writer.print("\t" + typedef_name + " " + (alt_annotation == null ? method.getSimpleName() : alt_annotation.value()));
+ writer.print(" = (" + typedef_name + ")((intptr_t)");
+ writer.println(Utils.FUNCTION_POINTER_VAR_NAME + ");");
+ }
+ generateStringListInits(writer, method.getParameters());
+ writer.print("\t");
+ if (!result_type.equals(env.getTypeUtils().getVoidType())) {
+ Declaration return_declaration;
+ ParameterDeclaration result_param = Utils.getResultParameter(method);
+ if (result_param != null)
+ return_declaration = result_param;
+ else
+ return_declaration = method;
+ NativeTypeTranslator native_translator = new NativeTypeTranslator(type_map, return_declaration);
+ result_type.accept(native_translator);
+ writer.print(native_translator.getSignature() + " " + Utils.RESULT_VAR_NAME);
+ if (result_param != null) {
+ writer.println(";");
+ writer.print("\t");
+ } else
+ writer.print(" = ");
+ }
+ writer.print((alt_annotation == null ? method.getSimpleName() : alt_annotation.value()) + "(");
+ generateCallParameters(writer, type_map, method.getParameters());
+ writer.print(")");
+ writer.println(";");
+ generateStringDeallocations(writer, method.getParameters());
+ if (!result_type.equals(env.getTypeUtils().getVoidType())) {
+ writer.print("\treturn ");
+ Class java_result_type = Utils.getJavaType(result_type);
+ if (Buffer.class.isAssignableFrom(java_result_type)) {
+ if (method.getAnnotation(CachedResult.class) != null)
+ writer.print("safeNewBufferCached(env, ");
+ else
+ writer.print("safeNewBuffer(env, ");
+ } else if (String.class.equals(java_result_type)) {
+ writer.print("NewStringNativeUnsigned(env, ");
+ } else if ( method.getAnnotation(GLpointer.class) != null ) {
+ writer.print("(intptr_t)");
+ }
+ writer.print(Utils.RESULT_VAR_NAME);
+ if (Buffer.class.isAssignableFrom(java_result_type)) {
+ writer.print(", ");
+ if (method.getAnnotation(CachedResult.class) != null && method.getAnnotation(CachedResult.class).isRange())
+ Utils.printExtraCallArguments(writer, method, method.getAnnotation(AutoResultSize.class).value());
+ else
+ Utils.printExtraCallArguments(writer, method, Utils.RESULT_SIZE_NAME);
+ }
+ if (Buffer.class.isAssignableFrom(java_result_type) ||
+ String.class.equals(java_result_type))
+ writer.print(")");
+ writer.println(";");
+ }
+ writer.println("}");
+ writer.println();
+ }
+
+ private static void generateCallParameters(PrintWriter writer, TypeMap type_map, Collection<ParameterDeclaration> params) {
+ if (params.size() > 0) {
+ Iterator<ParameterDeclaration> it = params.iterator();
+ generateCallParameter(writer, type_map, it.next());
+ while (it.hasNext()) {
+ writer.print(", ");
+ generateCallParameter(writer, type_map, it.next());
+ }
+ }
+ }
+
+ private static void generateCallParameter(PrintWriter writer, TypeMap type_map, ParameterDeclaration param) {
+ boolean is_indirect = param.getAnnotation(Indirect.class) != null;
+ if (is_indirect || param.getAnnotation(StringList.class) != null) {
+ writer.print("(");
+ NativeTypeTranslator translator = new NativeTypeTranslator(type_map, param);
+ param.getType().accept(translator);
+ writer.print(translator.getSignature());
+ writer.print("*)");
+ }
+ if ( param.getAnnotation(GLpointer.class) != null )
+ writer.print("(" + param.getAnnotation(GLpointer.class).value() + ")(intptr_t)");
+ if (param.getAnnotation(Result.class) != null || is_indirect)
+ writer.print("&");
+ if (param.getAnnotation(Result.class) != null) {
+ writer.print(Utils.RESULT_VAR_NAME);
+ } else {
+ writer.print(param.getSimpleName());
+ if ( param.getAnnotation(StringList.class) != null )
+ writer.print(STRING_LIST_POSTFIX);
+ else if (Utils.isAddressableType(param.getType()))
+ writer.print(BUFFER_ADDRESS_POSTFIX);
+ }
+ }
+
+ private static void generateStringDeallocations(PrintWriter writer, Collection<ParameterDeclaration> params) {
+ for (ParameterDeclaration param : params) {
+ if (Utils.getJavaType(param.getType()).equals(String.class) &&
+ param.getAnnotation(Result.class) == null)
+ writer.println("\tfree(" + param.getSimpleName() + BUFFER_ADDRESS_POSTFIX + ");");
+ else if (param.getAnnotation(StringList.class) != null ) // Free the string array mem
+ writer.println("\tfree(" + param.getSimpleName() + STRING_LIST_POSTFIX + ");");
+ }
+ }
+
+ private static void generateBufferParameterAddresses(TypeMap type_map, PrintWriter writer, MethodDeclaration method, Mode mode) {
+ boolean loopDeclared = false;
+ for (ParameterDeclaration param : method.getParameters())
+ if (Utils.isAddressableType(param.getType()) && param.getAnnotation(Result.class) == null)
+ loopDeclared = generateBufferParameterAddress(type_map, writer, method, param, mode, loopDeclared);
+ }
+
+ private static boolean generateBufferParameterAddress(TypeMap type_map, PrintWriter writer, MethodDeclaration method, ParameterDeclaration param, Mode mode, boolean loopDeclared) {
+ NativeTypeTranslator translator = new NativeTypeTranslator(type_map, param);
+ param.getType().accept(translator);
+ writer.print("\t" + translator.getSignature() + param.getSimpleName());
+ writer.print(BUFFER_ADDRESS_POSTFIX + " = ((");
+ writer.print(translator.getSignature());
+ Check check_annotation = param.getAnnotation(Check.class);
+ writer.print(")");
+ if (mode == Mode.BUFFEROBJECT && param.getAnnotation(BufferObject.class) != null) {
+ writer.print("offsetToPointer(" + param.getSimpleName() + Utils.BUFFER_OBJECT_PARAMETER_POSTFIX + "))");
+ } else {
+ Class java_type = Utils.getJavaType(param.getType());
+ if (Buffer.class.isAssignableFrom(java_type) || java_type.equals(CharSequence.class) || java_type.equals(CharSequence[].class)) {
+ boolean explicitly_byte_sized = java_type.equals(Buffer.class) ||
+ translator.getAnnotationType().equals(type_map.getVoidType());
+ if (explicitly_byte_sized)
+ writer.print("(((char *)");
+ if (method.getAnnotation(GenerateAutos.class) != null || (check_annotation != null && check_annotation.canBeNull())) {
+ writer.print("safeGetBufferAddress(env, " + param.getSimpleName());
+ } else {
+ writer.print("(*env)->GetDirectBufferAddress(env, " + param.getSimpleName());
+ }
+ writer.print("))");
+ writer.print(" + " + param.getSimpleName() + BUFFER_POSITION_POSTFIX);
+ if (explicitly_byte_sized)
+ writer.print("))");
+ } else if (java_type.equals(String.class)) {
+ writer.print("GetStringNativeChars(env, " + param.getSimpleName() + "))");
+ } else
+ throw new RuntimeException("Illegal type " + java_type);
+ }
+ writer.println(";");
+
+ if ( param.getAnnotation(StringList.class) != null ) {
+ if ( Utils.getJavaType(param.getType()) != CharSequence[].class && (
+ param.getAnnotation(GLchar.class) == null ||
+ param.getAnnotation(NullTerminated.class) == null ||
+ param.getAnnotation(NullTerminated.class).value().length() == 0
+ )
+ )
+ throw new RuntimeException("StringList annotation can only be applied on null-terminated GLchar buffers.");
+
+ if ( "_str".equals(param.getSimpleName()) )
+ throw new RuntimeException("The name '_str' is not valid for arguments annotated with StringList");
+
+ // Declare loop counters and allocate string array
+ if ( !loopDeclared ) {
+ writer.println("\tunsigned int _str_i;");
+ writer.println("\tGLchar *_str_address;");
+ loopDeclared = true;
+ }
+ writer.println("\tGLchar **" + param.getSimpleName() + STRING_LIST_POSTFIX + " = (GLchar **) malloc(" + param.getAnnotation(StringList.class).value() + "*sizeof(GLchar*));");
+ }
+ return loopDeclared;
+ }
+
+ private static void generateStringListInits(PrintWriter writer, Collection<ParameterDeclaration> params) {
+ for ( ParameterDeclaration param : params ) {
+ StringList stringList_annotation = param.getAnnotation(StringList.class);
+ if ( stringList_annotation != null ) {
+ String lengths = stringList_annotation.lengths();
+
+ // Init vars
+ writer.println("\t_str_i = 0;");
+ writer.println("\t_str_address = (GLchar *)" + param.getSimpleName() + BUFFER_ADDRESS_POSTFIX + ";");
+ // Fill string array with the string pointers
+ writer.println("\twhile ( _str_i < " + stringList_annotation.value() + " ) {");
+ if ( lengths.length() == 0 ) {
+ writer.println("\t\t" + param.getSimpleName() + STRING_LIST_POSTFIX + "[_str_i++] = _str_address;");
+ writer.println("\t\t_str_address += strlen(_str_address) + 1;");
+ } else {
+ writer.println("\t\t" + param.getSimpleName() + STRING_LIST_POSTFIX + "[_str_i] = _str_address;");
+ writer.println("\t\t_str_address += " + lengths + BUFFER_ADDRESS_POSTFIX + "[_str_i++];");
+ }
+ writer.println("\t}");
+ }
+ }
+ }
+
+}
diff --git a/src/java/org/lwjgl/util/generator/NativeType.java b/src/java/org/lwjgl/util/generator/NativeType.java
index f9a8207..5713638 100644
--- a/src/java/org/lwjgl/util/generator/NativeType.java
+++ b/src/java/org/lwjgl/util/generator/NativeType.java
@@ -1,49 +1,49 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * This annotation indicates that another annotation is
- * a native type.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: NativeType.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at Target(ElementType.ANNOTATION_TYPE)
-public @interface NativeType {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * This annotation indicates that another annotation is
+ * a native type.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: NativeType.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at Target(ElementType.ANNOTATION_TYPE)
+public @interface NativeType {
+}
diff --git a/src/java/org/lwjgl/util/generator/NativeTypeTranslator.java b/src/java/org/lwjgl/util/generator/NativeTypeTranslator.java
index 941cfb4..62d3ca0 100644
--- a/src/java/org/lwjgl/util/generator/NativeTypeTranslator.java
+++ b/src/java/org/lwjgl/util/generator/NativeTypeTranslator.java
@@ -1,229 +1,229 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-package org.lwjgl.util.generator;
-
-/**
- *
- * A TypeVisitor that translates types (and optional native type
- * annotations) to the native type string.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3281 $
- * $Id: NativeTypeTranslator.java 3281 2010-03-12 21:55:13Z spasi $
- */
-
-import org.lwjgl.opengl.PointerWrapper;
-
-import com.sun.mirror.declaration.*;
-import com.sun.mirror.type.*;
-import com.sun.mirror.util.*;
-
-import java.util.Collection;
-import java.util.ArrayList;
-
-import java.nio.*;
-
-import java.lang.annotation.Annotation;
-
-/**
- * $Id: NativeTypeTranslator.java 3281 2010-03-12 21:55:13Z spasi $
- *
- * A TypeVisitor that translates (annotated) TypeMirrors to
- * native types
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3281 $
- */
-public class NativeTypeTranslator implements TypeVisitor {
- private Collection<Class> native_types;
- private boolean is_indirect;
- private final Declaration declaration;
- private final TypeMap type_map;
-
- public NativeTypeTranslator(TypeMap type_map, Declaration declaration) {
- this.declaration = declaration;
- this.type_map = type_map;
- }
-
- public String getSignature() {
- StringBuilder signature = new StringBuilder();
- if (declaration.getAnnotation(Const.class) != null)
- signature.append("const ");
-
- if ( declaration.getAnnotation(GLpointer.class) != null ) {
- signature.append(declaration.getAnnotation(GLpointer.class).value());
- } else {
- // Use the name of the native type annotation as the C type name
- signature.append(getAnnotationType().getSimpleName());
- }
-
- if (is_indirect)
- signature.append(" *");
- return signature.toString();
- }
-
- public Class getAnnotationType() {
- if (native_types.size() != 1)
- throw new RuntimeException("Expected only one native type for declaration " + declaration +
- ", but got " + native_types.size());
- return native_types.iterator().next();
- }
-
- public void visitAnnotationType(AnnotationType t) {
- throw new RuntimeException(t + " is not allowed");
- }
-
- public void visitArrayType(ArrayType t) {
- if ( "java.lang.CharSequence".equals(t.getComponentType().toString()) ) {
- is_indirect = true;
- native_types = new ArrayList<Class>();
- native_types.add(GLchar.class);
- } else
- throw new RuntimeException(t + " is not allowed");
- }
-
- public static PrimitiveType.Kind getPrimitiveKindFromBufferClass(Class c) {
- if (IntBuffer.class.equals(c))
- return PrimitiveType.Kind.INT;
- else if (DoubleBuffer.class.equals(c))
- return PrimitiveType.Kind.DOUBLE;
- else if (ShortBuffer.class.equals(c))
- return PrimitiveType.Kind.SHORT;
- else if (ByteBuffer.class.equals(c))
- return PrimitiveType.Kind.BYTE;
- else if (FloatBuffer.class.equals(c))
- return PrimitiveType.Kind.FLOAT;
- else if (LongBuffer.class.equals(c))
- return PrimitiveType.Kind.LONG;
- else
- throw new RuntimeException(c + " is not allowed");
- }
-
- public static Class<?> getClassFromType(DeclaredType t) {
- try {
- return Class.forName(t.getDeclaration().getQualifiedName());
- } catch (ClassNotFoundException e) {
- throw new RuntimeException(e);
- }
- }
-
- private void getNativeTypeFromAnnotatedPrimitiveType(PrimitiveType.Kind kind) {
- native_types = translateAnnotations();
- if (native_types.size() == 0)
- native_types.add(type_map.getNativeTypeFromPrimitiveType(kind));
- }
-
- public void visitClassType(ClassType t) {
- is_indirect = true;
-
- Class<?> c = getClassFromType(t);
- if (String.class.equals(c)) {
- native_types = new ArrayList<Class>();
- native_types.add(type_map.getStringElementType());
- } else if (Buffer.class.equals(c)) {
- native_types = new ArrayList<Class>();
- native_types.add(type_map.getVoidType());
- } else if (Buffer.class.isAssignableFrom(c)) {
- PrimitiveType.Kind kind = getPrimitiveKindFromBufferClass(c);
- getNativeTypeFromAnnotatedPrimitiveType(kind);
- } else if ( PointerWrapper.class.isAssignableFrom(c) ) {
- native_types = new ArrayList<Class>();
- native_types.add(GLpointer.class);
-
- is_indirect = false;
- } else
- throw new RuntimeException(t + " is not allowed");
- }
-
- public void visitPrimitiveType(PrimitiveType t) {
- getNativeTypeFromAnnotatedPrimitiveType(t.getKind());
- }
-
- public void visitDeclaredType(DeclaredType t) {
- throw new RuntimeException(t + " is not allowed");
- }
-
- public void visitEnumType(EnumType t) {
- throw new RuntimeException(t + " is not allowed");
- }
-
- public void visitInterfaceType(InterfaceType t) {
- throw new RuntimeException(t + " is not allowed");
- }
-
- // Check if the annotation is itself annotated with a certain annotation type
- public static <T extends Annotation> T getAnnotation(AnnotationMirror annotation, Class<T> type) {
- return annotation.getAnnotationType().getDeclaration().getAnnotation(type);
- }
-
- private static Class translateAnnotation(AnnotationMirror annotation) {
- NativeType native_type = getAnnotation(annotation, NativeType.class);
- if (native_type != null) {
- return getClassFromType(annotation.getAnnotationType());
- } else
- return null;
- }
-
- private Collection<Class> translateAnnotations() {
- Collection<Class> result = new ArrayList<Class>();
- for (AnnotationMirror annotation : Utils.getSortedAnnotations(declaration.getAnnotationMirrors())) {
- Class translated_result = translateAnnotation(annotation);
- if (translated_result != null) {
- result.add(translated_result);
- }
- }
- return result;
- }
-
- public void visitReferenceType(ReferenceType t) {
- throw new RuntimeException(t + " is not allowed");
- }
-
- public void visitTypeMirror(TypeMirror t) {
- throw new RuntimeException(t + " is not allowed");
- }
-
- public void visitTypeVariable(TypeVariable t) {
- throw new RuntimeException(t + " is not allowed");
- }
-
- public void visitVoidType(VoidType t) {
- native_types = translateAnnotations();
- if (native_types.size() == 0)
- native_types.add(void.class);
- }
-
- public void visitWildcardType(WildcardType t) {
- throw new RuntimeException(t + " is not allowed");
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * A TypeVisitor that translates types (and optional native type
+ * annotations) to the native type string.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3281 $
+ * $Id: NativeTypeTranslator.java 3281 2010-03-12 21:55:13Z spasi $
+ */
+
+import org.lwjgl.opengl.PointerWrapper;
+
+import com.sun.mirror.declaration.*;
+import com.sun.mirror.type.*;
+import com.sun.mirror.util.*;
+
+import java.util.Collection;
+import java.util.ArrayList;
+
+import java.nio.*;
+
+import java.lang.annotation.Annotation;
+
+/**
+ * $Id: NativeTypeTranslator.java 3281 2010-03-12 21:55:13Z spasi $
+ *
+ * A TypeVisitor that translates (annotated) TypeMirrors to
+ * native types
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3281 $
+ */
+public class NativeTypeTranslator implements TypeVisitor {
+ private Collection<Class> native_types;
+ private boolean is_indirect;
+ private final Declaration declaration;
+ private final TypeMap type_map;
+
+ public NativeTypeTranslator(TypeMap type_map, Declaration declaration) {
+ this.declaration = declaration;
+ this.type_map = type_map;
+ }
+
+ public String getSignature() {
+ StringBuilder signature = new StringBuilder();
+ if (declaration.getAnnotation(Const.class) != null)
+ signature.append("const ");
+
+ if ( declaration.getAnnotation(GLpointer.class) != null ) {
+ signature.append(declaration.getAnnotation(GLpointer.class).value());
+ } else {
+ // Use the name of the native type annotation as the C type name
+ signature.append(getAnnotationType().getSimpleName());
+ }
+
+ if (is_indirect)
+ signature.append(" *");
+ return signature.toString();
+ }
+
+ public Class getAnnotationType() {
+ if (native_types.size() != 1)
+ throw new RuntimeException("Expected only one native type for declaration " + declaration +
+ ", but got " + native_types.size());
+ return native_types.iterator().next();
+ }
+
+ public void visitAnnotationType(AnnotationType t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public void visitArrayType(ArrayType t) {
+ if ( "java.lang.CharSequence".equals(t.getComponentType().toString()) ) {
+ is_indirect = true;
+ native_types = new ArrayList<Class>();
+ native_types.add(GLchar.class);
+ } else
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public static PrimitiveType.Kind getPrimitiveKindFromBufferClass(Class c) {
+ if (IntBuffer.class.equals(c))
+ return PrimitiveType.Kind.INT;
+ else if (DoubleBuffer.class.equals(c))
+ return PrimitiveType.Kind.DOUBLE;
+ else if (ShortBuffer.class.equals(c))
+ return PrimitiveType.Kind.SHORT;
+ else if (ByteBuffer.class.equals(c))
+ return PrimitiveType.Kind.BYTE;
+ else if (FloatBuffer.class.equals(c))
+ return PrimitiveType.Kind.FLOAT;
+ else if (LongBuffer.class.equals(c))
+ return PrimitiveType.Kind.LONG;
+ else
+ throw new RuntimeException(c + " is not allowed");
+ }
+
+ public static Class<?> getClassFromType(DeclaredType t) {
+ try {
+ return Class.forName(t.getDeclaration().getQualifiedName());
+ } catch (ClassNotFoundException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private void getNativeTypeFromAnnotatedPrimitiveType(PrimitiveType.Kind kind) {
+ native_types = translateAnnotations();
+ if (native_types.size() == 0)
+ native_types.add(type_map.getNativeTypeFromPrimitiveType(kind));
+ }
+
+ public void visitClassType(ClassType t) {
+ is_indirect = true;
+
+ Class<?> c = getClassFromType(t);
+ if (String.class.equals(c)) {
+ native_types = new ArrayList<Class>();
+ native_types.add(type_map.getStringElementType());
+ } else if (Buffer.class.equals(c)) {
+ native_types = new ArrayList<Class>();
+ native_types.add(type_map.getVoidType());
+ } else if (Buffer.class.isAssignableFrom(c)) {
+ PrimitiveType.Kind kind = getPrimitiveKindFromBufferClass(c);
+ getNativeTypeFromAnnotatedPrimitiveType(kind);
+ } else if ( PointerWrapper.class.isAssignableFrom(c) ) {
+ native_types = new ArrayList<Class>();
+ native_types.add(GLpointer.class);
+
+ is_indirect = false;
+ } else
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public void visitPrimitiveType(PrimitiveType t) {
+ getNativeTypeFromAnnotatedPrimitiveType(t.getKind());
+ }
+
+ public void visitDeclaredType(DeclaredType t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public void visitEnumType(EnumType t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public void visitInterfaceType(InterfaceType t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ // Check if the annotation is itself annotated with a certain annotation type
+ public static <T extends Annotation> T getAnnotation(AnnotationMirror annotation, Class<T> type) {
+ return annotation.getAnnotationType().getDeclaration().getAnnotation(type);
+ }
+
+ private static Class translateAnnotation(AnnotationMirror annotation) {
+ NativeType native_type = getAnnotation(annotation, NativeType.class);
+ if (native_type != null) {
+ return getClassFromType(annotation.getAnnotationType());
+ } else
+ return null;
+ }
+
+ private Collection<Class> translateAnnotations() {
+ Collection<Class> result = new ArrayList<Class>();
+ for (AnnotationMirror annotation : Utils.getSortedAnnotations(declaration.getAnnotationMirrors())) {
+ Class translated_result = translateAnnotation(annotation);
+ if (translated_result != null) {
+ result.add(translated_result);
+ }
+ }
+ return result;
+ }
+
+ public void visitReferenceType(ReferenceType t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public void visitTypeMirror(TypeMirror t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public void visitTypeVariable(TypeVariable t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public void visitVoidType(VoidType t) {
+ native_types = translateAnnotations();
+ if (native_types.size() == 0)
+ native_types.add(void.class);
+ }
+
+ public void visitWildcardType(WildcardType t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+}
diff --git a/src/java/org/lwjgl/util/generator/NoErrorCheck.java b/src/java/org/lwjgl/util/generator/NoErrorCheck.java
index 7e10c7f..2cdbf06 100644
--- a/src/java/org/lwjgl/util/generator/NoErrorCheck.java
+++ b/src/java/org/lwjgl/util/generator/NoErrorCheck.java
@@ -1,49 +1,49 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * This annotation implies that a method should not include
- * error checking even if it is enabled.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: NoErrorCheck.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at Target(ElementType.METHOD)
-public @interface NoErrorCheck {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * This annotation implies that a method should not include
+ * error checking even if it is enabled.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: NoErrorCheck.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at Target(ElementType.METHOD)
+public @interface NoErrorCheck {
+}
diff --git a/src/java/org/lwjgl/util/generator/NullTerminated.java b/src/java/org/lwjgl/util/generator/NullTerminated.java
index ff0a2dd..9b08a0d 100644
--- a/src/java/org/lwjgl/util/generator/NullTerminated.java
+++ b/src/java/org/lwjgl/util/generator/NullTerminated.java
@@ -1,50 +1,50 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * This annotation implies that a Buffer argument should be
- * checked for a trailing '\0'
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3260 $
- * $Id: NullTerminated.java 3260 2009-12-04 04:49:19Z spasi $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at Target(ElementType.PARAMETER)
-public @interface NullTerminated {
- String value() default "";
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * This annotation implies that a Buffer argument should be
+ * checked for a trailing '\0'
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3260 $
+ * $Id: NullTerminated.java 3260 2009-12-04 04:49:19Z spasi $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at Target(ElementType.PARAMETER)
+public @interface NullTerminated {
+ String value() default "";
+}
diff --git a/src/java/org/lwjgl/util/generator/Optional.java b/src/java/org/lwjgl/util/generator/Optional.java
index 60f1063..79585af 100644
--- a/src/java/org/lwjgl/util/generator/Optional.java
+++ b/src/java/org/lwjgl/util/generator/Optional.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- * A function annotated with @Optional will allow the extension to be available even if the driver does not expose that function.
- * This is useful when certain buggy drivers miss some functionality.
- *
- * @author spasi <spasi at users.sourceforge.net>
- */
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Target;
-
- at Target(ElementType.METHOD)
-public @interface Optional {
- String reason(); // No default value to force documentation
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ * A function annotated with @Optional will allow the extension to be available even if the driver does not expose that function.
+ * This is useful when certain buggy drivers miss some functionality.
+ *
+ * @author spasi <spasi at users.sourceforge.net>
+ */
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+ at Target(ElementType.METHOD)
+public @interface Optional {
+ String reason(); // No default value to force documentation
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/util/generator/OutParameter.java b/src/java/org/lwjgl/util/generator/OutParameter.java
index c23c6ee..6a91d0d 100644
--- a/src/java/org/lwjgl/util/generator/OutParameter.java
+++ b/src/java/org/lwjgl/util/generator/OutParameter.java
@@ -1,48 +1,48 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- * This annotation indicates that a parameter is written,
- * not read.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2286 $
- * $Id: Check.java 2286 2006-03-23 19:32:21Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at Target(ElementType.PARAMETER)
-public @interface OutParameter {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ * This annotation indicates that a parameter is written,
+ * not read.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2286 $
+ * $Id: Check.java 2286 2006-03-23 19:32:21Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at Target(ElementType.PARAMETER)
+public @interface OutParameter {
+}
diff --git a/src/java/org/lwjgl/util/generator/Platform.java b/src/java/org/lwjgl/util/generator/Platform.java
index 106a1c4..8f36e41 100644
--- a/src/java/org/lwjgl/util/generator/Platform.java
+++ b/src/java/org/lwjgl/util/generator/Platform.java
@@ -1,93 +1,93 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: Platform.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.io.PrintWriter;
-
-public enum Platform {
- WGL,
- GLX,
- ALL;
-
- public void printPrologue(PrintWriter writer) {
- if (this == ALL)
- return;
- writer.print("#ifdef ");
- switch (this) {
- case WGL:
- writer.println("_WIN32");
- break;
- case GLX:
- writer.println("_X11");
- break;
- default:
- throw new RuntimeException(this + " is not supported");
- }
- }
-
- public void printEpilogue(PrintWriter writer) {
- if (this == ALL)
- return;
- writer.println("#endif");
- }
-
- public String getOSPrefix() {
- switch (this) {
- case WGL:
- return "Windows";
- case GLX:
- return "Linux";
- default:
- throw new RuntimeException(this + " has no OS specific prefix");
- }
- }
-
- public String getPrefix() {
- switch (this) {
- case WGL:
- return "wgl";
- case GLX:
- return "glX";
- case ALL:
- return "gl";
- default:
- throw new RuntimeException(this + " is not supported");
- }
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: Platform.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.io.PrintWriter;
+
+public enum Platform {
+ WGL,
+ GLX,
+ ALL;
+
+ public void printPrologue(PrintWriter writer) {
+ if (this == ALL)
+ return;
+ writer.print("#ifdef ");
+ switch (this) {
+ case WGL:
+ writer.println("_WIN32");
+ break;
+ case GLX:
+ writer.println("_X11");
+ break;
+ default:
+ throw new RuntimeException(this + " is not supported");
+ }
+ }
+
+ public void printEpilogue(PrintWriter writer) {
+ if (this == ALL)
+ return;
+ writer.println("#endif");
+ }
+
+ public String getOSPrefix() {
+ switch (this) {
+ case WGL:
+ return "Windows";
+ case GLX:
+ return "Linux";
+ default:
+ throw new RuntimeException(this + " has no OS specific prefix");
+ }
+ }
+
+ public String getPrefix() {
+ switch (this) {
+ case WGL:
+ return "wgl";
+ case GLX:
+ return "glX";
+ case ALL:
+ return "gl";
+ default:
+ throw new RuntimeException(this + " is not supported");
+ }
+ }
+}
diff --git a/src/java/org/lwjgl/util/generator/PlatformDependent.java b/src/java/org/lwjgl/util/generator/PlatformDependent.java
index f6fe1ab..83f587d 100644
--- a/src/java/org/lwjgl/util/generator/PlatformDependent.java
+++ b/src/java/org/lwjgl/util/generator/PlatformDependent.java
@@ -1,51 +1,51 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * This annotation implies that the corresponding native
- * function symbol is named after the platform specific
- * window system (glX, wgl, ...)
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: PlatformDependent.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at Target(ElementType.METHOD)
-public @interface PlatformDependent {
- Platform[] value();
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * This annotation implies that the corresponding native
+ * function symbol is named after the platform specific
+ * window system (glX, wgl, ...)
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: PlatformDependent.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at Target(ElementType.METHOD)
+public @interface PlatformDependent {
+ Platform[] value();
+}
diff --git a/src/java/org/lwjgl/util/generator/PostfixTranslator.java b/src/java/org/lwjgl/util/generator/PostfixTranslator.java
index 0a4a08a..a47faee 100644
--- a/src/java/org/lwjgl/util/generator/PostfixTranslator.java
+++ b/src/java/org/lwjgl/util/generator/PostfixTranslator.java
@@ -1,182 +1,182 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-package org.lwjgl.util.generator;
-
-/**
- *
- * A TypeVisitor that translates (annotated) TypeMirrors to
- * postfixes.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3287 $
- * $Id: PostfixTranslator.java 3287 2010-03-14 23:24:40Z spasi $
- */
-
-import com.sun.mirror.declaration.*;
-import com.sun.mirror.type.*;
-import com.sun.mirror.util.*;
-
-import java.nio.*;
-
-public class PostfixTranslator implements TypeVisitor {
- private final StringBuilder signature = new StringBuilder();
- private final Declaration declaration;
- private final TypeMap type_map;
-
- public PostfixTranslator(TypeMap type_map, Declaration declaration) {
- this.declaration = declaration;
- this.type_map = type_map;
- }
-
- public String getSignature() {
- return signature.toString();
- }
-
- public void visitAnnotationType(AnnotationType t) {
- throw new RuntimeException(t + " is not allowed");
- }
-
- public void visitArrayType(ArrayType t) {
- throw new RuntimeException(t + " is not allowed");
- }
-
- private static PrimitiveType.Kind getPrimitiveKindFromBufferClass(Class c) {
- if (IntBuffer.class.equals(c) || int.class.equals(c) )
- return PrimitiveType.Kind.INT;
- else if (DoubleBuffer.class.equals(c) || double.class.equals(c) )
- return PrimitiveType.Kind.DOUBLE;
- else if (ShortBuffer.class.equals(c) || short.class.equals(c) )
- return PrimitiveType.Kind.SHORT;
- else if (ByteBuffer.class.equals(c) || byte.class.equals(c) )
- return PrimitiveType.Kind.BYTE;
- else if (FloatBuffer.class.equals(c) || float.class.equals(c))
- return PrimitiveType.Kind.FLOAT;
- else if (LongBuffer.class.equals(c) || long.class.equals(c) )
- return PrimitiveType.Kind.LONG;
- else
- throw new RuntimeException(c + " is not allowed");
- }
-
- public void visitClassType(ClassType t) {
- Class<?> c = NativeTypeTranslator.getClassFromType(t);
- PrimitiveType.Kind kind = getPrimitiveKindFromBufferClass(c);
- visitPrimitiveTypeKind(kind);
- }
-
- public void visitDeclaredType(DeclaredType t) {
- throw new RuntimeException(t + " is not allowed");
- }
-
- public void visitEnumType(EnumType t) {
- throw new RuntimeException(t + " is not allowed");
- }
-
- public void visitInterfaceType(InterfaceType t) {
- throw new RuntimeException(t + " is not allowed");
- }
-
- private boolean translateAnnotation(AnnotationMirror annotation) {
- NativeType native_type = NativeTypeTranslator.getAnnotation(annotation, NativeType.class);
- if (native_type != null) {
- Class annotation_class = NativeTypeTranslator.getClassFromType(annotation.getAnnotationType());
- signature.append(type_map.translateAnnotation(annotation_class));
- return true;
- } else
- return false;
- }
-
- private boolean translateAnnotations() {
- boolean result = false;
- for (AnnotationMirror annotation : Utils.getSortedAnnotations(declaration.getAnnotationMirrors()))
- if (translateAnnotation(annotation)) {
- if (result)
- throw new RuntimeException("Multiple native types");
- result = true;
- }
- return result;
- }
-
- public void visitPrimitiveType(PrimitiveType t) {
- visitPrimitiveTypeKind(t.getKind());
- }
-
- private void visitPrimitiveTypeKind(PrimitiveType.Kind kind) {
- boolean annotated_translation = translateAnnotations();
- if (annotated_translation)
- return;
- // No annotation type was specified, fall back to default
- String type;
- switch (kind) {
- case INT:
- type = "i";
- break;
- case DOUBLE:
- type = "d";
- break;
- case FLOAT:
- type = "f";
- break;
- case SHORT:
- type = "s";
- break;
- case BYTE:
- type = "b";
- break;
- case LONG:
- type = "i64";
- break;
- default:
- throw new RuntimeException(kind + " is not allowed");
- }
- signature.append(type);
- }
-
- public void visitReferenceType(ReferenceType t) {
- throw new RuntimeException(t + " is not allowed");
- }
-
- public void visitTypeMirror(TypeMirror t) {
- throw new RuntimeException(t + " is not allowed");
- }
-
- public void visitTypeVariable(TypeVariable t) {
- throw new RuntimeException(t + " is not allowed");
- }
-
- public void visitVoidType(VoidType t) {
- }
-
- public void visitWildcardType(WildcardType t) {
- throw new RuntimeException(t + " is not allowed");
- }
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * A TypeVisitor that translates (annotated) TypeMirrors to
+ * postfixes.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3287 $
+ * $Id: PostfixTranslator.java 3287 2010-03-14 23:24:40Z spasi $
+ */
+
+import com.sun.mirror.declaration.*;
+import com.sun.mirror.type.*;
+import com.sun.mirror.util.*;
+
+import java.nio.*;
+
+public class PostfixTranslator implements TypeVisitor {
+ private final StringBuilder signature = new StringBuilder();
+ private final Declaration declaration;
+ private final TypeMap type_map;
+
+ public PostfixTranslator(TypeMap type_map, Declaration declaration) {
+ this.declaration = declaration;
+ this.type_map = type_map;
+ }
+
+ public String getSignature() {
+ return signature.toString();
+ }
+
+ public void visitAnnotationType(AnnotationType t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public void visitArrayType(ArrayType t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ private static PrimitiveType.Kind getPrimitiveKindFromBufferClass(Class c) {
+ if (IntBuffer.class.equals(c) || int.class.equals(c) )
+ return PrimitiveType.Kind.INT;
+ else if (DoubleBuffer.class.equals(c) || double.class.equals(c) )
+ return PrimitiveType.Kind.DOUBLE;
+ else if (ShortBuffer.class.equals(c) || short.class.equals(c) )
+ return PrimitiveType.Kind.SHORT;
+ else if (ByteBuffer.class.equals(c) || byte.class.equals(c) )
+ return PrimitiveType.Kind.BYTE;
+ else if (FloatBuffer.class.equals(c) || float.class.equals(c))
+ return PrimitiveType.Kind.FLOAT;
+ else if (LongBuffer.class.equals(c) || long.class.equals(c) )
+ return PrimitiveType.Kind.LONG;
+ else
+ throw new RuntimeException(c + " is not allowed");
+ }
+
+ public void visitClassType(ClassType t) {
+ Class<?> c = NativeTypeTranslator.getClassFromType(t);
+ PrimitiveType.Kind kind = getPrimitiveKindFromBufferClass(c);
+ visitPrimitiveTypeKind(kind);
+ }
+
+ public void visitDeclaredType(DeclaredType t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public void visitEnumType(EnumType t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public void visitInterfaceType(InterfaceType t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ private boolean translateAnnotation(AnnotationMirror annotation) {
+ NativeType native_type = NativeTypeTranslator.getAnnotation(annotation, NativeType.class);
+ if (native_type != null) {
+ Class annotation_class = NativeTypeTranslator.getClassFromType(annotation.getAnnotationType());
+ signature.append(type_map.translateAnnotation(annotation_class));
+ return true;
+ } else
+ return false;
+ }
+
+ private boolean translateAnnotations() {
+ boolean result = false;
+ for (AnnotationMirror annotation : Utils.getSortedAnnotations(declaration.getAnnotationMirrors()))
+ if (translateAnnotation(annotation)) {
+ if (result)
+ throw new RuntimeException("Multiple native types");
+ result = true;
+ }
+ return result;
+ }
+
+ public void visitPrimitiveType(PrimitiveType t) {
+ visitPrimitiveTypeKind(t.getKind());
+ }
+
+ private void visitPrimitiveTypeKind(PrimitiveType.Kind kind) {
+ boolean annotated_translation = translateAnnotations();
+ if (annotated_translation)
+ return;
+ // No annotation type was specified, fall back to default
+ String type;
+ switch (kind) {
+ case INT:
+ type = "i";
+ break;
+ case DOUBLE:
+ type = "d";
+ break;
+ case FLOAT:
+ type = "f";
+ break;
+ case SHORT:
+ type = "s";
+ break;
+ case BYTE:
+ type = "b";
+ break;
+ case LONG:
+ type = "i64";
+ break;
+ default:
+ throw new RuntimeException(kind + " is not allowed");
+ }
+ signature.append(type);
+ }
+
+ public void visitReferenceType(ReferenceType t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public void visitTypeMirror(TypeMirror t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public void visitTypeVariable(TypeVariable t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public void visitVoidType(VoidType t) {
+ }
+
+ public void visitWildcardType(WildcardType t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/util/generator/ReferencesGeneratorProcessorFactory.java b/src/java/org/lwjgl/util/generator/ReferencesGeneratorProcessorFactory.java
index b3c50ff..9f7999f 100644
--- a/src/java/org/lwjgl/util/generator/ReferencesGeneratorProcessorFactory.java
+++ b/src/java/org/lwjgl/util/generator/ReferencesGeneratorProcessorFactory.java
@@ -1,205 +1,205 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-package org.lwjgl.util.generator;
-
-import static java.util.Collections.emptyList;
-import static java.util.Collections.unmodifiableCollection;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Set;
-
-import com.sun.mirror.apt.AnnotationProcessor;
-import com.sun.mirror.apt.AnnotationProcessorEnvironment;
-import com.sun.mirror.apt.AnnotationProcessorFactory;
-import com.sun.mirror.apt.AnnotationProcessors;
-import com.sun.mirror.apt.Filer;
-import com.sun.mirror.apt.RoundCompleteEvent;
-import com.sun.mirror.apt.RoundCompleteListener;
-import com.sun.mirror.declaration.AnnotationTypeDeclaration;
-import com.sun.mirror.declaration.InterfaceDeclaration;
-import com.sun.mirror.declaration.MethodDeclaration;
-import com.sun.mirror.declaration.ParameterDeclaration;
-import com.sun.mirror.declaration.TypeDeclaration;
-import com.sun.mirror.util.DeclarationFilter;
-
-/**
- *
- * Generator tool for creating the References class
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3237 $
- * $Id: ReferencesGeneratorProcessorFactory.java 3237 2009-09-08 15:07:15Z spasi $
- */
-public class ReferencesGeneratorProcessorFactory implements AnnotationProcessorFactory, RoundCompleteListener {
- private final static String REFERENCES_CLASS_NAME = "References";
- private final static String REFERENCES_PARAMETER_NAME = "references";
-
- private static boolean first_round = true;
-
- // Process any set of annotations
- private static final Collection<String> supportedAnnotations =
- unmodifiableCollection(Arrays.asList("*"));
-
- public Collection<String> supportedAnnotationTypes() {
- return supportedAnnotations;
- }
-
- public Collection<String> supportedOptions() {
- return emptyList();
- }
-
- public void roundComplete(RoundCompleteEvent event) {
- first_round = false;
- }
-
- public AnnotationProcessor getProcessorFor(Set<AnnotationTypeDeclaration> atds, AnnotationProcessorEnvironment env) {
- // Only process the initial types, not the generated ones
- if (first_round) {
- env.addListener(this);
- return new GeneratorProcessor(env);
- } else
- return AnnotationProcessors.NO_OP;
- }
-
- private static class GeneratorProcessor implements AnnotationProcessor {
- private final AnnotationProcessorEnvironment env;
-
- GeneratorProcessor(AnnotationProcessorEnvironment env) {
- this.env = env;
- }
-
- public void process() {
- try {
- generateReferencesSource();
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
-
- private static void generateClearsFromParameters(PrintWriter writer, InterfaceDeclaration interface_decl, MethodDeclaration method) {
- for (ParameterDeclaration param : method.getParameters()) {
- CachedReference cached_reference_annotation = param.getAnnotation(CachedReference.class);
- if (cached_reference_annotation != null && cached_reference_annotation.name().length() == 0) {
- Class nio_type = Utils.getNIOBufferType(param.getType());
- String reference_name = Utils.getReferenceName(interface_decl, method, param);
- writer.println("\t\tthis." + reference_name + " = null;");
- }
- }
- }
-
- private static void generateCopiesFromParameters(PrintWriter writer, InterfaceDeclaration interface_decl, MethodDeclaration method) {
- for (ParameterDeclaration param : method.getParameters()) {
- CachedReference cached_reference_annotation = param.getAnnotation(CachedReference.class);
- if (cached_reference_annotation != null && cached_reference_annotation.name().length() == 0) {
- Class nio_type = Utils.getNIOBufferType(param.getType());
- String reference_name = Utils.getReferenceName(interface_decl, method, param);
- writer.print("\t\t\tthis." + reference_name + " = ");
- writer.println(REFERENCES_PARAMETER_NAME + "." + reference_name + ";");
- }
- }
- }
-
- private static void generateClearsFromMethods(PrintWriter writer, InterfaceDeclaration interface_decl) {
- for (MethodDeclaration method : interface_decl.getMethods()) {
- generateClearsFromParameters(writer, interface_decl, method);
- }
- }
-
- private static void generateCopiesFromMethods(PrintWriter writer, InterfaceDeclaration interface_decl) {
- for (MethodDeclaration method : interface_decl.getMethods()) {
- generateCopiesFromParameters(writer, interface_decl, method);
- }
- }
-
- private static void generateReferencesFromParameters(PrintWriter writer, InterfaceDeclaration interface_decl, MethodDeclaration method) {
- for (ParameterDeclaration param : method.getParameters()) {
- CachedReference cached_reference_annotation = param.getAnnotation(CachedReference.class);
- if (cached_reference_annotation != null && cached_reference_annotation.name().length() == 0) {
- Class nio_type = Utils.getNIOBufferType(param.getType());
- if (nio_type == null)
- throw new RuntimeException(param + " in method " + method + " in " + interface_decl + " is annotated with "
- + cached_reference_annotation.annotationType().getSimpleName() + " but the parameter is not a NIO buffer");
- writer.print("\t" + nio_type.getName() + " " + Utils.getReferenceName(interface_decl, method, param));
- writer.println(";");
- }
- }
- }
-
- private static void generateReferencesFromMethods(PrintWriter writer, InterfaceDeclaration interface_decl) {
- for (MethodDeclaration method : interface_decl.getMethods()) {
- generateReferencesFromParameters(writer, interface_decl, method);
- }
- }
-
- private void generateReferencesSource() throws IOException {
- PrintWriter writer = env.getFiler().createTextFile(Filer.Location.SOURCE_TREE, "org.lwjgl.opengl", new File(REFERENCES_CLASS_NAME + ".java"), null);
- writer.println("/* MACHINE GENERATED FILE, DO NOT EDIT */");
- writer.println();
- writer.println("package org.lwjgl.opengl;");
- writer.println();
- writer.println("class " + REFERENCES_CLASS_NAME + " extends BaseReferences {");
- writer.println("\t" + REFERENCES_CLASS_NAME + "(ContextCapabilities caps) {");
- writer.println("\t\tsuper(caps);");
- writer.println("\t}");
- DeclarationFilter filter = DeclarationFilter.getFilter(InterfaceDeclaration.class);
- Collection<TypeDeclaration> interface_decls = filter.filter(env.getSpecifiedTypeDeclarations());
- for (TypeDeclaration typedecl : interface_decls) {
- InterfaceDeclaration interface_decl = (InterfaceDeclaration)typedecl;
- generateReferencesFromMethods(writer, interface_decl);
- }
- writer.println();
- writer.println("\tvoid copy(" + REFERENCES_CLASS_NAME + " " + REFERENCES_PARAMETER_NAME + ", int mask) {");
- writer.println("\t\tsuper.copy(" + REFERENCES_PARAMETER_NAME + ", mask);");
- writer.println("\t\tif ( (mask & GL11.GL_CLIENT_VERTEX_ARRAY_BIT) != 0 ) {");
- for (TypeDeclaration typedecl : interface_decls) {
- InterfaceDeclaration interface_decl = (InterfaceDeclaration)typedecl;
- generateCopiesFromMethods(writer, interface_decl);
- }
- writer.println("\t\t}");
- writer.println("\t}");
- writer.println("\tvoid clear() {");
- writer.println("\t\tsuper.clear();");
- for (TypeDeclaration typedecl : interface_decls) {
- InterfaceDeclaration interface_decl = (InterfaceDeclaration)typedecl;
- generateClearsFromMethods(writer, interface_decl);
- }
- writer.println("\t}");
- writer.println("}");
- writer.close();
- }
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+package org.lwjgl.util.generator;
+
+import static java.util.Collections.emptyList;
+import static java.util.Collections.unmodifiableCollection;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Set;
+
+import com.sun.mirror.apt.AnnotationProcessor;
+import com.sun.mirror.apt.AnnotationProcessorEnvironment;
+import com.sun.mirror.apt.AnnotationProcessorFactory;
+import com.sun.mirror.apt.AnnotationProcessors;
+import com.sun.mirror.apt.Filer;
+import com.sun.mirror.apt.RoundCompleteEvent;
+import com.sun.mirror.apt.RoundCompleteListener;
+import com.sun.mirror.declaration.AnnotationTypeDeclaration;
+import com.sun.mirror.declaration.InterfaceDeclaration;
+import com.sun.mirror.declaration.MethodDeclaration;
+import com.sun.mirror.declaration.ParameterDeclaration;
+import com.sun.mirror.declaration.TypeDeclaration;
+import com.sun.mirror.util.DeclarationFilter;
+
+/**
+ *
+ * Generator tool for creating the References class
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3237 $
+ * $Id: ReferencesGeneratorProcessorFactory.java 3237 2009-09-08 15:07:15Z spasi $
+ */
+public class ReferencesGeneratorProcessorFactory implements AnnotationProcessorFactory, RoundCompleteListener {
+ private final static String REFERENCES_CLASS_NAME = "References";
+ private final static String REFERENCES_PARAMETER_NAME = "references";
+
+ private static boolean first_round = true;
+
+ // Process any set of annotations
+ private static final Collection<String> supportedAnnotations =
+ unmodifiableCollection(Arrays.asList("*"));
+
+ public Collection<String> supportedAnnotationTypes() {
+ return supportedAnnotations;
+ }
+
+ public Collection<String> supportedOptions() {
+ return emptyList();
+ }
+
+ public void roundComplete(RoundCompleteEvent event) {
+ first_round = false;
+ }
+
+ public AnnotationProcessor getProcessorFor(Set<AnnotationTypeDeclaration> atds, AnnotationProcessorEnvironment env) {
+ // Only process the initial types, not the generated ones
+ if (first_round) {
+ env.addListener(this);
+ return new GeneratorProcessor(env);
+ } else
+ return AnnotationProcessors.NO_OP;
+ }
+
+ private static class GeneratorProcessor implements AnnotationProcessor {
+ private final AnnotationProcessorEnvironment env;
+
+ GeneratorProcessor(AnnotationProcessorEnvironment env) {
+ this.env = env;
+ }
+
+ public void process() {
+ try {
+ generateReferencesSource();
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private static void generateClearsFromParameters(PrintWriter writer, InterfaceDeclaration interface_decl, MethodDeclaration method) {
+ for (ParameterDeclaration param : method.getParameters()) {
+ CachedReference cached_reference_annotation = param.getAnnotation(CachedReference.class);
+ if (cached_reference_annotation != null && cached_reference_annotation.name().length() == 0) {
+ Class nio_type = Utils.getNIOBufferType(param.getType());
+ String reference_name = Utils.getReferenceName(interface_decl, method, param);
+ writer.println("\t\tthis." + reference_name + " = null;");
+ }
+ }
+ }
+
+ private static void generateCopiesFromParameters(PrintWriter writer, InterfaceDeclaration interface_decl, MethodDeclaration method) {
+ for (ParameterDeclaration param : method.getParameters()) {
+ CachedReference cached_reference_annotation = param.getAnnotation(CachedReference.class);
+ if (cached_reference_annotation != null && cached_reference_annotation.name().length() == 0) {
+ Class nio_type = Utils.getNIOBufferType(param.getType());
+ String reference_name = Utils.getReferenceName(interface_decl, method, param);
+ writer.print("\t\t\tthis." + reference_name + " = ");
+ writer.println(REFERENCES_PARAMETER_NAME + "." + reference_name + ";");
+ }
+ }
+ }
+
+ private static void generateClearsFromMethods(PrintWriter writer, InterfaceDeclaration interface_decl) {
+ for (MethodDeclaration method : interface_decl.getMethods()) {
+ generateClearsFromParameters(writer, interface_decl, method);
+ }
+ }
+
+ private static void generateCopiesFromMethods(PrintWriter writer, InterfaceDeclaration interface_decl) {
+ for (MethodDeclaration method : interface_decl.getMethods()) {
+ generateCopiesFromParameters(writer, interface_decl, method);
+ }
+ }
+
+ private static void generateReferencesFromParameters(PrintWriter writer, InterfaceDeclaration interface_decl, MethodDeclaration method) {
+ for (ParameterDeclaration param : method.getParameters()) {
+ CachedReference cached_reference_annotation = param.getAnnotation(CachedReference.class);
+ if (cached_reference_annotation != null && cached_reference_annotation.name().length() == 0) {
+ Class nio_type = Utils.getNIOBufferType(param.getType());
+ if (nio_type == null)
+ throw new RuntimeException(param + " in method " + method + " in " + interface_decl + " is annotated with "
+ + cached_reference_annotation.annotationType().getSimpleName() + " but the parameter is not a NIO buffer");
+ writer.print("\t" + nio_type.getName() + " " + Utils.getReferenceName(interface_decl, method, param));
+ writer.println(";");
+ }
+ }
+ }
+
+ private static void generateReferencesFromMethods(PrintWriter writer, InterfaceDeclaration interface_decl) {
+ for (MethodDeclaration method : interface_decl.getMethods()) {
+ generateReferencesFromParameters(writer, interface_decl, method);
+ }
+ }
+
+ private void generateReferencesSource() throws IOException {
+ PrintWriter writer = env.getFiler().createTextFile(Filer.Location.SOURCE_TREE, "org.lwjgl.opengl", new File(REFERENCES_CLASS_NAME + ".java"), null);
+ writer.println("/* MACHINE GENERATED FILE, DO NOT EDIT */");
+ writer.println();
+ writer.println("package org.lwjgl.opengl;");
+ writer.println();
+ writer.println("class " + REFERENCES_CLASS_NAME + " extends BaseReferences {");
+ writer.println("\t" + REFERENCES_CLASS_NAME + "(ContextCapabilities caps) {");
+ writer.println("\t\tsuper(caps);");
+ writer.println("\t}");
+ DeclarationFilter filter = DeclarationFilter.getFilter(InterfaceDeclaration.class);
+ Collection<TypeDeclaration> interface_decls = filter.filter(env.getSpecifiedTypeDeclarations());
+ for (TypeDeclaration typedecl : interface_decls) {
+ InterfaceDeclaration interface_decl = (InterfaceDeclaration)typedecl;
+ generateReferencesFromMethods(writer, interface_decl);
+ }
+ writer.println();
+ writer.println("\tvoid copy(" + REFERENCES_CLASS_NAME + " " + REFERENCES_PARAMETER_NAME + ", int mask) {");
+ writer.println("\t\tsuper.copy(" + REFERENCES_PARAMETER_NAME + ", mask);");
+ writer.println("\t\tif ( (mask & GL11.GL_CLIENT_VERTEX_ARRAY_BIT) != 0 ) {");
+ for (TypeDeclaration typedecl : interface_decls) {
+ InterfaceDeclaration interface_decl = (InterfaceDeclaration)typedecl;
+ generateCopiesFromMethods(writer, interface_decl);
+ }
+ writer.println("\t\t}");
+ writer.println("\t}");
+ writer.println("\tvoid clear() {");
+ writer.println("\t\tsuper.clear();");
+ for (TypeDeclaration typedecl : interface_decls) {
+ InterfaceDeclaration interface_decl = (InterfaceDeclaration)typedecl;
+ generateClearsFromMethods(writer, interface_decl);
+ }
+ writer.println("\t}");
+ writer.println("}");
+ writer.close();
+ }
+ }
+}
diff --git a/src/java/org/lwjgl/util/generator/RegisterStubsGenerator.java b/src/java/org/lwjgl/util/generator/RegisterStubsGenerator.java
index 7aea345..dc311f6 100644
--- a/src/java/org/lwjgl/util/generator/RegisterStubsGenerator.java
+++ b/src/java/org/lwjgl/util/generator/RegisterStubsGenerator.java
@@ -1,119 +1,119 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-package org.lwjgl.util.generator;
-
-/**
- *
- * This class generates the initNatives native function.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3288 $
- * $Id: RegisterStubsGenerator.java 3288 2010-03-16 17:58:48Z spasi $
- */
-
-import com.sun.mirror.declaration.*;
-import com.sun.mirror.type.*;
-
-import java.io.*;
-import java.util.*;
-
-public class RegisterStubsGenerator {
- public static void generateMethodsNativeStubBind(PrintWriter writer, InterfaceDeclaration d, boolean generate_error_checks, boolean context_specific) {
- Iterator<? extends MethodDeclaration> it = d.getMethods().iterator();
- while (it.hasNext()) {
- MethodDeclaration method = it.next();
- if ( method.getAnnotation(Alternate.class) != null )
- continue;
- EnumSet<Platform> platforms;
- PlatformDependent platform_annotation = method.getAnnotation(PlatformDependent.class);
- if (platform_annotation != null)
- platforms = EnumSet.copyOf(Arrays.asList(platform_annotation.value()));
- else
- platforms = EnumSet.of(Platform.ALL);
- for (Platform platform : platforms) {
- platform.printPrologue(writer);
- boolean has_buffer_parameter = Utils.hasMethodBufferObjectParameter(method);
- printMethodNativeStubBind(writer, d, method, platform, Mode.NORMAL, it.hasNext() || has_buffer_parameter, generate_error_checks, context_specific);
- if (has_buffer_parameter) {
- printMethodNativeStubBind(writer, d, method, platform, Mode.BUFFEROBJECT, it.hasNext(), generate_error_checks, context_specific);
- }
- platform.printEpilogue(writer);
- }
- }
- writer.println();
- }
-
- private static String getTypeSignature(TypeMirror type, boolean add_position_signature) {
- SignatureTranslator v = new SignatureTranslator(add_position_signature);
- type.accept(v);
- return v.getSignature();
- }
-
- private static String getMethodSignature(MethodDeclaration method, Mode mode) {
- Collection<ParameterDeclaration> params = method.getParameters();
- String signature = "(";
- for (ParameterDeclaration param : params) {
- if (param.getAnnotation(Result.class) != null)
- continue;
- if (mode == Mode.BUFFEROBJECT && param.getAnnotation(BufferObject.class) != null) {
- signature += "I";
- } else {
- signature += getTypeSignature(param.getType(), true);
- }
- }
- TypeMirror result_type = Utils.getMethodReturnType(method);
- if (Utils.getNIOBufferType(result_type) != null)
- signature += "I";
- String result_type_signature = getTypeSignature(result_type, false);
- if (method.getAnnotation(CachedResult.class) != null)
- signature += result_type_signature;
- signature += ")";
- signature += result_type_signature;
- return signature;
- }
-
- private static void printMethodNativeStubBind(PrintWriter writer, InterfaceDeclaration d, MethodDeclaration method, Platform platform, Mode mode, boolean has_more, boolean generate_error_checks, boolean context_specific) {
- writer.print("\t\t{\"" + Utils.getSimpleNativeMethodName(method, generate_error_checks, context_specific));
- if (mode == Mode.BUFFEROBJECT)
- writer.print(Utils.BUFFER_OBJECT_METHOD_POSTFIX);
- writer.print("\", \"" + getMethodSignature(method, mode) + "\", (void *)&");
- writer.print(Utils.getQualifiedNativeMethodName(Utils.getQualifiedClassName(d), method, generate_error_checks, context_specific));
- if (mode == Mode.BUFFEROBJECT)
- writer.print(Utils.BUFFER_OBJECT_METHOD_POSTFIX);
- String opengl_handle_name = method.getSimpleName().replaceFirst("gl", platform.getPrefix());
- writer.print(", \"" + opengl_handle_name + "\", (void *)&" + method.getSimpleName() + "}");
- if (has_more)
- writer.println(",");
- }
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * This class generates the initNatives native function.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3288 $
+ * $Id: RegisterStubsGenerator.java 3288 2010-03-16 17:58:48Z spasi $
+ */
+
+import com.sun.mirror.declaration.*;
+import com.sun.mirror.type.*;
+
+import java.io.*;
+import java.util.*;
+
+public class RegisterStubsGenerator {
+ public static void generateMethodsNativeStubBind(PrintWriter writer, InterfaceDeclaration d, boolean generate_error_checks, boolean context_specific) {
+ Iterator<? extends MethodDeclaration> it = d.getMethods().iterator();
+ while (it.hasNext()) {
+ MethodDeclaration method = it.next();
+ if ( method.getAnnotation(Alternate.class) != null )
+ continue;
+ EnumSet<Platform> platforms;
+ PlatformDependent platform_annotation = method.getAnnotation(PlatformDependent.class);
+ if (platform_annotation != null)
+ platforms = EnumSet.copyOf(Arrays.asList(platform_annotation.value()));
+ else
+ platforms = EnumSet.of(Platform.ALL);
+ for (Platform platform : platforms) {
+ platform.printPrologue(writer);
+ boolean has_buffer_parameter = Utils.hasMethodBufferObjectParameter(method);
+ printMethodNativeStubBind(writer, d, method, platform, Mode.NORMAL, it.hasNext() || has_buffer_parameter, generate_error_checks, context_specific);
+ if (has_buffer_parameter) {
+ printMethodNativeStubBind(writer, d, method, platform, Mode.BUFFEROBJECT, it.hasNext(), generate_error_checks, context_specific);
+ }
+ platform.printEpilogue(writer);
+ }
+ }
+ writer.println();
+ }
+
+ private static String getTypeSignature(TypeMirror type, boolean add_position_signature) {
+ SignatureTranslator v = new SignatureTranslator(add_position_signature);
+ type.accept(v);
+ return v.getSignature();
+ }
+
+ private static String getMethodSignature(MethodDeclaration method, Mode mode) {
+ Collection<ParameterDeclaration> params = method.getParameters();
+ String signature = "(";
+ for (ParameterDeclaration param : params) {
+ if (param.getAnnotation(Result.class) != null)
+ continue;
+ if (mode == Mode.BUFFEROBJECT && param.getAnnotation(BufferObject.class) != null) {
+ signature += "I";
+ } else {
+ signature += getTypeSignature(param.getType(), true);
+ }
+ }
+ TypeMirror result_type = Utils.getMethodReturnType(method);
+ if (Utils.getNIOBufferType(result_type) != null)
+ signature += "I";
+ String result_type_signature = getTypeSignature(result_type, false);
+ if (method.getAnnotation(CachedResult.class) != null)
+ signature += result_type_signature;
+ signature += ")";
+ signature += result_type_signature;
+ return signature;
+ }
+
+ private static void printMethodNativeStubBind(PrintWriter writer, InterfaceDeclaration d, MethodDeclaration method, Platform platform, Mode mode, boolean has_more, boolean generate_error_checks, boolean context_specific) {
+ writer.print("\t\t{\"" + Utils.getSimpleNativeMethodName(method, generate_error_checks, context_specific));
+ if (mode == Mode.BUFFEROBJECT)
+ writer.print(Utils.BUFFER_OBJECT_METHOD_POSTFIX);
+ writer.print("\", \"" + getMethodSignature(method, mode) + "\", (void *)&");
+ writer.print(Utils.getQualifiedNativeMethodName(Utils.getQualifiedClassName(d), method, generate_error_checks, context_specific));
+ if (mode == Mode.BUFFEROBJECT)
+ writer.print(Utils.BUFFER_OBJECT_METHOD_POSTFIX);
+ String opengl_handle_name = method.getSimpleName().replaceFirst("gl", platform.getPrefix());
+ writer.print(", \"" + opengl_handle_name + "\", (void *)&" + method.getSimpleName() + "}");
+ if (has_more)
+ writer.println(",");
+ }
+
+}
diff --git a/src/java/org/lwjgl/util/generator/Result.java b/src/java/org/lwjgl/util/generator/Result.java
index ca20b34..8a23b28 100644
--- a/src/java/org/lwjgl/util/generator/Result.java
+++ b/src/java/org/lwjgl/util/generator/Result.java
@@ -1,49 +1,49 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * This annotation indicates that the method result is in the
- * specified parameter.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: Result.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at Target(ElementType.PARAMETER)
-public @interface Result {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * This annotation indicates that the method result is in the
+ * specified parameter.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: Result.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at Target(ElementType.PARAMETER)
+public @interface Result {
+}
diff --git a/src/java/org/lwjgl/util/generator/SignatureTranslator.java b/src/java/org/lwjgl/util/generator/SignatureTranslator.java
index 289fc11..0d4ba11 100644
--- a/src/java/org/lwjgl/util/generator/SignatureTranslator.java
+++ b/src/java/org/lwjgl/util/generator/SignatureTranslator.java
@@ -1,142 +1,142 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-package org.lwjgl.util.generator;
-
-/**
- *
- * A TypeVisitor that translates types to JNI signatures.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: SignatureTranslator.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import com.sun.mirror.type.*;
-import com.sun.mirror.util.*;
-
-import java.nio.*;
-
-class SignatureTranslator implements TypeVisitor {
- private final boolean add_position_signature;
- private final StringBuilder signature = new StringBuilder();
-
- SignatureTranslator(boolean add_position_signature) {
- this.add_position_signature = add_position_signature;
- }
-
- private static String getNativeNameFromClassName(String class_name) {
- return class_name.replaceAll("\\.", "/");
- }
-
- public String getSignature() {
- return signature.toString();
- }
-
- public void visitAnnotationType(AnnotationType t) {
- throw new RuntimeException(t + " is not allowed");
- }
-
- public void visitArrayType(ArrayType t) {
- throw new RuntimeException(t + " is not allowed");
- }
-
- public void visitClassType(ClassType t) {
- String type_name = getNativeNameFromClassName(t.getDeclaration().getQualifiedName());
- signature.append("L");
- signature.append(type_name);
- signature.append(";");
- if (add_position_signature && Buffer.class.isAssignableFrom(NativeTypeTranslator.getClassFromType(t))) {
- signature.append("I");
- }
- }
-
- public void visitDeclaredType(DeclaredType t) {
- throw new RuntimeException(t + " is not allowed");
- }
-
- public void visitEnumType(EnumType t) {
- throw new RuntimeException(t + " is not allowed");
- }
-
- public void visitInterfaceType(InterfaceType t) {
- throw new RuntimeException(t + " is not allowed");
- }
-
- public void visitPrimitiveType(PrimitiveType t) {
- switch (t.getKind()) {
- case BOOLEAN:
- signature.append("Z");
- break;
- case INT:
- signature.append("I");
- break;
- case FLOAT:
- signature.append("F");
- break;
- case SHORT:
- signature.append("S");
- break;
- case DOUBLE:
- signature.append("D");
- break;
- case BYTE:
- signature.append("B");
- break;
- case LONG:
- signature.append("J");
- break;
- default:
- throw new RuntimeException("Unsupported type " + t);
- }
- }
-
- public void visitReferenceType(ReferenceType t) {
- throw new RuntimeException(t + " is not allowed");
- }
-
- public void visitTypeMirror(TypeMirror t) {
- throw new RuntimeException(t + " is not allowed");
- }
-
- public void visitTypeVariable(TypeVariable t) {
- throw new RuntimeException(t + " is not allowed");
- }
-
- public void visitVoidType(VoidType t) {
- signature.append("V");
- }
-
- public void visitWildcardType(WildcardType t) {
- throw new RuntimeException(t + " is not allowed");
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * A TypeVisitor that translates types to JNI signatures.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: SignatureTranslator.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import com.sun.mirror.type.*;
+import com.sun.mirror.util.*;
+
+import java.nio.*;
+
+class SignatureTranslator implements TypeVisitor {
+ private final boolean add_position_signature;
+ private final StringBuilder signature = new StringBuilder();
+
+ SignatureTranslator(boolean add_position_signature) {
+ this.add_position_signature = add_position_signature;
+ }
+
+ private static String getNativeNameFromClassName(String class_name) {
+ return class_name.replaceAll("\\.", "/");
+ }
+
+ public String getSignature() {
+ return signature.toString();
+ }
+
+ public void visitAnnotationType(AnnotationType t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public void visitArrayType(ArrayType t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public void visitClassType(ClassType t) {
+ String type_name = getNativeNameFromClassName(t.getDeclaration().getQualifiedName());
+ signature.append("L");
+ signature.append(type_name);
+ signature.append(";");
+ if (add_position_signature && Buffer.class.isAssignableFrom(NativeTypeTranslator.getClassFromType(t))) {
+ signature.append("I");
+ }
+ }
+
+ public void visitDeclaredType(DeclaredType t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public void visitEnumType(EnumType t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public void visitInterfaceType(InterfaceType t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public void visitPrimitiveType(PrimitiveType t) {
+ switch (t.getKind()) {
+ case BOOLEAN:
+ signature.append("Z");
+ break;
+ case INT:
+ signature.append("I");
+ break;
+ case FLOAT:
+ signature.append("F");
+ break;
+ case SHORT:
+ signature.append("S");
+ break;
+ case DOUBLE:
+ signature.append("D");
+ break;
+ case BYTE:
+ signature.append("B");
+ break;
+ case LONG:
+ signature.append("J");
+ break;
+ default:
+ throw new RuntimeException("Unsupported type " + t);
+ }
+ }
+
+ public void visitReferenceType(ReferenceType t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public void visitTypeMirror(TypeMirror t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public void visitTypeVariable(TypeVariable t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+
+ public void visitVoidType(VoidType t) {
+ signature.append("V");
+ }
+
+ public void visitWildcardType(WildcardType t) {
+ throw new RuntimeException(t + " is not allowed");
+ }
+}
diff --git a/src/java/org/lwjgl/util/generator/Signedness.java b/src/java/org/lwjgl/util/generator/Signedness.java
index 3f8ca1b..e742be0 100644
--- a/src/java/org/lwjgl/util/generator/Signedness.java
+++ b/src/java/org/lwjgl/util/generator/Signedness.java
@@ -1,46 +1,46 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: Signedness.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-public enum Signedness {
- SIGNED,
- UNSIGNED,
- NONE,
- BOTH
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: Signedness.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+public enum Signedness {
+ SIGNED,
+ UNSIGNED,
+ NONE,
+ BOTH
+}
diff --git a/src/java/org/lwjgl/util/generator/StringList.java b/src/java/org/lwjgl/util/generator/StringList.java
index 0d9e20d..91f1091 100644
--- a/src/java/org/lwjgl/util/generator/StringList.java
+++ b/src/java/org/lwjgl/util/generator/StringList.java
@@ -1,48 +1,48 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * @author spasi <spasi at users.sourceforge.net>
- */
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Target;
-
- at Target({ElementType.PARAMETER, ElementType.METHOD})
-public @interface StringList {
- /** Number of values in the string list (name of native-side parameter) */
- String value();
- /** List of string lengths (name of native-side parameter) */
- String lengths() default "";
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * @author spasi <spasi at users.sourceforge.net>
+ */
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+ at Target({ElementType.PARAMETER, ElementType.METHOD})
+public @interface StringList {
+ /** Number of values in the string list (name of native-side parameter) */
+ String value();
+ /** List of string lengths (name of native-side parameter) */
+ String lengths() default "";
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/util/generator/StripPostfix.java b/src/java/org/lwjgl/util/generator/StripPostfix.java
index 8f63d42..cf2ed2a 100644
--- a/src/java/org/lwjgl/util/generator/StripPostfix.java
+++ b/src/java/org/lwjgl/util/generator/StripPostfix.java
@@ -1,53 +1,53 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * This annotation implies that a method have its postfix stripped
- * according to a specified Buffer parameter.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3256 $
- * $Id: StripPostfix.java 3256 2009-12-01 03:37:27Z spasi $
- */
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
- at Target(ElementType.METHOD)
-public @interface StripPostfix {
- String value(); // The parameter to deduce the postfix from
- String extension() default "NULL";
- boolean hasPostfix() default true;
- String postfix() default "NULL";
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * This annotation implies that a method have its postfix stripped
+ * according to a specified Buffer parameter.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3256 $
+ * $Id: StripPostfix.java 3256 2009-12-01 03:37:27Z spasi $
+ */
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+ at Target(ElementType.METHOD)
+public @interface StripPostfix {
+ String value(); // The parameter to deduce the postfix from
+ String extension() default "NULL";
+ boolean hasPostfix() default true;
+ String postfix() default "NULL";
+}
diff --git a/src/java/org/lwjgl/util/generator/TypeInfo.java b/src/java/org/lwjgl/util/generator/TypeInfo.java
index 63a3b37..9f1b69d 100644
--- a/src/java/org/lwjgl/util/generator/TypeInfo.java
+++ b/src/java/org/lwjgl/util/generator/TypeInfo.java
@@ -1,229 +1,229 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * This class represent a parameter configuration. There are multiple
- * TypeInfos in case of multityped parameters.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3279 $
- * $Id: TypeInfo.java 3279 2010-03-11 21:06:49Z spasi $
- */
-
-import com.sun.mirror.declaration.*;
-import com.sun.mirror.type.*;
-
-import java.util.*;
-import java.nio.*;
-
-public class TypeInfo {
- public static final String UNSIGNED_PARAMETER_NAME = "unsigned";
-
- private final Signedness signedness;
- private final Class type;
- private final String auto_type;
-
- private TypeInfo(Class type, Signedness signedness, String auto_type) {
- this.type = type;
- this.signedness = signedness;
- this.auto_type = auto_type;
- }
-
- public Class getType() {
- return type;
- }
-
- public Signedness getSignedness() {
- return signedness;
- }
-
- public String getAutoType() {
- if (auto_type == null)
- throw new RuntimeException("No auto type assigned");
- return auto_type;
- }
-
- private static Class getTypeFromPrimitiveKind(PrimitiveType.Kind kind) {
- Class type;
- switch (kind) {
- case LONG:
- type = long.class;
- break;
- case INT:
- type = int.class;
- break;
- case FLOAT:
- type = float.class;
- break;
- case DOUBLE:
- type = double.class;
- break;
- case SHORT:
- type = short.class;
- break;
- case BYTE:
- type = byte.class;
- break;
- default:
- throw new RuntimeException(kind + " is not allowed");
- }
- return type;
- }
-
- private static Class getBufferTypeFromPrimitiveKind(PrimitiveType.Kind kind) {
- Class type;
- switch (kind) {
- case INT:
- type = IntBuffer.class;
- break;
- case FLOAT:
- type = FloatBuffer.class;
- break;
- case DOUBLE:
- type = DoubleBuffer.class;
- break;
- case SHORT:
- type = ShortBuffer.class;
- break;
- case LONG:
- type = LongBuffer.class;
- break;
- case BYTE: /* fall through */
- case BOOLEAN:
- type = ByteBuffer.class;
- break;
- default:
- throw new RuntimeException(kind + " is not allowed");
- }
- return type;
- }
-
- private static TypeInfo getDefaultTypeInfo(TypeMirror t) {
- Class java_type = Utils.getJavaType(t);
- return new TypeInfo(java_type, Signedness.NONE, null);
- }
-
- public static Map<ParameterDeclaration, TypeInfo> getDefaultTypeInfoMap(MethodDeclaration method) {
- Map<ParameterDeclaration, TypeInfo> map = new HashMap<ParameterDeclaration, TypeInfo>();
- for (ParameterDeclaration param : method.getParameters()) {
- TypeInfo type_info = getDefaultTypeInfo(param.getType());
- map.put(param, type_info);
- }
- return map;
- }
-
- private static Collection<TypeInfo> getTypeInfos(TypeMap type_map, Declaration param, TypeMirror decl_type) {
- Collection<AnnotationMirror> annotations = Utils.getSortedAnnotations(param.getAnnotationMirrors());
- Map<Class, TypeInfo> types = new HashMap<Class, TypeInfo>();
- Collection<TypeInfo> multityped_result = new ArrayList<TypeInfo>();
- boolean add_default_type = true;
- for (AnnotationMirror annotation : annotations) {
- NativeType native_type_annotation = NativeTypeTranslator.getAnnotation(annotation, NativeType.class);
- if (native_type_annotation != null) {
- Class annotation_type = NativeTypeTranslator.getClassFromType(annotation.getAnnotationType());
- Signedness signedness = type_map.getSignednessFromType(annotation_type);
- Class inverse_type = type_map.getInverseType(annotation_type);
- String auto_type = type_map.getAutoTypeFromAnnotation(annotation);
- if (inverse_type != null) {
- if (types.containsKey(inverse_type)) {
- TypeInfo inverse_type_info = types.get(inverse_type);
- String inverse_auto_type = inverse_type_info.getAutoType();
- auto_type = signedness == Signedness.UNSIGNED ? auto_type + " : " + inverse_auto_type :
- inverse_auto_type + " : " + auto_type;
- auto_type = UNSIGNED_PARAMETER_NAME + " ? " + auto_type;
- signedness = Signedness.BOTH;
- types.remove(inverse_type);
- multityped_result.remove(inverse_type_info);
- }
- }
- Class type;
- PrimitiveType.Kind kind;
- GLvoid void_annotation = param.getAnnotation(GLvoid.class);
- kind = void_annotation == null ? type_map.getPrimitiveTypeFromNativeType(annotation_type) : void_annotation.value();
- if (Utils.getNIOBufferType(decl_type) != null)
- type = getBufferTypeFromPrimitiveKind(kind);
- else
- type = getTypeFromPrimitiveKind(kind);
- TypeInfo type_info = new TypeInfo(type, signedness, auto_type);
- types.put(annotation_type, type_info);
- multityped_result.add(type_info);
- add_default_type = false;
- }
- }
- if (add_default_type) {
- TypeInfo default_type_info = getDefaultTypeInfo(decl_type);
- Collection<TypeInfo> result = new ArrayList<TypeInfo>();
- result.add(default_type_info);
- return result;
- } else
- return multityped_result;
- }
-
- private static Map<ParameterDeclaration, Collection<TypeInfo>> getTypeInfoMap(TypeMap type_map, MethodDeclaration method) {
- Map<ParameterDeclaration, Collection<TypeInfo>> map = new HashMap<ParameterDeclaration, Collection<TypeInfo>>();
- for (ParameterDeclaration param : method.getParameters()) {
- Collection<TypeInfo> types = getTypeInfos(type_map, param, param.getType());
- map.put(param, types);
- }
- return map;
- }
-
- public static Collection<Map<ParameterDeclaration, TypeInfo>> getTypeInfoCrossProduct(TypeMap type_map, MethodDeclaration method) {
- Collection<ParameterDeclaration> parameter_collection = method.getParameters();
- ParameterDeclaration[] parameters = new ParameterDeclaration[parameter_collection.size()];
- parameter_collection.toArray(parameters);
- Collection<Map<ParameterDeclaration, TypeInfo>> cross_product = new ArrayList<Map<ParameterDeclaration, TypeInfo>>();
- getCrossProductRecursive(0, parameters, getTypeInfoMap(type_map, method),
- new HashMap<ParameterDeclaration, TypeInfo>(), cross_product);
- return cross_product;
- }
-
- private static void getCrossProductRecursive(int index, ParameterDeclaration[] parameters, Map<ParameterDeclaration,
- Collection<TypeInfo>> typeinfos_map, Map<ParameterDeclaration, TypeInfo> current_instance,
- Collection<Map<ParameterDeclaration, TypeInfo>> cross_product) {
- if (index == parameters.length) {
- cross_product.add(current_instance);
- return;
- }
- ParameterDeclaration param = parameters[index];
- Collection<TypeInfo> typeinfos = typeinfos_map.get(param);
- if (typeinfos != null) {
- for (TypeInfo typeinfo : typeinfos) {
- Map<ParameterDeclaration, TypeInfo> instance = new HashMap<ParameterDeclaration, TypeInfo>(current_instance);
- instance.put(param, typeinfo);
- getCrossProductRecursive(index + 1, parameters, typeinfos_map, instance, cross_product);
- }
- }
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * This class represent a parameter configuration. There are multiple
+ * TypeInfos in case of multityped parameters.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3279 $
+ * $Id: TypeInfo.java 3279 2010-03-11 21:06:49Z spasi $
+ */
+
+import com.sun.mirror.declaration.*;
+import com.sun.mirror.type.*;
+
+import java.util.*;
+import java.nio.*;
+
+public class TypeInfo {
+ public static final String UNSIGNED_PARAMETER_NAME = "unsigned";
+
+ private final Signedness signedness;
+ private final Class type;
+ private final String auto_type;
+
+ private TypeInfo(Class type, Signedness signedness, String auto_type) {
+ this.type = type;
+ this.signedness = signedness;
+ this.auto_type = auto_type;
+ }
+
+ public Class getType() {
+ return type;
+ }
+
+ public Signedness getSignedness() {
+ return signedness;
+ }
+
+ public String getAutoType() {
+ if (auto_type == null)
+ throw new RuntimeException("No auto type assigned");
+ return auto_type;
+ }
+
+ private static Class getTypeFromPrimitiveKind(PrimitiveType.Kind kind) {
+ Class type;
+ switch (kind) {
+ case LONG:
+ type = long.class;
+ break;
+ case INT:
+ type = int.class;
+ break;
+ case FLOAT:
+ type = float.class;
+ break;
+ case DOUBLE:
+ type = double.class;
+ break;
+ case SHORT:
+ type = short.class;
+ break;
+ case BYTE:
+ type = byte.class;
+ break;
+ default:
+ throw new RuntimeException(kind + " is not allowed");
+ }
+ return type;
+ }
+
+ private static Class getBufferTypeFromPrimitiveKind(PrimitiveType.Kind kind) {
+ Class type;
+ switch (kind) {
+ case INT:
+ type = IntBuffer.class;
+ break;
+ case FLOAT:
+ type = FloatBuffer.class;
+ break;
+ case DOUBLE:
+ type = DoubleBuffer.class;
+ break;
+ case SHORT:
+ type = ShortBuffer.class;
+ break;
+ case LONG:
+ type = LongBuffer.class;
+ break;
+ case BYTE: /* fall through */
+ case BOOLEAN:
+ type = ByteBuffer.class;
+ break;
+ default:
+ throw new RuntimeException(kind + " is not allowed");
+ }
+ return type;
+ }
+
+ private static TypeInfo getDefaultTypeInfo(TypeMirror t) {
+ Class java_type = Utils.getJavaType(t);
+ return new TypeInfo(java_type, Signedness.NONE, null);
+ }
+
+ public static Map<ParameterDeclaration, TypeInfo> getDefaultTypeInfoMap(MethodDeclaration method) {
+ Map<ParameterDeclaration, TypeInfo> map = new HashMap<ParameterDeclaration, TypeInfo>();
+ for (ParameterDeclaration param : method.getParameters()) {
+ TypeInfo type_info = getDefaultTypeInfo(param.getType());
+ map.put(param, type_info);
+ }
+ return map;
+ }
+
+ private static Collection<TypeInfo> getTypeInfos(TypeMap type_map, Declaration param, TypeMirror decl_type) {
+ Collection<AnnotationMirror> annotations = Utils.getSortedAnnotations(param.getAnnotationMirrors());
+ Map<Class, TypeInfo> types = new HashMap<Class, TypeInfo>();
+ Collection<TypeInfo> multityped_result = new ArrayList<TypeInfo>();
+ boolean add_default_type = true;
+ for (AnnotationMirror annotation : annotations) {
+ NativeType native_type_annotation = NativeTypeTranslator.getAnnotation(annotation, NativeType.class);
+ if (native_type_annotation != null) {
+ Class annotation_type = NativeTypeTranslator.getClassFromType(annotation.getAnnotationType());
+ Signedness signedness = type_map.getSignednessFromType(annotation_type);
+ Class inverse_type = type_map.getInverseType(annotation_type);
+ String auto_type = type_map.getAutoTypeFromAnnotation(annotation);
+ if (inverse_type != null) {
+ if (types.containsKey(inverse_type)) {
+ TypeInfo inverse_type_info = types.get(inverse_type);
+ String inverse_auto_type = inverse_type_info.getAutoType();
+ auto_type = signedness == Signedness.UNSIGNED ? auto_type + " : " + inverse_auto_type :
+ inverse_auto_type + " : " + auto_type;
+ auto_type = UNSIGNED_PARAMETER_NAME + " ? " + auto_type;
+ signedness = Signedness.BOTH;
+ types.remove(inverse_type);
+ multityped_result.remove(inverse_type_info);
+ }
+ }
+ Class type;
+ PrimitiveType.Kind kind;
+ GLvoid void_annotation = param.getAnnotation(GLvoid.class);
+ kind = void_annotation == null ? type_map.getPrimitiveTypeFromNativeType(annotation_type) : void_annotation.value();
+ if (Utils.getNIOBufferType(decl_type) != null)
+ type = getBufferTypeFromPrimitiveKind(kind);
+ else
+ type = getTypeFromPrimitiveKind(kind);
+ TypeInfo type_info = new TypeInfo(type, signedness, auto_type);
+ types.put(annotation_type, type_info);
+ multityped_result.add(type_info);
+ add_default_type = false;
+ }
+ }
+ if (add_default_type) {
+ TypeInfo default_type_info = getDefaultTypeInfo(decl_type);
+ Collection<TypeInfo> result = new ArrayList<TypeInfo>();
+ result.add(default_type_info);
+ return result;
+ } else
+ return multityped_result;
+ }
+
+ private static Map<ParameterDeclaration, Collection<TypeInfo>> getTypeInfoMap(TypeMap type_map, MethodDeclaration method) {
+ Map<ParameterDeclaration, Collection<TypeInfo>> map = new HashMap<ParameterDeclaration, Collection<TypeInfo>>();
+ for (ParameterDeclaration param : method.getParameters()) {
+ Collection<TypeInfo> types = getTypeInfos(type_map, param, param.getType());
+ map.put(param, types);
+ }
+ return map;
+ }
+
+ public static Collection<Map<ParameterDeclaration, TypeInfo>> getTypeInfoCrossProduct(TypeMap type_map, MethodDeclaration method) {
+ Collection<ParameterDeclaration> parameter_collection = method.getParameters();
+ ParameterDeclaration[] parameters = new ParameterDeclaration[parameter_collection.size()];
+ parameter_collection.toArray(parameters);
+ Collection<Map<ParameterDeclaration, TypeInfo>> cross_product = new ArrayList<Map<ParameterDeclaration, TypeInfo>>();
+ getCrossProductRecursive(0, parameters, getTypeInfoMap(type_map, method),
+ new HashMap<ParameterDeclaration, TypeInfo>(), cross_product);
+ return cross_product;
+ }
+
+ private static void getCrossProductRecursive(int index, ParameterDeclaration[] parameters, Map<ParameterDeclaration,
+ Collection<TypeInfo>> typeinfos_map, Map<ParameterDeclaration, TypeInfo> current_instance,
+ Collection<Map<ParameterDeclaration, TypeInfo>> cross_product) {
+ if (index == parameters.length) {
+ cross_product.add(current_instance);
+ return;
+ }
+ ParameterDeclaration param = parameters[index];
+ Collection<TypeInfo> typeinfos = typeinfos_map.get(param);
+ if (typeinfos != null) {
+ for (TypeInfo typeinfo : typeinfos) {
+ Map<ParameterDeclaration, TypeInfo> instance = new HashMap<ParameterDeclaration, TypeInfo>(current_instance);
+ instance.put(param, typeinfo);
+ getCrossProductRecursive(index + 1, parameters, typeinfos_map, instance, cross_product);
+ }
+ }
+ }
+}
diff --git a/src/java/org/lwjgl/util/generator/TypeMap.java b/src/java/org/lwjgl/util/generator/TypeMap.java
index 76a4a49..2c53086 100644
--- a/src/java/org/lwjgl/util/generator/TypeMap.java
+++ b/src/java/org/lwjgl/util/generator/TypeMap.java
@@ -1,63 +1,63 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-package org.lwjgl.util.generator;
-
-/**
- *
- * The interface to the OpenAL/OpenGL specific generator behaviour
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: TypeMap.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import com.sun.mirror.declaration.*;
-import com.sun.mirror.type.*;
-
-import java.io.*;
-
-public interface TypeMap {
- String getErrorCheckMethodName();
- String getRegisterNativesFunctionName();
- PrimitiveType.Kind getPrimitiveTypeFromNativeType(Class native_type);
- String getTypedefPrefix();
- void printNativeIncludes(PrintWriter writer);
- Class getStringElementType();
- Class[] getValidAnnotationTypes(Class type);
- Class getVoidType();
- String translateAnnotation(Class annotation_type);
- Class getNativeTypeFromPrimitiveType(PrimitiveType.Kind kind);
- String getAutoTypeFromAnnotation(AnnotationMirror annotation);
- Class getInverseType(Class type);
- Signedness getSignednessFromType(Class type);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * The interface to the OpenAL/OpenGL specific generator behaviour
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: TypeMap.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import com.sun.mirror.declaration.*;
+import com.sun.mirror.type.*;
+
+import java.io.*;
+
+public interface TypeMap {
+ String getErrorCheckMethodName();
+ String getRegisterNativesFunctionName();
+ PrimitiveType.Kind getPrimitiveTypeFromNativeType(Class native_type);
+ String getTypedefPrefix();
+ void printNativeIncludes(PrintWriter writer);
+ Class getStringElementType();
+ Class[] getValidAnnotationTypes(Class type);
+ Class getVoidType();
+ String translateAnnotation(Class annotation_type);
+ Class getNativeTypeFromPrimitiveType(PrimitiveType.Kind kind);
+ String getAutoTypeFromAnnotation(AnnotationMirror annotation);
+ Class getInverseType(Class type);
+ Signedness getSignednessFromType(Class type);
+}
diff --git a/src/java/org/lwjgl/util/generator/TypedefsGenerator.java b/src/java/org/lwjgl/util/generator/TypedefsGenerator.java
index fe6863a..4b11d3f 100644
--- a/src/java/org/lwjgl/util/generator/TypedefsGenerator.java
+++ b/src/java/org/lwjgl/util/generator/TypedefsGenerator.java
@@ -1,91 +1,91 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-package org.lwjgl.util.generator;
-
-/**
- *
- * A TypeVisitor that generates the native typedefs.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3281 $
- * $Id: TypedefsGenerator.java 3281 2010-03-12 21:55:13Z spasi $
- */
-
-import com.sun.mirror.declaration.*;
-import com.sun.mirror.type.*;
-
-import java.io.*;
-import java.util.*;
-
-public class TypedefsGenerator {
- private static void generateNativeTypedefs(TypeMap type_map, PrintWriter writer, MethodDeclaration method) {
- TypeMirror return_type = method.getReturnType();
- writer.print("typedef ");
- NativeTypeTranslator translator = new NativeTypeTranslator(type_map, method);
- return_type.accept(translator);
- writer.print(translator.getSignature());
- writer.print(" (");
- writer.print(type_map.getTypedefPrefix());
- writer.print(" *" + Utils.getTypedefName(method) + ") (");
- generateNativeTypedefsParameters(type_map, writer, method.getParameters());
- writer.println(");");
- }
-
- private static void generateNativeTypedefsParameters(TypeMap type_map, PrintWriter writer, Collection<ParameterDeclaration> params) {
- if (params.size() > 0) {
- Iterator<ParameterDeclaration> it = params.iterator();
- generateNativeTypedefsParameter(type_map, writer, it.next());
- while (it.hasNext()) {
- writer.print(", ");
- generateNativeTypedefsParameter(type_map, writer, it.next());
- }
- }
- }
-
- private static void generateNativeTypedefsParameter(TypeMap type_map, PrintWriter writer, ParameterDeclaration param) {
- NativeTypeTranslator translator = new NativeTypeTranslator(type_map, param);
- param.getType().accept(translator);
- writer.print(translator.getSignature());
- if (param.getAnnotation(Result.class) != null || param.getAnnotation(Indirect.class) != null || param.getAnnotation(StringList.class) != null)
- writer.print("*");
- writer.print(" " + param.getSimpleName());
- }
-
- public static void generateNativeTypedefs(TypeMap type_map, PrintWriter writer, Collection<? extends MethodDeclaration> methods) {
- for (MethodDeclaration method : methods) {
- if ( method.getAnnotation(Alternate.class) == null )
- generateNativeTypedefs(type_map, writer, method);
- }
- }
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * A TypeVisitor that generates the native typedefs.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3281 $
+ * $Id: TypedefsGenerator.java 3281 2010-03-12 21:55:13Z spasi $
+ */
+
+import com.sun.mirror.declaration.*;
+import com.sun.mirror.type.*;
+
+import java.io.*;
+import java.util.*;
+
+public class TypedefsGenerator {
+ private static void generateNativeTypedefs(TypeMap type_map, PrintWriter writer, MethodDeclaration method) {
+ TypeMirror return_type = method.getReturnType();
+ writer.print("typedef ");
+ NativeTypeTranslator translator = new NativeTypeTranslator(type_map, method);
+ return_type.accept(translator);
+ writer.print(translator.getSignature());
+ writer.print(" (");
+ writer.print(type_map.getTypedefPrefix());
+ writer.print(" *" + Utils.getTypedefName(method) + ") (");
+ generateNativeTypedefsParameters(type_map, writer, method.getParameters());
+ writer.println(");");
+ }
+
+ private static void generateNativeTypedefsParameters(TypeMap type_map, PrintWriter writer, Collection<ParameterDeclaration> params) {
+ if (params.size() > 0) {
+ Iterator<ParameterDeclaration> it = params.iterator();
+ generateNativeTypedefsParameter(type_map, writer, it.next());
+ while (it.hasNext()) {
+ writer.print(", ");
+ generateNativeTypedefsParameter(type_map, writer, it.next());
+ }
+ }
+ }
+
+ private static void generateNativeTypedefsParameter(TypeMap type_map, PrintWriter writer, ParameterDeclaration param) {
+ NativeTypeTranslator translator = new NativeTypeTranslator(type_map, param);
+ param.getType().accept(translator);
+ writer.print(translator.getSignature());
+ if (param.getAnnotation(Result.class) != null || param.getAnnotation(Indirect.class) != null || param.getAnnotation(StringList.class) != null)
+ writer.print("*");
+ writer.print(" " + param.getSimpleName());
+ }
+
+ public static void generateNativeTypedefs(TypeMap type_map, PrintWriter writer, Collection<? extends MethodDeclaration> methods) {
+ for (MethodDeclaration method : methods) {
+ if ( method.getAnnotation(Alternate.class) == null )
+ generateNativeTypedefs(type_map, writer, method);
+ }
+ }
+
+}
diff --git a/src/java/org/lwjgl/util/generator/Utils.java b/src/java/org/lwjgl/util/generator/Utils.java
index c9f1b94..3d6aad8 100644
--- a/src/java/org/lwjgl/util/generator/Utils.java
+++ b/src/java/org/lwjgl/util/generator/Utils.java
@@ -1,397 +1,397 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.generator;
-
-/**
- *
- * Various utility methods to the generator.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3299 $
- * $Id: Utils.java 3299 2010-03-31 15:46:16Z spasi $
- */
-
-import java.io.PrintWriter;
-import java.nio.Buffer;
-import java.nio.ByteBuffer;
-import java.util.*;
-
-import com.sun.mirror.declaration.*;
-import com.sun.mirror.type.PrimitiveType;
-import com.sun.mirror.type.TypeMirror;
-
-public class Utils {
-
- public static final String TYPEDEF_POSTFIX = "PROC";
- public static final String FUNCTION_POINTER_VAR_NAME = "function_pointer";
- public static final String FUNCTION_POINTER_POSTFIX = "_pointer";
- public static final String CHECKS_CLASS_NAME = "GLChecks";
- public static final String CONTEXT_CAPS_CLASS_NAME = "ContextCapabilities";
- public static final String STUB_INITIALIZER_NAME = "initNativeStubs";
- public static final String BUFFER_OBJECT_METHOD_POSTFIX = "BO";
- public static final String BUFFER_OBJECT_PARAMETER_POSTFIX = "_buffer_offset";
- public static final String RESULT_SIZE_NAME = "result_size";
- public static final String RESULT_VAR_NAME = "__result";
- public static final String CACHED_BUFFER_LENGTH_NAME = "length";
- public static final String CACHED_BUFFER_NAME = "old_buffer";
- private static final String OVERLOADED_METHOD_PREFIX = "n";
-
- public static String getTypedefName(MethodDeclaration method) {
- Alternate alt_annotation = method.getAnnotation(Alternate.class);
- return (alt_annotation == null ? method.getSimpleName() : alt_annotation.value()) + TYPEDEF_POSTFIX;
- }
-
- public static String getFunctionAddressName(InterfaceDeclaration interface_decl, MethodDeclaration method) {
- return getFunctionAddressName(interface_decl, method, false);
- }
-
- public static String getFunctionAddressName(InterfaceDeclaration interface_decl, MethodDeclaration method, boolean forceAlt) {
- Alternate alt_annotation = method.getAnnotation(Alternate.class);
- if ( alt_annotation == null || (alt_annotation.nativeAlt() && !forceAlt) )
- return interface_decl.getSimpleName() + "_" + method.getSimpleName() + FUNCTION_POINTER_POSTFIX;
- else
- return interface_decl.getSimpleName() + "_" + alt_annotation.value() + FUNCTION_POINTER_POSTFIX;
- }
-
- public static boolean isFinal(InterfaceDeclaration d) {
- Extension extension_annotation = d.getAnnotation(Extension.class);
- return extension_annotation == null || extension_annotation.isFinal();
- }
-
- private static class AnnotationMirrorComparator implements Comparator<AnnotationMirror> {
- public int compare(AnnotationMirror a1, AnnotationMirror a2) {
- String n1 = a1.getAnnotationType().getDeclaration().getQualifiedName();
- String n2 = a2.getAnnotationType().getDeclaration().getQualifiedName();
- int result = n1.compareTo(n2);
- return result;
- }
-
- public boolean equals(AnnotationMirror a1, AnnotationMirror a2) {
- return compare(a1, a2) == 0;
- }
- }
-
- public static Collection<AnnotationMirror> getSortedAnnotations(Collection<AnnotationMirror> annotations) {
- List<AnnotationMirror> annotation_list = new ArrayList<AnnotationMirror>(annotations);
- Collections.sort(annotation_list, new AnnotationMirrorComparator());
- return annotation_list;
- }
-
- public static String getReferenceName(InterfaceDeclaration interface_decl, MethodDeclaration method, ParameterDeclaration param) {
- return interface_decl.getSimpleName() + "_" + method.getSimpleName() + "_" + param.getSimpleName();
- }
-
- public static boolean isAddressableType(TypeMirror type) {
- return isAddressableType(getJavaType(type));
- }
-
- public static boolean isAddressableType(Class type) {
- return Buffer.class.isAssignableFrom(type) || String.class.equals(type) || CharSequence.class.equals(type) || CharSequence[].class.equals(type);
- }
-
- public static Class getJavaType(TypeMirror type_mirror) {
- JavaTypeTranslator translator = new JavaTypeTranslator();
- type_mirror.accept(translator);
- return translator.getType();
- }
-
- private static boolean hasParameterMultipleTypes(ParameterDeclaration param) {
- int num_native_annotations = 0;
- for (AnnotationMirror annotation : param.getAnnotationMirrors())
- if (NativeTypeTranslator.getAnnotation(annotation, NativeType.class) != null)
- num_native_annotations++;
- return num_native_annotations > 1;
- }
-
- public static boolean isParameterMultiTyped(ParameterDeclaration param) {
- boolean result = Buffer.class.equals(Utils.getJavaType(param.getType()));
- if (!result && hasParameterMultipleTypes(param))
- throw new RuntimeException(param + " not defined as java.nio.Buffer but has multiple types");
- return result;
- }
-
- public static ParameterDeclaration findParameter(MethodDeclaration method, String name) {
- for (ParameterDeclaration param : method.getParameters())
- if (param.getSimpleName().equals(name))
- return param;
- throw new RuntimeException("Parameter " + name + " not found");
- }
-
- public static void printDocComment(PrintWriter writer, Declaration decl) {
- String doc_comment = decl.getDocComment();
- if (doc_comment != null) {
- String tab = decl instanceof InterfaceDeclaration ? "" : "\t";
- writer.println(tab + "/**");
- StringTokenizer doc_lines = new StringTokenizer(doc_comment, "\n");
- while (doc_lines.hasMoreTokens())
- writer.println(tab + " * " + doc_lines.nextToken());
- writer.println(tab + " */");
- } else if ( (decl instanceof MethodDeclaration) && decl.getAnnotation(Alternate.class) != null )
- writer.println("\t/** Overloads " + decl.getAnnotation(Alternate.class).value() + " */");
- }
-
- public static AnnotationMirror getParameterAutoAnnotation(ParameterDeclaration param) {
- for (AnnotationMirror annotation : param.getAnnotationMirrors())
- if (NativeTypeTranslator.getAnnotation(annotation, Auto.class) != null)
- return annotation;
- return null;
- }
-
- public static boolean isMethodIndirect(boolean generate_error_checks, boolean context_specific, MethodDeclaration method) {
- for (ParameterDeclaration param : method.getParameters()) {
- if (isAddressableType(param.getType()) || getParameterAutoAnnotation(param) != null ||
- param.getAnnotation(Constant.class) != null)
- return true;
- }
- return hasMethodBufferObjectParameter(method) || method.getAnnotation(Code.class) != null ||
- method.getAnnotation(CachedResult.class) != null ||
- (generate_error_checks && method.getAnnotation(NoErrorCheck.class) == null) ||
- context_specific;
- }
-
- public static String getNativeQualifiedName(String qualified_name) {
- return qualified_name.replaceAll("\\.", "_");
- }
-
- public static String getQualifiedNativeMethodName(String qualified_class_name, String method_name) {
- return "Java_" + getNativeQualifiedName(qualified_class_name) + "_" + method_name;
- }
-
- public static String getQualifiedNativeMethodName(String qualified_class_name, MethodDeclaration method, boolean generate_error_checks, boolean context_specific) {
- String method_name = getSimpleNativeMethodName(method, generate_error_checks, context_specific);
- return getQualifiedNativeMethodName(qualified_class_name, method_name);
- }
-
- public static ParameterDeclaration getResultParameter(MethodDeclaration method) {
- ParameterDeclaration result_param = null;
- for (ParameterDeclaration param : method.getParameters()) {
- if (param.getAnnotation(Result.class) != null) {
- if (result_param != null)
- throw new RuntimeException("Multiple parameters annotated with Result in method " + method);
- result_param = param;
- }
- }
- return result_param;
- }
-
- public static TypeMirror getMethodReturnType(MethodDeclaration method) {
- TypeMirror result_type;
- ParameterDeclaration result_param = getResultParameter(method);
- if (result_param != null) {
- result_type = result_param.getType();
- } else
- result_type = method.getReturnType();
- return result_type;
- }
-
- public static String getMethodReturnType(MethodDeclaration method, GLreturn return_annotation, boolean buffer) {
- ParameterDeclaration return_param = null;
- for ( ParameterDeclaration param : method.getParameters() ) {
- if ( param.getSimpleName().equals(return_annotation.value()) ) {
- return_param = param;
- break;
- }
- }
- if ( return_param == null )
- throw new RuntimeException("The @GLreturn parameter \"" + return_annotation.value() + "\" could not be found in method: " + method);
-
- PrimitiveType.Kind kind = NativeTypeTranslator.getPrimitiveKindFromBufferClass(Utils.getJavaType(return_param.getType()));
- if ( return_param.getAnnotation(GLboolean.class) != null )
- kind = PrimitiveType.Kind.BOOLEAN;
-
- if ( kind == PrimitiveType.Kind.BYTE && (return_param.getAnnotation(GLchar.class) != null || return_param.getAnnotation(GLcharARB.class) != null) )
- return "String";
- else {
- final String type = JavaTypeTranslator.getPrimitiveClassFromKind(kind).getName();
- return buffer ? Character.toUpperCase(type.charAt(0)) + type.substring(1) : type;
- }
- }
-
- public static boolean needResultSize(MethodDeclaration method) {
- return getNIOBufferType(getMethodReturnType(method)) != null && method.getAnnotation(AutoResultSize.class) == null;
- }
-
- public static void printExtraCallArguments(PrintWriter writer, MethodDeclaration method, String size_parameter_name) {
- writer.print(size_parameter_name);
- if (method.getAnnotation(CachedResult.class) != null) {
- writer.print(", " + CACHED_BUFFER_NAME);
- }
- }
-
- private static String getClassName(InterfaceDeclaration interface_decl, String opengl_name) {
- Extension extension_annotation = interface_decl.getAnnotation(Extension.class);
- if (extension_annotation != null && !"".equals(extension_annotation.className())) {
- return extension_annotation.className();
- }
- StringBuilder result = new StringBuilder();
- for (int i = 0; i < opengl_name.length(); i++) {
- int ch = opengl_name.codePointAt(i);
- if (ch == '_') {
- i++;
- result.appendCodePoint(Character.toUpperCase(opengl_name.codePointAt(i)));
- } else
- result.appendCodePoint(ch);
- }
- return result.toString();
- }
-
- public static boolean hasMethodBufferObjectParameter(MethodDeclaration method) {
- for (ParameterDeclaration param : method.getParameters()) {
- if (param.getAnnotation(BufferObject.class) != null) {
- return true;
- }
- }
- return false;
- }
-
- public static String getQualifiedClassName(InterfaceDeclaration interface_decl) {
- return interface_decl.getPackage().getQualifiedName() + "." + getSimpleClassName(interface_decl);
- }
-
- public static String getSimpleClassName(InterfaceDeclaration interface_decl) {
- return getClassName(interface_decl, interface_decl.getSimpleName());
- }
-
- public static Class<?> getNIOBufferType(TypeMirror t) {
- Class<?> param_type = getJavaType(t);
- if (Buffer.class.isAssignableFrom(param_type))
- return param_type;
- else if ( param_type == CharSequence.class || param_type == CharSequence[].class )
- return ByteBuffer.class;
- else
- return null;
- }
-
- public static String getSimpleNativeMethodName(MethodDeclaration method, boolean generate_error_checks, boolean context_specific) {
- String method_name;
- Alternate alt_annotation = method.getAnnotation(Alternate.class);
- method_name = alt_annotation == null || alt_annotation.nativeAlt() ? method.getSimpleName() : alt_annotation.value();
- if (isMethodIndirect(generate_error_checks, context_specific, method))
- method_name = OVERLOADED_METHOD_PREFIX + method_name;
- return method_name;
- }
-
- static boolean isReturnParameter(MethodDeclaration method, ParameterDeclaration param) {
- GLreturn string_annotation = method.getAnnotation(GLreturn.class);
- if ( string_annotation == null || !string_annotation.value().equals(param.getSimpleName()) )
- return false;
-
- if ( param.getAnnotation(OutParameter.class) == null )
- throw new RuntimeException("The parameter specified in @GLreturn is not annotated with @OutParameter in method: " + method);
-
- if ( param.getAnnotation(Check.class) != null )
- throw new RuntimeException("The parameter specified in @GLreturn is annotated with @Check in method: " + method);
-
- if ( param.getAnnotation(GLchar.class) != null && Utils.getJavaType(param.getType()).equals(ByteBuffer.class) && string_annotation.maxLength().length() == 0 )
- throw new RuntimeException("The @GLreturn annotation is missing a maxLength parameter in method: " + method);
-
- return true;
- }
-
- static String getStringOffset(MethodDeclaration method, ParameterDeclaration param) {
- String offset = null;
- for ( ParameterDeclaration p : method.getParameters() ) {
- if ( param != null && p.getSimpleName().equals(param.getSimpleName()) )
- break;
-
- final Class type = Utils.getJavaType(p.getType());
- if ( type.equals(CharSequence.class) ) {
- if ( offset == null )
- offset = p.getSimpleName() + ".length()";
- else
- offset += " + " + p.getSimpleName() + ".length()";
- if ( p.getAnnotation(NullTerminated.class) != null ) offset += " + 1";
-
- } else if ( type.equals(CharSequence[].class) ) {
- if ( offset == null )
- offset = "APIUtils.getTotalLength(" + p.getSimpleName() + ")";
- else
- offset += " + APIUtils.getTotalLength(" + p.getSimpleName() + ")";
- if ( p.getAnnotation(NullTerminated.class) != null ) offset += " + " + p.getSimpleName() + ".length";
- }
-
- }
- return offset;
- }
-
- static void printGLReturnPre(PrintWriter writer, MethodDeclaration method, GLreturn return_annotation) {
- final String return_type = getMethodReturnType(method, return_annotation, true);
-
- if ( "String".equals(return_type) ) {
- if ( !return_annotation.forceMaxLength() ) {
- writer.println("IntBuffer " + return_annotation.value() + "_length = APIUtils.getLengths();");
- writer.print("\t\t");
- }
- writer.print("ByteBuffer " + return_annotation.value() + " = APIUtils.getBufferByte(" + return_annotation.maxLength());
- /*
- Params that use the return buffer will advance its position while filling it. When we return, the position will be
- at the right spot for grabbing the returned string bytes. We only have to make sure that the original buffer was
- large enough to hold everything, so that no re-allocations happen while filling.
- */
- final String offset = getStringOffset(method, null);
- if ( offset != null )
- writer.print(" + " + offset);
- writer.println(");");
- } else {
- final String buffer_type = "Boolean".equals(return_type) ? "Byte" : return_type;
- writer.print(buffer_type + "Buffer " + return_annotation.value() + " = APIUtils.getBuffer" + buffer_type + "(");
- if ( "Byte".equals(buffer_type) )
- writer.print('1');
- writer.println(");");
- }
-
- writer.print("\t\t");
- }
-
- static void printGLReturnPost(PrintWriter writer, MethodDeclaration method, GLreturn return_annotation) {
- final String return_type = getMethodReturnType(method, return_annotation, true);
-
- if ( "String".equals(return_type) ) {
- writer.print("\t\t" + return_annotation.value() + ".limit(");
- final String offset = getStringOffset(method, null);
- if ( offset != null)
- writer.print(offset + " + ");
- if ( return_annotation.forceMaxLength() )
- writer.print(return_annotation.maxLength());
- else
- writer.print(return_annotation.value() + "_length.get(0)");
- writer.println(");");
- writer.println("\t\treturn APIUtils.getString(" + return_annotation.value() + ");");
- } else {
- writer.print("\t\treturn " + return_annotation.value() + ".get(0)");
- if ( "Boolean".equals(return_type) )
- writer.print(" == 1");
- writer.println(";");
- }
- }
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.generator;
+
+/**
+ *
+ * Various utility methods to the generator.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3299 $
+ * $Id: Utils.java 3299 2010-03-31 15:46:16Z spasi $
+ */
+
+import java.io.PrintWriter;
+import java.nio.Buffer;
+import java.nio.ByteBuffer;
+import java.util.*;
+
+import com.sun.mirror.declaration.*;
+import com.sun.mirror.type.PrimitiveType;
+import com.sun.mirror.type.TypeMirror;
+
+public class Utils {
+
+ public static final String TYPEDEF_POSTFIX = "PROC";
+ public static final String FUNCTION_POINTER_VAR_NAME = "function_pointer";
+ public static final String FUNCTION_POINTER_POSTFIX = "_pointer";
+ public static final String CHECKS_CLASS_NAME = "GLChecks";
+ public static final String CONTEXT_CAPS_CLASS_NAME = "ContextCapabilities";
+ public static final String STUB_INITIALIZER_NAME = "initNativeStubs";
+ public static final String BUFFER_OBJECT_METHOD_POSTFIX = "BO";
+ public static final String BUFFER_OBJECT_PARAMETER_POSTFIX = "_buffer_offset";
+ public static final String RESULT_SIZE_NAME = "result_size";
+ public static final String RESULT_VAR_NAME = "__result";
+ public static final String CACHED_BUFFER_LENGTH_NAME = "length";
+ public static final String CACHED_BUFFER_NAME = "old_buffer";
+ private static final String OVERLOADED_METHOD_PREFIX = "n";
+
+ public static String getTypedefName(MethodDeclaration method) {
+ Alternate alt_annotation = method.getAnnotation(Alternate.class);
+ return (alt_annotation == null ? method.getSimpleName() : alt_annotation.value()) + TYPEDEF_POSTFIX;
+ }
+
+ public static String getFunctionAddressName(InterfaceDeclaration interface_decl, MethodDeclaration method) {
+ return getFunctionAddressName(interface_decl, method, false);
+ }
+
+ public static String getFunctionAddressName(InterfaceDeclaration interface_decl, MethodDeclaration method, boolean forceAlt) {
+ Alternate alt_annotation = method.getAnnotation(Alternate.class);
+ if ( alt_annotation == null || (alt_annotation.nativeAlt() && !forceAlt) )
+ return interface_decl.getSimpleName() + "_" + method.getSimpleName() + FUNCTION_POINTER_POSTFIX;
+ else
+ return interface_decl.getSimpleName() + "_" + alt_annotation.value() + FUNCTION_POINTER_POSTFIX;
+ }
+
+ public static boolean isFinal(InterfaceDeclaration d) {
+ Extension extension_annotation = d.getAnnotation(Extension.class);
+ return extension_annotation == null || extension_annotation.isFinal();
+ }
+
+ private static class AnnotationMirrorComparator implements Comparator<AnnotationMirror> {
+ public int compare(AnnotationMirror a1, AnnotationMirror a2) {
+ String n1 = a1.getAnnotationType().getDeclaration().getQualifiedName();
+ String n2 = a2.getAnnotationType().getDeclaration().getQualifiedName();
+ int result = n1.compareTo(n2);
+ return result;
+ }
+
+ public boolean equals(AnnotationMirror a1, AnnotationMirror a2) {
+ return compare(a1, a2) == 0;
+ }
+ }
+
+ public static Collection<AnnotationMirror> getSortedAnnotations(Collection<AnnotationMirror> annotations) {
+ List<AnnotationMirror> annotation_list = new ArrayList<AnnotationMirror>(annotations);
+ Collections.sort(annotation_list, new AnnotationMirrorComparator());
+ return annotation_list;
+ }
+
+ public static String getReferenceName(InterfaceDeclaration interface_decl, MethodDeclaration method, ParameterDeclaration param) {
+ return interface_decl.getSimpleName() + "_" + method.getSimpleName() + "_" + param.getSimpleName();
+ }
+
+ public static boolean isAddressableType(TypeMirror type) {
+ return isAddressableType(getJavaType(type));
+ }
+
+ public static boolean isAddressableType(Class type) {
+ return Buffer.class.isAssignableFrom(type) || String.class.equals(type) || CharSequence.class.equals(type) || CharSequence[].class.equals(type);
+ }
+
+ public static Class getJavaType(TypeMirror type_mirror) {
+ JavaTypeTranslator translator = new JavaTypeTranslator();
+ type_mirror.accept(translator);
+ return translator.getType();
+ }
+
+ private static boolean hasParameterMultipleTypes(ParameterDeclaration param) {
+ int num_native_annotations = 0;
+ for (AnnotationMirror annotation : param.getAnnotationMirrors())
+ if (NativeTypeTranslator.getAnnotation(annotation, NativeType.class) != null)
+ num_native_annotations++;
+ return num_native_annotations > 1;
+ }
+
+ public static boolean isParameterMultiTyped(ParameterDeclaration param) {
+ boolean result = Buffer.class.equals(Utils.getJavaType(param.getType()));
+ if (!result && hasParameterMultipleTypes(param))
+ throw new RuntimeException(param + " not defined as java.nio.Buffer but has multiple types");
+ return result;
+ }
+
+ public static ParameterDeclaration findParameter(MethodDeclaration method, String name) {
+ for (ParameterDeclaration param : method.getParameters())
+ if (param.getSimpleName().equals(name))
+ return param;
+ throw new RuntimeException("Parameter " + name + " not found");
+ }
+
+ public static void printDocComment(PrintWriter writer, Declaration decl) {
+ String doc_comment = decl.getDocComment();
+ if (doc_comment != null) {
+ String tab = decl instanceof InterfaceDeclaration ? "" : "\t";
+ writer.println(tab + "/**");
+ StringTokenizer doc_lines = new StringTokenizer(doc_comment, "\n");
+ while (doc_lines.hasMoreTokens())
+ writer.println(tab + " * " + doc_lines.nextToken());
+ writer.println(tab + " */");
+ } else if ( (decl instanceof MethodDeclaration) && decl.getAnnotation(Alternate.class) != null )
+ writer.println("\t/** Overloads " + decl.getAnnotation(Alternate.class).value() + " */");
+ }
+
+ public static AnnotationMirror getParameterAutoAnnotation(ParameterDeclaration param) {
+ for (AnnotationMirror annotation : param.getAnnotationMirrors())
+ if (NativeTypeTranslator.getAnnotation(annotation, Auto.class) != null)
+ return annotation;
+ return null;
+ }
+
+ public static boolean isMethodIndirect(boolean generate_error_checks, boolean context_specific, MethodDeclaration method) {
+ for (ParameterDeclaration param : method.getParameters()) {
+ if (isAddressableType(param.getType()) || getParameterAutoAnnotation(param) != null ||
+ param.getAnnotation(Constant.class) != null)
+ return true;
+ }
+ return hasMethodBufferObjectParameter(method) || method.getAnnotation(Code.class) != null ||
+ method.getAnnotation(CachedResult.class) != null ||
+ (generate_error_checks && method.getAnnotation(NoErrorCheck.class) == null) ||
+ context_specific;
+ }
+
+ public static String getNativeQualifiedName(String qualified_name) {
+ return qualified_name.replaceAll("\\.", "_");
+ }
+
+ public static String getQualifiedNativeMethodName(String qualified_class_name, String method_name) {
+ return "Java_" + getNativeQualifiedName(qualified_class_name) + "_" + method_name;
+ }
+
+ public static String getQualifiedNativeMethodName(String qualified_class_name, MethodDeclaration method, boolean generate_error_checks, boolean context_specific) {
+ String method_name = getSimpleNativeMethodName(method, generate_error_checks, context_specific);
+ return getQualifiedNativeMethodName(qualified_class_name, method_name);
+ }
+
+ public static ParameterDeclaration getResultParameter(MethodDeclaration method) {
+ ParameterDeclaration result_param = null;
+ for (ParameterDeclaration param : method.getParameters()) {
+ if (param.getAnnotation(Result.class) != null) {
+ if (result_param != null)
+ throw new RuntimeException("Multiple parameters annotated with Result in method " + method);
+ result_param = param;
+ }
+ }
+ return result_param;
+ }
+
+ public static TypeMirror getMethodReturnType(MethodDeclaration method) {
+ TypeMirror result_type;
+ ParameterDeclaration result_param = getResultParameter(method);
+ if (result_param != null) {
+ result_type = result_param.getType();
+ } else
+ result_type = method.getReturnType();
+ return result_type;
+ }
+
+ public static String getMethodReturnType(MethodDeclaration method, GLreturn return_annotation, boolean buffer) {
+ ParameterDeclaration return_param = null;
+ for ( ParameterDeclaration param : method.getParameters() ) {
+ if ( param.getSimpleName().equals(return_annotation.value()) ) {
+ return_param = param;
+ break;
+ }
+ }
+ if ( return_param == null )
+ throw new RuntimeException("The @GLreturn parameter \"" + return_annotation.value() + "\" could not be found in method: " + method);
+
+ PrimitiveType.Kind kind = NativeTypeTranslator.getPrimitiveKindFromBufferClass(Utils.getJavaType(return_param.getType()));
+ if ( return_param.getAnnotation(GLboolean.class) != null )
+ kind = PrimitiveType.Kind.BOOLEAN;
+
+ if ( kind == PrimitiveType.Kind.BYTE && (return_param.getAnnotation(GLchar.class) != null || return_param.getAnnotation(GLcharARB.class) != null) )
+ return "String";
+ else {
+ final String type = JavaTypeTranslator.getPrimitiveClassFromKind(kind).getName();
+ return buffer ? Character.toUpperCase(type.charAt(0)) + type.substring(1) : type;
+ }
+ }
+
+ public static boolean needResultSize(MethodDeclaration method) {
+ return getNIOBufferType(getMethodReturnType(method)) != null && method.getAnnotation(AutoResultSize.class) == null;
+ }
+
+ public static void printExtraCallArguments(PrintWriter writer, MethodDeclaration method, String size_parameter_name) {
+ writer.print(size_parameter_name);
+ if (method.getAnnotation(CachedResult.class) != null) {
+ writer.print(", " + CACHED_BUFFER_NAME);
+ }
+ }
+
+ private static String getClassName(InterfaceDeclaration interface_decl, String opengl_name) {
+ Extension extension_annotation = interface_decl.getAnnotation(Extension.class);
+ if (extension_annotation != null && !"".equals(extension_annotation.className())) {
+ return extension_annotation.className();
+ }
+ StringBuilder result = new StringBuilder();
+ for (int i = 0; i < opengl_name.length(); i++) {
+ int ch = opengl_name.codePointAt(i);
+ if (ch == '_') {
+ i++;
+ result.appendCodePoint(Character.toUpperCase(opengl_name.codePointAt(i)));
+ } else
+ result.appendCodePoint(ch);
+ }
+ return result.toString();
+ }
+
+ public static boolean hasMethodBufferObjectParameter(MethodDeclaration method) {
+ for (ParameterDeclaration param : method.getParameters()) {
+ if (param.getAnnotation(BufferObject.class) != null) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static String getQualifiedClassName(InterfaceDeclaration interface_decl) {
+ return interface_decl.getPackage().getQualifiedName() + "." + getSimpleClassName(interface_decl);
+ }
+
+ public static String getSimpleClassName(InterfaceDeclaration interface_decl) {
+ return getClassName(interface_decl, interface_decl.getSimpleName());
+ }
+
+ public static Class<?> getNIOBufferType(TypeMirror t) {
+ Class<?> param_type = getJavaType(t);
+ if (Buffer.class.isAssignableFrom(param_type))
+ return param_type;
+ else if ( param_type == CharSequence.class || param_type == CharSequence[].class )
+ return ByteBuffer.class;
+ else
+ return null;
+ }
+
+ public static String getSimpleNativeMethodName(MethodDeclaration method, boolean generate_error_checks, boolean context_specific) {
+ String method_name;
+ Alternate alt_annotation = method.getAnnotation(Alternate.class);
+ method_name = alt_annotation == null || alt_annotation.nativeAlt() ? method.getSimpleName() : alt_annotation.value();
+ if (isMethodIndirect(generate_error_checks, context_specific, method))
+ method_name = OVERLOADED_METHOD_PREFIX + method_name;
+ return method_name;
+ }
+
+ static boolean isReturnParameter(MethodDeclaration method, ParameterDeclaration param) {
+ GLreturn string_annotation = method.getAnnotation(GLreturn.class);
+ if ( string_annotation == null || !string_annotation.value().equals(param.getSimpleName()) )
+ return false;
+
+ if ( param.getAnnotation(OutParameter.class) == null )
+ throw new RuntimeException("The parameter specified in @GLreturn is not annotated with @OutParameter in method: " + method);
+
+ if ( param.getAnnotation(Check.class) != null )
+ throw new RuntimeException("The parameter specified in @GLreturn is annotated with @Check in method: " + method);
+
+ if ( param.getAnnotation(GLchar.class) != null && Utils.getJavaType(param.getType()).equals(ByteBuffer.class) && string_annotation.maxLength().length() == 0 )
+ throw new RuntimeException("The @GLreturn annotation is missing a maxLength parameter in method: " + method);
+
+ return true;
+ }
+
+ static String getStringOffset(MethodDeclaration method, ParameterDeclaration param) {
+ String offset = null;
+ for ( ParameterDeclaration p : method.getParameters() ) {
+ if ( param != null && p.getSimpleName().equals(param.getSimpleName()) )
+ break;
+
+ final Class type = Utils.getJavaType(p.getType());
+ if ( type.equals(CharSequence.class) ) {
+ if ( offset == null )
+ offset = p.getSimpleName() + ".length()";
+ else
+ offset += " + " + p.getSimpleName() + ".length()";
+ if ( p.getAnnotation(NullTerminated.class) != null ) offset += " + 1";
+
+ } else if ( type.equals(CharSequence[].class) ) {
+ if ( offset == null )
+ offset = "APIUtils.getTotalLength(" + p.getSimpleName() + ")";
+ else
+ offset += " + APIUtils.getTotalLength(" + p.getSimpleName() + ")";
+ if ( p.getAnnotation(NullTerminated.class) != null ) offset += " + " + p.getSimpleName() + ".length";
+ }
+
+ }
+ return offset;
+ }
+
+ static void printGLReturnPre(PrintWriter writer, MethodDeclaration method, GLreturn return_annotation) {
+ final String return_type = getMethodReturnType(method, return_annotation, true);
+
+ if ( "String".equals(return_type) ) {
+ if ( !return_annotation.forceMaxLength() ) {
+ writer.println("IntBuffer " + return_annotation.value() + "_length = APIUtils.getLengths();");
+ writer.print("\t\t");
+ }
+ writer.print("ByteBuffer " + return_annotation.value() + " = APIUtils.getBufferByte(" + return_annotation.maxLength());
+ /*
+ Params that use the return buffer will advance its position while filling it. When we return, the position will be
+ at the right spot for grabbing the returned string bytes. We only have to make sure that the original buffer was
+ large enough to hold everything, so that no re-allocations happen while filling.
+ */
+ final String offset = getStringOffset(method, null);
+ if ( offset != null )
+ writer.print(" + " + offset);
+ writer.println(");");
+ } else {
+ final String buffer_type = "Boolean".equals(return_type) ? "Byte" : return_type;
+ writer.print(buffer_type + "Buffer " + return_annotation.value() + " = APIUtils.getBuffer" + buffer_type + "(");
+ if ( "Byte".equals(buffer_type) )
+ writer.print('1');
+ writer.println(");");
+ }
+
+ writer.print("\t\t");
+ }
+
+ static void printGLReturnPost(PrintWriter writer, MethodDeclaration method, GLreturn return_annotation) {
+ final String return_type = getMethodReturnType(method, return_annotation, true);
+
+ if ( "String".equals(return_type) ) {
+ writer.print("\t\t" + return_annotation.value() + ".limit(");
+ final String offset = getStringOffset(method, null);
+ if ( offset != null)
+ writer.print(offset + " + ");
+ if ( return_annotation.forceMaxLength() )
+ writer.print(return_annotation.maxLength());
+ else
+ writer.print(return_annotation.value() + "_length.get(0)");
+ writer.println(");");
+ writer.println("\t\treturn APIUtils.getString(" + return_annotation.value() + ");");
+ } else {
+ writer.print("\t\treturn " + return_annotation.value() + ".get(0)");
+ if ( "Boolean".equals(return_type) )
+ writer.print(" == 1");
+ writer.println(";");
+ }
+ }
+
+}
diff --git a/src/java/org/lwjgl/util/glu/Cylinder.java b/src/java/org/lwjgl/util/glu/Cylinder.java
index 4792f83..f4d8543 100644
--- a/src/java/org/lwjgl/util/glu/Cylinder.java
+++ b/src/java/org/lwjgl/util/glu/Cylinder.java
@@ -1,200 +1,200 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.glu;
-
-import org.lwjgl.opengl.GL11;
-
-/**
- * Cylinder.java
- *
- *
- * Created 23-dec-2003
- * @author Erik Duijs
- */
-public class Cylinder extends Quadric {
-
- /**
- * Constructor for Cylinder.
- */
- public Cylinder() {
- super();
- }
-
- /**
- * 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 draw(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 (super.orientation == GLU.GLU_INSIDE) {
- nsign = -1.0f;
- } else {
- nsign = 1.0f;
- }
-
- da = 2.0f * GLU.PI / slices;
- dr = (topRadius - baseRadius) / stacks;
- dz = height / stacks;
- nz = (baseRadius - topRadius) / height;
- // Z component of normal vectors
-
- if (super.drawStyle == GLU.GLU_POINT) {
- GL11.glBegin(GL11.GL_POINTS);
- for (i = 0; i < slices; i++) {
- x = cos((i * da));
- y = sin((i * da));
- normal3f(x * nsign, y * nsign, nz * nsign);
-
- z = 0.0f;
- r = baseRadius;
- for (j = 0; j <= stacks; j++) {
- GL11.glVertex3f((x * r), (y * r), z);
- z += dz;
- r += dr;
- }
- }
- GL11.glEnd();
- } else if (super.drawStyle == GLU.GLU_LINE || super.drawStyle == GLU.GLU_SILHOUETTE) {
- // Draw rings
- if (super.drawStyle == GLU.GLU_LINE) {
- z = 0.0f;
- r = baseRadius;
- for (j = 0; j <= stacks; j++) {
- GL11.glBegin(GL11.GL_LINE_LOOP);
- for (i = 0; i < slices; i++) {
- x = cos((i * da));
- y = sin((i * da));
- normal3f(x * nsign, y * nsign, nz * nsign);
- GL11.glVertex3f((x * r), (y * r), z);
- }
- GL11.glEnd();
- z += dz;
- r += dr;
- }
- } else {
- // draw one ring at each end
- if (baseRadius != 0.0) {
- GL11.glBegin(GL11.GL_LINE_LOOP);
- for (i = 0; i < slices; i++) {
- x = cos((i * da));
- y = sin((i * da));
- normal3f(x * nsign, y * nsign, nz * nsign);
- GL11.glVertex3f((x * baseRadius), (y * baseRadius), 0.0f);
- }
- GL11.glEnd();
- GL11.glBegin(GL11.GL_LINE_LOOP);
- for (i = 0; i < slices; i++) {
- x = cos((i * da));
- y = sin((i * da));
- normal3f(x * nsign, y * nsign, nz * nsign);
- GL11.glVertex3f((x * topRadius), (y * topRadius), height);
- }
- GL11.glEnd();
- }
- }
- // draw length lines
- GL11.glBegin(GL11.GL_LINES);
- for (i = 0; i < slices; i++) {
- x = cos((i * da));
- y = sin((i * da));
- normal3f(x * nsign, y * nsign, nz * nsign);
- GL11.glVertex3f((x * baseRadius), (y * baseRadius), 0.0f);
- GL11.glVertex3f((x * topRadius), (y * topRadius), (height));
- }
- GL11.glEnd();
- } else if (super.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;
- GL11.glBegin(GL11.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((x * nsign), (y * nsign), (nz * nsign));
- TXTR_COORD(s, t);
- GL11.glVertex3f((x * r), (y * r), z);
- normal3f((x * nsign), (y * nsign), (nz * nsign));
- TXTR_COORD(s, t + dt);
- GL11.glVertex3f((x * (r + dr)), (y * (r + dr)), (z + dz));
- } else {
- normal3f(x * nsign, y * nsign, nz * nsign);
- TXTR_COORD(s, t);
- GL11.glVertex3f((x * r), (y * r), z);
- normal3f(x * nsign, y * nsign, nz * nsign);
- TXTR_COORD(s, t + dt);
- GL11.glVertex3f((x * (r + dr)), (y * (r + dr)), (z + dz));
- }
- s += ds;
- } // for slices
- GL11.glEnd();
- r += dr;
- t += dt;
- z += dz;
- } // for stacks
- }
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.glu;
+
+import org.lwjgl.opengl.GL11;
+
+/**
+ * Cylinder.java
+ *
+ *
+ * Created 23-dec-2003
+ * @author Erik Duijs
+ */
+public class Cylinder extends Quadric {
+
+ /**
+ * Constructor for Cylinder.
+ */
+ public Cylinder() {
+ super();
+ }
+
+ /**
+ * 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 draw(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 (super.orientation == GLU.GLU_INSIDE) {
+ nsign = -1.0f;
+ } else {
+ nsign = 1.0f;
+ }
+
+ da = 2.0f * GLU.PI / slices;
+ dr = (topRadius - baseRadius) / stacks;
+ dz = height / stacks;
+ nz = (baseRadius - topRadius) / height;
+ // Z component of normal vectors
+
+ if (super.drawStyle == GLU.GLU_POINT) {
+ GL11.glBegin(GL11.GL_POINTS);
+ for (i = 0; i < slices; i++) {
+ x = cos((i * da));
+ y = sin((i * da));
+ normal3f(x * nsign, y * nsign, nz * nsign);
+
+ z = 0.0f;
+ r = baseRadius;
+ for (j = 0; j <= stacks; j++) {
+ GL11.glVertex3f((x * r), (y * r), z);
+ z += dz;
+ r += dr;
+ }
+ }
+ GL11.glEnd();
+ } else if (super.drawStyle == GLU.GLU_LINE || super.drawStyle == GLU.GLU_SILHOUETTE) {
+ // Draw rings
+ if (super.drawStyle == GLU.GLU_LINE) {
+ z = 0.0f;
+ r = baseRadius;
+ for (j = 0; j <= stacks; j++) {
+ GL11.glBegin(GL11.GL_LINE_LOOP);
+ for (i = 0; i < slices; i++) {
+ x = cos((i * da));
+ y = sin((i * da));
+ normal3f(x * nsign, y * nsign, nz * nsign);
+ GL11.glVertex3f((x * r), (y * r), z);
+ }
+ GL11.glEnd();
+ z += dz;
+ r += dr;
+ }
+ } else {
+ // draw one ring at each end
+ if (baseRadius != 0.0) {
+ GL11.glBegin(GL11.GL_LINE_LOOP);
+ for (i = 0; i < slices; i++) {
+ x = cos((i * da));
+ y = sin((i * da));
+ normal3f(x * nsign, y * nsign, nz * nsign);
+ GL11.glVertex3f((x * baseRadius), (y * baseRadius), 0.0f);
+ }
+ GL11.glEnd();
+ GL11.glBegin(GL11.GL_LINE_LOOP);
+ for (i = 0; i < slices; i++) {
+ x = cos((i * da));
+ y = sin((i * da));
+ normal3f(x * nsign, y * nsign, nz * nsign);
+ GL11.glVertex3f((x * topRadius), (y * topRadius), height);
+ }
+ GL11.glEnd();
+ }
+ }
+ // draw length lines
+ GL11.glBegin(GL11.GL_LINES);
+ for (i = 0; i < slices; i++) {
+ x = cos((i * da));
+ y = sin((i * da));
+ normal3f(x * nsign, y * nsign, nz * nsign);
+ GL11.glVertex3f((x * baseRadius), (y * baseRadius), 0.0f);
+ GL11.glVertex3f((x * topRadius), (y * topRadius), (height));
+ }
+ GL11.glEnd();
+ } else if (super.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;
+ GL11.glBegin(GL11.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((x * nsign), (y * nsign), (nz * nsign));
+ TXTR_COORD(s, t);
+ GL11.glVertex3f((x * r), (y * r), z);
+ normal3f((x * nsign), (y * nsign), (nz * nsign));
+ TXTR_COORD(s, t + dt);
+ GL11.glVertex3f((x * (r + dr)), (y * (r + dr)), (z + dz));
+ } else {
+ normal3f(x * nsign, y * nsign, nz * nsign);
+ TXTR_COORD(s, t);
+ GL11.glVertex3f((x * r), (y * r), z);
+ normal3f(x * nsign, y * nsign, nz * nsign);
+ TXTR_COORD(s, t + dt);
+ GL11.glVertex3f((x * (r + dr)), (y * (r + dr)), (z + dz));
+ }
+ s += ds;
+ } // for slices
+ GL11.glEnd();
+ r += dr;
+ t += dt;
+ z += dz;
+ } // for stacks
+ }
+ }
+}
diff --git a/src/java/org/lwjgl/util/glu/Disk.java b/src/java/org/lwjgl/util/glu/Disk.java
index 0f5cf28..e0a76f9 100644
--- a/src/java/org/lwjgl/util/glu/Disk.java
+++ b/src/java/org/lwjgl/util/glu/Disk.java
@@ -1,213 +1,213 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.glu;
-
-import org.lwjgl.opengl.GL11;
-
-/**
- * Disk.java
- *
- *
- * Created 23-dec-2003
- * @author Erik Duijs
- */
-public class Disk extends Quadric {
-
- /**
- * Constructor for Disk.
- */
- public Disk() {
- super();
- }
-
- /**
- * 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 draw(float innerRadius, float outerRadius, int slices, int loops)
- {
- float da, dr;
-
- /* Normal vectors */
- if (super.normals != GLU.GLU_NONE) {
- if (super.orientation == GLU.GLU_OUTSIDE) {
- GL11.glNormal3f(0.0f, 0.0f, +1.0f);
- }
- else {
- GL11.glNormal3f(0.0f, 0.0f, -1.0f);
- }
- }
-
- da = 2.0f * GLU.PI / slices;
- dr = (outerRadius - innerRadius) / loops;
-
- switch (super.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 (super.orientation == GLU.GLU_OUTSIDE) {
- int s;
- GL11.glBegin(GL11.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(0.5f + sa * r2 / dtc, 0.5f + ca * r2 / dtc);
- GL11.glVertex2f(r2 * sa, r2 * ca);
- TXTR_COORD(0.5f + sa * r1 / dtc, 0.5f + ca * r1 / dtc);
- GL11.glVertex2f(r1 * sa, r1 * ca);
- }
- GL11.glEnd();
- }
- else {
- int s;
- GL11.glBegin(GL11.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(0.5f - sa * r2 / dtc, 0.5f + ca * r2 / dtc);
- GL11.glVertex2f(r2 * sa, r2 * ca);
- TXTR_COORD(0.5f - sa * r1 / dtc, 0.5f + ca * r1 / dtc);
- GL11.glVertex2f(r1 * sa, r1 * ca);
- }
- GL11.glEnd();
- }
- r1 = r2;
- }
- break;
- }
- case GLU.GLU_LINE:
- {
- int l, s;
- /* draw loops */
- for (l = 0; l <= loops; l++) {
- float r = innerRadius + l * dr;
- GL11.glBegin(GL11.GL_LINE_LOOP);
- for (s = 0; s < slices; s++) {
- float a = s * da;
- GL11.glVertex2f(r * sin(a), r * cos(a));
- }
- GL11.glEnd();
- }
- /* draw spokes */
- for (s = 0; s < slices; s++) {
- float a = s * da;
- float x = sin(a);
- float y = cos(a);
- GL11.glBegin(GL11.GL_LINE_STRIP);
- for (l = 0; l <= loops; l++) {
- float r = innerRadius + l * dr;
- GL11.glVertex2f(r * x, r * y);
- }
- GL11.glEnd();
- }
- break;
- }
- case GLU.GLU_POINT:
- {
- int s;
- GL11.glBegin(GL11.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;
- GL11.glVertex2f(r * x, r * y);
- }
- }
- GL11.glEnd();
- break;
- }
- case GLU.GLU_SILHOUETTE:
- {
- if (innerRadius != 0.0) {
- float a;
- GL11.glBegin(GL11.GL_LINE_LOOP);
- for (a = 0.0f; a < 2.0 * GLU.PI; a += da) {
- float x = innerRadius * sin(a);
- float y = innerRadius * cos(a);
- GL11.glVertex2f(x, y);
- }
- GL11.glEnd();
- }
- {
- float a;
- GL11.glBegin(GL11.GL_LINE_LOOP);
- for (a = 0; a < 2.0f * GLU.PI; a += da) {
- float x = outerRadius * sin(a);
- float y = outerRadius * cos(a);
- GL11.glVertex2f(x, y);
- }
- GL11.glEnd();
- }
- break;
- }
- default:
- return;
- }
- }
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.glu;
+
+import org.lwjgl.opengl.GL11;
+
+/**
+ * Disk.java
+ *
+ *
+ * Created 23-dec-2003
+ * @author Erik Duijs
+ */
+public class Disk extends Quadric {
+
+ /**
+ * Constructor for Disk.
+ */
+ public Disk() {
+ super();
+ }
+
+ /**
+ * 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 draw(float innerRadius, float outerRadius, int slices, int loops)
+ {
+ float da, dr;
+
+ /* Normal vectors */
+ if (super.normals != GLU.GLU_NONE) {
+ if (super.orientation == GLU.GLU_OUTSIDE) {
+ GL11.glNormal3f(0.0f, 0.0f, +1.0f);
+ }
+ else {
+ GL11.glNormal3f(0.0f, 0.0f, -1.0f);
+ }
+ }
+
+ da = 2.0f * GLU.PI / slices;
+ dr = (outerRadius - innerRadius) / loops;
+
+ switch (super.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 (super.orientation == GLU.GLU_OUTSIDE) {
+ int s;
+ GL11.glBegin(GL11.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(0.5f + sa * r2 / dtc, 0.5f + ca * r2 / dtc);
+ GL11.glVertex2f(r2 * sa, r2 * ca);
+ TXTR_COORD(0.5f + sa * r1 / dtc, 0.5f + ca * r1 / dtc);
+ GL11.glVertex2f(r1 * sa, r1 * ca);
+ }
+ GL11.glEnd();
+ }
+ else {
+ int s;
+ GL11.glBegin(GL11.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(0.5f - sa * r2 / dtc, 0.5f + ca * r2 / dtc);
+ GL11.glVertex2f(r2 * sa, r2 * ca);
+ TXTR_COORD(0.5f - sa * r1 / dtc, 0.5f + ca * r1 / dtc);
+ GL11.glVertex2f(r1 * sa, r1 * ca);
+ }
+ GL11.glEnd();
+ }
+ r1 = r2;
+ }
+ break;
+ }
+ case GLU.GLU_LINE:
+ {
+ int l, s;
+ /* draw loops */
+ for (l = 0; l <= loops; l++) {
+ float r = innerRadius + l * dr;
+ GL11.glBegin(GL11.GL_LINE_LOOP);
+ for (s = 0; s < slices; s++) {
+ float a = s * da;
+ GL11.glVertex2f(r * sin(a), r * cos(a));
+ }
+ GL11.glEnd();
+ }
+ /* draw spokes */
+ for (s = 0; s < slices; s++) {
+ float a = s * da;
+ float x = sin(a);
+ float y = cos(a);
+ GL11.glBegin(GL11.GL_LINE_STRIP);
+ for (l = 0; l <= loops; l++) {
+ float r = innerRadius + l * dr;
+ GL11.glVertex2f(r * x, r * y);
+ }
+ GL11.glEnd();
+ }
+ break;
+ }
+ case GLU.GLU_POINT:
+ {
+ int s;
+ GL11.glBegin(GL11.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;
+ GL11.glVertex2f(r * x, r * y);
+ }
+ }
+ GL11.glEnd();
+ break;
+ }
+ case GLU.GLU_SILHOUETTE:
+ {
+ if (innerRadius != 0.0) {
+ float a;
+ GL11.glBegin(GL11.GL_LINE_LOOP);
+ for (a = 0.0f; a < 2.0 * GLU.PI; a += da) {
+ float x = innerRadius * sin(a);
+ float y = innerRadius * cos(a);
+ GL11.glVertex2f(x, y);
+ }
+ GL11.glEnd();
+ }
+ {
+ float a;
+ GL11.glBegin(GL11.GL_LINE_LOOP);
+ for (a = 0; a < 2.0f * GLU.PI; a += da) {
+ float x = outerRadius * sin(a);
+ float y = outerRadius * cos(a);
+ GL11.glVertex2f(x, y);
+ }
+ GL11.glEnd();
+ }
+ break;
+ }
+ default:
+ return;
+ }
+ }
+
+}
diff --git a/src/java/org/lwjgl/util/glu/GLU.java b/src/java/org/lwjgl/util/glu/GLU.java
index 210ddac..c7e6271 100644
--- a/src/java/org/lwjgl/util/glu/GLU.java
+++ b/src/java/org/lwjgl/util/glu/GLU.java
@@ -1,429 +1,429 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.glu;
-
-import java.nio.ByteBuffer;
-import java.nio.FloatBuffer;
-import java.nio.IntBuffer;
-
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.opengl.Util;
-import org.lwjgl.util.glu.tessellation.GLUtessellatorImpl;
-
-/**
- * GLU.java
- *
- *
- * Created 23-dec-2003
- * @author Erik Duijs
- */
-public class GLU {
- static final float PI = (float)Math.PI;
-
- /* Errors: (return value 0 = no error) */
- 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_INCOMPATIBLE_GL_VERSION = 100903;
-
- /* StringName */
- public static final int GLU_VERSION = 100800;
- public static final int GLU_EXTENSIONS = 100801;
-
- /* Boolean */
- public static final boolean GLU_TRUE = true;
- public static final boolean GLU_FALSE = false;
-
-
- /**** Quadric constants ****/
-
- /* QuadricNormal */
- public static final int GLU_SMOOTH = 100000;
- public static final int GLU_FLAT = 100001;
- public static final int GLU_NONE = 100002;
-
- /* 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;
-
- /* QuadricOrientation */
- public static final int GLU_OUTSIDE = 100020;
- public static final int GLU_INSIDE = 100021;
-
- /* Callback types: */
- /* ERROR = 100103 */
-
-
- /**** Tesselation constants ****/
-
- public static final double GLU_TESS_MAX_COORD = 1.0e150;
- public static final double TESS_MAX_COORD = 1.0e150;
-
- /* 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;
-
- /* 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;
-
- /* TessCallback */
- public static final int GLU_TESS_BEGIN = 100100; /* void (CALLBACK*)(GLenum type) */
- public static final int GLU_TESS_VERTEX = 100101; /* void (CALLBACK*)(void *data) */
- public static final int GLU_TESS_END = 100102; /* void (CALLBACK*)(void) */
- public static final int GLU_TESS_ERROR = 100103; /* void (CALLBACK*)(GLenum errno) */
- public static final int GLU_TESS_EDGE_FLAG = 100104; /* void (CALLBACK*)(GLboolean boundaryEdge) */
- public static final int GLU_TESS_COMBINE = 100105; /* void (CALLBACK*)(GLdouble coords[3],
- void *data[4],
- GLfloat weight[4],
- void **dataOut) */
- public static final int GLU_TESS_BEGIN_DATA = 100106; /* void (CALLBACK*)(GLenum type,
- void *polygon_data) */
- public static final int GLU_TESS_VERTEX_DATA = 100107; /* void (CALLBACK*)(void *data,
- void *polygon_data) */
- public static final int GLU_TESS_END_DATA = 100108; /* void (CALLBACK*)(void *polygon_data) */
- public static final int GLU_TESS_ERROR_DATA = 100109; /* void (CALLBACK*)(GLenum errno,
- void *polygon_data) */
- public static final int GLU_TESS_EDGE_FLAG_DATA = 100110; /* void (CALLBACK*)(GLboolean boundaryEdge,
- void *polygon_data) */
- public static final int GLU_TESS_COMBINE_DATA = 100111; /* void (CALLBACK*)(GLdouble coords[3],
- void *data[4],
- GLfloat weight[4],
- void **dataOut,
- void *polygon_data) */
-
- /* 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 = GLU_TESS_ERROR1;
- public static final int GLU_TESS_MISSING_BEGIN_CONTOUR = GLU_TESS_ERROR2;
- public static final int GLU_TESS_MISSING_END_POLYGON = GLU_TESS_ERROR3;
- public static final int GLU_TESS_MISSING_END_CONTOUR = GLU_TESS_ERROR4;
- public static final int GLU_TESS_COORD_TOO_LARGE = GLU_TESS_ERROR5;
- public static final int GLU_TESS_NEED_COMBINE_CALLBACK = GLU_TESS_ERROR6;
-
- /**** NURBS constants ****/
-
- /* 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;
-
- /* NurbsSampling */
- 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;
-
- /* NurbsDisplay */
- /* FILL = 100012 */
- public static final int GLU_OUTLINE_POLYGON = 100240;
- public static final int GLU_OUTLINE_PATCH = 100241;
-
- /* NurbsCallback */
- /* ERROR = 100103 */
-
- /* NurbsErrors */
- 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;
-
- /* Contours types -- obsolete! */
- 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;
-
- /* Names without "TESS_" prefix */
- public static final int GLU_BEGIN = GLU_TESS_BEGIN;
- public static final int GLU_VERTEX = GLU_TESS_VERTEX;
- public static final int GLU_END = GLU_TESS_END;
- public static final int GLU_ERROR = GLU_TESS_ERROR;
- public static final int GLU_EDGE_FLAG = GLU_TESS_EDGE_FLAG;
-
- /**
- * Method gluLookAt
- * @param eyex
- * @param eyey
- * @param eyez
- * @param centerx
- * @param centery
- * @param centerz
- * @param upx
- * @param upy
- * @param upz
- */
- public static void gluLookAt(
- float eyex,
- float eyey,
- float eyez,
- float centerx,
- float centery,
- float centerz,
- float upx,
- float upy,
- float upz) {
-
- Project.gluLookAt(eyex, eyey, eyez, centerx, centery, centerz, upx, upy, upz);
- }
-
- /**
- * Method gluOrtho2D
- * @param left
- * @param right
- * @param bottom
- * @param top
- */
- public static void gluOrtho2D(
- float left,
- float right,
- float bottom,
- float top) {
-
- GL11.glOrtho(left, right, bottom, top, -1.0, 1.0);
- }
-
- /**
- * Method gluPerspective
- * @param fovy
- * @param aspect
- * @param zNear
- * @param zFar
- */
- public static void gluPerspective(
- float fovy,
- float aspect,
- float zNear,
- float zFar) {
-
- Project.gluPerspective(fovy, aspect, zNear, zFar);
- }
-
- /**
- * Method gluProject
- * @param objx
- * @param objy
- * @param objz
- * @param modelMatrix
- * @param projMatrix
- * @param viewport
- * @param win_pos
- */
- public static boolean gluProject(float objx, float objy, float objz,
- FloatBuffer modelMatrix,
- FloatBuffer projMatrix,
- IntBuffer viewport,
- FloatBuffer win_pos)
- {
- return Project.gluProject(objx, objy, objz, modelMatrix, projMatrix, viewport, win_pos);
- }
-
- /**
- * Method gluUnproject
- * @param winx
- * @param winy
- * @param winz
- * @param modelMatrix
- * @param projMatrix
- * @param viewport
- * @param obj_pos
- */
- public static boolean gluUnProject(float winx, float winy, float winz,
- FloatBuffer modelMatrix,
- FloatBuffer projMatrix,
- IntBuffer viewport,
- FloatBuffer obj_pos)
- {
- return Project.gluUnProject(winx, winy, winz, modelMatrix, projMatrix, viewport, obj_pos);
- }
-
- /**
- * Method gluPickMatrix
- * @param x
- * @param y
- * @param width
- * @param height
- * @param viewport
- */
- public static void gluPickMatrix(
- float x,
- float y,
- float width,
- float height,
- IntBuffer viewport) {
-
- Project.gluPickMatrix(x, y, width, height, viewport);
- }
-
- /**
- * Method gluGetString.
- * @param name
- * @return String
- */
- public static String gluGetString(int name) {
- return Registry.gluGetString(name);
- }
-
- /**
- * Method gluCheckExtension.
- * @param extName
- * @param extString
- * @return boolean
- */
- public static boolean gluCheckExtension(String extName, String extString) {
- return Registry.gluCheckExtension(extName, extString);
- }
-
- /**
- * Method gluBuild2DMipmaps
- * @param target
- * @param components
- * @param width
- * @param height
- * @param format
- * @param type
- * @param data
- * @return int
- */
- public static int gluBuild2DMipmaps(
- int target,
- int components,
- int width,
- int height,
- int format,
- int type,
- ByteBuffer data) {
-
- return MipMap.gluBuild2DMipmaps(target, components, width, height, format, type, data);
- }
-
- /**
- * Method gluScaleImage.
- * @param format
- * @param widthIn
- * @param heightIn
- * @param typeIn
- * @param dataIn
- * @param widthOut
- * @param heightOut
- * @param typeOut
- * @param dataOut
- * @return int
- */
- public static int gluScaleImage(
- int format,
- int widthIn,
- int heightIn,
- int typeIn,
- ByteBuffer dataIn,
- int widthOut,
- int heightOut,
- int typeOut,
- ByteBuffer dataOut) {
-
- return MipMap.gluScaleImage(format, widthIn, heightIn, typeIn, dataIn, widthOut, heightOut, typeOut, dataOut);
- }
-
- public static String gluErrorString(int error_code) {
- switch (error_code) {
- case GLU.GLU_INVALID_ENUM:
- return "Invalid enum (glu)";
- case GLU.GLU_INVALID_VALUE:
- return "Invalid value (glu)";
- case GLU.GLU_OUT_OF_MEMORY:
- return "Out of memory (glu)";
- default:
- return Util.translateGLErrorString(error_code);
- }
- }
-
- public static GLUtessellator gluNewTess() {
- return new GLUtessellatorImpl();
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.glu;
+
+import java.nio.ByteBuffer;
+import java.nio.FloatBuffer;
+import java.nio.IntBuffer;
+
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.Util;
+import org.lwjgl.util.glu.tessellation.GLUtessellatorImpl;
+
+/**
+ * GLU.java
+ *
+ *
+ * Created 23-dec-2003
+ * @author Erik Duijs
+ */
+public class GLU {
+ static final float PI = (float)Math.PI;
+
+ /* Errors: (return value 0 = no error) */
+ 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_INCOMPATIBLE_GL_VERSION = 100903;
+
+ /* StringName */
+ public static final int GLU_VERSION = 100800;
+ public static final int GLU_EXTENSIONS = 100801;
+
+ /* Boolean */
+ public static final boolean GLU_TRUE = true;
+ public static final boolean GLU_FALSE = false;
+
+
+ /**** Quadric constants ****/
+
+ /* QuadricNormal */
+ public static final int GLU_SMOOTH = 100000;
+ public static final int GLU_FLAT = 100001;
+ public static final int GLU_NONE = 100002;
+
+ /* 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;
+
+ /* QuadricOrientation */
+ public static final int GLU_OUTSIDE = 100020;
+ public static final int GLU_INSIDE = 100021;
+
+ /* Callback types: */
+ /* ERROR = 100103 */
+
+
+ /**** Tesselation constants ****/
+
+ public static final double GLU_TESS_MAX_COORD = 1.0e150;
+ public static final double TESS_MAX_COORD = 1.0e150;
+
+ /* 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;
+
+ /* 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;
+
+ /* TessCallback */
+ public static final int GLU_TESS_BEGIN = 100100; /* void (CALLBACK*)(GLenum type) */
+ public static final int GLU_TESS_VERTEX = 100101; /* void (CALLBACK*)(void *data) */
+ public static final int GLU_TESS_END = 100102; /* void (CALLBACK*)(void) */
+ public static final int GLU_TESS_ERROR = 100103; /* void (CALLBACK*)(GLenum errno) */
+ public static final int GLU_TESS_EDGE_FLAG = 100104; /* void (CALLBACK*)(GLboolean boundaryEdge) */
+ public static final int GLU_TESS_COMBINE = 100105; /* void (CALLBACK*)(GLdouble coords[3],
+ void *data[4],
+ GLfloat weight[4],
+ void **dataOut) */
+ public static final int GLU_TESS_BEGIN_DATA = 100106; /* void (CALLBACK*)(GLenum type,
+ void *polygon_data) */
+ public static final int GLU_TESS_VERTEX_DATA = 100107; /* void (CALLBACK*)(void *data,
+ void *polygon_data) */
+ public static final int GLU_TESS_END_DATA = 100108; /* void (CALLBACK*)(void *polygon_data) */
+ public static final int GLU_TESS_ERROR_DATA = 100109; /* void (CALLBACK*)(GLenum errno,
+ void *polygon_data) */
+ public static final int GLU_TESS_EDGE_FLAG_DATA = 100110; /* void (CALLBACK*)(GLboolean boundaryEdge,
+ void *polygon_data) */
+ public static final int GLU_TESS_COMBINE_DATA = 100111; /* void (CALLBACK*)(GLdouble coords[3],
+ void *data[4],
+ GLfloat weight[4],
+ void **dataOut,
+ void *polygon_data) */
+
+ /* 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 = GLU_TESS_ERROR1;
+ public static final int GLU_TESS_MISSING_BEGIN_CONTOUR = GLU_TESS_ERROR2;
+ public static final int GLU_TESS_MISSING_END_POLYGON = GLU_TESS_ERROR3;
+ public static final int GLU_TESS_MISSING_END_CONTOUR = GLU_TESS_ERROR4;
+ public static final int GLU_TESS_COORD_TOO_LARGE = GLU_TESS_ERROR5;
+ public static final int GLU_TESS_NEED_COMBINE_CALLBACK = GLU_TESS_ERROR6;
+
+ /**** NURBS constants ****/
+
+ /* 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;
+
+ /* NurbsSampling */
+ 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;
+
+ /* NurbsDisplay */
+ /* FILL = 100012 */
+ public static final int GLU_OUTLINE_POLYGON = 100240;
+ public static final int GLU_OUTLINE_PATCH = 100241;
+
+ /* NurbsCallback */
+ /* ERROR = 100103 */
+
+ /* NurbsErrors */
+ 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;
+
+ /* Contours types -- obsolete! */
+ 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;
+
+ /* Names without "TESS_" prefix */
+ public static final int GLU_BEGIN = GLU_TESS_BEGIN;
+ public static final int GLU_VERTEX = GLU_TESS_VERTEX;
+ public static final int GLU_END = GLU_TESS_END;
+ public static final int GLU_ERROR = GLU_TESS_ERROR;
+ public static final int GLU_EDGE_FLAG = GLU_TESS_EDGE_FLAG;
+
+ /**
+ * Method gluLookAt
+ * @param eyex
+ * @param eyey
+ * @param eyez
+ * @param centerx
+ * @param centery
+ * @param centerz
+ * @param upx
+ * @param upy
+ * @param upz
+ */
+ public static void gluLookAt(
+ float eyex,
+ float eyey,
+ float eyez,
+ float centerx,
+ float centery,
+ float centerz,
+ float upx,
+ float upy,
+ float upz) {
+
+ Project.gluLookAt(eyex, eyey, eyez, centerx, centery, centerz, upx, upy, upz);
+ }
+
+ /**
+ * Method gluOrtho2D
+ * @param left
+ * @param right
+ * @param bottom
+ * @param top
+ */
+ public static void gluOrtho2D(
+ float left,
+ float right,
+ float bottom,
+ float top) {
+
+ GL11.glOrtho(left, right, bottom, top, -1.0, 1.0);
+ }
+
+ /**
+ * Method gluPerspective
+ * @param fovy
+ * @param aspect
+ * @param zNear
+ * @param zFar
+ */
+ public static void gluPerspective(
+ float fovy,
+ float aspect,
+ float zNear,
+ float zFar) {
+
+ Project.gluPerspective(fovy, aspect, zNear, zFar);
+ }
+
+ /**
+ * Method gluProject
+ * @param objx
+ * @param objy
+ * @param objz
+ * @param modelMatrix
+ * @param projMatrix
+ * @param viewport
+ * @param win_pos
+ */
+ public static boolean gluProject(float objx, float objy, float objz,
+ FloatBuffer modelMatrix,
+ FloatBuffer projMatrix,
+ IntBuffer viewport,
+ FloatBuffer win_pos)
+ {
+ return Project.gluProject(objx, objy, objz, modelMatrix, projMatrix, viewport, win_pos);
+ }
+
+ /**
+ * Method gluUnproject
+ * @param winx
+ * @param winy
+ * @param winz
+ * @param modelMatrix
+ * @param projMatrix
+ * @param viewport
+ * @param obj_pos
+ */
+ public static boolean gluUnProject(float winx, float winy, float winz,
+ FloatBuffer modelMatrix,
+ FloatBuffer projMatrix,
+ IntBuffer viewport,
+ FloatBuffer obj_pos)
+ {
+ return Project.gluUnProject(winx, winy, winz, modelMatrix, projMatrix, viewport, obj_pos);
+ }
+
+ /**
+ * Method gluPickMatrix
+ * @param x
+ * @param y
+ * @param width
+ * @param height
+ * @param viewport
+ */
+ public static void gluPickMatrix(
+ float x,
+ float y,
+ float width,
+ float height,
+ IntBuffer viewport) {
+
+ Project.gluPickMatrix(x, y, width, height, viewport);
+ }
+
+ /**
+ * Method gluGetString.
+ * @param name
+ * @return String
+ */
+ public static String gluGetString(int name) {
+ return Registry.gluGetString(name);
+ }
+
+ /**
+ * Method gluCheckExtension.
+ * @param extName
+ * @param extString
+ * @return boolean
+ */
+ public static boolean gluCheckExtension(String extName, String extString) {
+ return Registry.gluCheckExtension(extName, extString);
+ }
+
+ /**
+ * Method gluBuild2DMipmaps
+ * @param target
+ * @param components
+ * @param width
+ * @param height
+ * @param format
+ * @param type
+ * @param data
+ * @return int
+ */
+ public static int gluBuild2DMipmaps(
+ int target,
+ int components,
+ int width,
+ int height,
+ int format,
+ int type,
+ ByteBuffer data) {
+
+ return MipMap.gluBuild2DMipmaps(target, components, width, height, format, type, data);
+ }
+
+ /**
+ * Method gluScaleImage.
+ * @param format
+ * @param widthIn
+ * @param heightIn
+ * @param typeIn
+ * @param dataIn
+ * @param widthOut
+ * @param heightOut
+ * @param typeOut
+ * @param dataOut
+ * @return int
+ */
+ public static int gluScaleImage(
+ int format,
+ int widthIn,
+ int heightIn,
+ int typeIn,
+ ByteBuffer dataIn,
+ int widthOut,
+ int heightOut,
+ int typeOut,
+ ByteBuffer dataOut) {
+
+ return MipMap.gluScaleImage(format, widthIn, heightIn, typeIn, dataIn, widthOut, heightOut, typeOut, dataOut);
+ }
+
+ public static String gluErrorString(int error_code) {
+ switch (error_code) {
+ case GLU.GLU_INVALID_ENUM:
+ return "Invalid enum (glu)";
+ case GLU.GLU_INVALID_VALUE:
+ return "Invalid value (glu)";
+ case GLU.GLU_OUT_OF_MEMORY:
+ return "Out of memory (glu)";
+ default:
+ return Util.translateGLErrorString(error_code);
+ }
+ }
+
+ public static GLUtessellator gluNewTess() {
+ return new GLUtessellatorImpl();
+ }
+}
diff --git a/src/java/org/lwjgl/util/glu/GLUtessellator.java b/src/java/org/lwjgl/util/glu/GLUtessellator.java
index c07c6e4..be6b3c1 100644
--- a/src/java/org/lwjgl/util/glu/GLUtessellator.java
+++ b/src/java/org/lwjgl/util/glu/GLUtessellator.java
@@ -1,72 +1,72 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-package org.lwjgl.util.glu;
-
-public interface GLUtessellator {
-
- public abstract void gluDeleteTess();
-
- public abstract void gluTessProperty(int which, double value);
-
- /* Returns tessellator property */
- public abstract void gluGetTessProperty(int which, double[] value,
- int value_offset); /* gluGetTessProperty() */
-
- public abstract void gluTessNormal(double x, double y, double z);
-
- public abstract void gluTessCallback(int which,
- GLUtessellatorCallback aCallback);
-
- public abstract void gluTessVertex(double[] coords, int coords_offset,
- Object vertexData);
-
- public abstract void gluTessBeginPolygon(Object data);
-
- public abstract void gluTessBeginContour();
-
- public abstract void gluTessEndContour();
-
- public abstract void gluTessEndPolygon();
-
- /*******************************************************/
-
- /* Obsolete calls -- for backward compatibility */
-
- public abstract void gluBeginPolygon();
-
- /*ARGSUSED*/
- public abstract void gluNextContour(int type);
-
- public abstract void gluEndPolygon();
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+package org.lwjgl.util.glu;
+
+public interface GLUtessellator {
+
+ public abstract void gluDeleteTess();
+
+ public abstract void gluTessProperty(int which, double value);
+
+ /* Returns tessellator property */
+ public abstract void gluGetTessProperty(int which, double[] value,
+ int value_offset); /* gluGetTessProperty() */
+
+ public abstract void gluTessNormal(double x, double y, double z);
+
+ public abstract void gluTessCallback(int which,
+ GLUtessellatorCallback aCallback);
+
+ public abstract void gluTessVertex(double[] coords, int coords_offset,
+ Object vertexData);
+
+ public abstract void gluTessBeginPolygon(Object data);
+
+ public abstract void gluTessBeginContour();
+
+ public abstract void gluTessEndContour();
+
+ public abstract void gluTessEndPolygon();
+
+ /*******************************************************/
+
+ /* Obsolete calls -- for backward compatibility */
+
+ public abstract void gluBeginPolygon();
+
+ /*ARGSUSED*/
+ public abstract void gluNextContour(int type);
+
+ public abstract void gluEndPolygon();
+
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/util/glu/MipMap.java b/src/java/org/lwjgl/util/glu/MipMap.java
index 229f52f..698371f 100644
--- a/src/java/org/lwjgl/util/glu/MipMap.java
+++ b/src/java/org/lwjgl/util/glu/MipMap.java
@@ -1,351 +1,351 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.glu;
-
-import java.nio.ByteBuffer;
-
-import org.lwjgl.BufferUtils;
-import org.lwjgl.opengl.GL11;
-
-/**
- * MipMap.java
- *
- *
- * Created 11-jan-2004
- * @author Erik Duijs
- */
-public class MipMap extends Util {
-
- /**
- * Method gluBuild2DMipmaps
- *
- * @param target
- * @param components
- * @param width
- * @param height
- * @param format
- * @param type
- * @param data
- * @return int
- */
- public static int gluBuild2DMipmaps(final int target,
- final int components, final int width, final int height,
- final int format, final int type, final ByteBuffer data) {
- if ( width < 1 || height < 1 ) return GLU.GLU_INVALID_VALUE;
-
- final int bpp = bytesPerPixel(format, type);
- if ( bpp == 0 )
- return GLU.GLU_INVALID_ENUM;
-
- final int maxSize = glGetIntegerv(GL11.GL_MAX_TEXTURE_SIZE);
-
- int w = nearestPower(width);
- if ( w > maxSize )
- w = maxSize;
-
- int h = nearestPower(height);
- if ( h > maxSize )
- h = maxSize;
-
- // Get current glPixelStore state
- PixelStoreState pss = new PixelStoreState();
-
- // set pixel packing
- GL11.glPixelStorei(GL11.GL_PACK_ROW_LENGTH, 0);
- GL11.glPixelStorei(GL11.GL_PACK_ALIGNMENT, 1);
- GL11.glPixelStorei(GL11.GL_PACK_SKIP_ROWS, 0);
- GL11.glPixelStorei(GL11.GL_PACK_SKIP_PIXELS, 0);
-
- ByteBuffer image;
- int retVal = 0;
- boolean done = false;
-
- if ( w != width || h != height ) {
- // must rescale image to get "top" mipmap texture image
- image = BufferUtils.createByteBuffer((w + 4) * h * bpp);
- int error = gluScaleImage(format, width, height, type, data, w, h, type, image);
- if ( error != 0 ) {
- retVal = error;
- done = true;
- }
-
- /* set pixel unpacking */
- GL11.glPixelStorei(GL11.GL_UNPACK_ROW_LENGTH, 0);
- GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1);
- GL11.glPixelStorei(GL11.GL_UNPACK_SKIP_ROWS, 0);
- GL11.glPixelStorei(GL11.GL_UNPACK_SKIP_PIXELS, 0);
- } else {
- image = data;
- }
-
- ByteBuffer bufferA = null;
- ByteBuffer bufferB = null;
-
- int level = 0;
- while ( !done ) {
- if (image != data) {
- /* set pixel unpacking */
- GL11.glPixelStorei(GL11.GL_UNPACK_ROW_LENGTH, 0);
- GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1);
- GL11.glPixelStorei(GL11.GL_UNPACK_SKIP_ROWS, 0);
- GL11.glPixelStorei(GL11.GL_UNPACK_SKIP_PIXELS, 0);
- }
-
- GL11.glTexImage2D(target, level, components, w, h, 0, format, type, image);
-
- if ( w == 1 && h == 1 )
- break;
-
- final int newW = (w < 2) ? 1 : w >> 1;
- final int newH = (h < 2) ? 1 : h >> 1;
-
- final ByteBuffer newImage;
-
- if ( bufferA == null )
- newImage = (bufferA = BufferUtils.createByteBuffer((newW + 4) * newH * bpp));
- else if ( bufferB == null )
- newImage = (bufferB = BufferUtils.createByteBuffer((newW + 4) * newH * bpp));
- else
- newImage = bufferB;
-
- int error = gluScaleImage(format, w, h, type, image, newW, newH, type, newImage);
- if ( error != 0 ) {
- retVal = error;
- done = true;
- }
-
- image = newImage;
- if ( bufferB != null )
- bufferB = bufferA;
-
- w = newW;
- h = newH;
- level++;
- }
-
- // Restore original glPixelStore state
- pss.save();
-
- return retVal;
- }
-
- /**
- * Method gluScaleImage.
- * @param format
- * @param widthIn
- * @param heightIn
- * @param typein
- * @param dataIn
- * @param widthOut
- * @param heightOut
- * @param typeOut
- * @param dataOut
- * @return int
- */
- public static int gluScaleImage(int format,
- int widthIn, int heightIn, int typein, ByteBuffer dataIn,
- int widthOut, int heightOut, int typeOut, ByteBuffer dataOut) {
-
- final int components = compPerPix(format);
- if ( components == -1 )
- return GLU.GLU_INVALID_ENUM;
-
- int i, j, k;
- float[] tempIn, tempOut;
- float sx, sy;
- int sizein, sizeout;
- int rowstride, rowlen;
-
- // temp image data
- tempIn = new float[widthIn * heightIn * components];
- tempOut = new float[widthOut * heightOut * components];
-
- // Determine bytes per input type
- switch ( typein ) {
- case GL11.GL_UNSIGNED_BYTE:
- sizein = 1;
- break;
- case GL11.GL_FLOAT:
- sizein = 4;
- break;
- default:
- return GL11.GL_INVALID_ENUM;
- }
-
- // Determine bytes per output type
- switch ( typeOut ) {
- case GL11.GL_UNSIGNED_BYTE:
- sizeout = 1;
- break;
- case GL11.GL_FLOAT:
- sizeout = 4;
- break;
- default:
- return GL11.GL_INVALID_ENUM;
- }
-
- // Get glPixelStore state
- PixelStoreState pss = new PixelStoreState();
-
- //Unpack the pixel data and convert to floating point
- if ( pss.unpackRowLength > 0 )
- rowlen = pss.unpackRowLength;
- else
- rowlen = widthIn;
-
- if ( sizein >= pss.unpackAlignment )
- rowstride = components * rowlen;
- else
- rowstride = pss.unpackAlignment / sizein * ceil(components * rowlen * sizein, pss.unpackAlignment);
-
- switch ( typein ) {
- case GL11.GL_UNSIGNED_BYTE:
- k = 0;
- dataIn.rewind();
- for ( i = 0; i < heightIn; i++ ) {
- int ubptr = i * rowstride + pss.unpackSkipRows * rowstride + pss.unpackSkipPixels * components;
- for ( j = 0; j < widthIn * components; j++ ) {
- tempIn[k++] = dataIn.get(ubptr++) & 0xff;
- }
- }
- break;
- case GL11.GL_FLOAT:
- k = 0;
- dataIn.rewind();
- for ( i = 0; i < heightIn; i++ )
- {
- int fptr = 4 * (i * rowstride + pss.unpackSkipRows * rowstride + pss.unpackSkipPixels * components);
- for ( j = 0; j < widthIn * components; j++ )
- {
- tempIn[k++] = dataIn.getFloat(fptr);
- fptr += 4;
- }
- }
- break;
- default:
- return GLU.GLU_INVALID_ENUM;
- }
-
- // Do scaling
- sx = (float)widthIn / (float)widthOut;
- sy = (float)heightIn / (float)heightOut;
-
- float[] c = new float[components];
- int src, dst;
-
- for ( int iy = 0; iy < heightOut; iy++ ) {
- for ( int ix = 0; ix < widthOut; ix++ ) {
- int x0 = (int)(ix * sx);
- int x1 = (int)((ix + 1) * sx);
- int y0 = (int)(iy * sy);
- int y1 = (int)((iy + 1) * sy);
-
- int readPix = 0;
-
- // reset weighted pixel
- for ( int ic = 0; ic < components; ic++ ) {
- c[ic] = 0;
- }
-
- // create weighted pixel
- for ( int ix0 = x0; ix0 < x1; ix0++ ) {
- for ( int iy0 = y0; iy0 < y1; iy0++ ) {
-
- src = (iy0 * widthIn + ix0) * components;
-
- for ( int ic = 0; ic < components; ic++ ) {
- c[ic] += tempIn[src + ic];
- }
-
- readPix++;
- }
- }
-
- // store weighted pixel
- dst = (iy * widthOut + ix) * components;
-
- if ( readPix == 0 ) {
- // Image is sized up, caused by non power of two texture as input
- src = (y0 * widthIn + x0) * components;
- for ( int ic = 0; ic < components; ic++ ) {
- tempOut[dst++] = tempIn[src + ic];
- }
- } else {
- // sized down
- for ( k = 0; k < components; k++ ) {
- tempOut[dst++] = c[k] / readPix;
- }
- }
- }
- }
-
-
- // Convert temp output
- if ( pss.packRowLength > 0 )
- rowlen = pss.packRowLength;
- else
- rowlen = widthOut;
-
- if ( sizeout >= pss.packAlignment )
- rowstride = components * rowlen;
- else
- rowstride = pss.packAlignment / sizeout * ceil(components * rowlen * sizeout, pss.packAlignment);
-
- switch ( typeOut ) {
- case GL11.GL_UNSIGNED_BYTE:
- k = 0;
- for ( i = 0; i < heightOut; i++ ) {
- int ubptr = i * rowstride + pss.packSkipRows * rowstride + pss.packSkipPixels * components;
-
- for ( j = 0; j < widthOut * components; j++ ) {
- dataOut.put(ubptr++, (byte)tempOut[k++]);
- }
- }
- break;
- case GL11.GL_FLOAT:
- k = 0;
- for ( i = 0; i < heightOut; i++ ) {
- int fptr = 4 * (i * rowstride + pss.unpackSkipRows * rowstride + pss.unpackSkipPixels * components);
-
- for ( j = 0; j < widthOut * components; j++ ) {
- dataOut.putFloat(fptr, tempOut[k++]);
- fptr += 4;
- }
- }
- break;
- default:
- return GLU.GLU_INVALID_ENUM;
- }
-
- return 0;
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.glu;
+
+import java.nio.ByteBuffer;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.opengl.GL11;
+
+/**
+ * MipMap.java
+ *
+ *
+ * Created 11-jan-2004
+ * @author Erik Duijs
+ */
+public class MipMap extends Util {
+
+ /**
+ * Method gluBuild2DMipmaps
+ *
+ * @param target
+ * @param components
+ * @param width
+ * @param height
+ * @param format
+ * @param type
+ * @param data
+ * @return int
+ */
+ public static int gluBuild2DMipmaps(final int target,
+ final int components, final int width, final int height,
+ final int format, final int type, final ByteBuffer data) {
+ if ( width < 1 || height < 1 ) return GLU.GLU_INVALID_VALUE;
+
+ final int bpp = bytesPerPixel(format, type);
+ if ( bpp == 0 )
+ return GLU.GLU_INVALID_ENUM;
+
+ final int maxSize = glGetIntegerv(GL11.GL_MAX_TEXTURE_SIZE);
+
+ int w = nearestPower(width);
+ if ( w > maxSize )
+ w = maxSize;
+
+ int h = nearestPower(height);
+ if ( h > maxSize )
+ h = maxSize;
+
+ // Get current glPixelStore state
+ PixelStoreState pss = new PixelStoreState();
+
+ // set pixel packing
+ GL11.glPixelStorei(GL11.GL_PACK_ROW_LENGTH, 0);
+ GL11.glPixelStorei(GL11.GL_PACK_ALIGNMENT, 1);
+ GL11.glPixelStorei(GL11.GL_PACK_SKIP_ROWS, 0);
+ GL11.glPixelStorei(GL11.GL_PACK_SKIP_PIXELS, 0);
+
+ ByteBuffer image;
+ int retVal = 0;
+ boolean done = false;
+
+ if ( w != width || h != height ) {
+ // must rescale image to get "top" mipmap texture image
+ image = BufferUtils.createByteBuffer((w + 4) * h * bpp);
+ int error = gluScaleImage(format, width, height, type, data, w, h, type, image);
+ if ( error != 0 ) {
+ retVal = error;
+ done = true;
+ }
+
+ /* set pixel unpacking */
+ GL11.glPixelStorei(GL11.GL_UNPACK_ROW_LENGTH, 0);
+ GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1);
+ GL11.glPixelStorei(GL11.GL_UNPACK_SKIP_ROWS, 0);
+ GL11.glPixelStorei(GL11.GL_UNPACK_SKIP_PIXELS, 0);
+ } else {
+ image = data;
+ }
+
+ ByteBuffer bufferA = null;
+ ByteBuffer bufferB = null;
+
+ int level = 0;
+ while ( !done ) {
+ if (image != data) {
+ /* set pixel unpacking */
+ GL11.glPixelStorei(GL11.GL_UNPACK_ROW_LENGTH, 0);
+ GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1);
+ GL11.glPixelStorei(GL11.GL_UNPACK_SKIP_ROWS, 0);
+ GL11.glPixelStorei(GL11.GL_UNPACK_SKIP_PIXELS, 0);
+ }
+
+ GL11.glTexImage2D(target, level, components, w, h, 0, format, type, image);
+
+ if ( w == 1 && h == 1 )
+ break;
+
+ final int newW = (w < 2) ? 1 : w >> 1;
+ final int newH = (h < 2) ? 1 : h >> 1;
+
+ final ByteBuffer newImage;
+
+ if ( bufferA == null )
+ newImage = (bufferA = BufferUtils.createByteBuffer((newW + 4) * newH * bpp));
+ else if ( bufferB == null )
+ newImage = (bufferB = BufferUtils.createByteBuffer((newW + 4) * newH * bpp));
+ else
+ newImage = bufferB;
+
+ int error = gluScaleImage(format, w, h, type, image, newW, newH, type, newImage);
+ if ( error != 0 ) {
+ retVal = error;
+ done = true;
+ }
+
+ image = newImage;
+ if ( bufferB != null )
+ bufferB = bufferA;
+
+ w = newW;
+ h = newH;
+ level++;
+ }
+
+ // Restore original glPixelStore state
+ pss.save();
+
+ return retVal;
+ }
+
+ /**
+ * Method gluScaleImage.
+ * @param format
+ * @param widthIn
+ * @param heightIn
+ * @param typein
+ * @param dataIn
+ * @param widthOut
+ * @param heightOut
+ * @param typeOut
+ * @param dataOut
+ * @return int
+ */
+ public static int gluScaleImage(int format,
+ int widthIn, int heightIn, int typein, ByteBuffer dataIn,
+ int widthOut, int heightOut, int typeOut, ByteBuffer dataOut) {
+
+ final int components = compPerPix(format);
+ if ( components == -1 )
+ return GLU.GLU_INVALID_ENUM;
+
+ int i, j, k;
+ float[] tempIn, tempOut;
+ float sx, sy;
+ int sizein, sizeout;
+ int rowstride, rowlen;
+
+ // temp image data
+ tempIn = new float[widthIn * heightIn * components];
+ tempOut = new float[widthOut * heightOut * components];
+
+ // Determine bytes per input type
+ switch ( typein ) {
+ case GL11.GL_UNSIGNED_BYTE:
+ sizein = 1;
+ break;
+ case GL11.GL_FLOAT:
+ sizein = 4;
+ break;
+ default:
+ return GL11.GL_INVALID_ENUM;
+ }
+
+ // Determine bytes per output type
+ switch ( typeOut ) {
+ case GL11.GL_UNSIGNED_BYTE:
+ sizeout = 1;
+ break;
+ case GL11.GL_FLOAT:
+ sizeout = 4;
+ break;
+ default:
+ return GL11.GL_INVALID_ENUM;
+ }
+
+ // Get glPixelStore state
+ PixelStoreState pss = new PixelStoreState();
+
+ //Unpack the pixel data and convert to floating point
+ if ( pss.unpackRowLength > 0 )
+ rowlen = pss.unpackRowLength;
+ else
+ rowlen = widthIn;
+
+ if ( sizein >= pss.unpackAlignment )
+ rowstride = components * rowlen;
+ else
+ rowstride = pss.unpackAlignment / sizein * ceil(components * rowlen * sizein, pss.unpackAlignment);
+
+ switch ( typein ) {
+ case GL11.GL_UNSIGNED_BYTE:
+ k = 0;
+ dataIn.rewind();
+ for ( i = 0; i < heightIn; i++ ) {
+ int ubptr = i * rowstride + pss.unpackSkipRows * rowstride + pss.unpackSkipPixels * components;
+ for ( j = 0; j < widthIn * components; j++ ) {
+ tempIn[k++] = dataIn.get(ubptr++) & 0xff;
+ }
+ }
+ break;
+ case GL11.GL_FLOAT:
+ k = 0;
+ dataIn.rewind();
+ for ( i = 0; i < heightIn; i++ )
+ {
+ int fptr = 4 * (i * rowstride + pss.unpackSkipRows * rowstride + pss.unpackSkipPixels * components);
+ for ( j = 0; j < widthIn * components; j++ )
+ {
+ tempIn[k++] = dataIn.getFloat(fptr);
+ fptr += 4;
+ }
+ }
+ break;
+ default:
+ return GLU.GLU_INVALID_ENUM;
+ }
+
+ // Do scaling
+ sx = (float)widthIn / (float)widthOut;
+ sy = (float)heightIn / (float)heightOut;
+
+ float[] c = new float[components];
+ int src, dst;
+
+ for ( int iy = 0; iy < heightOut; iy++ ) {
+ for ( int ix = 0; ix < widthOut; ix++ ) {
+ int x0 = (int)(ix * sx);
+ int x1 = (int)((ix + 1) * sx);
+ int y0 = (int)(iy * sy);
+ int y1 = (int)((iy + 1) * sy);
+
+ int readPix = 0;
+
+ // reset weighted pixel
+ for ( int ic = 0; ic < components; ic++ ) {
+ c[ic] = 0;
+ }
+
+ // create weighted pixel
+ for ( int ix0 = x0; ix0 < x1; ix0++ ) {
+ for ( int iy0 = y0; iy0 < y1; iy0++ ) {
+
+ src = (iy0 * widthIn + ix0) * components;
+
+ for ( int ic = 0; ic < components; ic++ ) {
+ c[ic] += tempIn[src + ic];
+ }
+
+ readPix++;
+ }
+ }
+
+ // store weighted pixel
+ dst = (iy * widthOut + ix) * components;
+
+ if ( readPix == 0 ) {
+ // Image is sized up, caused by non power of two texture as input
+ src = (y0 * widthIn + x0) * components;
+ for ( int ic = 0; ic < components; ic++ ) {
+ tempOut[dst++] = tempIn[src + ic];
+ }
+ } else {
+ // sized down
+ for ( k = 0; k < components; k++ ) {
+ tempOut[dst++] = c[k] / readPix;
+ }
+ }
+ }
+ }
+
+
+ // Convert temp output
+ if ( pss.packRowLength > 0 )
+ rowlen = pss.packRowLength;
+ else
+ rowlen = widthOut;
+
+ if ( sizeout >= pss.packAlignment )
+ rowstride = components * rowlen;
+ else
+ rowstride = pss.packAlignment / sizeout * ceil(components * rowlen * sizeout, pss.packAlignment);
+
+ switch ( typeOut ) {
+ case GL11.GL_UNSIGNED_BYTE:
+ k = 0;
+ for ( i = 0; i < heightOut; i++ ) {
+ int ubptr = i * rowstride + pss.packSkipRows * rowstride + pss.packSkipPixels * components;
+
+ for ( j = 0; j < widthOut * components; j++ ) {
+ dataOut.put(ubptr++, (byte)tempOut[k++]);
+ }
+ }
+ break;
+ case GL11.GL_FLOAT:
+ k = 0;
+ for ( i = 0; i < heightOut; i++ ) {
+ int fptr = 4 * (i * rowstride + pss.unpackSkipRows * rowstride + pss.unpackSkipPixels * components);
+
+ for ( j = 0; j < widthOut * components; j++ ) {
+ dataOut.putFloat(fptr, tempOut[k++]);
+ fptr += 4;
+ }
+ }
+ break;
+ default:
+ return GLU.GLU_INVALID_ENUM;
+ }
+
+ return 0;
+ }
+}
diff --git a/src/java/org/lwjgl/util/glu/PartialDisk.java b/src/java/org/lwjgl/util/glu/PartialDisk.java
index 269b5b0..0347eca 100644
--- a/src/java/org/lwjgl/util/glu/PartialDisk.java
+++ b/src/java/org/lwjgl/util/glu/PartialDisk.java
@@ -1,357 +1,357 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.glu;
-
-import org.lwjgl.opengl.GL11;
-
-/**
- * PartialDisk.java
- *
- *
- * Created 23-dec-2003
- *
- * @author Erik Duijs
- */
-public class PartialDisk extends Quadric {
-
- private static final int CACHE_SIZE = 240;
-
- /**
- * Constructor for PartialDisk.
- */
- public PartialDisk() {
- super();
- }
-
- /**
- * 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 draw(
- float innerRadius,
- float outerRadius,
- int slices,
- int loops,
- float startAngle,
- float sweepAngle) {
-
- int i, j;
- float[] sinCache = new float[CACHE_SIZE];
- float[] cosCache = new float[CACHE_SIZE];
- float angle;
- 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 * GLU.PI;
- for (i = 0; i <= slices; i++) {
- angle = angleOffset + ((GLU.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 (super.normals) {
- case GLU.GLU_FLAT :
- case GLU.GLU_SMOOTH :
- if (super.orientation == GLU.GLU_OUTSIDE) {
- GL11.glNormal3f(0.0f, 0.0f, 1.0f);
- } else {
- GL11.glNormal3f(0.0f, 0.0f, -1.0f);
- }
- break;
- default :
- case GLU.GLU_NONE :
- break;
- }
-
- switch (super.drawStyle) {
- case GLU.GLU_FILL :
- if (innerRadius == .0f) {
- finish = loops - 1;
- /* Triangle strip for inner polygons */
- GL11.glBegin(GL11.GL_TRIANGLE_FAN);
- if (super.textureFlag) {
- GL11.glTexCoord2f(0.5f, 0.5f);
- }
- GL11.glVertex3f(0.0f, 0.0f, 0.0f);
- radiusLow = outerRadius - deltaRadius * ((float) (loops - 1) / loops);
- if (super.textureFlag) {
- texLow = radiusLow / outerRadius / 2;
- }
-
- if (super.orientation == GLU.GLU_OUTSIDE) {
- for (i = slices; i >= 0; i--) {
- if (super.textureFlag) {
- GL11.glTexCoord2f(
- texLow * sinCache[i] + 0.5f,
- texLow * cosCache[i] + 0.5f);
- }
- GL11.glVertex3f(radiusLow * sinCache[i], radiusLow * cosCache[i], 0.0f);
- }
- } else {
- for (i = 0; i <= slices; i++) {
- if (super.textureFlag) {
- GL11.glTexCoord2f(
- texLow * sinCache[i] + 0.5f,
- texLow * cosCache[i] + 0.5f);
- }
- GL11.glVertex3f(radiusLow * sinCache[i], radiusLow * cosCache[i], 0.0f);
- }
- }
- GL11.glEnd();
- } else {
- finish = loops;
- }
- for (j = 0; j < finish; j++) {
- radiusLow = outerRadius - deltaRadius * ((float) j / loops);
- radiusHigh = outerRadius - deltaRadius * ((float) (j + 1) / loops);
- if (super.textureFlag) {
- texLow = radiusLow / outerRadius / 2;
- texHigh = radiusHigh / outerRadius / 2;
- }
-
- GL11.glBegin(GL11.GL_QUAD_STRIP);
- for (i = 0; i <= slices; i++) {
- if (super.orientation == GLU.GLU_OUTSIDE) {
- if (super.textureFlag) {
- GL11.glTexCoord2f(
- texLow * sinCache[i] + 0.5f,
- texLow * cosCache[i] + 0.5f);
- }
- GL11.glVertex3f(radiusLow * sinCache[i], radiusLow * cosCache[i], 0.0f);
-
- if (super.textureFlag) {
- GL11.glTexCoord2f(
- texHigh * sinCache[i] + 0.5f,
- texHigh * cosCache[i] + 0.5f);
- }
- GL11.glVertex3f(
- radiusHigh * sinCache[i],
- radiusHigh * cosCache[i],
- 0.0f);
- } else {
- if (super.textureFlag) {
- GL11.glTexCoord2f(
- texHigh * sinCache[i] + 0.5f,
- texHigh * cosCache[i] + 0.5f);
- }
- GL11.glVertex3f(
- radiusHigh * sinCache[i],
- radiusHigh * cosCache[i],
- 0.0f);
-
- if (super.textureFlag) {
- GL11.glTexCoord2f(
- texLow * sinCache[i] + 0.5f,
- texLow * cosCache[i] + 0.5f);
- }
- GL11.glVertex3f(radiusLow * sinCache[i], radiusLow * cosCache[i], 0.0f);
- }
- }
- GL11.glEnd();
- }
- break;
- case GLU.GLU_POINT :
- GL11.glBegin(GL11.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 (super.textureFlag) {
- texLow = radiusLow / outerRadius / 2;
-
- GL11.glTexCoord2f(
- texLow * sinCache[i] + 0.5f,
- texLow * cosCache[i] + 0.5f);
- }
- GL11.glVertex3f(radiusLow * sintemp, radiusLow * costemp, 0.0f);
- }
- }
- GL11.glEnd();
- break;
- case GLU.GLU_LINE :
- if (innerRadius == outerRadius) {
- GL11.glBegin(GL11.GL_LINE_STRIP);
-
- for (i = 0; i <= slices; i++) {
- if (super.textureFlag) {
- GL11.glTexCoord2f(sinCache[i] / 2 + 0.5f, cosCache[i] / 2 + 0.5f);
- }
- GL11.glVertex3f(innerRadius * sinCache[i], innerRadius * cosCache[i], 0.0f);
- }
- GL11.glEnd();
- break;
- }
- for (j = 0; j <= loops; j++) {
- radiusLow = outerRadius - deltaRadius * ((float) j / loops);
- if (super.textureFlag) {
- texLow = radiusLow / outerRadius / 2;
- }
-
- GL11.glBegin(GL11.GL_LINE_STRIP);
- for (i = 0; i <= slices; i++) {
- if (super.textureFlag) {
- GL11.glTexCoord2f(
- texLow * sinCache[i] + 0.5f,
- texLow * cosCache[i] + 0.5f);
- }
- GL11.glVertex3f(radiusLow * sinCache[i], radiusLow * cosCache[i], 0.0f);
- }
- GL11.glEnd();
- }
- for (i = 0; i < slices2; i++) {
- sintemp = sinCache[i];
- costemp = cosCache[i];
- GL11.glBegin(GL11.GL_LINE_STRIP);
- for (j = 0; j <= loops; j++) {
- radiusLow = outerRadius - deltaRadius * ((float) j / loops);
- if (super.textureFlag) {
- texLow = radiusLow / outerRadius / 2;
- }
-
- if (super.textureFlag) {
- GL11.glTexCoord2f(
- texLow * sinCache[i] + 0.5f,
- texLow * cosCache[i] + 0.5f);
- }
- GL11.glVertex3f(radiusLow * sintemp, radiusLow * costemp, 0.0f);
- }
- GL11.glEnd();
- }
- break;
- case GLU.GLU_SILHOUETTE :
- if (sweepAngle < 360.0f) {
- for (i = 0; i <= slices; i += slices) {
- sintemp = sinCache[i];
- costemp = cosCache[i];
- GL11.glBegin(GL11.GL_LINE_STRIP);
- for (j = 0; j <= loops; j++) {
- radiusLow = outerRadius - deltaRadius * ((float) j / loops);
-
- if (super.textureFlag) {
- texLow = radiusLow / outerRadius / 2;
- GL11.glTexCoord2f(
- texLow * sinCache[i] + 0.5f,
- texLow * cosCache[i] + 0.5f);
- }
- GL11.glVertex3f(radiusLow * sintemp, radiusLow * costemp, 0.0f);
- }
- GL11.glEnd();
- }
- }
- for (j = 0; j <= loops; j += loops) {
- radiusLow = outerRadius - deltaRadius * ((float) j / loops);
- if (super.textureFlag) {
- texLow = radiusLow / outerRadius / 2;
- }
-
- GL11.glBegin(GL11.GL_LINE_STRIP);
- for (i = 0; i <= slices; i++) {
- if (super.textureFlag) {
- GL11.glTexCoord2f(
- texLow * sinCache[i] + 0.5f,
- texLow * cosCache[i] + 0.5f);
- }
- GL11.glVertex3f(radiusLow * sinCache[i], radiusLow * cosCache[i], 0.0f);
- }
- GL11.glEnd();
- if (innerRadius == outerRadius)
- break;
- }
- break;
- default :
- break;
- }
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.glu;
+
+import org.lwjgl.opengl.GL11;
+
+/**
+ * PartialDisk.java
+ *
+ *
+ * Created 23-dec-2003
+ *
+ * @author Erik Duijs
+ */
+public class PartialDisk extends Quadric {
+
+ private static final int CACHE_SIZE = 240;
+
+ /**
+ * Constructor for PartialDisk.
+ */
+ public PartialDisk() {
+ super();
+ }
+
+ /**
+ * 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 draw(
+ float innerRadius,
+ float outerRadius,
+ int slices,
+ int loops,
+ float startAngle,
+ float sweepAngle) {
+
+ int i, j;
+ float[] sinCache = new float[CACHE_SIZE];
+ float[] cosCache = new float[CACHE_SIZE];
+ float angle;
+ 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 * GLU.PI;
+ for (i = 0; i <= slices; i++) {
+ angle = angleOffset + ((GLU.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 (super.normals) {
+ case GLU.GLU_FLAT :
+ case GLU.GLU_SMOOTH :
+ if (super.orientation == GLU.GLU_OUTSIDE) {
+ GL11.glNormal3f(0.0f, 0.0f, 1.0f);
+ } else {
+ GL11.glNormal3f(0.0f, 0.0f, -1.0f);
+ }
+ break;
+ default :
+ case GLU.GLU_NONE :
+ break;
+ }
+
+ switch (super.drawStyle) {
+ case GLU.GLU_FILL :
+ if (innerRadius == .0f) {
+ finish = loops - 1;
+ /* Triangle strip for inner polygons */
+ GL11.glBegin(GL11.GL_TRIANGLE_FAN);
+ if (super.textureFlag) {
+ GL11.glTexCoord2f(0.5f, 0.5f);
+ }
+ GL11.glVertex3f(0.0f, 0.0f, 0.0f);
+ radiusLow = outerRadius - deltaRadius * ((float) (loops - 1) / loops);
+ if (super.textureFlag) {
+ texLow = radiusLow / outerRadius / 2;
+ }
+
+ if (super.orientation == GLU.GLU_OUTSIDE) {
+ for (i = slices; i >= 0; i--) {
+ if (super.textureFlag) {
+ GL11.glTexCoord2f(
+ texLow * sinCache[i] + 0.5f,
+ texLow * cosCache[i] + 0.5f);
+ }
+ GL11.glVertex3f(radiusLow * sinCache[i], radiusLow * cosCache[i], 0.0f);
+ }
+ } else {
+ for (i = 0; i <= slices; i++) {
+ if (super.textureFlag) {
+ GL11.glTexCoord2f(
+ texLow * sinCache[i] + 0.5f,
+ texLow * cosCache[i] + 0.5f);
+ }
+ GL11.glVertex3f(radiusLow * sinCache[i], radiusLow * cosCache[i], 0.0f);
+ }
+ }
+ GL11.glEnd();
+ } else {
+ finish = loops;
+ }
+ for (j = 0; j < finish; j++) {
+ radiusLow = outerRadius - deltaRadius * ((float) j / loops);
+ radiusHigh = outerRadius - deltaRadius * ((float) (j + 1) / loops);
+ if (super.textureFlag) {
+ texLow = radiusLow / outerRadius / 2;
+ texHigh = radiusHigh / outerRadius / 2;
+ }
+
+ GL11.glBegin(GL11.GL_QUAD_STRIP);
+ for (i = 0; i <= slices; i++) {
+ if (super.orientation == GLU.GLU_OUTSIDE) {
+ if (super.textureFlag) {
+ GL11.glTexCoord2f(
+ texLow * sinCache[i] + 0.5f,
+ texLow * cosCache[i] + 0.5f);
+ }
+ GL11.glVertex3f(radiusLow * sinCache[i], radiusLow * cosCache[i], 0.0f);
+
+ if (super.textureFlag) {
+ GL11.glTexCoord2f(
+ texHigh * sinCache[i] + 0.5f,
+ texHigh * cosCache[i] + 0.5f);
+ }
+ GL11.glVertex3f(
+ radiusHigh * sinCache[i],
+ radiusHigh * cosCache[i],
+ 0.0f);
+ } else {
+ if (super.textureFlag) {
+ GL11.glTexCoord2f(
+ texHigh * sinCache[i] + 0.5f,
+ texHigh * cosCache[i] + 0.5f);
+ }
+ GL11.glVertex3f(
+ radiusHigh * sinCache[i],
+ radiusHigh * cosCache[i],
+ 0.0f);
+
+ if (super.textureFlag) {
+ GL11.glTexCoord2f(
+ texLow * sinCache[i] + 0.5f,
+ texLow * cosCache[i] + 0.5f);
+ }
+ GL11.glVertex3f(radiusLow * sinCache[i], radiusLow * cosCache[i], 0.0f);
+ }
+ }
+ GL11.glEnd();
+ }
+ break;
+ case GLU.GLU_POINT :
+ GL11.glBegin(GL11.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 (super.textureFlag) {
+ texLow = radiusLow / outerRadius / 2;
+
+ GL11.glTexCoord2f(
+ texLow * sinCache[i] + 0.5f,
+ texLow * cosCache[i] + 0.5f);
+ }
+ GL11.glVertex3f(radiusLow * sintemp, radiusLow * costemp, 0.0f);
+ }
+ }
+ GL11.glEnd();
+ break;
+ case GLU.GLU_LINE :
+ if (innerRadius == outerRadius) {
+ GL11.glBegin(GL11.GL_LINE_STRIP);
+
+ for (i = 0; i <= slices; i++) {
+ if (super.textureFlag) {
+ GL11.glTexCoord2f(sinCache[i] / 2 + 0.5f, cosCache[i] / 2 + 0.5f);
+ }
+ GL11.glVertex3f(innerRadius * sinCache[i], innerRadius * cosCache[i], 0.0f);
+ }
+ GL11.glEnd();
+ break;
+ }
+ for (j = 0; j <= loops; j++) {
+ radiusLow = outerRadius - deltaRadius * ((float) j / loops);
+ if (super.textureFlag) {
+ texLow = radiusLow / outerRadius / 2;
+ }
+
+ GL11.glBegin(GL11.GL_LINE_STRIP);
+ for (i = 0; i <= slices; i++) {
+ if (super.textureFlag) {
+ GL11.glTexCoord2f(
+ texLow * sinCache[i] + 0.5f,
+ texLow * cosCache[i] + 0.5f);
+ }
+ GL11.glVertex3f(radiusLow * sinCache[i], radiusLow * cosCache[i], 0.0f);
+ }
+ GL11.glEnd();
+ }
+ for (i = 0; i < slices2; i++) {
+ sintemp = sinCache[i];
+ costemp = cosCache[i];
+ GL11.glBegin(GL11.GL_LINE_STRIP);
+ for (j = 0; j <= loops; j++) {
+ radiusLow = outerRadius - deltaRadius * ((float) j / loops);
+ if (super.textureFlag) {
+ texLow = radiusLow / outerRadius / 2;
+ }
+
+ if (super.textureFlag) {
+ GL11.glTexCoord2f(
+ texLow * sinCache[i] + 0.5f,
+ texLow * cosCache[i] + 0.5f);
+ }
+ GL11.glVertex3f(radiusLow * sintemp, radiusLow * costemp, 0.0f);
+ }
+ GL11.glEnd();
+ }
+ break;
+ case GLU.GLU_SILHOUETTE :
+ if (sweepAngle < 360.0f) {
+ for (i = 0; i <= slices; i += slices) {
+ sintemp = sinCache[i];
+ costemp = cosCache[i];
+ GL11.glBegin(GL11.GL_LINE_STRIP);
+ for (j = 0; j <= loops; j++) {
+ radiusLow = outerRadius - deltaRadius * ((float) j / loops);
+
+ if (super.textureFlag) {
+ texLow = radiusLow / outerRadius / 2;
+ GL11.glTexCoord2f(
+ texLow * sinCache[i] + 0.5f,
+ texLow * cosCache[i] + 0.5f);
+ }
+ GL11.glVertex3f(radiusLow * sintemp, radiusLow * costemp, 0.0f);
+ }
+ GL11.glEnd();
+ }
+ }
+ for (j = 0; j <= loops; j += loops) {
+ radiusLow = outerRadius - deltaRadius * ((float) j / loops);
+ if (super.textureFlag) {
+ texLow = radiusLow / outerRadius / 2;
+ }
+
+ GL11.glBegin(GL11.GL_LINE_STRIP);
+ for (i = 0; i <= slices; i++) {
+ if (super.textureFlag) {
+ GL11.glTexCoord2f(
+ texLow * sinCache[i] + 0.5f,
+ texLow * cosCache[i] + 0.5f);
+ }
+ GL11.glVertex3f(radiusLow * sinCache[i], radiusLow * cosCache[i], 0.0f);
+ }
+ GL11.glEnd();
+ if (innerRadius == outerRadius)
+ break;
+ }
+ break;
+ default :
+ break;
+ }
+ }
+}
diff --git a/src/java/org/lwjgl/util/glu/PixelStoreState.java b/src/java/org/lwjgl/util/glu/PixelStoreState.java
index c93686f..6efbe50 100644
--- a/src/java/org/lwjgl/util/glu/PixelStoreState.java
+++ b/src/java/org/lwjgl/util/glu/PixelStoreState.java
@@ -1,84 +1,84 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.glu;
-
-import org.lwjgl.opengl.GL11;
-
-/**
- * PixelStoreState.java
- *
- *
- * Created 11-jan-2004
- * @author Erik Duijs
- */
-class PixelStoreState extends Util {
-
- public int unpackRowLength;
- public int unpackAlignment;
- public int unpackSkipRows;
- public int unpackSkipPixels;
- public int packRowLength;
- public int packAlignment;
- public int packSkipRows;
- public int packSkipPixels;
-
- /**
- * Constructor for PixelStoreState.
- */
- PixelStoreState() {
- super();
- load();
- }
-
- public void load() {
- unpackRowLength = glGetIntegerv(GL11.GL_UNPACK_ROW_LENGTH);
- unpackAlignment = glGetIntegerv(GL11.GL_UNPACK_ALIGNMENT);
- unpackSkipRows = glGetIntegerv(GL11.GL_UNPACK_SKIP_ROWS);
- unpackSkipPixels = glGetIntegerv(GL11.GL_UNPACK_SKIP_PIXELS);
- packRowLength = glGetIntegerv(GL11.GL_PACK_ROW_LENGTH);
- packAlignment = glGetIntegerv(GL11.GL_PACK_ALIGNMENT);
- packSkipRows = glGetIntegerv(GL11.GL_PACK_SKIP_ROWS);
- packSkipPixels = glGetIntegerv(GL11.GL_PACK_SKIP_PIXELS);
- }
-
- public void save() {
- GL11.glPixelStorei(GL11.GL_UNPACK_ROW_LENGTH, unpackRowLength);
- GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, unpackAlignment);
- GL11.glPixelStorei(GL11.GL_UNPACK_SKIP_ROWS, unpackSkipRows);
- GL11.glPixelStorei(GL11.GL_UNPACK_SKIP_PIXELS, unpackSkipPixels);
- GL11.glPixelStorei(GL11.GL_PACK_ROW_LENGTH, packRowLength);
- GL11.glPixelStorei(GL11.GL_PACK_ALIGNMENT, packAlignment);
- GL11.glPixelStorei(GL11.GL_PACK_SKIP_ROWS, packSkipRows);
- GL11.glPixelStorei(GL11.GL_PACK_SKIP_PIXELS, packSkipPixels);
- }
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.glu;
+
+import org.lwjgl.opengl.GL11;
+
+/**
+ * PixelStoreState.java
+ *
+ *
+ * Created 11-jan-2004
+ * @author Erik Duijs
+ */
+class PixelStoreState extends Util {
+
+ public int unpackRowLength;
+ public int unpackAlignment;
+ public int unpackSkipRows;
+ public int unpackSkipPixels;
+ public int packRowLength;
+ public int packAlignment;
+ public int packSkipRows;
+ public int packSkipPixels;
+
+ /**
+ * Constructor for PixelStoreState.
+ */
+ PixelStoreState() {
+ super();
+ load();
+ }
+
+ public void load() {
+ unpackRowLength = glGetIntegerv(GL11.GL_UNPACK_ROW_LENGTH);
+ unpackAlignment = glGetIntegerv(GL11.GL_UNPACK_ALIGNMENT);
+ unpackSkipRows = glGetIntegerv(GL11.GL_UNPACK_SKIP_ROWS);
+ unpackSkipPixels = glGetIntegerv(GL11.GL_UNPACK_SKIP_PIXELS);
+ packRowLength = glGetIntegerv(GL11.GL_PACK_ROW_LENGTH);
+ packAlignment = glGetIntegerv(GL11.GL_PACK_ALIGNMENT);
+ packSkipRows = glGetIntegerv(GL11.GL_PACK_SKIP_ROWS);
+ packSkipPixels = glGetIntegerv(GL11.GL_PACK_SKIP_PIXELS);
+ }
+
+ public void save() {
+ GL11.glPixelStorei(GL11.GL_UNPACK_ROW_LENGTH, unpackRowLength);
+ GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, unpackAlignment);
+ GL11.glPixelStorei(GL11.GL_UNPACK_SKIP_ROWS, unpackSkipRows);
+ GL11.glPixelStorei(GL11.GL_UNPACK_SKIP_PIXELS, unpackSkipPixels);
+ GL11.glPixelStorei(GL11.GL_PACK_ROW_LENGTH, packRowLength);
+ GL11.glPixelStorei(GL11.GL_PACK_ALIGNMENT, packAlignment);
+ GL11.glPixelStorei(GL11.GL_PACK_SKIP_ROWS, packSkipRows);
+ GL11.glPixelStorei(GL11.GL_PACK_SKIP_PIXELS, packSkipPixels);
+ }
+
+}
diff --git a/src/java/org/lwjgl/util/glu/Project.java b/src/java/org/lwjgl/util/glu/Project.java
index 552a2a6..151dcb8 100644
--- a/src/java/org/lwjgl/util/glu/Project.java
+++ b/src/java/org/lwjgl/util/glu/Project.java
@@ -1,410 +1,410 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.glu;
-
-import java.nio.FloatBuffer;
-import java.nio.IntBuffer;
-
-import org.lwjgl.BufferUtils;
-import org.lwjgl.opengl.GL11;
-
-/**
- * Project.java
- * <p/>
- * <p/>
- * Created 11-jan-2004
- *
- * @author Erik Duijs
- */
-public class Project extends Util {
-
- 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 FloatBuffer matrix = BufferUtils.createFloatBuffer(16);
- private static final FloatBuffer finalMatrix = BufferUtils.createFloatBuffer(16);
-
- private static final FloatBuffer tempMatrix = BufferUtils.createFloatBuffer(16);
- private static final float[] in = new float[4];
- private static final float[] out = new float[4];
-
- private static final float[] forward = new float[3];
- private static final float[] side = new float[3];
- private static final float[] up = new float[3];
-
- /**
- * Make matrix an identity matrix
- */
- private static void __gluMakeIdentityf(FloatBuffer m) {
- int oldPos = m.position();
- m.put(IDENTITY_MATRIX);
- m.position(oldPos);
- }
-
- /**
- * Method __gluMultMatrixVecf
- *
- * @param finalMatrix
- * @param in
- * @param out
- */
- private static void __gluMultMatrixVecf(FloatBuffer m, float[] in, float[] out) {
- for (int i = 0; i < 4; i++) {
- out[i] =
- in[0] * m.get(m.position() + 0*4 + i)
- + in[1] * m.get(m.position() + 1*4 + i)
- + in[2] * m.get(m.position() + 2*4 + i)
- + in[3] * m.get(m.position() + 3*4 + i);
-
- }
- }
-
- /**
- * @param src
- * @param inverse
- *
- * @return
- */
- private static boolean __gluInvertMatrixf(FloatBuffer src, FloatBuffer inverse) {
- int i, j, k, swap;
- float t;
- FloatBuffer temp = Project.tempMatrix;
-
-
- for (i = 0; i < 16; i++) {
- temp.put(i, src.get(i + src.position()));
- }
- __gluMakeIdentityf(inverse);
-
- for (i = 0; i < 4; i++) {
- /*
- * * Look for largest element in column
- */
- swap = i;
- for (j = i + 1; j < 4; j++) {
- /*
- * if (fabs(temp[j][i]) > fabs(temp[i][i])) { swap = 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);
- inverse.put(i*4 + k, inverse.get(swap*4 + k));
- //inverse.put((i << 2) + k, inverse.get((swap << 2) + k));
- inverse.put(swap*4 + k, t);
- //inverse.put((swap << 2) + k, 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, inverse.get(i*4 + k)/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, inverse.get(j*4 + k) - inverse.get(i*4 + k) * t);
- /*inverse.put(
- (j << 2) + k,
- inverse.get((j << 2) + k) - inverse.get((i << 2) + k) * t);*/
- }
- }
- }
- }
- return true;
- }
-
- /**
- * @param a
- * @param b
- * @param r
- */
- private static void __gluMultMatricesf(FloatBuffer a, FloatBuffer b, FloatBuffer r) {
- for (int i = 0; i < 4; i++) {
- for (int j = 0; j < 4; j++) {
- r.put(r.position() + i*4 + j,
- a.get(a.position() + i*4 + 0) * b.get(b.position() + 0*4 + j) + a.get(a.position() + i*4 + 1) * b.get(b.position() + 1*4 + j) + a.get(a.position() + i*4 + 2) * b.get(b.position() + 2*4 + j) + a.get(a.position() + i*4 + 3) * b.get(b.position() + 3*4 + j));
- }
- }
- }
-
- /**
- * Method gluPerspective.
- *
- * @param fovy
- * @param aspect
- * @param zNear
- * @param zFar
- */
- public static void gluPerspective(float fovy, float aspect, float zNear, float zFar) {
- float sine, cotangent, deltaZ;
- float radians = fovy / 2 * GLU.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(matrix);
-
- matrix.put(0 * 4 + 0, cotangent / aspect);
- matrix.put(1 * 4 + 1, cotangent);
- matrix.put(2 * 4 + 2, - (zFar + zNear) / deltaZ);
- matrix.put(2 * 4 + 3, -1);
- matrix.put(3 * 4 + 2, -2 * zNear * zFar / deltaZ);
- matrix.put(3 * 4 + 3, 0);
-
- GL11.glMultMatrix(matrix);
- }
-
- /**
- * Method gluLookAt
- *
- * @param eyex
- * @param eyey
- * @param eyez
- * @param centerx
- * @param centery
- * @param centerz
- * @param upx
- * @param upy
- * @param upz
- */
- public static void gluLookAt(
- float eyex,
- float eyey,
- float eyez,
- float centerx,
- float centery,
- float centerz,
- float upx,
- float upy,
- float upz) {
- float[] forward = Project.forward;
- float[] side = Project.side;
- float[] up = Project.up;
-
- forward[0] = centerx - eyex;
- forward[1] = centery - eyey;
- forward[2] = centerz - eyez;
-
- up[0] = upx;
- up[1] = upy;
- up[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(matrix);
- matrix.put(0 * 4 + 0, side[0]);
- matrix.put(1 * 4 + 0, side[1]);
- matrix.put(2 * 4 + 0, side[2]);
-
- matrix.put(0 * 4 + 1, up[0]);
- matrix.put(1 * 4 + 1, up[1]);
- matrix.put(2 * 4 + 1, up[2]);
-
- matrix.put(0 * 4 + 2, -forward[0]);
- matrix.put(1 * 4 + 2, -forward[1]);
- matrix.put(2 * 4 + 2, -forward[2]);
-
- GL11.glMultMatrix(matrix);
- GL11.glTranslatef(-eyex, -eyey, -eyez);
- }
-
- /**
- * Method gluProject
- *
- * @param objx
- * @param objy
- * @param objz
- * @param modelMatrix
- * @param projMatrix
- * @param viewport
- * @param win_pos
- */
- public static boolean gluProject(
- float objx,
- float objy,
- float objz,
- FloatBuffer modelMatrix,
- FloatBuffer projMatrix,
- IntBuffer viewport,
- FloatBuffer win_pos) {
-
- float[] in = Project.in;
- float[] out = Project.out;
-
- in[0] = objx;
- in[1] = objy;
- in[2] = objz;
- in[3] = 1.0f;
-
- __gluMultMatrixVecf(modelMatrix, in, out);
- __gluMultMatrixVecf(projMatrix, out, in);
-
- if (in[3] == 0.0)
- 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.put(0, in[0] * viewport.get(viewport.position() + 2) + viewport.get(viewport.position() + 0));
- win_pos.put(1, in[1] * viewport.get(viewport.position() + 3) + viewport.get(viewport.position() + 1));
- win_pos.put(2, in[2]);
-
- return true;
- }
-
- /**
- * Method gluUnproject
- *
- * @param winx
- * @param winy
- * @param winz
- * @param modelMatrix
- * @param projMatrix
- * @param viewport
- * @param obj_pos
- */
- public static boolean gluUnProject(
- float winx,
- float winy,
- float winz,
- FloatBuffer modelMatrix,
- FloatBuffer projMatrix,
- IntBuffer viewport,
- FloatBuffer obj_pos) {
- float[] in = Project.in;
- float[] out = Project.out;
-
- __gluMultMatricesf(modelMatrix, projMatrix, finalMatrix);
-
- if (!__gluInvertMatrixf(finalMatrix, finalMatrix))
- 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.get(viewport.position() + 0)) / viewport.get(viewport.position() + 2);
- in[1] = (in[1] - viewport.get(viewport.position() + 1)) / viewport.get(viewport.position() + 3);
-
- // 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(finalMatrix, in, out);
-
- if (out[3] == 0.0)
- return false;
-
- out[3] = 1.0f / out[3];
-
- obj_pos.put(obj_pos.position() + 0, out[0] * out[3]);
- obj_pos.put(obj_pos.position() + 1, out[1] * out[3]);
- obj_pos.put(obj_pos.position() + 2, out[2] * out[3]);
-
- return true;
- }
-
- /**
- * Method gluPickMatrix
- *
- * @param x
- * @param y
- * @param deltaX
- * @param deltaY
- * @param viewport
- */
- public static void gluPickMatrix(
- 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 */
- GL11.glTranslatef(
- (viewport.get(viewport.position() + 2) - 2 * (x - viewport.get(viewport.position() + 0))) / deltaX,
- (viewport.get(viewport.position() + 3) - 2 * (y - viewport.get(viewport.position() + 1))) / deltaY,
- 0);
- GL11.glScalef(viewport.get(viewport.position() + 2) / deltaX, viewport.get(viewport.position() + 3) / deltaY, 1.0f);
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.glu;
+
+import java.nio.FloatBuffer;
+import java.nio.IntBuffer;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.opengl.GL11;
+
+/**
+ * Project.java
+ * <p/>
+ * <p/>
+ * Created 11-jan-2004
+ *
+ * @author Erik Duijs
+ */
+public class Project extends Util {
+
+ 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 FloatBuffer matrix = BufferUtils.createFloatBuffer(16);
+ private static final FloatBuffer finalMatrix = BufferUtils.createFloatBuffer(16);
+
+ private static final FloatBuffer tempMatrix = BufferUtils.createFloatBuffer(16);
+ private static final float[] in = new float[4];
+ private static final float[] out = new float[4];
+
+ private static final float[] forward = new float[3];
+ private static final float[] side = new float[3];
+ private static final float[] up = new float[3];
+
+ /**
+ * Make matrix an identity matrix
+ */
+ private static void __gluMakeIdentityf(FloatBuffer m) {
+ int oldPos = m.position();
+ m.put(IDENTITY_MATRIX);
+ m.position(oldPos);
+ }
+
+ /**
+ * Method __gluMultMatrixVecf
+ *
+ * @param finalMatrix
+ * @param in
+ * @param out
+ */
+ private static void __gluMultMatrixVecf(FloatBuffer m, float[] in, float[] out) {
+ for (int i = 0; i < 4; i++) {
+ out[i] =
+ in[0] * m.get(m.position() + 0*4 + i)
+ + in[1] * m.get(m.position() + 1*4 + i)
+ + in[2] * m.get(m.position() + 2*4 + i)
+ + in[3] * m.get(m.position() + 3*4 + i);
+
+ }
+ }
+
+ /**
+ * @param src
+ * @param inverse
+ *
+ * @return
+ */
+ private static boolean __gluInvertMatrixf(FloatBuffer src, FloatBuffer inverse) {
+ int i, j, k, swap;
+ float t;
+ FloatBuffer temp = Project.tempMatrix;
+
+
+ for (i = 0; i < 16; i++) {
+ temp.put(i, src.get(i + src.position()));
+ }
+ __gluMakeIdentityf(inverse);
+
+ for (i = 0; i < 4; i++) {
+ /*
+ * * Look for largest element in column
+ */
+ swap = i;
+ for (j = i + 1; j < 4; j++) {
+ /*
+ * if (fabs(temp[j][i]) > fabs(temp[i][i])) { swap = 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);
+ inverse.put(i*4 + k, inverse.get(swap*4 + k));
+ //inverse.put((i << 2) + k, inverse.get((swap << 2) + k));
+ inverse.put(swap*4 + k, t);
+ //inverse.put((swap << 2) + k, 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, inverse.get(i*4 + k)/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, inverse.get(j*4 + k) - inverse.get(i*4 + k) * t);
+ /*inverse.put(
+ (j << 2) + k,
+ inverse.get((j << 2) + k) - inverse.get((i << 2) + k) * t);*/
+ }
+ }
+ }
+ }
+ return true;
+ }
+
+ /**
+ * @param a
+ * @param b
+ * @param r
+ */
+ private static void __gluMultMatricesf(FloatBuffer a, FloatBuffer b, FloatBuffer r) {
+ for (int i = 0; i < 4; i++) {
+ for (int j = 0; j < 4; j++) {
+ r.put(r.position() + i*4 + j,
+ a.get(a.position() + i*4 + 0) * b.get(b.position() + 0*4 + j) + a.get(a.position() + i*4 + 1) * b.get(b.position() + 1*4 + j) + a.get(a.position() + i*4 + 2) * b.get(b.position() + 2*4 + j) + a.get(a.position() + i*4 + 3) * b.get(b.position() + 3*4 + j));
+ }
+ }
+ }
+
+ /**
+ * Method gluPerspective.
+ *
+ * @param fovy
+ * @param aspect
+ * @param zNear
+ * @param zFar
+ */
+ public static void gluPerspective(float fovy, float aspect, float zNear, float zFar) {
+ float sine, cotangent, deltaZ;
+ float radians = fovy / 2 * GLU.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(matrix);
+
+ matrix.put(0 * 4 + 0, cotangent / aspect);
+ matrix.put(1 * 4 + 1, cotangent);
+ matrix.put(2 * 4 + 2, - (zFar + zNear) / deltaZ);
+ matrix.put(2 * 4 + 3, -1);
+ matrix.put(3 * 4 + 2, -2 * zNear * zFar / deltaZ);
+ matrix.put(3 * 4 + 3, 0);
+
+ GL11.glMultMatrix(matrix);
+ }
+
+ /**
+ * Method gluLookAt
+ *
+ * @param eyex
+ * @param eyey
+ * @param eyez
+ * @param centerx
+ * @param centery
+ * @param centerz
+ * @param upx
+ * @param upy
+ * @param upz
+ */
+ public static void gluLookAt(
+ float eyex,
+ float eyey,
+ float eyez,
+ float centerx,
+ float centery,
+ float centerz,
+ float upx,
+ float upy,
+ float upz) {
+ float[] forward = Project.forward;
+ float[] side = Project.side;
+ float[] up = Project.up;
+
+ forward[0] = centerx - eyex;
+ forward[1] = centery - eyey;
+ forward[2] = centerz - eyez;
+
+ up[0] = upx;
+ up[1] = upy;
+ up[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(matrix);
+ matrix.put(0 * 4 + 0, side[0]);
+ matrix.put(1 * 4 + 0, side[1]);
+ matrix.put(2 * 4 + 0, side[2]);
+
+ matrix.put(0 * 4 + 1, up[0]);
+ matrix.put(1 * 4 + 1, up[1]);
+ matrix.put(2 * 4 + 1, up[2]);
+
+ matrix.put(0 * 4 + 2, -forward[0]);
+ matrix.put(1 * 4 + 2, -forward[1]);
+ matrix.put(2 * 4 + 2, -forward[2]);
+
+ GL11.glMultMatrix(matrix);
+ GL11.glTranslatef(-eyex, -eyey, -eyez);
+ }
+
+ /**
+ * Method gluProject
+ *
+ * @param objx
+ * @param objy
+ * @param objz
+ * @param modelMatrix
+ * @param projMatrix
+ * @param viewport
+ * @param win_pos
+ */
+ public static boolean gluProject(
+ float objx,
+ float objy,
+ float objz,
+ FloatBuffer modelMatrix,
+ FloatBuffer projMatrix,
+ IntBuffer viewport,
+ FloatBuffer win_pos) {
+
+ float[] in = Project.in;
+ float[] out = Project.out;
+
+ in[0] = objx;
+ in[1] = objy;
+ in[2] = objz;
+ in[3] = 1.0f;
+
+ __gluMultMatrixVecf(modelMatrix, in, out);
+ __gluMultMatrixVecf(projMatrix, out, in);
+
+ if (in[3] == 0.0)
+ 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.put(0, in[0] * viewport.get(viewport.position() + 2) + viewport.get(viewport.position() + 0));
+ win_pos.put(1, in[1] * viewport.get(viewport.position() + 3) + viewport.get(viewport.position() + 1));
+ win_pos.put(2, in[2]);
+
+ return true;
+ }
+
+ /**
+ * Method gluUnproject
+ *
+ * @param winx
+ * @param winy
+ * @param winz
+ * @param modelMatrix
+ * @param projMatrix
+ * @param viewport
+ * @param obj_pos
+ */
+ public static boolean gluUnProject(
+ float winx,
+ float winy,
+ float winz,
+ FloatBuffer modelMatrix,
+ FloatBuffer projMatrix,
+ IntBuffer viewport,
+ FloatBuffer obj_pos) {
+ float[] in = Project.in;
+ float[] out = Project.out;
+
+ __gluMultMatricesf(modelMatrix, projMatrix, finalMatrix);
+
+ if (!__gluInvertMatrixf(finalMatrix, finalMatrix))
+ 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.get(viewport.position() + 0)) / viewport.get(viewport.position() + 2);
+ in[1] = (in[1] - viewport.get(viewport.position() + 1)) / viewport.get(viewport.position() + 3);
+
+ // 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(finalMatrix, in, out);
+
+ if (out[3] == 0.0)
+ return false;
+
+ out[3] = 1.0f / out[3];
+
+ obj_pos.put(obj_pos.position() + 0, out[0] * out[3]);
+ obj_pos.put(obj_pos.position() + 1, out[1] * out[3]);
+ obj_pos.put(obj_pos.position() + 2, out[2] * out[3]);
+
+ return true;
+ }
+
+ /**
+ * Method gluPickMatrix
+ *
+ * @param x
+ * @param y
+ * @param deltaX
+ * @param deltaY
+ * @param viewport
+ */
+ public static void gluPickMatrix(
+ 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 */
+ GL11.glTranslatef(
+ (viewport.get(viewport.position() + 2) - 2 * (x - viewport.get(viewport.position() + 0))) / deltaX,
+ (viewport.get(viewport.position() + 3) - 2 * (y - viewport.get(viewport.position() + 1))) / deltaY,
+ 0);
+ GL11.glScalef(viewport.get(viewport.position() + 2) / deltaX, viewport.get(viewport.position() + 3) / deltaY, 1.0f);
+ }
+}
diff --git a/src/java/org/lwjgl/util/glu/Quadric.java b/src/java/org/lwjgl/util/glu/Quadric.java
index 9a86c73..3f4c652 100644
--- a/src/java/org/lwjgl/util/glu/Quadric.java
+++ b/src/java/org/lwjgl/util/glu/Quadric.java
@@ -1,198 +1,198 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.glu;
-
-import org.lwjgl.opengl.GL11;
-
-/**
- * Quadric.java
- *
- *
- * Created 22-dec-2003
- * @author Erik Duijs
- */
-public class Quadric {
-
- protected int drawStyle;
- protected int orientation;
- protected boolean textureFlag;
- protected int normals;
-
- /**
- * Constructor for Quadric.
- */
- public Quadric() {
- super();
-
- drawStyle = GLU.GLU_FILL;
- orientation = GLU.GLU_OUTSIDE;
- textureFlag = false;
- normals = GLU.GLU_SMOOTH;
- }
-
- /**
- * Call glNormal3f after scaling normal to unit length.
- *
- * @param x
- * @param y
- * @param z
- */
- protected void normal3f(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;
- }
- GL11.glNormal3f(x, y, z);
- }
-
- /**
- * 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;
- }
-
- protected void TXTR_COORD(float x, float y) {
- if (textureFlag) GL11.glTexCoord2f(x,y);
- }
-
-
- protected float sin(float r) {
- return (float)Math.sin(r);
- }
-
- protected float cos(float r) {
- return (float)Math.cos(r);
- }
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.glu;
+
+import org.lwjgl.opengl.GL11;
+
+/**
+ * Quadric.java
+ *
+ *
+ * Created 22-dec-2003
+ * @author Erik Duijs
+ */
+public class Quadric {
+
+ protected int drawStyle;
+ protected int orientation;
+ protected boolean textureFlag;
+ protected int normals;
+
+ /**
+ * Constructor for Quadric.
+ */
+ public Quadric() {
+ super();
+
+ drawStyle = GLU.GLU_FILL;
+ orientation = GLU.GLU_OUTSIDE;
+ textureFlag = false;
+ normals = GLU.GLU_SMOOTH;
+ }
+
+ /**
+ * Call glNormal3f after scaling normal to unit length.
+ *
+ * @param x
+ * @param y
+ * @param z
+ */
+ protected void normal3f(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;
+ }
+ GL11.glNormal3f(x, y, z);
+ }
+
+ /**
+ * 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;
+ }
+
+ protected void TXTR_COORD(float x, float y) {
+ if (textureFlag) GL11.glTexCoord2f(x,y);
+ }
+
+
+ protected float sin(float r) {
+ return (float)Math.sin(r);
+ }
+
+ protected float cos(float r) {
+ return (float)Math.cos(r);
+ }
+
+}
diff --git a/src/java/org/lwjgl/util/glu/Registry.java b/src/java/org/lwjgl/util/glu/Registry.java
index 05abb5e..a472dcc 100644
--- a/src/java/org/lwjgl/util/glu/Registry.java
+++ b/src/java/org/lwjgl/util/glu/Registry.java
@@ -1,78 +1,78 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.glu;
-
-/**
- * Registry.java
- *
- *
- * Created 11-jan-2004
- * @author Erik Duijs
- */
-public class Registry extends Util {
-
- private static final String versionString = "1.3";
- private static final String extensionString =
- "GLU_EXT_nurbs_tessellator " + "GLU_EXT_object_space_tess ";
-
- /**
- * Method gluGetString
- * @param name
- * @return String
- */
- public static String gluGetString(int name) {
-
- if (name == GLU.GLU_VERSION) {
- return versionString;
- } else if (name == GLU.GLU_EXTENSIONS) {
- return extensionString;
- }
- return null;
- }
-
- /**
- * Method gluCheckExtension
- *
- * @param extName is an extension name.
- * @param 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.
- * @return boolean true if extName is found otherwise it returns false.
- */
- public static boolean gluCheckExtension(String extName, String extString) {
- if (extString == null || extName == null)
- return false;
-
- return extString.indexOf(extName) != -1;
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.glu;
+
+/**
+ * Registry.java
+ *
+ *
+ * Created 11-jan-2004
+ * @author Erik Duijs
+ */
+public class Registry extends Util {
+
+ private static final String versionString = "1.3";
+ private static final String extensionString =
+ "GLU_EXT_nurbs_tessellator " + "GLU_EXT_object_space_tess ";
+
+ /**
+ * Method gluGetString
+ * @param name
+ * @return String
+ */
+ public static String gluGetString(int name) {
+
+ if (name == GLU.GLU_VERSION) {
+ return versionString;
+ } else if (name == GLU.GLU_EXTENSIONS) {
+ return extensionString;
+ }
+ return null;
+ }
+
+ /**
+ * Method gluCheckExtension
+ *
+ * @param extName is an extension name.
+ * @param 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.
+ * @return boolean true if extName is found otherwise it returns false.
+ */
+ public static boolean gluCheckExtension(String extName, String extString) {
+ if (extString == null || extName == null)
+ return false;
+
+ return extString.indexOf(extName) != -1;
+ }
+}
diff --git a/src/java/org/lwjgl/util/glu/Sphere.java b/src/java/org/lwjgl/util/glu/Sphere.java
index 3f8e906..fcc60ab 100644
--- a/src/java/org/lwjgl/util/glu/Sphere.java
+++ b/src/java/org/lwjgl/util/glu/Sphere.java
@@ -1,229 +1,229 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.glu;
-
-
-import org.lwjgl.opengl.GL11;
-
-/**
- * Sphere.java
- *
- *
- * Created 23-dec-2003
- * @author Erik Duijs
- */
-public class Sphere extends Quadric {
-
- /**
- * Constructor
- */
- public Sphere() {
- super();
- }
-
- /**
- * 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 draw(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 = super.normals != GLU.GLU_NONE;
-
- if (super.orientation == GLU.GLU_INSIDE) {
- nsign = -1.0f;
- } else {
- nsign = 1.0f;
- }
-
- drho = GLU.PI / stacks;
- dtheta = 2.0f * GLU.PI / slices;
-
- if (super.drawStyle == GLU.GLU_FILL) {
- if (!super.textureFlag) {
- // draw +Z end as a triangle fan
- GL11.glBegin(GL11.GL_TRIANGLE_FAN);
- GL11.glNormal3f(0.0f, 0.0f, 1.0f);
- GL11.glVertex3f(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) {
- GL11.glNormal3f(x * nsign, y * nsign, z * nsign);
- }
- GL11.glVertex3f(x * radius, y * radius, z * radius);
- }
- GL11.glEnd();
- }
-
- ds = 1.0f / slices;
- dt = 1.0f / stacks;
- t = 1.0f; // because loop now runs from 0
- if (super.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;
- GL11.glBegin(GL11.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) {
- GL11.glNormal3f(x * nsign, y * nsign, z * nsign);
- }
- TXTR_COORD(s, t);
- GL11.glVertex3f(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) {
- GL11.glNormal3f(x * nsign, y * nsign, z * nsign);
- }
- TXTR_COORD(s, t - dt);
- s += ds;
- GL11.glVertex3f(x * radius, y * radius, z * radius);
- }
- GL11.glEnd();
- t -= dt;
- }
-
- if (!super.textureFlag) {
- // draw -Z end as a triangle fan
- GL11.glBegin(GL11.GL_TRIANGLE_FAN);
- GL11.glNormal3f(0.0f, 0.0f, -1.0f);
- GL11.glVertex3f(0.0f, 0.0f, -radius * nsign);
- rho = GLU.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)
- GL11.glNormal3f(x * nsign, y * nsign, z * nsign);
- s -= ds;
- GL11.glVertex3f(x * radius, y * radius, z * radius);
- }
- GL11.glEnd();
- }
- } else if (
- super.drawStyle == GLU.GLU_LINE
- || super.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;
- GL11.glBegin(GL11.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)
- GL11.glNormal3f(x * nsign, y * nsign, z * nsign);
- GL11.glVertex3f(x * radius, y * radius, z * radius);
- }
- GL11.glEnd();
- }
- // draw slice lines
- for (j = 0; j < slices; j++) {
- theta = j * dtheta;
- GL11.glBegin(GL11.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)
- GL11.glNormal3f(x * nsign, y * nsign, z * nsign);
- GL11.glVertex3f(x * radius, y * radius, z * radius);
- }
- GL11.glEnd();
- }
- } else if (super.drawStyle == GLU.GLU_POINT) {
- // top and bottom-most points
- GL11.glBegin(GL11.GL_POINTS);
- if (normals)
- GL11.glNormal3f(0.0f, 0.0f, nsign);
- GL11.glVertex3f(0.0f, 0.0f, radius);
- if (normals)
- GL11.glNormal3f(0.0f, 0.0f, -nsign);
- GL11.glVertex3f(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)
- GL11.glNormal3f(x * nsign, y * nsign, z * nsign);
- GL11.glVertex3f(x * radius, y * radius, z * radius);
- }
- }
- GL11.glEnd();
- }
- }
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.glu;
+
+
+import org.lwjgl.opengl.GL11;
+
+/**
+ * Sphere.java
+ *
+ *
+ * Created 23-dec-2003
+ * @author Erik Duijs
+ */
+public class Sphere extends Quadric {
+
+ /**
+ * Constructor
+ */
+ public Sphere() {
+ super();
+ }
+
+ /**
+ * 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 draw(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 = super.normals != GLU.GLU_NONE;
+
+ if (super.orientation == GLU.GLU_INSIDE) {
+ nsign = -1.0f;
+ } else {
+ nsign = 1.0f;
+ }
+
+ drho = GLU.PI / stacks;
+ dtheta = 2.0f * GLU.PI / slices;
+
+ if (super.drawStyle == GLU.GLU_FILL) {
+ if (!super.textureFlag) {
+ // draw +Z end as a triangle fan
+ GL11.glBegin(GL11.GL_TRIANGLE_FAN);
+ GL11.glNormal3f(0.0f, 0.0f, 1.0f);
+ GL11.glVertex3f(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) {
+ GL11.glNormal3f(x * nsign, y * nsign, z * nsign);
+ }
+ GL11.glVertex3f(x * radius, y * radius, z * radius);
+ }
+ GL11.glEnd();
+ }
+
+ ds = 1.0f / slices;
+ dt = 1.0f / stacks;
+ t = 1.0f; // because loop now runs from 0
+ if (super.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;
+ GL11.glBegin(GL11.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) {
+ GL11.glNormal3f(x * nsign, y * nsign, z * nsign);
+ }
+ TXTR_COORD(s, t);
+ GL11.glVertex3f(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) {
+ GL11.glNormal3f(x * nsign, y * nsign, z * nsign);
+ }
+ TXTR_COORD(s, t - dt);
+ s += ds;
+ GL11.glVertex3f(x * radius, y * radius, z * radius);
+ }
+ GL11.glEnd();
+ t -= dt;
+ }
+
+ if (!super.textureFlag) {
+ // draw -Z end as a triangle fan
+ GL11.glBegin(GL11.GL_TRIANGLE_FAN);
+ GL11.glNormal3f(0.0f, 0.0f, -1.0f);
+ GL11.glVertex3f(0.0f, 0.0f, -radius * nsign);
+ rho = GLU.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)
+ GL11.glNormal3f(x * nsign, y * nsign, z * nsign);
+ s -= ds;
+ GL11.glVertex3f(x * radius, y * radius, z * radius);
+ }
+ GL11.glEnd();
+ }
+ } else if (
+ super.drawStyle == GLU.GLU_LINE
+ || super.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;
+ GL11.glBegin(GL11.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)
+ GL11.glNormal3f(x * nsign, y * nsign, z * nsign);
+ GL11.glVertex3f(x * radius, y * radius, z * radius);
+ }
+ GL11.glEnd();
+ }
+ // draw slice lines
+ for (j = 0; j < slices; j++) {
+ theta = j * dtheta;
+ GL11.glBegin(GL11.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)
+ GL11.glNormal3f(x * nsign, y * nsign, z * nsign);
+ GL11.glVertex3f(x * radius, y * radius, z * radius);
+ }
+ GL11.glEnd();
+ }
+ } else if (super.drawStyle == GLU.GLU_POINT) {
+ // top and bottom-most points
+ GL11.glBegin(GL11.GL_POINTS);
+ if (normals)
+ GL11.glNormal3f(0.0f, 0.0f, nsign);
+ GL11.glVertex3f(0.0f, 0.0f, radius);
+ if (normals)
+ GL11.glNormal3f(0.0f, 0.0f, -nsign);
+ GL11.glVertex3f(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)
+ GL11.glNormal3f(x * nsign, y * nsign, z * nsign);
+ GL11.glVertex3f(x * radius, y * radius, z * radius);
+ }
+ }
+ GL11.glEnd();
+ }
+ }
+
+}
diff --git a/src/java/org/lwjgl/util/glu/Util.java b/src/java/org/lwjgl/util/glu/Util.java
index 7ad9679..ea45d12 100644
--- a/src/java/org/lwjgl/util/glu/Util.java
+++ b/src/java/org/lwjgl/util/glu/Util.java
@@ -1,246 +1,246 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.glu;
-
-import java.nio.IntBuffer;
-
-import org.lwjgl.BufferUtils;
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.opengl.GL12;
-
-/**
- * Util.java
- * <p/>
- * <p/>
- * Created 7-jan-2004
- *
- * @author Erik Duijs
- */
-public class Util {
-
- /**
- * temp IntBuffer of one for getting an int from some GL functions
- */
- private static IntBuffer scratch = BufferUtils.createIntBuffer(16);
-
- /**
- * 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);
- }
-
- /**
- * Normalize vector
- *
- * @param v
- *
- * @return float[]
- */
- protected static float[] 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 )
- return v;
-
- r = 1.0f / r;
-
- v[0] *= r;
- v[1] *= r;
- v[2] *= r;
-
- return v;
- }
-
- /**
- * Calculate cross-product
- *
- * @param v1
- * @param v2
- * @param result
- */
- protected 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];
- }
-
- /**
- * Method compPerPix.
- *
- * @param format
- *
- * @return int
- */
- protected static int compPerPix(int format) {
- /* Determine number of components per pixel */
- switch ( format ) {
- case GL11.GL_COLOR_INDEX:
- case GL11.GL_STENCIL_INDEX:
- case GL11.GL_DEPTH_COMPONENT:
- case GL11.GL_RED:
- case GL11.GL_GREEN:
- case GL11.GL_BLUE:
- case GL11.GL_ALPHA:
- case GL11.GL_LUMINANCE:
- return 1;
- case GL11.GL_LUMINANCE_ALPHA:
- return 2;
- case GL11.GL_RGB:
- case GL12.GL_BGR:
- return 3;
- case GL11.GL_RGBA:
- case GL12.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 GL11.GL_COLOR_INDEX:
- case GL11.GL_STENCIL_INDEX:
- case GL11.GL_DEPTH_COMPONENT:
- case GL11.GL_RED:
- case GL11.GL_GREEN:
- case GL11.GL_BLUE:
- case GL11.GL_ALPHA:
- case GL11.GL_LUMINANCE:
- n = 1;
- break;
- case GL11.GL_LUMINANCE_ALPHA:
- n = 2;
- break;
- case GL11.GL_RGB:
- case GL12.GL_BGR:
- n = 3;
- break;
- case GL11.GL_RGBA:
- case GL12.GL_BGRA:
- n = 4;
- break;
- default :
- n = 0;
- }
-
- switch ( type ) {
- case GL11.GL_UNSIGNED_BYTE:
- m = 1;
- break;
- case GL11.GL_BYTE:
- m = 1;
- break;
- case GL11.GL_BITMAP:
- m = 1;
- break;
- case GL11.GL_UNSIGNED_SHORT:
- m = 2;
- break;
- case GL11.GL_SHORT:
- m = 2;
- break;
- case GL11.GL_UNSIGNED_INT:
- m = 4;
- break;
- case GL11.GL_INT:
- m = 4;
- break;
- case GL11.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 static int glGetIntegerv(int what) {
- scratch.rewind();
- GL11.glGetInteger(what, scratch);
- return scratch.get();
- }
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.glu;
+
+import java.nio.IntBuffer;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
+
+/**
+ * Util.java
+ * <p/>
+ * <p/>
+ * Created 7-jan-2004
+ *
+ * @author Erik Duijs
+ */
+public class Util {
+
+ /**
+ * temp IntBuffer of one for getting an int from some GL functions
+ */
+ private static IntBuffer scratch = BufferUtils.createIntBuffer(16);
+
+ /**
+ * 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);
+ }
+
+ /**
+ * Normalize vector
+ *
+ * @param v
+ *
+ * @return float[]
+ */
+ protected static float[] 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 )
+ return v;
+
+ r = 1.0f / r;
+
+ v[0] *= r;
+ v[1] *= r;
+ v[2] *= r;
+
+ return v;
+ }
+
+ /**
+ * Calculate cross-product
+ *
+ * @param v1
+ * @param v2
+ * @param result
+ */
+ protected 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];
+ }
+
+ /**
+ * Method compPerPix.
+ *
+ * @param format
+ *
+ * @return int
+ */
+ protected static int compPerPix(int format) {
+ /* Determine number of components per pixel */
+ switch ( format ) {
+ case GL11.GL_COLOR_INDEX:
+ case GL11.GL_STENCIL_INDEX:
+ case GL11.GL_DEPTH_COMPONENT:
+ case GL11.GL_RED:
+ case GL11.GL_GREEN:
+ case GL11.GL_BLUE:
+ case GL11.GL_ALPHA:
+ case GL11.GL_LUMINANCE:
+ return 1;
+ case GL11.GL_LUMINANCE_ALPHA:
+ return 2;
+ case GL11.GL_RGB:
+ case GL12.GL_BGR:
+ return 3;
+ case GL11.GL_RGBA:
+ case GL12.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 GL11.GL_COLOR_INDEX:
+ case GL11.GL_STENCIL_INDEX:
+ case GL11.GL_DEPTH_COMPONENT:
+ case GL11.GL_RED:
+ case GL11.GL_GREEN:
+ case GL11.GL_BLUE:
+ case GL11.GL_ALPHA:
+ case GL11.GL_LUMINANCE:
+ n = 1;
+ break;
+ case GL11.GL_LUMINANCE_ALPHA:
+ n = 2;
+ break;
+ case GL11.GL_RGB:
+ case GL12.GL_BGR:
+ n = 3;
+ break;
+ case GL11.GL_RGBA:
+ case GL12.GL_BGRA:
+ n = 4;
+ break;
+ default :
+ n = 0;
+ }
+
+ switch ( type ) {
+ case GL11.GL_UNSIGNED_BYTE:
+ m = 1;
+ break;
+ case GL11.GL_BYTE:
+ m = 1;
+ break;
+ case GL11.GL_BITMAP:
+ m = 1;
+ break;
+ case GL11.GL_UNSIGNED_SHORT:
+ m = 2;
+ break;
+ case GL11.GL_SHORT:
+ m = 2;
+ break;
+ case GL11.GL_UNSIGNED_INT:
+ m = 4;
+ break;
+ case GL11.GL_INT:
+ m = 4;
+ break;
+ case GL11.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 static int glGetIntegerv(int what) {
+ scratch.rewind();
+ GL11.glGetInteger(what, scratch);
+ return scratch.get();
+ }
+
+}
diff --git a/src/java/org/lwjgl/util/input/ControllerAdapter.java b/src/java/org/lwjgl/util/input/ControllerAdapter.java
index 541e506..2bb42aa 100644
--- a/src/java/org/lwjgl/util/input/ControllerAdapter.java
+++ b/src/java/org/lwjgl/util/input/ControllerAdapter.java
@@ -1,329 +1,329 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.input;
-
-import org.lwjgl.input.Controller;
-
-/**
- * Adapter for the Controller interface. It can be used as placeholder
- * Controller, which doesn't do anything (eg if Controllers.create() fails and
- * you don't want to take care of that).
- *
- * @author Onyx, Aho and all the other aliases...
- */
-public class ControllerAdapter implements Controller {
-
- /**
- * Get the name assigned to this controller.
- *
- * @return The name assigned to this controller
- */
- public String getName() {
- return "Dummy Controller";
- }
-
- /**
- * Get the index of this controller in the collection
- *
- * @return The index of this controller in the collection
- */
- public int getIndex() {
- return 0; //-1 maybe?
- }
-
- /**
- * Retrieve the number of buttons available on this controller
- *
- * @return The number of butotns available on this controller
- */
- public int getButtonCount() {
- return 0;
- }
-
- /**
- * Get the name of the specified button. Be warned, often this is as
- * exciting as "Button X"
- *
- * @param index The index of the button whose name should be retrieved
- * @return The name of the button requested
- */
- public String getButtonName(int index) {
- return "button n/a";
- }
-
- /**
- * Check if a button is currently pressed
- *
- * @param index The button to check
- * @return True if the button is currently pressed
- */
- public boolean isButtonPressed(int index) {
- return false;
- }
-
- /**
- * Poll the controller for new data. This will also update events
- */
- public void poll() {
- }
-
- /**
- * Get the X-Axis value of the POV on this controller
- *
- * @return The X-Axis value of the POV on this controller
- */
- public float getPovX() {
- return 0f;
- }
-
- /**
- * Get the Y-Axis value of the POV on this controller
- *
- * @return The Y-Axis value of the POV on this controller
- */
- public float getPovY() {
- return 0f;
- }
-
- /**
- * Get the dead zone for a specified axis
- *
- * @param index The index of the axis for which to retrieve the dead zone
- * @return The dead zone for the specified axis
- */
- public float getDeadZone(int index) {
- return 0f;
- }
-
- /**
- * Set the dead zone for the specified axis
- *
- * @param index The index of hte axis for which to set the dead zone
- * @param zone The dead zone to use for the specified axis
- */
- public void setDeadZone(int index, float zone) {
- }
-
- /**
- * Retrieve the number of axes available on this controller.
- *
- * @return The number of axes available on this controller.
- */
- public int getAxisCount() {
- return 0;
- }
-
- /**
- * Get the name that's given to the specified axis
- *
- * @param index The index of the axis whose name should be retrieved
- * @return The name of the specified axis.
- */
- public String getAxisName(int index) {
- return "axis n/a";
- }
-
- /**
- * Retrieve the value thats currently available on a specified axis. The
- * value will always be between 1.0 and -1.0 and will calibrate as values
- * are passed read. It may be useful to get the player to wiggle the
- * joystick from side to side to get the calibration right.
- *
- * @param index The index of axis to be read
- * @return The value from the specified axis.
- */
- public float getAxisValue(int index) {
- return 0f;
- }
-
- /**
- * Get the value from the X axis if there is one. If no X axis is defined a
- * zero value will be returned.
- *
- * @return The value from the X axis
- */
- public float getXAxisValue() {
- return 0f;
- }
-
- /**
- * Get the dead zone for the X axis.
- *
- * @return The dead zone for the X axis
- */
- public float getXAxisDeadZone() {
- return 0f;
- }
-
- /**
- * Set the dead zone for the X axis
- *
- * @param zone The dead zone to use for the X axis
- */
- public void setXAxisDeadZone(float zone) {
- }
-
- /**
- * Get the value from the Y axis if there is one. If no Y axis is defined a
- * zero value will be returned.
- *
- * @return The value from the Y axis
- */
- public float getYAxisValue() {
- return 0f;
- }
-
- /**
- * Get the dead zone for the Y axis.
- *
- * @return The dead zone for the Y axis
- */
- public float getYAxisDeadZone() {
- return 0f;
- }
-
- /**
- * Set the dead zone for the Y axis
- *
- * @param zone The dead zone to use for the Y axis
- */
- public void setYAxisDeadZone(float zone) {
- }
-
- /**
- * Get the value from the Z axis if there is one. If no Z axis is defined a
- * zero value will be returned.
- *
- * @return The value from the Z axis
- */
- public float getZAxisValue() {
- return 0f;
- }
-
- /**
- * Get the dead zone for the Z axis.
- *
- * @return The dead zone for the Z axis
- */
- public float getZAxisDeadZone() {
- return 0f;
- }
-
- /**
- * Set the dead zone for the Z axis
- *
- * @param zone The dead zone to use for the Z axis
- */
- public void setZAxisDeadZone(float zone) {
- }
-
- /**
- * Get the value from the RX axis if there is one. If no RX axis is defined
- * a zero value will be returned.
- *
- * @return The value from the RX axis
- */
- public float getRXAxisValue() {
- return 0f;
- }
-
- /**
- * Get the dead zone for the RX axis.
- *
- * @return The dead zone for the RX axis
- */
- public float getRXAxisDeadZone() {
- return 0f;
- }
-
- /**
- * Set the dead zone for the RX axis
- *
- * @param zone The dead zone to use for the RX axis
- */
- public void setRXAxisDeadZone(float zone) {
- }
-
- /**
- * Get the value from the RY axis if there is one. If no RY axis is defined
- * a zero value will be returned.
- *
- * @return The value from the RY axis
- */
- public float getRYAxisValue() {
- return 0f;
- }
-
- /**
- * Get the dead zone for the RY axis.
- *
- * @return The dead zone for the RY axis
- */
- public float getRYAxisDeadZone() {
- return 0f;
- }
-
- /**
- * Set the dead zone for the RY axis
- *
- * @param zone The dead zone to use for the RY axis
- */
- public void setRYAxisDeadZone(float zone) {
- }
-
- /**
- * Get the value from the RZ axis if there is one. If no RZ axis is defined
- * a zero value will be returned.
- *
- * @return The value from the RZ axis
- */
- public float getRZAxisValue() {
- return 0f;
- }
-
- /**
- * Get the dead zone for the RZ axis.
- *
- * @return The dead zone for the RZ axis
- */
- public float getRZAxisDeadZone() {
- return 0f;
- }
-
- /**
- * Set the dead zone for the RZ axis
- *
- * @param zone The dead zone to use for the RZ axis
- */
- public void setRZAxisDeadZone(float zone) {
- }
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.input;
+
+import org.lwjgl.input.Controller;
+
+/**
+ * Adapter for the Controller interface. It can be used as placeholder
+ * Controller, which doesn't do anything (eg if Controllers.create() fails and
+ * you don't want to take care of that).
+ *
+ * @author Onyx, Aho and all the other aliases...
+ */
+public class ControllerAdapter implements Controller {
+
+ /**
+ * Get the name assigned to this controller.
+ *
+ * @return The name assigned to this controller
+ */
+ public String getName() {
+ return "Dummy Controller";
+ }
+
+ /**
+ * Get the index of this controller in the collection
+ *
+ * @return The index of this controller in the collection
+ */
+ public int getIndex() {
+ return 0; //-1 maybe?
+ }
+
+ /**
+ * Retrieve the number of buttons available on this controller
+ *
+ * @return The number of butotns available on this controller
+ */
+ public int getButtonCount() {
+ return 0;
+ }
+
+ /**
+ * Get the name of the specified button. Be warned, often this is as
+ * exciting as "Button X"
+ *
+ * @param index The index of the button whose name should be retrieved
+ * @return The name of the button requested
+ */
+ public String getButtonName(int index) {
+ return "button n/a";
+ }
+
+ /**
+ * Check if a button is currently pressed
+ *
+ * @param index The button to check
+ * @return True if the button is currently pressed
+ */
+ public boolean isButtonPressed(int index) {
+ return false;
+ }
+
+ /**
+ * Poll the controller for new data. This will also update events
+ */
+ public void poll() {
+ }
+
+ /**
+ * Get the X-Axis value of the POV on this controller
+ *
+ * @return The X-Axis value of the POV on this controller
+ */
+ public float getPovX() {
+ return 0f;
+ }
+
+ /**
+ * Get the Y-Axis value of the POV on this controller
+ *
+ * @return The Y-Axis value of the POV on this controller
+ */
+ public float getPovY() {
+ return 0f;
+ }
+
+ /**
+ * Get the dead zone for a specified axis
+ *
+ * @param index The index of the axis for which to retrieve the dead zone
+ * @return The dead zone for the specified axis
+ */
+ public float getDeadZone(int index) {
+ return 0f;
+ }
+
+ /**
+ * Set the dead zone for the specified axis
+ *
+ * @param index The index of hte axis for which to set the dead zone
+ * @param zone The dead zone to use for the specified axis
+ */
+ public void setDeadZone(int index, float zone) {
+ }
+
+ /**
+ * Retrieve the number of axes available on this controller.
+ *
+ * @return The number of axes available on this controller.
+ */
+ public int getAxisCount() {
+ return 0;
+ }
+
+ /**
+ * Get the name that's given to the specified axis
+ *
+ * @param index The index of the axis whose name should be retrieved
+ * @return The name of the specified axis.
+ */
+ public String getAxisName(int index) {
+ return "axis n/a";
+ }
+
+ /**
+ * Retrieve the value thats currently available on a specified axis. The
+ * value will always be between 1.0 and -1.0 and will calibrate as values
+ * are passed read. It may be useful to get the player to wiggle the
+ * joystick from side to side to get the calibration right.
+ *
+ * @param index The index of axis to be read
+ * @return The value from the specified axis.
+ */
+ public float getAxisValue(int index) {
+ return 0f;
+ }
+
+ /**
+ * Get the value from the X axis if there is one. If no X axis is defined a
+ * zero value will be returned.
+ *
+ * @return The value from the X axis
+ */
+ public float getXAxisValue() {
+ return 0f;
+ }
+
+ /**
+ * Get the dead zone for the X axis.
+ *
+ * @return The dead zone for the X axis
+ */
+ public float getXAxisDeadZone() {
+ return 0f;
+ }
+
+ /**
+ * Set the dead zone for the X axis
+ *
+ * @param zone The dead zone to use for the X axis
+ */
+ public void setXAxisDeadZone(float zone) {
+ }
+
+ /**
+ * Get the value from the Y axis if there is one. If no Y axis is defined a
+ * zero value will be returned.
+ *
+ * @return The value from the Y axis
+ */
+ public float getYAxisValue() {
+ return 0f;
+ }
+
+ /**
+ * Get the dead zone for the Y axis.
+ *
+ * @return The dead zone for the Y axis
+ */
+ public float getYAxisDeadZone() {
+ return 0f;
+ }
+
+ /**
+ * Set the dead zone for the Y axis
+ *
+ * @param zone The dead zone to use for the Y axis
+ */
+ public void setYAxisDeadZone(float zone) {
+ }
+
+ /**
+ * Get the value from the Z axis if there is one. If no Z axis is defined a
+ * zero value will be returned.
+ *
+ * @return The value from the Z axis
+ */
+ public float getZAxisValue() {
+ return 0f;
+ }
+
+ /**
+ * Get the dead zone for the Z axis.
+ *
+ * @return The dead zone for the Z axis
+ */
+ public float getZAxisDeadZone() {
+ return 0f;
+ }
+
+ /**
+ * Set the dead zone for the Z axis
+ *
+ * @param zone The dead zone to use for the Z axis
+ */
+ public void setZAxisDeadZone(float zone) {
+ }
+
+ /**
+ * Get the value from the RX axis if there is one. If no RX axis is defined
+ * a zero value will be returned.
+ *
+ * @return The value from the RX axis
+ */
+ public float getRXAxisValue() {
+ return 0f;
+ }
+
+ /**
+ * Get the dead zone for the RX axis.
+ *
+ * @return The dead zone for the RX axis
+ */
+ public float getRXAxisDeadZone() {
+ return 0f;
+ }
+
+ /**
+ * Set the dead zone for the RX axis
+ *
+ * @param zone The dead zone to use for the RX axis
+ */
+ public void setRXAxisDeadZone(float zone) {
+ }
+
+ /**
+ * Get the value from the RY axis if there is one. If no RY axis is defined
+ * a zero value will be returned.
+ *
+ * @return The value from the RY axis
+ */
+ public float getRYAxisValue() {
+ return 0f;
+ }
+
+ /**
+ * Get the dead zone for the RY axis.
+ *
+ * @return The dead zone for the RY axis
+ */
+ public float getRYAxisDeadZone() {
+ return 0f;
+ }
+
+ /**
+ * Set the dead zone for the RY axis
+ *
+ * @param zone The dead zone to use for the RY axis
+ */
+ public void setRYAxisDeadZone(float zone) {
+ }
+
+ /**
+ * Get the value from the RZ axis if there is one. If no RZ axis is defined
+ * a zero value will be returned.
+ *
+ * @return The value from the RZ axis
+ */
+ public float getRZAxisValue() {
+ return 0f;
+ }
+
+ /**
+ * Get the dead zone for the RZ axis.
+ *
+ * @return The dead zone for the RZ axis
+ */
+ public float getRZAxisDeadZone() {
+ return 0f;
+ }
+
+ /**
+ * Set the dead zone for the RZ axis
+ *
+ * @param zone The dead zone to use for the RZ axis
+ */
+ public void setRZAxisDeadZone(float zone) {
+ }
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/util/jinput/KeyMap.java b/src/java/org/lwjgl/util/jinput/KeyMap.java
index 0bbf65f..eec1675 100644
--- a/src/java/org/lwjgl/util/jinput/KeyMap.java
+++ b/src/java/org/lwjgl/util/jinput/KeyMap.java
@@ -1,293 +1,293 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.jinput;
-
-import org.lwjgl.input.Keyboard;
-import net.java.games.input.Component;
-
-/**
- * @author elias
- */
-final class KeyMap {
- public final static Component.Identifier.Key map(int lwjgl_key_code) {
- switch (lwjgl_key_code) {
- case Keyboard.KEY_ESCAPE:
- return Component.Identifier.Key.ESCAPE;
- case Keyboard.KEY_1:
- return Component.Identifier.Key._1;
- case Keyboard.KEY_2:
- return Component.Identifier.Key._2;
- case Keyboard.KEY_3:
- return Component.Identifier.Key._3;
- case Keyboard.KEY_4:
- return Component.Identifier.Key._4;
- case Keyboard.KEY_5:
- return Component.Identifier.Key._5;
- case Keyboard.KEY_6:
- return Component.Identifier.Key._6;
- case Keyboard.KEY_7:
- return Component.Identifier.Key._7;
- case Keyboard.KEY_8:
- return Component.Identifier.Key._8;
- case Keyboard.KEY_9:
- return Component.Identifier.Key._9;
- case Keyboard.KEY_0:
- return Component.Identifier.Key._0;
- case Keyboard.KEY_MINUS:
- return Component.Identifier.Key.MINUS;
- case Keyboard.KEY_EQUALS:
- return Component.Identifier.Key.EQUALS;
- case Keyboard.KEY_BACK:
- return Component.Identifier.Key.BACK;
- case Keyboard.KEY_TAB:
- return Component.Identifier.Key.TAB;
- case Keyboard.KEY_Q:
- return Component.Identifier.Key.Q;
- case Keyboard.KEY_W:
- return Component.Identifier.Key.W;
- case Keyboard.KEY_E:
- return Component.Identifier.Key.E;
- case Keyboard.KEY_R:
- return Component.Identifier.Key.R;
- case Keyboard.KEY_T:
- return Component.Identifier.Key.T;
- case Keyboard.KEY_Y:
- return Component.Identifier.Key.Y;
- case Keyboard.KEY_U:
- return Component.Identifier.Key.U;
- case Keyboard.KEY_I:
- return Component.Identifier.Key.I;
- case Keyboard.KEY_O:
- return Component.Identifier.Key.O;
- case Keyboard.KEY_P:
- return Component.Identifier.Key.P;
- case Keyboard.KEY_LBRACKET:
- return Component.Identifier.Key.LBRACKET;
- case Keyboard.KEY_RBRACKET:
- return Component.Identifier.Key.RBRACKET;
- case Keyboard.KEY_RETURN:
- return Component.Identifier.Key.RETURN;
- case Keyboard.KEY_LCONTROL:
- return Component.Identifier.Key.LCONTROL;
- case Keyboard.KEY_A:
- return Component.Identifier.Key.A;
- case Keyboard.KEY_S:
- return Component.Identifier.Key.S;
- case Keyboard.KEY_D:
- return Component.Identifier.Key.D;
- case Keyboard.KEY_F:
- return Component.Identifier.Key.F;
- case Keyboard.KEY_G:
- return Component.Identifier.Key.G;
- case Keyboard.KEY_H:
- return Component.Identifier.Key.H;
- case Keyboard.KEY_J:
- return Component.Identifier.Key.J;
- case Keyboard.KEY_K:
- return Component.Identifier.Key.K;
- case Keyboard.KEY_L:
- return Component.Identifier.Key.L;
- case Keyboard.KEY_SEMICOLON:
- return Component.Identifier.Key.SEMICOLON;
- case Keyboard.KEY_APOSTROPHE:
- return Component.Identifier.Key.APOSTROPHE;
- case Keyboard.KEY_GRAVE:
- return Component.Identifier.Key.GRAVE;
- case Keyboard.KEY_LSHIFT:
- return Component.Identifier.Key.LSHIFT;
- case Keyboard.KEY_BACKSLASH:
- return Component.Identifier.Key.BACKSLASH;
- case Keyboard.KEY_Z:
- return Component.Identifier.Key.Z;
- case Keyboard.KEY_X:
- return Component.Identifier.Key.X;
- case Keyboard.KEY_C:
- return Component.Identifier.Key.C;
- case Keyboard.KEY_V:
- return Component.Identifier.Key.V;
- case Keyboard.KEY_B:
- return Component.Identifier.Key.B;
- case Keyboard.KEY_N:
- return Component.Identifier.Key.N;
- case Keyboard.KEY_M:
- return Component.Identifier.Key.M;
- case Keyboard.KEY_COMMA:
- return Component.Identifier.Key.COMMA;
- case Keyboard.KEY_PERIOD:
- return Component.Identifier.Key.PERIOD;
- case Keyboard.KEY_SLASH:
- return Component.Identifier.Key.SLASH;
- case Keyboard.KEY_RSHIFT:
- return Component.Identifier.Key.RSHIFT;
- case Keyboard.KEY_MULTIPLY:
- return Component.Identifier.Key.MULTIPLY;
- case Keyboard.KEY_LMENU:
- return Component.Identifier.Key.LALT;
- case Keyboard.KEY_SPACE:
- return Component.Identifier.Key.SPACE;
- case Keyboard.KEY_CAPITAL:
- return Component.Identifier.Key.CAPITAL;
- case Keyboard.KEY_F1:
- return Component.Identifier.Key.F1;
- case Keyboard.KEY_F2:
- return Component.Identifier.Key.F2;
- case Keyboard.KEY_F3:
- return Component.Identifier.Key.F3;
- case Keyboard.KEY_F4:
- return Component.Identifier.Key.F4;
- case Keyboard.KEY_F5:
- return Component.Identifier.Key.F5;
- case Keyboard.KEY_F6:
- return Component.Identifier.Key.F6;
- case Keyboard.KEY_F7:
- return Component.Identifier.Key.F7;
- case Keyboard.KEY_F8:
- return Component.Identifier.Key.F8;
- case Keyboard.KEY_F9:
- return Component.Identifier.Key.F9;
- case Keyboard.KEY_F10:
- return Component.Identifier.Key.F10;
- case Keyboard.KEY_NUMLOCK:
- return Component.Identifier.Key.NUMLOCK;
- case Keyboard.KEY_SCROLL:
- return Component.Identifier.Key.SCROLL;
- case Keyboard.KEY_NUMPAD7:
- return Component.Identifier.Key.NUMPAD7;
- case Keyboard.KEY_NUMPAD8:
- return Component.Identifier.Key.NUMPAD8;
- case Keyboard.KEY_NUMPAD9:
- return Component.Identifier.Key.NUMPAD9;
- case Keyboard.KEY_SUBTRACT:
- return Component.Identifier.Key.SUBTRACT;
- case Keyboard.KEY_NUMPAD4:
- return Component.Identifier.Key.NUMPAD4;
- case Keyboard.KEY_NUMPAD5:
- return Component.Identifier.Key.NUMPAD5;
- case Keyboard.KEY_NUMPAD6:
- return Component.Identifier.Key.NUMPAD6;
- case Keyboard.KEY_ADD:
- return Component.Identifier.Key.ADD;
- case Keyboard.KEY_NUMPAD1:
- return Component.Identifier.Key.NUMPAD1;
- case Keyboard.KEY_NUMPAD2:
- return Component.Identifier.Key.NUMPAD2;
- case Keyboard.KEY_NUMPAD3:
- return Component.Identifier.Key.NUMPAD3;
- case Keyboard.KEY_NUMPAD0:
- return Component.Identifier.Key.NUMPAD0;
- case Keyboard.KEY_DECIMAL:
- return Component.Identifier.Key.DECIMAL;
- case Keyboard.KEY_F11:
- return Component.Identifier.Key.F11;
- case Keyboard.KEY_F12:
- return Component.Identifier.Key.F12;
- case Keyboard.KEY_F13:
- return Component.Identifier.Key.F13;
- case Keyboard.KEY_F14:
- return Component.Identifier.Key.F14;
- case Keyboard.KEY_F15:
- return Component.Identifier.Key.F15;
- case Keyboard.KEY_KANA:
- return Component.Identifier.Key.KANA;
- case Keyboard.KEY_CONVERT:
- return Component.Identifier.Key.CONVERT;
- case Keyboard.KEY_NOCONVERT:
- return Component.Identifier.Key.NOCONVERT;
- case Keyboard.KEY_YEN:
- return Component.Identifier.Key.YEN;
- case Keyboard.KEY_NUMPADEQUALS:
- return Component.Identifier.Key.NUMPADEQUAL;
- case Keyboard.KEY_CIRCUMFLEX:
- return Component.Identifier.Key.CIRCUMFLEX;
- case Keyboard.KEY_AT:
- return Component.Identifier.Key.AT;
- case Keyboard.KEY_COLON:
- return Component.Identifier.Key.COLON;
- case Keyboard.KEY_UNDERLINE:
- return Component.Identifier.Key.UNDERLINE;
- case Keyboard.KEY_KANJI:
- return Component.Identifier.Key.KANJI;
- case Keyboard.KEY_STOP:
- return Component.Identifier.Key.STOP;
- case Keyboard.KEY_AX:
- return Component.Identifier.Key.AX;
- case Keyboard.KEY_UNLABELED:
- return Component.Identifier.Key.UNLABELED;
- case Keyboard.KEY_NUMPADENTER:
- return Component.Identifier.Key.NUMPADENTER;
- case Keyboard.KEY_RCONTROL:
- return Component.Identifier.Key.RCONTROL;
- case Keyboard.KEY_NUMPADCOMMA:
- return Component.Identifier.Key.NUMPADCOMMA;
- case Keyboard.KEY_DIVIDE:
- return Component.Identifier.Key.DIVIDE;
- case Keyboard.KEY_SYSRQ:
- return Component.Identifier.Key.SYSRQ;
- case Keyboard.KEY_RMENU:
- return Component.Identifier.Key.RALT;
- case Keyboard.KEY_PAUSE:
- return Component.Identifier.Key.PAUSE;
- case Keyboard.KEY_HOME:
- return Component.Identifier.Key.HOME;
- case Keyboard.KEY_UP:
- return Component.Identifier.Key.UP;
- case Keyboard.KEY_PRIOR:
- return Component.Identifier.Key.PAGEUP;
- case Keyboard.KEY_LEFT:
- return Component.Identifier.Key.LEFT;
- case Keyboard.KEY_RIGHT:
- return Component.Identifier.Key.RIGHT;
- case Keyboard.KEY_END:
- return Component.Identifier.Key.END;
- case Keyboard.KEY_DOWN:
- return Component.Identifier.Key.DOWN;
- case Keyboard.KEY_NEXT:
- return Component.Identifier.Key.PAGEDOWN;
- case Keyboard.KEY_INSERT:
- return Component.Identifier.Key.INSERT;
- case Keyboard.KEY_DELETE:
- return Component.Identifier.Key.DELETE;
- case Keyboard.KEY_LMETA:
- return Component.Identifier.Key.LWIN;
- case Keyboard.KEY_RMETA:
- return Component.Identifier.Key.RWIN;
- case Keyboard.KEY_APPS:
- return Component.Identifier.Key.APPS;
- case Keyboard.KEY_POWER:
- return Component.Identifier.Key.POWER;
- case Keyboard.KEY_SLEEP:
- return Component.Identifier.Key.SLEEP;
- default:
- return Component.Identifier.Key.UNKNOWN;
- }
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.jinput;
+
+import org.lwjgl.input.Keyboard;
+import net.java.games.input.Component;
+
+/**
+ * @author elias
+ */
+final class KeyMap {
+ public final static Component.Identifier.Key map(int lwjgl_key_code) {
+ switch (lwjgl_key_code) {
+ case Keyboard.KEY_ESCAPE:
+ return Component.Identifier.Key.ESCAPE;
+ case Keyboard.KEY_1:
+ return Component.Identifier.Key._1;
+ case Keyboard.KEY_2:
+ return Component.Identifier.Key._2;
+ case Keyboard.KEY_3:
+ return Component.Identifier.Key._3;
+ case Keyboard.KEY_4:
+ return Component.Identifier.Key._4;
+ case Keyboard.KEY_5:
+ return Component.Identifier.Key._5;
+ case Keyboard.KEY_6:
+ return Component.Identifier.Key._6;
+ case Keyboard.KEY_7:
+ return Component.Identifier.Key._7;
+ case Keyboard.KEY_8:
+ return Component.Identifier.Key._8;
+ case Keyboard.KEY_9:
+ return Component.Identifier.Key._9;
+ case Keyboard.KEY_0:
+ return Component.Identifier.Key._0;
+ case Keyboard.KEY_MINUS:
+ return Component.Identifier.Key.MINUS;
+ case Keyboard.KEY_EQUALS:
+ return Component.Identifier.Key.EQUALS;
+ case Keyboard.KEY_BACK:
+ return Component.Identifier.Key.BACK;
+ case Keyboard.KEY_TAB:
+ return Component.Identifier.Key.TAB;
+ case Keyboard.KEY_Q:
+ return Component.Identifier.Key.Q;
+ case Keyboard.KEY_W:
+ return Component.Identifier.Key.W;
+ case Keyboard.KEY_E:
+ return Component.Identifier.Key.E;
+ case Keyboard.KEY_R:
+ return Component.Identifier.Key.R;
+ case Keyboard.KEY_T:
+ return Component.Identifier.Key.T;
+ case Keyboard.KEY_Y:
+ return Component.Identifier.Key.Y;
+ case Keyboard.KEY_U:
+ return Component.Identifier.Key.U;
+ case Keyboard.KEY_I:
+ return Component.Identifier.Key.I;
+ case Keyboard.KEY_O:
+ return Component.Identifier.Key.O;
+ case Keyboard.KEY_P:
+ return Component.Identifier.Key.P;
+ case Keyboard.KEY_LBRACKET:
+ return Component.Identifier.Key.LBRACKET;
+ case Keyboard.KEY_RBRACKET:
+ return Component.Identifier.Key.RBRACKET;
+ case Keyboard.KEY_RETURN:
+ return Component.Identifier.Key.RETURN;
+ case Keyboard.KEY_LCONTROL:
+ return Component.Identifier.Key.LCONTROL;
+ case Keyboard.KEY_A:
+ return Component.Identifier.Key.A;
+ case Keyboard.KEY_S:
+ return Component.Identifier.Key.S;
+ case Keyboard.KEY_D:
+ return Component.Identifier.Key.D;
+ case Keyboard.KEY_F:
+ return Component.Identifier.Key.F;
+ case Keyboard.KEY_G:
+ return Component.Identifier.Key.G;
+ case Keyboard.KEY_H:
+ return Component.Identifier.Key.H;
+ case Keyboard.KEY_J:
+ return Component.Identifier.Key.J;
+ case Keyboard.KEY_K:
+ return Component.Identifier.Key.K;
+ case Keyboard.KEY_L:
+ return Component.Identifier.Key.L;
+ case Keyboard.KEY_SEMICOLON:
+ return Component.Identifier.Key.SEMICOLON;
+ case Keyboard.KEY_APOSTROPHE:
+ return Component.Identifier.Key.APOSTROPHE;
+ case Keyboard.KEY_GRAVE:
+ return Component.Identifier.Key.GRAVE;
+ case Keyboard.KEY_LSHIFT:
+ return Component.Identifier.Key.LSHIFT;
+ case Keyboard.KEY_BACKSLASH:
+ return Component.Identifier.Key.BACKSLASH;
+ case Keyboard.KEY_Z:
+ return Component.Identifier.Key.Z;
+ case Keyboard.KEY_X:
+ return Component.Identifier.Key.X;
+ case Keyboard.KEY_C:
+ return Component.Identifier.Key.C;
+ case Keyboard.KEY_V:
+ return Component.Identifier.Key.V;
+ case Keyboard.KEY_B:
+ return Component.Identifier.Key.B;
+ case Keyboard.KEY_N:
+ return Component.Identifier.Key.N;
+ case Keyboard.KEY_M:
+ return Component.Identifier.Key.M;
+ case Keyboard.KEY_COMMA:
+ return Component.Identifier.Key.COMMA;
+ case Keyboard.KEY_PERIOD:
+ return Component.Identifier.Key.PERIOD;
+ case Keyboard.KEY_SLASH:
+ return Component.Identifier.Key.SLASH;
+ case Keyboard.KEY_RSHIFT:
+ return Component.Identifier.Key.RSHIFT;
+ case Keyboard.KEY_MULTIPLY:
+ return Component.Identifier.Key.MULTIPLY;
+ case Keyboard.KEY_LMENU:
+ return Component.Identifier.Key.LALT;
+ case Keyboard.KEY_SPACE:
+ return Component.Identifier.Key.SPACE;
+ case Keyboard.KEY_CAPITAL:
+ return Component.Identifier.Key.CAPITAL;
+ case Keyboard.KEY_F1:
+ return Component.Identifier.Key.F1;
+ case Keyboard.KEY_F2:
+ return Component.Identifier.Key.F2;
+ case Keyboard.KEY_F3:
+ return Component.Identifier.Key.F3;
+ case Keyboard.KEY_F4:
+ return Component.Identifier.Key.F4;
+ case Keyboard.KEY_F5:
+ return Component.Identifier.Key.F5;
+ case Keyboard.KEY_F6:
+ return Component.Identifier.Key.F6;
+ case Keyboard.KEY_F7:
+ return Component.Identifier.Key.F7;
+ case Keyboard.KEY_F8:
+ return Component.Identifier.Key.F8;
+ case Keyboard.KEY_F9:
+ return Component.Identifier.Key.F9;
+ case Keyboard.KEY_F10:
+ return Component.Identifier.Key.F10;
+ case Keyboard.KEY_NUMLOCK:
+ return Component.Identifier.Key.NUMLOCK;
+ case Keyboard.KEY_SCROLL:
+ return Component.Identifier.Key.SCROLL;
+ case Keyboard.KEY_NUMPAD7:
+ return Component.Identifier.Key.NUMPAD7;
+ case Keyboard.KEY_NUMPAD8:
+ return Component.Identifier.Key.NUMPAD8;
+ case Keyboard.KEY_NUMPAD9:
+ return Component.Identifier.Key.NUMPAD9;
+ case Keyboard.KEY_SUBTRACT:
+ return Component.Identifier.Key.SUBTRACT;
+ case Keyboard.KEY_NUMPAD4:
+ return Component.Identifier.Key.NUMPAD4;
+ case Keyboard.KEY_NUMPAD5:
+ return Component.Identifier.Key.NUMPAD5;
+ case Keyboard.KEY_NUMPAD6:
+ return Component.Identifier.Key.NUMPAD6;
+ case Keyboard.KEY_ADD:
+ return Component.Identifier.Key.ADD;
+ case Keyboard.KEY_NUMPAD1:
+ return Component.Identifier.Key.NUMPAD1;
+ case Keyboard.KEY_NUMPAD2:
+ return Component.Identifier.Key.NUMPAD2;
+ case Keyboard.KEY_NUMPAD3:
+ return Component.Identifier.Key.NUMPAD3;
+ case Keyboard.KEY_NUMPAD0:
+ return Component.Identifier.Key.NUMPAD0;
+ case Keyboard.KEY_DECIMAL:
+ return Component.Identifier.Key.DECIMAL;
+ case Keyboard.KEY_F11:
+ return Component.Identifier.Key.F11;
+ case Keyboard.KEY_F12:
+ return Component.Identifier.Key.F12;
+ case Keyboard.KEY_F13:
+ return Component.Identifier.Key.F13;
+ case Keyboard.KEY_F14:
+ return Component.Identifier.Key.F14;
+ case Keyboard.KEY_F15:
+ return Component.Identifier.Key.F15;
+ case Keyboard.KEY_KANA:
+ return Component.Identifier.Key.KANA;
+ case Keyboard.KEY_CONVERT:
+ return Component.Identifier.Key.CONVERT;
+ case Keyboard.KEY_NOCONVERT:
+ return Component.Identifier.Key.NOCONVERT;
+ case Keyboard.KEY_YEN:
+ return Component.Identifier.Key.YEN;
+ case Keyboard.KEY_NUMPADEQUALS:
+ return Component.Identifier.Key.NUMPADEQUAL;
+ case Keyboard.KEY_CIRCUMFLEX:
+ return Component.Identifier.Key.CIRCUMFLEX;
+ case Keyboard.KEY_AT:
+ return Component.Identifier.Key.AT;
+ case Keyboard.KEY_COLON:
+ return Component.Identifier.Key.COLON;
+ case Keyboard.KEY_UNDERLINE:
+ return Component.Identifier.Key.UNDERLINE;
+ case Keyboard.KEY_KANJI:
+ return Component.Identifier.Key.KANJI;
+ case Keyboard.KEY_STOP:
+ return Component.Identifier.Key.STOP;
+ case Keyboard.KEY_AX:
+ return Component.Identifier.Key.AX;
+ case Keyboard.KEY_UNLABELED:
+ return Component.Identifier.Key.UNLABELED;
+ case Keyboard.KEY_NUMPADENTER:
+ return Component.Identifier.Key.NUMPADENTER;
+ case Keyboard.KEY_RCONTROL:
+ return Component.Identifier.Key.RCONTROL;
+ case Keyboard.KEY_NUMPADCOMMA:
+ return Component.Identifier.Key.NUMPADCOMMA;
+ case Keyboard.KEY_DIVIDE:
+ return Component.Identifier.Key.DIVIDE;
+ case Keyboard.KEY_SYSRQ:
+ return Component.Identifier.Key.SYSRQ;
+ case Keyboard.KEY_RMENU:
+ return Component.Identifier.Key.RALT;
+ case Keyboard.KEY_PAUSE:
+ return Component.Identifier.Key.PAUSE;
+ case Keyboard.KEY_HOME:
+ return Component.Identifier.Key.HOME;
+ case Keyboard.KEY_UP:
+ return Component.Identifier.Key.UP;
+ case Keyboard.KEY_PRIOR:
+ return Component.Identifier.Key.PAGEUP;
+ case Keyboard.KEY_LEFT:
+ return Component.Identifier.Key.LEFT;
+ case Keyboard.KEY_RIGHT:
+ return Component.Identifier.Key.RIGHT;
+ case Keyboard.KEY_END:
+ return Component.Identifier.Key.END;
+ case Keyboard.KEY_DOWN:
+ return Component.Identifier.Key.DOWN;
+ case Keyboard.KEY_NEXT:
+ return Component.Identifier.Key.PAGEDOWN;
+ case Keyboard.KEY_INSERT:
+ return Component.Identifier.Key.INSERT;
+ case Keyboard.KEY_DELETE:
+ return Component.Identifier.Key.DELETE;
+ case Keyboard.KEY_LMETA:
+ return Component.Identifier.Key.LWIN;
+ case Keyboard.KEY_RMETA:
+ return Component.Identifier.Key.RWIN;
+ case Keyboard.KEY_APPS:
+ return Component.Identifier.Key.APPS;
+ case Keyboard.KEY_POWER:
+ return Component.Identifier.Key.POWER;
+ case Keyboard.KEY_SLEEP:
+ return Component.Identifier.Key.SLEEP;
+ default:
+ return Component.Identifier.Key.UNKNOWN;
+ }
+ }
+}
diff --git a/src/java/org/lwjgl/util/jinput/LWJGLEnvironmentPlugin.java b/src/java/org/lwjgl/util/jinput/LWJGLEnvironmentPlugin.java
index 6f4b5f3..c84c854 100644
--- a/src/java/org/lwjgl/util/jinput/LWJGLEnvironmentPlugin.java
+++ b/src/java/org/lwjgl/util/jinput/LWJGLEnvironmentPlugin.java
@@ -1,55 +1,55 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.jinput;
-
-import net.java.games.input.Controller;
-import net.java.games.input.ControllerEnvironment;
-import net.java.games.util.plugins.Plugin;
-
-/**
- * @author elias
- */
-public class LWJGLEnvironmentPlugin extends ControllerEnvironment implements Plugin {
- private final Controller[] controllers;
-
- public LWJGLEnvironmentPlugin() {
- this.controllers = new Controller[]{new LWJGLKeyboard(), new LWJGLMouse()};
- }
-
- public Controller[] getControllers() {
- return controllers;
- }
-
- public boolean isSupported() {
- return true;
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.jinput;
+
+import net.java.games.input.Controller;
+import net.java.games.input.ControllerEnvironment;
+import net.java.games.util.plugins.Plugin;
+
+/**
+ * @author elias
+ */
+public class LWJGLEnvironmentPlugin extends ControllerEnvironment implements Plugin {
+ private final Controller[] controllers;
+
+ public LWJGLEnvironmentPlugin() {
+ this.controllers = new Controller[]{new LWJGLKeyboard(), new LWJGLMouse()};
+ }
+
+ public Controller[] getControllers() {
+ return controllers;
+ }
+
+ public boolean isSupported() {
+ return true;
+ }
+}
diff --git a/src/java/org/lwjgl/util/jinput/LWJGLKeyboard.java b/src/java/org/lwjgl/util/jinput/LWJGLKeyboard.java
index 303e2dd..f024b52 100644
--- a/src/java/org/lwjgl/util/jinput/LWJGLKeyboard.java
+++ b/src/java/org/lwjgl/util/jinput/LWJGLKeyboard.java
@@ -1,132 +1,132 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.jinput;
-
-import net.java.games.input.AbstractComponent;
-import net.java.games.input.Keyboard;
-import net.java.games.input.Component;
-import net.java.games.input.Controller;
-import net.java.games.input.Rumbler;
-import net.java.games.input.Event;
-import java.util.List;
-import java.util.ArrayList;
-
-import java.io.IOException;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-
-/**
- * @author elias
- */
-final class LWJGLKeyboard extends Keyboard {
- protected LWJGLKeyboard() {
- super("LWJGLKeyboard", createComponents(), new Controller[]{}, new Rumbler[]{});
- }
-
- private final static Component[] createComponents() {
- List components = new ArrayList();
- Field[] vkey_fields = org.lwjgl.input.Keyboard.class.getFields();
- for (int i = 0; i < vkey_fields.length; i++) {
- Field vkey_field = vkey_fields[i];
- try {
- if (Modifier.isStatic(vkey_field.getModifiers()) && vkey_field.getType() == int.class &&
- vkey_field.getName().startsWith("KEY_")) {
- int vkey_code = vkey_field.getInt(null);
- Component.Identifier.Key key_id = KeyMap.map(vkey_code);
- if (key_id != Component.Identifier.Key.UNKNOWN)
- components.add(new Key(key_id, vkey_code));
- }
- } catch (IllegalAccessException e) {
- throw new RuntimeException(e);
- }
- }
- return (Component[])components.toArray(new Component[]{});
- }
-
- public final synchronized void pollDevice() throws IOException {
- if (!org.lwjgl.input.Keyboard.isCreated())
- return;
- org.lwjgl.input.Keyboard.poll();
- Component[] components = getComponents();
- for (int i = 0; i < components.length; i++) {
- Key key = (Key)components[i];
- key.update();
- }
- }
-
- protected final synchronized boolean getNextDeviceEvent(Event event) throws IOException {
- if (!org.lwjgl.input.Keyboard.isCreated())
- return false;
- if (!org.lwjgl.input.Keyboard.next())
- return false;
- int lwjgl_key = org.lwjgl.input.Keyboard.getEventKey();
- if (lwjgl_key == org.lwjgl.input.Keyboard.KEY_NONE)
- return false;
- Component.Identifier.Key key_id = KeyMap.map(lwjgl_key);
- if (key_id == null)
- return false;
- Component key = getComponent(key_id);
- if (key == null)
- return false;
- float value = org.lwjgl.input.Keyboard.getEventKeyState() ? 1 : 0;
- event.set(key, value, org.lwjgl.input.Keyboard.getEventNanoseconds());
- return true;
- }
-
-
- private final static class Key extends AbstractComponent {
- private final int lwjgl_key;
- private float value;
-
- public Key(Component.Identifier.Key key_id, int lwjgl_key) {
- super(key_id.getName(), key_id);
- this.lwjgl_key = lwjgl_key;
- }
-
- public final void update() {
- this.value = org.lwjgl.input.Keyboard.isKeyDown(lwjgl_key) ? 1 : 0;
- }
-
- protected final float poll() {
- return value;
- }
-
- public final boolean isRelative() {
- return false;
- }
-
- public final boolean isAnalog() {
- return false;
- }
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.jinput;
+
+import net.java.games.input.AbstractComponent;
+import net.java.games.input.Keyboard;
+import net.java.games.input.Component;
+import net.java.games.input.Controller;
+import net.java.games.input.Rumbler;
+import net.java.games.input.Event;
+import java.util.List;
+import java.util.ArrayList;
+
+import java.io.IOException;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+
+/**
+ * @author elias
+ */
+final class LWJGLKeyboard extends Keyboard {
+ protected LWJGLKeyboard() {
+ super("LWJGLKeyboard", createComponents(), new Controller[]{}, new Rumbler[]{});
+ }
+
+ private final static Component[] createComponents() {
+ List components = new ArrayList();
+ Field[] vkey_fields = org.lwjgl.input.Keyboard.class.getFields();
+ for (int i = 0; i < vkey_fields.length; i++) {
+ Field vkey_field = vkey_fields[i];
+ try {
+ if (Modifier.isStatic(vkey_field.getModifiers()) && vkey_field.getType() == int.class &&
+ vkey_field.getName().startsWith("KEY_")) {
+ int vkey_code = vkey_field.getInt(null);
+ Component.Identifier.Key key_id = KeyMap.map(vkey_code);
+ if (key_id != Component.Identifier.Key.UNKNOWN)
+ components.add(new Key(key_id, vkey_code));
+ }
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ return (Component[])components.toArray(new Component[]{});
+ }
+
+ public final synchronized void pollDevice() throws IOException {
+ if (!org.lwjgl.input.Keyboard.isCreated())
+ return;
+ org.lwjgl.input.Keyboard.poll();
+ Component[] components = getComponents();
+ for (int i = 0; i < components.length; i++) {
+ Key key = (Key)components[i];
+ key.update();
+ }
+ }
+
+ protected final synchronized boolean getNextDeviceEvent(Event event) throws IOException {
+ if (!org.lwjgl.input.Keyboard.isCreated())
+ return false;
+ if (!org.lwjgl.input.Keyboard.next())
+ return false;
+ int lwjgl_key = org.lwjgl.input.Keyboard.getEventKey();
+ if (lwjgl_key == org.lwjgl.input.Keyboard.KEY_NONE)
+ return false;
+ Component.Identifier.Key key_id = KeyMap.map(lwjgl_key);
+ if (key_id == null)
+ return false;
+ Component key = getComponent(key_id);
+ if (key == null)
+ return false;
+ float value = org.lwjgl.input.Keyboard.getEventKeyState() ? 1 : 0;
+ event.set(key, value, org.lwjgl.input.Keyboard.getEventNanoseconds());
+ return true;
+ }
+
+
+ private final static class Key extends AbstractComponent {
+ private final int lwjgl_key;
+ private float value;
+
+ public Key(Component.Identifier.Key key_id, int lwjgl_key) {
+ super(key_id.getName(), key_id);
+ this.lwjgl_key = lwjgl_key;
+ }
+
+ public final void update() {
+ this.value = org.lwjgl.input.Keyboard.isKeyDown(lwjgl_key) ? 1 : 0;
+ }
+
+ protected final float poll() {
+ return value;
+ }
+
+ public final boolean isRelative() {
+ return false;
+ }
+
+ public final boolean isAnalog() {
+ return false;
+ }
+ }
+}
diff --git a/src/java/org/lwjgl/util/jinput/LWJGLMouse.java b/src/java/org/lwjgl/util/jinput/LWJGLMouse.java
index 3b37b9a..bb9ec9c 100644
--- a/src/java/org/lwjgl/util/jinput/LWJGLMouse.java
+++ b/src/java/org/lwjgl/util/jinput/LWJGLMouse.java
@@ -1,191 +1,191 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.jinput;
-
-import java.io.IOException;
-
-import net.java.games.input.AbstractComponent;
-import net.java.games.input.Component;
-import net.java.games.input.Controller;
-import net.java.games.input.Event;
-import net.java.games.input.Mouse;
-import net.java.games.input.Rumbler;
-
-/**
- * @author elias
- */
-final class LWJGLMouse extends Mouse {
- private final static int EVENT_X = 1;
- private final static int EVENT_Y = 2;
- private final static int EVENT_WHEEL = 3;
- private final static int EVENT_BUTTON = 4;
- private final static int EVENT_DONE = 5;
-
- private int event_state = EVENT_DONE;
-
- protected LWJGLMouse() {
- super("LWJGLMouse", createComponents(), new Controller[]{}, new Rumbler[]{});
- }
-
- private final static Component[] createComponents() {
- return new Component[]{new Axis(Component.Identifier.Axis.X),
- new Axis(Component.Identifier.Axis.Y),
- new Axis(Component.Identifier.Axis.Z),
- new Button(Component.Identifier.Button.LEFT),
- new Button(Component.Identifier.Button.MIDDLE),
- new Button(Component.Identifier.Button.RIGHT)};
- }
-
- public final synchronized void pollDevice() throws IOException {
- if (!org.lwjgl.input.Mouse.isCreated())
- return;
- org.lwjgl.input.Mouse.poll();
- for (int i = 0; i < 3; i++)
- setButtonState(i);
- }
-
- private final Button map(int lwjgl_button) {
- switch (lwjgl_button) {
- case 0:
- return (Button)getLeft();
- case 1:
- return (Button)getRight();
- case 2:
- return (Button)getMiddle();
- default:
- return null;
- }
- }
-
- private final void setButtonState(int lwjgl_button) {
- Button button = map(lwjgl_button);
- if (button != null)
- button.setValue(org.lwjgl.input.Mouse.isButtonDown(lwjgl_button) ? 1 : 0);
- }
-
- protected final synchronized boolean getNextDeviceEvent(Event event) throws IOException {
- if (!org.lwjgl.input.Mouse.isCreated())
- return false;
- while (true) {
- long nanos = org.lwjgl.input.Mouse.getEventNanoseconds();
- switch (event_state) {
- case EVENT_X:
- event_state = EVENT_Y;
- int dx = org.lwjgl.input.Mouse.getEventDX();
- if (dx != 0) {
- event.set(getX(), dx, nanos);
- return true;
- }
- break;
- case EVENT_Y:
- event_state = EVENT_WHEEL;
- /* We must negate the y coord since lwjgl uses the
- * OpenGL coordinate system
- */
- int dy = -org.lwjgl.input.Mouse.getEventDY();
- if (dy != 0) {
- event.set(getY(), dy, nanos);
- return true;
- }
- break;
- case EVENT_WHEEL:
- event_state = EVENT_BUTTON;
- int dwheel = org.lwjgl.input.Mouse.getEventDWheel();
- if (dwheel != 0) {
- event.set(getWheel(), dwheel, nanos);
- return true;
- }
- break;
- case EVENT_BUTTON:
- event_state = EVENT_DONE;
- int lwjgl_button = org.lwjgl.input.Mouse.getEventButton();
- if (lwjgl_button != -1) {
- Button button = map(lwjgl_button);
- if (button != null) {
- event.set(button, org.lwjgl.input.Mouse.getEventButtonState() ? 1f : 0f, nanos);
- return true;
- }
- }
- break;
- case EVENT_DONE:
- if (!org.lwjgl.input.Mouse.next())
- return false;
- event_state = EVENT_X;
- break;
- default:
- break;
- }
- }
- }
-
- final static class Axis extends AbstractComponent {
- public Axis(Component.Identifier.Axis axis_id) {
- super(axis_id.getName(), axis_id);
- }
-
- public final boolean isRelative() {
- return true;
- }
-
- protected final float poll() throws IOException {
- return 0;
- }
-
- public final boolean isAnalog() {
- return true;
- }
- }
-
- final static class Button extends AbstractComponent {
- private float value;
-
- public Button(Component.Identifier.Button button_id) {
- super(button_id.getName(), button_id);
- }
-
- protected final void setValue(float value) {
- this.value = value;
- }
-
- protected final float poll() throws IOException {
- return value;
- }
-
- public final boolean isRelative() {
- return false;
- }
-
- public final boolean isAnalog() {
- return false;
- }
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.jinput;
+
+import java.io.IOException;
+
+import net.java.games.input.AbstractComponent;
+import net.java.games.input.Component;
+import net.java.games.input.Controller;
+import net.java.games.input.Event;
+import net.java.games.input.Mouse;
+import net.java.games.input.Rumbler;
+
+/**
+ * @author elias
+ */
+final class LWJGLMouse extends Mouse {
+ private final static int EVENT_X = 1;
+ private final static int EVENT_Y = 2;
+ private final static int EVENT_WHEEL = 3;
+ private final static int EVENT_BUTTON = 4;
+ private final static int EVENT_DONE = 5;
+
+ private int event_state = EVENT_DONE;
+
+ protected LWJGLMouse() {
+ super("LWJGLMouse", createComponents(), new Controller[]{}, new Rumbler[]{});
+ }
+
+ private final static Component[] createComponents() {
+ return new Component[]{new Axis(Component.Identifier.Axis.X),
+ new Axis(Component.Identifier.Axis.Y),
+ new Axis(Component.Identifier.Axis.Z),
+ new Button(Component.Identifier.Button.LEFT),
+ new Button(Component.Identifier.Button.MIDDLE),
+ new Button(Component.Identifier.Button.RIGHT)};
+ }
+
+ public final synchronized void pollDevice() throws IOException {
+ if (!org.lwjgl.input.Mouse.isCreated())
+ return;
+ org.lwjgl.input.Mouse.poll();
+ for (int i = 0; i < 3; i++)
+ setButtonState(i);
+ }
+
+ private final Button map(int lwjgl_button) {
+ switch (lwjgl_button) {
+ case 0:
+ return (Button)getLeft();
+ case 1:
+ return (Button)getRight();
+ case 2:
+ return (Button)getMiddle();
+ default:
+ return null;
+ }
+ }
+
+ private final void setButtonState(int lwjgl_button) {
+ Button button = map(lwjgl_button);
+ if (button != null)
+ button.setValue(org.lwjgl.input.Mouse.isButtonDown(lwjgl_button) ? 1 : 0);
+ }
+
+ protected final synchronized boolean getNextDeviceEvent(Event event) throws IOException {
+ if (!org.lwjgl.input.Mouse.isCreated())
+ return false;
+ while (true) {
+ long nanos = org.lwjgl.input.Mouse.getEventNanoseconds();
+ switch (event_state) {
+ case EVENT_X:
+ event_state = EVENT_Y;
+ int dx = org.lwjgl.input.Mouse.getEventDX();
+ if (dx != 0) {
+ event.set(getX(), dx, nanos);
+ return true;
+ }
+ break;
+ case EVENT_Y:
+ event_state = EVENT_WHEEL;
+ /* We must negate the y coord since lwjgl uses the
+ * OpenGL coordinate system
+ */
+ int dy = -org.lwjgl.input.Mouse.getEventDY();
+ if (dy != 0) {
+ event.set(getY(), dy, nanos);
+ return true;
+ }
+ break;
+ case EVENT_WHEEL:
+ event_state = EVENT_BUTTON;
+ int dwheel = org.lwjgl.input.Mouse.getEventDWheel();
+ if (dwheel != 0) {
+ event.set(getWheel(), dwheel, nanos);
+ return true;
+ }
+ break;
+ case EVENT_BUTTON:
+ event_state = EVENT_DONE;
+ int lwjgl_button = org.lwjgl.input.Mouse.getEventButton();
+ if (lwjgl_button != -1) {
+ Button button = map(lwjgl_button);
+ if (button != null) {
+ event.set(button, org.lwjgl.input.Mouse.getEventButtonState() ? 1f : 0f, nanos);
+ return true;
+ }
+ }
+ break;
+ case EVENT_DONE:
+ if (!org.lwjgl.input.Mouse.next())
+ return false;
+ event_state = EVENT_X;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ final static class Axis extends AbstractComponent {
+ public Axis(Component.Identifier.Axis axis_id) {
+ super(axis_id.getName(), axis_id);
+ }
+
+ public final boolean isRelative() {
+ return true;
+ }
+
+ protected final float poll() throws IOException {
+ return 0;
+ }
+
+ public final boolean isAnalog() {
+ return true;
+ }
+ }
+
+ final static class Button extends AbstractComponent {
+ private float value;
+
+ public Button(Component.Identifier.Button button_id) {
+ super(button_id.getName(), button_id);
+ }
+
+ protected final void setValue(float value) {
+ this.value = value;
+ }
+
+ protected final float poll() throws IOException {
+ return value;
+ }
+
+ public final boolean isRelative() {
+ return false;
+ }
+
+ public final boolean isAnalog() {
+ return false;
+ }
+ }
+}
diff --git a/src/java/org/lwjgl/util/vector/Matrix.java b/src/java/org/lwjgl/util/vector/Matrix.java
index efab6f6..4f3ee5d 100644
--- a/src/java/org/lwjgl/util/vector/Matrix.java
+++ b/src/java/org/lwjgl/util/vector/Matrix.java
@@ -1,134 +1,134 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.vector;
-
-import java.io.Serializable;
-import java.nio.FloatBuffer;
-
-/**
- *
- * Base class for matrices. When a matrix is constructed it will be the identity
- * matrix unless otherwise stated.
- *
- * @author cix_foo <cix_foo at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: Matrix.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public abstract class Matrix implements Serializable {
-
- /**
- * Constructor for Matrix.
- */
- public Matrix() {
- super();
- }
-
- /**
- * Set this matrix to be the identity matrix.
- * @return this
- */
- public abstract Matrix setIdentity();
-
-
- /**
- * Invert this matrix
- * @return this
- */
- public abstract Matrix invert();
-
-
- /**
- * Load from a float buffer. The buffer stores the matrix in column major
- * (OpenGL) order.
- *
- * @param buf A float buffer to read from
- * @return this
- */
- public abstract Matrix load(FloatBuffer buf);
-
-
- /**
- * Load from a float buffer. The buffer stores the matrix in row major
- * (mathematical) order.
- *
- * @param buf A float buffer to read from
- * @return this
- */
- public abstract Matrix loadTranspose(FloatBuffer buf);
-
-
- /**
- * Negate this matrix
- * @return this
- */
- public abstract Matrix negate();
-
-
- /**
- * Store this matrix in a float buffer. The matrix is stored in column
- * major (openGL) order.
- * @param buf The buffer to store this matrix in
- * @return this
- */
- public abstract Matrix store(FloatBuffer buf);
-
-
- /**
- * Store this matrix in a float buffer. The matrix is stored in row
- * major (maths) order.
- * @param buf The buffer to store this matrix in
- * @return this
- */
- public abstract Matrix storeTranspose(FloatBuffer buf);
-
-
- /**
- * Transpose this matrix
- * @return this
- */
- public abstract Matrix transpose();
-
-
- /**
- * Set this matrix to 0.
- * @return this
- */
- public abstract Matrix setZero();
-
-
- /**
- * @return the determinant of the matrix
- */
- public abstract float determinant();
-
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.vector;
+
+import java.io.Serializable;
+import java.nio.FloatBuffer;
+
+/**
+ *
+ * Base class for matrices. When a matrix is constructed it will be the identity
+ * matrix unless otherwise stated.
+ *
+ * @author cix_foo <cix_foo at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: Matrix.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public abstract class Matrix implements Serializable {
+
+ /**
+ * Constructor for Matrix.
+ */
+ public Matrix() {
+ super();
+ }
+
+ /**
+ * Set this matrix to be the identity matrix.
+ * @return this
+ */
+ public abstract Matrix setIdentity();
+
+
+ /**
+ * Invert this matrix
+ * @return this
+ */
+ public abstract Matrix invert();
+
+
+ /**
+ * Load from a float buffer. The buffer stores the matrix in column major
+ * (OpenGL) order.
+ *
+ * @param buf A float buffer to read from
+ * @return this
+ */
+ public abstract Matrix load(FloatBuffer buf);
+
+
+ /**
+ * Load from a float buffer. The buffer stores the matrix in row major
+ * (mathematical) order.
+ *
+ * @param buf A float buffer to read from
+ * @return this
+ */
+ public abstract Matrix loadTranspose(FloatBuffer buf);
+
+
+ /**
+ * Negate this matrix
+ * @return this
+ */
+ public abstract Matrix negate();
+
+
+ /**
+ * Store this matrix in a float buffer. The matrix is stored in column
+ * major (openGL) order.
+ * @param buf The buffer to store this matrix in
+ * @return this
+ */
+ public abstract Matrix store(FloatBuffer buf);
+
+
+ /**
+ * Store this matrix in a float buffer. The matrix is stored in row
+ * major (maths) order.
+ * @param buf The buffer to store this matrix in
+ * @return this
+ */
+ public abstract Matrix storeTranspose(FloatBuffer buf);
+
+
+ /**
+ * Transpose this matrix
+ * @return this
+ */
+ public abstract Matrix transpose();
+
+
+ /**
+ * Set this matrix to 0.
+ * @return this
+ */
+ public abstract Matrix setZero();
+
+
+ /**
+ * @return the determinant of the matrix
+ */
+ public abstract float determinant();
+
+
+}
diff --git a/src/java/org/lwjgl/util/vector/Matrix2f.java b/src/java/org/lwjgl/util/vector/Matrix2f.java
index a802d90..40b4590 100644
--- a/src/java/org/lwjgl/util/vector/Matrix2f.java
+++ b/src/java/org/lwjgl/util/vector/Matrix2f.java
@@ -1,400 +1,400 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.vector;
-
-import java.io.Serializable;
-import java.nio.FloatBuffer;
-
-/**
- *
- * Holds a 2x2 matrix
- *
- * @author cix_foo <cix_foo at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: Matrix2f.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-public class Matrix2f extends Matrix implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- public float m00, m01, m10, m11;
-
- /**
- * Constructor for Matrix2f. The matrix is initialised to the identity.
- */
- public Matrix2f() {
- setIdentity();
- }
-
- /**
- * Constructor
- */
- public Matrix2f(Matrix2f src) {
- load(src);
- }
-
- /**
- * Load from another matrix
- * @param src The source matrix
- * @return this
- */
- public Matrix2f load(Matrix2f src) {
- return load(src, this);
- }
-
- /**
- * Copy the source matrix to the destination matrix.
- * @param src The source matrix
- * @param dest The destination matrix, or null if a new one should be created.
- * @return The copied matrix
- */
- public static Matrix2f load(Matrix2f src, Matrix2f dest) {
- if (dest == null)
- dest = new Matrix2f();
-
- dest.m00 = src.m00;
- dest.m01 = src.m01;
- dest.m10 = src.m10;
- dest.m11 = src.m11;
-
- return dest;
- }
-
- /**
- * Load from a float buffer. The buffer stores the matrix in column major
- * (OpenGL) order.
- *
- * @param buf A float buffer to read from
- * @return this
- */
- public Matrix load(FloatBuffer buf) {
-
- m00 = buf.get();
- m01 = buf.get();
- m10 = buf.get();
- m11 = buf.get();
-
- return this;
- }
-
- /**
- * Load from a float buffer. The buffer stores the matrix in row major
- * (mathematical) order.
- *
- * @param buf A float buffer to read from
- * @return this
- */
- public Matrix loadTranspose(FloatBuffer buf) {
-
- m00 = buf.get();
- m10 = buf.get();
- m01 = buf.get();
- m11 = buf.get();
-
- return this;
- }
-
- /**
- * Store this matrix in a float buffer. The matrix is stored in column
- * major (openGL) order.
- * @param buf The buffer to store this matrix in
- */
- public Matrix store(FloatBuffer buf) {
- buf.put(m00);
- buf.put(m01);
- buf.put(m10);
- buf.put(m11);
- return this;
- }
-
- /**
- * Store this matrix in a float buffer. The matrix is stored in row
- * major (maths) order.
- * @param buf The buffer to store this matrix in
- */
- public Matrix storeTranspose(FloatBuffer buf) {
- buf.put(m00);
- buf.put(m10);
- buf.put(m01);
- buf.put(m11);
- return this;
- }
-
-
-
- /**
- * Add two matrices together and place the result in a third matrix.
- * @param left The left source matrix
- * @param right The right source matrix
- * @param dest The destination matrix, or null if a new one is to be created
- * @return the destination matrix
- */
- public static Matrix2f add(Matrix2f left, Matrix2f right, Matrix2f dest) {
- if (dest == null)
- dest = new Matrix2f();
-
- dest.m00 = left.m00 + right.m00;
- dest.m01 = left.m01 + right.m01;
- dest.m10 = left.m10 + right.m10;
- dest.m11 = left.m11 + right.m11;
-
- return dest;
- }
-
- /**
- * Subtract the right matrix from the left and place the result in a third matrix.
- * @param left The left source matrix
- * @param right The right source matrix
- * @param dest The destination matrix, or null if a new one is to be created
- * @return the destination matrix
- */
- public static Matrix2f sub(Matrix2f left, Matrix2f right, Matrix2f dest) {
- if (dest == null)
- dest = new Matrix2f();
-
- dest.m00 = left.m00 - right.m00;
- dest.m01 = left.m01 - right.m01;
- dest.m10 = left.m10 - right.m10;
- dest.m11 = left.m11 - right.m11;
-
- return dest;
- }
-
- /**
- * Multiply the right matrix by the left and place the result in a third matrix.
- * @param left The left source matrix
- * @param right The right source matrix
- * @param dest The destination matrix, or null if a new one is to be created
- * @return the destination matrix
- */
- public static Matrix2f mul(Matrix2f left, Matrix2f right, Matrix2f dest) {
- if (dest == null)
- dest = new Matrix2f();
-
- float m00 = left.m00 * right.m00 + left.m10 * right.m01;
- float m01 = left.m01 * right.m00 + left.m11 * right.m01;
- float m10 = left.m00 * right.m10 + left.m10 * right.m11;
- float m11 = left.m01 * right.m10 + left.m11 * right.m11;
-
- dest.m00 = m00;
- dest.m01 = m01;
- dest.m10 = m10;
- dest.m11 = m11;
-
- return dest;
- }
-
- /**
- * Transform a Vector by a matrix and return the result in a destination
- * vector.
- * @param left The left matrix
- * @param right The right vector
- * @param dest The destination vector, or null if a new one is to be created
- * @return the destination vector
- */
- public static Vector2f transform(Matrix2f left, Vector2f right, Vector2f dest) {
- if (dest == null)
- dest = new Vector2f();
-
- float x = left.m00 * right.x + left.m10 * right.y;
- float y = left.m01 * right.x + left.m11 * right.y;
-
- dest.x = x;
- dest.y = y;
-
- return dest;
- }
-
- /**
- * Transpose this matrix
- * @return this
- */
- public Matrix transpose() {
- return transpose(this);
- }
-
- /**
- * Transpose this matrix and place the result in another matrix.
- * @param dest The destination matrix or null if a new matrix is to be created
- * @return the transposed matrix
- */
- public Matrix2f transpose(Matrix2f dest) {
- return transpose(this, dest);
- }
-
- /**
- * Transpose the source matrix and place the result in the destination matrix.
- * @param src The source matrix or null if a new matrix is to be created
- * @param dest The destination matrix or null if a new matrix is to be created
- * @return the transposed matrix
- */
- public static Matrix2f transpose(Matrix2f src, Matrix2f dest) {
- if (dest == null)
- dest = new Matrix2f();
-
- float m01 = src.m10;
- float m10 = src.m01;
-
- dest.m01 = m01;
- dest.m10 = m10;
-
- return dest;
- }
-
- /**
- * Invert this matrix
- * @return this if successful, null otherwise
- */
- public Matrix invert() {
- return invert(this, this);
- }
-
- /**
- * Invert the source matrix and place the result in the destination matrix.
- * @param src The source matrix to be inverted
- * @param dest The destination matrix or null if a new matrix is to be created
- * @return The inverted matrix, or null if source can't be reverted.
- */
- public static Matrix2f invert(Matrix2f src, Matrix2f dest) {
- /*
- *inv(A) = 1/det(A) * adj(A);
- */
-
- float determinant = src.determinant();
- if (determinant != 0) {
- if (dest == null)
- dest = new Matrix2f();
- float determinant_inv = 1f/determinant;
- float t00 = src.m11*determinant_inv;
- float t01 = -src.m01*determinant_inv;
- float t11 = src.m00*determinant_inv;
- float t10 = -src.m10*determinant_inv;
-
- dest.m00 = t00;
- dest.m01 = t01;
- dest.m10 = t10;
- dest.m11 = t11;
- return dest;
- } else
- return null;
- }
-
- /**
- * Returns a string representation of this matrix
- */
- public String toString() {
- StringBuffer buf = new StringBuffer();
- buf.append(m00).append(' ').append(m10).append(' ').append('\n');
- buf.append(m01).append(' ').append(m11).append(' ').append('\n');
- return buf.toString();
- }
-
- /**
- * Negate this matrix
- * @return this
- */
- public Matrix negate() {
- return negate(this);
- }
-
- /**
- * Negate this matrix and stash the result in another matrix.
- * @param dest The destination matrix, or null if a new matrix is to be created
- * @return the negated matrix
- */
- public Matrix2f negate(Matrix2f dest) {
- return negate(this, this);
- }
-
- /**
- * Negate the source matrix and stash the result in the destination matrix.
- * @param src The source matrix to be negated
- * @param dest The destination matrix, or null if a new matrix is to be created
- * @return the negated matrix
- */
- public static Matrix2f negate(Matrix2f src, Matrix2f dest) {
- if (dest == null)
- dest = new Matrix2f();
-
- dest.m00 = -src.m00;
- dest.m01 = -src.m01;
- dest.m10 = -src.m10;
- dest.m11 = -src.m11;
-
- return dest;
- }
-
- /**
- * Set this matrix to be the identity matrix.
- * @return this
- */
- public Matrix setIdentity() {
- return setIdentity(this);
- }
-
- /**
- * Set the source matrix to be the identity matrix.
- * @param src The matrix to set to the identity.
- * @return The source matrix
- */
- public static Matrix2f setIdentity(Matrix2f src) {
- src.m00 = 1.0f;
- src.m01 = 0.0f;
- src.m10 = 0.0f;
- src.m11 = 1.0f;
- return src;
- }
-
- /**
- * Set this matrix to 0.
- * @return this
- */
- public Matrix setZero() {
- return setZero(this);
- }
-
- public static Matrix2f setZero(Matrix2f src) {
- src.m00 = 0.0f;
- src.m01 = 0.0f;
- src.m10 = 0.0f;
- src.m11 = 0.0f;
- return src;
- }
-
- /* (non-Javadoc)
- * @see org.lwjgl.vector.Matrix#determinant()
- */
- public float determinant() {
- return m00 * m11 - m01*m10;
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.vector;
+
+import java.io.Serializable;
+import java.nio.FloatBuffer;
+
+/**
+ *
+ * Holds a 2x2 matrix
+ *
+ * @author cix_foo <cix_foo at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: Matrix2f.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+public class Matrix2f extends Matrix implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ public float m00, m01, m10, m11;
+
+ /**
+ * Constructor for Matrix2f. The matrix is initialised to the identity.
+ */
+ public Matrix2f() {
+ setIdentity();
+ }
+
+ /**
+ * Constructor
+ */
+ public Matrix2f(Matrix2f src) {
+ load(src);
+ }
+
+ /**
+ * Load from another matrix
+ * @param src The source matrix
+ * @return this
+ */
+ public Matrix2f load(Matrix2f src) {
+ return load(src, this);
+ }
+
+ /**
+ * Copy the source matrix to the destination matrix.
+ * @param src The source matrix
+ * @param dest The destination matrix, or null if a new one should be created.
+ * @return The copied matrix
+ */
+ public static Matrix2f load(Matrix2f src, Matrix2f dest) {
+ if (dest == null)
+ dest = new Matrix2f();
+
+ dest.m00 = src.m00;
+ dest.m01 = src.m01;
+ dest.m10 = src.m10;
+ dest.m11 = src.m11;
+
+ return dest;
+ }
+
+ /**
+ * Load from a float buffer. The buffer stores the matrix in column major
+ * (OpenGL) order.
+ *
+ * @param buf A float buffer to read from
+ * @return this
+ */
+ public Matrix load(FloatBuffer buf) {
+
+ m00 = buf.get();
+ m01 = buf.get();
+ m10 = buf.get();
+ m11 = buf.get();
+
+ return this;
+ }
+
+ /**
+ * Load from a float buffer. The buffer stores the matrix in row major
+ * (mathematical) order.
+ *
+ * @param buf A float buffer to read from
+ * @return this
+ */
+ public Matrix loadTranspose(FloatBuffer buf) {
+
+ m00 = buf.get();
+ m10 = buf.get();
+ m01 = buf.get();
+ m11 = buf.get();
+
+ return this;
+ }
+
+ /**
+ * Store this matrix in a float buffer. The matrix is stored in column
+ * major (openGL) order.
+ * @param buf The buffer to store this matrix in
+ */
+ public Matrix store(FloatBuffer buf) {
+ buf.put(m00);
+ buf.put(m01);
+ buf.put(m10);
+ buf.put(m11);
+ return this;
+ }
+
+ /**
+ * Store this matrix in a float buffer. The matrix is stored in row
+ * major (maths) order.
+ * @param buf The buffer to store this matrix in
+ */
+ public Matrix storeTranspose(FloatBuffer buf) {
+ buf.put(m00);
+ buf.put(m10);
+ buf.put(m01);
+ buf.put(m11);
+ return this;
+ }
+
+
+
+ /**
+ * Add two matrices together and place the result in a third matrix.
+ * @param left The left source matrix
+ * @param right The right source matrix
+ * @param dest The destination matrix, or null if a new one is to be created
+ * @return the destination matrix
+ */
+ public static Matrix2f add(Matrix2f left, Matrix2f right, Matrix2f dest) {
+ if (dest == null)
+ dest = new Matrix2f();
+
+ dest.m00 = left.m00 + right.m00;
+ dest.m01 = left.m01 + right.m01;
+ dest.m10 = left.m10 + right.m10;
+ dest.m11 = left.m11 + right.m11;
+
+ return dest;
+ }
+
+ /**
+ * Subtract the right matrix from the left and place the result in a third matrix.
+ * @param left The left source matrix
+ * @param right The right source matrix
+ * @param dest The destination matrix, or null if a new one is to be created
+ * @return the destination matrix
+ */
+ public static Matrix2f sub(Matrix2f left, Matrix2f right, Matrix2f dest) {
+ if (dest == null)
+ dest = new Matrix2f();
+
+ dest.m00 = left.m00 - right.m00;
+ dest.m01 = left.m01 - right.m01;
+ dest.m10 = left.m10 - right.m10;
+ dest.m11 = left.m11 - right.m11;
+
+ return dest;
+ }
+
+ /**
+ * Multiply the right matrix by the left and place the result in a third matrix.
+ * @param left The left source matrix
+ * @param right The right source matrix
+ * @param dest The destination matrix, or null if a new one is to be created
+ * @return the destination matrix
+ */
+ public static Matrix2f mul(Matrix2f left, Matrix2f right, Matrix2f dest) {
+ if (dest == null)
+ dest = new Matrix2f();
+
+ float m00 = left.m00 * right.m00 + left.m10 * right.m01;
+ float m01 = left.m01 * right.m00 + left.m11 * right.m01;
+ float m10 = left.m00 * right.m10 + left.m10 * right.m11;
+ float m11 = left.m01 * right.m10 + left.m11 * right.m11;
+
+ dest.m00 = m00;
+ dest.m01 = m01;
+ dest.m10 = m10;
+ dest.m11 = m11;
+
+ return dest;
+ }
+
+ /**
+ * Transform a Vector by a matrix and return the result in a destination
+ * vector.
+ * @param left The left matrix
+ * @param right The right vector
+ * @param dest The destination vector, or null if a new one is to be created
+ * @return the destination vector
+ */
+ public static Vector2f transform(Matrix2f left, Vector2f right, Vector2f dest) {
+ if (dest == null)
+ dest = new Vector2f();
+
+ float x = left.m00 * right.x + left.m10 * right.y;
+ float y = left.m01 * right.x + left.m11 * right.y;
+
+ dest.x = x;
+ dest.y = y;
+
+ return dest;
+ }
+
+ /**
+ * Transpose this matrix
+ * @return this
+ */
+ public Matrix transpose() {
+ return transpose(this);
+ }
+
+ /**
+ * Transpose this matrix and place the result in another matrix.
+ * @param dest The destination matrix or null if a new matrix is to be created
+ * @return the transposed matrix
+ */
+ public Matrix2f transpose(Matrix2f dest) {
+ return transpose(this, dest);
+ }
+
+ /**
+ * Transpose the source matrix and place the result in the destination matrix.
+ * @param src The source matrix or null if a new matrix is to be created
+ * @param dest The destination matrix or null if a new matrix is to be created
+ * @return the transposed matrix
+ */
+ public static Matrix2f transpose(Matrix2f src, Matrix2f dest) {
+ if (dest == null)
+ dest = new Matrix2f();
+
+ float m01 = src.m10;
+ float m10 = src.m01;
+
+ dest.m01 = m01;
+ dest.m10 = m10;
+
+ return dest;
+ }
+
+ /**
+ * Invert this matrix
+ * @return this if successful, null otherwise
+ */
+ public Matrix invert() {
+ return invert(this, this);
+ }
+
+ /**
+ * Invert the source matrix and place the result in the destination matrix.
+ * @param src The source matrix to be inverted
+ * @param dest The destination matrix or null if a new matrix is to be created
+ * @return The inverted matrix, or null if source can't be reverted.
+ */
+ public static Matrix2f invert(Matrix2f src, Matrix2f dest) {
+ /*
+ *inv(A) = 1/det(A) * adj(A);
+ */
+
+ float determinant = src.determinant();
+ if (determinant != 0) {
+ if (dest == null)
+ dest = new Matrix2f();
+ float determinant_inv = 1f/determinant;
+ float t00 = src.m11*determinant_inv;
+ float t01 = -src.m01*determinant_inv;
+ float t11 = src.m00*determinant_inv;
+ float t10 = -src.m10*determinant_inv;
+
+ dest.m00 = t00;
+ dest.m01 = t01;
+ dest.m10 = t10;
+ dest.m11 = t11;
+ return dest;
+ } else
+ return null;
+ }
+
+ /**
+ * Returns a string representation of this matrix
+ */
+ public String toString() {
+ StringBuffer buf = new StringBuffer();
+ buf.append(m00).append(' ').append(m10).append(' ').append('\n');
+ buf.append(m01).append(' ').append(m11).append(' ').append('\n');
+ return buf.toString();
+ }
+
+ /**
+ * Negate this matrix
+ * @return this
+ */
+ public Matrix negate() {
+ return negate(this);
+ }
+
+ /**
+ * Negate this matrix and stash the result in another matrix.
+ * @param dest The destination matrix, or null if a new matrix is to be created
+ * @return the negated matrix
+ */
+ public Matrix2f negate(Matrix2f dest) {
+ return negate(this, this);
+ }
+
+ /**
+ * Negate the source matrix and stash the result in the destination matrix.
+ * @param src The source matrix to be negated
+ * @param dest The destination matrix, or null if a new matrix is to be created
+ * @return the negated matrix
+ */
+ public static Matrix2f negate(Matrix2f src, Matrix2f dest) {
+ if (dest == null)
+ dest = new Matrix2f();
+
+ dest.m00 = -src.m00;
+ dest.m01 = -src.m01;
+ dest.m10 = -src.m10;
+ dest.m11 = -src.m11;
+
+ return dest;
+ }
+
+ /**
+ * Set this matrix to be the identity matrix.
+ * @return this
+ */
+ public Matrix setIdentity() {
+ return setIdentity(this);
+ }
+
+ /**
+ * Set the source matrix to be the identity matrix.
+ * @param src The matrix to set to the identity.
+ * @return The source matrix
+ */
+ public static Matrix2f setIdentity(Matrix2f src) {
+ src.m00 = 1.0f;
+ src.m01 = 0.0f;
+ src.m10 = 0.0f;
+ src.m11 = 1.0f;
+ return src;
+ }
+
+ /**
+ * Set this matrix to 0.
+ * @return this
+ */
+ public Matrix setZero() {
+ return setZero(this);
+ }
+
+ public static Matrix2f setZero(Matrix2f src) {
+ src.m00 = 0.0f;
+ src.m01 = 0.0f;
+ src.m10 = 0.0f;
+ src.m11 = 0.0f;
+ return src;
+ }
+
+ /* (non-Javadoc)
+ * @see org.lwjgl.vector.Matrix#determinant()
+ */
+ public float determinant() {
+ return m00 * m11 - m01*m10;
+ }
+}
diff --git a/src/java/org/lwjgl/util/vector/Matrix3f.java b/src/java/org/lwjgl/util/vector/Matrix3f.java
index f766a95..ecef36c 100644
--- a/src/java/org/lwjgl/util/vector/Matrix3f.java
+++ b/src/java/org/lwjgl/util/vector/Matrix3f.java
@@ -1,510 +1,510 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.vector;
-
-import java.io.Serializable;
-import java.nio.FloatBuffer;
-
-/**
- *
- * Holds a 3x3 matrix.
- *
- * @author cix_foo <cix_foo at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: Matrix3f.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-public class Matrix3f extends Matrix implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- public float m00,
- m01,
- m02,
- m10,
- m11,
- m12,
- m20,
- m21,
- m22;
-
- /**
- * Constructor for Matrix3f. Matrix is initialised to the identity.
- */
- public Matrix3f() {
- super();
- setIdentity();
- }
-
- /**
- * Load from another matrix
- * @param src The source matrix
- * @return this
- */
- public Matrix3f load(Matrix3f src) {
- return load(src, this);
- }
-
- /**
- * Copy source matrix to destination matrix
- * @param src The source matrix
- * @param dest The destination matrix, or null of a new matrix is to be created
- * @return The copied matrix
- */
- public static Matrix3f load(Matrix3f src, Matrix3f dest) {
- if (dest == null)
- dest = new Matrix3f();
-
- dest.m00 = src.m00;
- dest.m10 = src.m10;
- dest.m20 = src.m20;
- dest.m01 = src.m01;
- dest.m11 = src.m11;
- dest.m21 = src.m21;
- dest.m02 = src.m02;
- dest.m12 = src.m12;
- dest.m22 = src.m22;
-
- return dest;
- }
-
- /**
- * Load from a float buffer. The buffer stores the matrix in column major
- * (OpenGL) order.
- *
- * @param buf A float buffer to read from
- * @return this
- */
- public Matrix load(FloatBuffer buf) {
-
- m00 = buf.get();
- m01 = buf.get();
- m02 = buf.get();
- m10 = buf.get();
- m11 = buf.get();
- m12 = buf.get();
- m20 = buf.get();
- m21 = buf.get();
- m22 = buf.get();
-
- return this;
- }
-
- /**
- * Load from a float buffer. The buffer stores the matrix in row major
- * (maths) order.
- *
- * @param buf A float buffer to read from
- * @return this
- */
- public Matrix loadTranspose(FloatBuffer buf) {
-
- m00 = buf.get();
- m10 = buf.get();
- m20 = buf.get();
- m01 = buf.get();
- m11 = buf.get();
- m21 = buf.get();
- m02 = buf.get();
- m12 = buf.get();
- m22 = buf.get();
-
- return this;
- }
-
- /**
- * Store this matrix in a float buffer. The matrix is stored in column
- * major (openGL) order.
- * @param buf The buffer to store this matrix in
- */
- public Matrix store(FloatBuffer buf) {
- buf.put(m00);
- buf.put(m01);
- buf.put(m02);
- buf.put(m10);
- buf.put(m11);
- buf.put(m12);
- buf.put(m20);
- buf.put(m21);
- buf.put(m22);
- return this;
- }
-
- /**
- * Store this matrix in a float buffer. The matrix is stored in row
- * major (maths) order.
- * @param buf The buffer to store this matrix in
- */
- public Matrix storeTranspose(FloatBuffer buf) {
- buf.put(m00);
- buf.put(m10);
- buf.put(m20);
- buf.put(m01);
- buf.put(m11);
- buf.put(m21);
- buf.put(m02);
- buf.put(m12);
- buf.put(m22);
- return this;
- }
-
- /**
- * Add two matrices together and place the result in a third matrix.
- * @param left The left source matrix
- * @param right The right source matrix
- * @param dest The destination matrix, or null if a new one is to be created
- * @return the destination matrix
- */
- public static Matrix3f add(Matrix3f left, Matrix3f right, Matrix3f dest) {
- if (dest == null)
- dest = new Matrix3f();
-
- dest.m00 = left.m00 + right.m00;
- dest.m01 = left.m01 + right.m01;
- dest.m02 = left.m02 + right.m02;
- dest.m10 = left.m10 + right.m10;
- dest.m11 = left.m11 + right.m11;
- dest.m12 = left.m12 + right.m12;
- dest.m20 = left.m20 + right.m20;
- dest.m21 = left.m21 + right.m21;
- dest.m22 = left.m22 + right.m22;
-
- return dest;
- }
-
- /**
- * Subtract the right matrix from the left and place the result in a third matrix.
- * @param left The left source matrix
- * @param right The right source matrix
- * @param dest The destination matrix, or null if a new one is to be created
- * @return the destination matrix
- */
- public static Matrix3f sub(Matrix3f left, Matrix3f right, Matrix3f dest) {
- if (dest == null)
- dest = new Matrix3f();
-
- dest.m00 = left.m00 - right.m00;
- dest.m01 = left.m01 - right.m01;
- dest.m02 = left.m02 - right.m02;
- dest.m10 = left.m10 - right.m10;
- dest.m11 = left.m11 - right.m11;
- dest.m12 = left.m12 - right.m12;
- dest.m20 = left.m20 - right.m20;
- dest.m21 = left.m21 - right.m21;
- dest.m22 = left.m22 - right.m22;
-
- return dest;
- }
-
- /**
- * Multiply the right matrix by the left and place the result in a third matrix.
- * @param left The left source matrix
- * @param right The right source matrix
- * @param dest The destination matrix, or null if a new one is to be created
- * @return the destination matrix
- */
- public static Matrix3f mul(Matrix3f left, Matrix3f right, Matrix3f dest) {
- if (dest == null)
- dest = new Matrix3f();
-
- float m00 =
- left.m00 * right.m00 + left.m10 * right.m01 + left.m20 * right.m02;
- float m01 =
- left.m01 * right.m00 + left.m11 * right.m01 + left.m21 * right.m02;
- float m02 =
- left.m02 * right.m00 + left.m12 * right.m01 + left.m22 * right.m02;
- float m10 =
- left.m00 * right.m10 + left.m10 * right.m11 + left.m20 * right.m12;
- float m11 =
- left.m01 * right.m10 + left.m11 * right.m11 + left.m21 * right.m12;
- float m12 =
- left.m02 * right.m10 + left.m12 * right.m11 + left.m22 * right.m12;
- float m20 =
- left.m00 * right.m20 + left.m10 * right.m21 + left.m20 * right.m22;
- float m21 =
- left.m01 * right.m20 + left.m11 * right.m21 + left.m21 * right.m22;
- float m22 =
- left.m02 * right.m20 + left.m12 * right.m21 + left.m22 * right.m22;
-
- dest.m00 = m00;
- dest.m01 = m01;
- dest.m02 = m02;
- dest.m10 = m10;
- dest.m11 = m11;
- dest.m12 = m12;
- dest.m20 = m20;
- dest.m21 = m21;
- dest.m22 = m22;
-
- return dest;
- }
-
- /**
- * Transform a Vector by a matrix and return the result in a destination
- * vector.
- * @param left The left matrix
- * @param right The right vector
- * @param dest The destination vector, or null if a new one is to be created
- * @return the destination vector
- */
- public static Vector3f transform(Matrix3f left, Vector3f right, Vector3f dest) {
- if (dest == null)
- dest = new Vector3f();
-
- float x = left.m00 * right.x + left.m10 * right.y + left.m20 * right.z;
- float y = left.m01 * right.x + left.m11 * right.y + left.m21 * right.z;
- float z = left.m02 * right.x + left.m12 * right.y + left.m22 * right.z;
-
- dest.x = x;
- dest.y = y;
- dest.z = z;
-
- return dest;
- }
-
- /**
- * Transpose this matrix
- * @return this
- */
- public Matrix transpose() {
- return transpose(this, this);
- }
-
- /**
- * Transpose this matrix and place the result in another matrix
- * @param dest The destination matrix or null if a new matrix is to be created
- * @return the transposed matrix
- */
- public Matrix3f transpose(Matrix3f dest) {
- return transpose(this, dest);
- }
-
- /**
- * Transpose the source matrix and place the result into the destination matrix
- * @param src The source matrix to be transposed
- * @param dest The destination matrix or null if a new matrix is to be created
- * @return the transposed matrix
- */
- public static Matrix3f transpose(Matrix3f src, Matrix3f dest) {
- if (dest == null)
- dest = new Matrix3f();
- float m00 = src.m00;
- float m01 = src.m10;
- float m02 = src.m20;
- float m10 = src.m01;
- float m11 = src.m11;
- float m12 = src.m21;
- float m20 = src.m02;
- float m21 = src.m12;
- float m22 = src.m22;
-
- dest.m00 = m00;
- dest.m01 = m01;
- dest.m02 = m02;
- dest.m10 = m10;
- dest.m11 = m11;
- dest.m12 = m12;
- dest.m20 = m20;
- dest.m21 = m21;
- dest.m22 = m22;
- return dest;
- }
-
- /**
- * @return the determinant of the matrix
- */
- public float determinant() {
- float f =
- m00 * (m11 * m22 - m12 * m21)
- + m01 * (m12 * m20 - m10 * m22)
- + m02 * (m10 * m21 - m11 * m20);
- return f;
- }
-
- /**
- * Returns a string representation of this matrix
- */
- public String toString() {
- StringBuffer buf = new StringBuffer();
- buf.append(m00).append(' ').append(m10).append(' ').append(m20).append(' ').append('\n');
- buf.append(m01).append(' ').append(m11).append(' ').append(m21).append(' ').append('\n');
- buf.append(m02).append(' ').append(m12).append(' ').append(m22).append(' ').append('\n');
- return buf.toString();
- }
-
- /**
- * Invert this matrix
- * @return this if successful, null otherwise
- */
- public Matrix invert() {
- return invert(this, this);
- }
-
- /**
- * Invert the source matrix and put the result into the destination matrix
- * @param src The source matrix to be inverted
- * @param dest The destination matrix, or null if a new one is to be created
- * @return The inverted matrix if successful, null otherwise
- */
- public static Matrix3f invert(Matrix3f src, Matrix3f dest) {
- float determinant = src.determinant();
-
- if (determinant != 0) {
- if (dest == null)
- dest = new Matrix3f();
- /* do it the ordinary way
- *
- * inv(A) = 1/det(A) * adj(T), where adj(T) = transpose(Conjugate Matrix)
- *
- * m00 m01 m02
- * m10 m11 m12
- * m20 m21 m22
- */
- float determinant_inv = 1f/determinant;
-
- // get the conjugate matrix
- float t00 = src.m11 * src.m22 - src.m12* src.m21;
- float t01 = - src.m10 * src.m22 + src.m12 * src.m20;
- float t02 = src.m10 * src.m21 - src.m11 * src.m20;
- float t10 = - src.m01 * src.m22 + src.m02 * src.m21;
- float t11 = src.m00 * src.m22 - src.m02 * src.m20;
- float t12 = - src.m00 * src.m21 + src.m01 * src.m20;
- float t20 = src.m01 * src.m12 - src.m02 * src.m11;
- float t21 = -src.m00 * src.m12 + src.m02 * src.m10;
- float t22 = src.m00 * src.m11 - src.m01 * src.m10;
-
- dest.m00 = t00*determinant_inv;
- dest.m11 = t11*determinant_inv;
- dest.m22 = t22*determinant_inv;
- dest.m01 = t10*determinant_inv;
- dest.m10 = t01*determinant_inv;
- dest.m20 = t02*determinant_inv;
- dest.m02 = t20*determinant_inv;
- dest.m12 = t21*determinant_inv;
- dest.m21 = t12*determinant_inv;
- return dest;
- } else
- return null;
- }
-
-
- /**
- * Negate this matrix
- * @return this
- */
- public Matrix negate() {
- return negate(this);
- }
-
- /**
- * Negate this matrix and place the result in a destination matrix.
- * @param dest The destination matrix, or null if a new matrix is to be created
- * @return the negated matrix
- */
- public Matrix3f negate(Matrix3f dest) {
- return negate(this, this);
- }
-
- /**
- * Negate the source matrix and place the result in the destination matrix.
- * @param src The source matrix
- * @param dest The destination matrix, or null if a new matrix is to be created
- * @return the negated matrix
- */
- public static Matrix3f negate(Matrix3f src, Matrix3f dest) {
- if (dest == null)
- dest = new Matrix3f();
-
- dest.m00 = -src.m00;
- dest.m01 = -src.m02;
- dest.m02 = -src.m01;
- dest.m10 = -src.m10;
- dest.m11 = -src.m12;
- dest.m12 = -src.m11;
- dest.m20 = -src.m20;
- dest.m21 = -src.m22;
- dest.m22 = -src.m21;
- return dest;
- }
-
- /**
- * Set this matrix to be the identity matrix.
- * @return this
- */
- public Matrix setIdentity() {
- return setIdentity(this);
- }
-
- /**
- * Set the matrix to be the identity matrix.
- * @param m The matrix to be set to the identity
- * @return m
- */
- public static Matrix3f setIdentity(Matrix3f m) {
- m.m00 = 1.0f;
- m.m01 = 0.0f;
- m.m02 = 0.0f;
- m.m10 = 0.0f;
- m.m11 = 1.0f;
- m.m12 = 0.0f;
- m.m20 = 0.0f;
- m.m21 = 0.0f;
- m.m22 = 1.0f;
- return m;
- }
-
- /**
- * Set this matrix to 0.
- * @return this
- */
- public Matrix setZero() {
- return setZero(this);
- }
-
- /**
- * Set the matrix matrix to 0.
- * @param m The matrix to be set to 0
- * @return m
- */
- public static Matrix3f setZero(Matrix3f m) {
- m.m00 = 0.0f;
- m.m01 = 0.0f;
- m.m02 = 0.0f;
- m.m10 = 0.0f;
- m.m11 = 0.0f;
- m.m12 = 0.0f;
- m.m20 = 0.0f;
- m.m21 = 0.0f;
- m.m22 = 0.0f;
- return m;
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.vector;
+
+import java.io.Serializable;
+import java.nio.FloatBuffer;
+
+/**
+ *
+ * Holds a 3x3 matrix.
+ *
+ * @author cix_foo <cix_foo at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: Matrix3f.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+public class Matrix3f extends Matrix implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ public float m00,
+ m01,
+ m02,
+ m10,
+ m11,
+ m12,
+ m20,
+ m21,
+ m22;
+
+ /**
+ * Constructor for Matrix3f. Matrix is initialised to the identity.
+ */
+ public Matrix3f() {
+ super();
+ setIdentity();
+ }
+
+ /**
+ * Load from another matrix
+ * @param src The source matrix
+ * @return this
+ */
+ public Matrix3f load(Matrix3f src) {
+ return load(src, this);
+ }
+
+ /**
+ * Copy source matrix to destination matrix
+ * @param src The source matrix
+ * @param dest The destination matrix, or null of a new matrix is to be created
+ * @return The copied matrix
+ */
+ public static Matrix3f load(Matrix3f src, Matrix3f dest) {
+ if (dest == null)
+ dest = new Matrix3f();
+
+ dest.m00 = src.m00;
+ dest.m10 = src.m10;
+ dest.m20 = src.m20;
+ dest.m01 = src.m01;
+ dest.m11 = src.m11;
+ dest.m21 = src.m21;
+ dest.m02 = src.m02;
+ dest.m12 = src.m12;
+ dest.m22 = src.m22;
+
+ return dest;
+ }
+
+ /**
+ * Load from a float buffer. The buffer stores the matrix in column major
+ * (OpenGL) order.
+ *
+ * @param buf A float buffer to read from
+ * @return this
+ */
+ public Matrix load(FloatBuffer buf) {
+
+ m00 = buf.get();
+ m01 = buf.get();
+ m02 = buf.get();
+ m10 = buf.get();
+ m11 = buf.get();
+ m12 = buf.get();
+ m20 = buf.get();
+ m21 = buf.get();
+ m22 = buf.get();
+
+ return this;
+ }
+
+ /**
+ * Load from a float buffer. The buffer stores the matrix in row major
+ * (maths) order.
+ *
+ * @param buf A float buffer to read from
+ * @return this
+ */
+ public Matrix loadTranspose(FloatBuffer buf) {
+
+ m00 = buf.get();
+ m10 = buf.get();
+ m20 = buf.get();
+ m01 = buf.get();
+ m11 = buf.get();
+ m21 = buf.get();
+ m02 = buf.get();
+ m12 = buf.get();
+ m22 = buf.get();
+
+ return this;
+ }
+
+ /**
+ * Store this matrix in a float buffer. The matrix is stored in column
+ * major (openGL) order.
+ * @param buf The buffer to store this matrix in
+ */
+ public Matrix store(FloatBuffer buf) {
+ buf.put(m00);
+ buf.put(m01);
+ buf.put(m02);
+ buf.put(m10);
+ buf.put(m11);
+ buf.put(m12);
+ buf.put(m20);
+ buf.put(m21);
+ buf.put(m22);
+ return this;
+ }
+
+ /**
+ * Store this matrix in a float buffer. The matrix is stored in row
+ * major (maths) order.
+ * @param buf The buffer to store this matrix in
+ */
+ public Matrix storeTranspose(FloatBuffer buf) {
+ buf.put(m00);
+ buf.put(m10);
+ buf.put(m20);
+ buf.put(m01);
+ buf.put(m11);
+ buf.put(m21);
+ buf.put(m02);
+ buf.put(m12);
+ buf.put(m22);
+ return this;
+ }
+
+ /**
+ * Add two matrices together and place the result in a third matrix.
+ * @param left The left source matrix
+ * @param right The right source matrix
+ * @param dest The destination matrix, or null if a new one is to be created
+ * @return the destination matrix
+ */
+ public static Matrix3f add(Matrix3f left, Matrix3f right, Matrix3f dest) {
+ if (dest == null)
+ dest = new Matrix3f();
+
+ dest.m00 = left.m00 + right.m00;
+ dest.m01 = left.m01 + right.m01;
+ dest.m02 = left.m02 + right.m02;
+ dest.m10 = left.m10 + right.m10;
+ dest.m11 = left.m11 + right.m11;
+ dest.m12 = left.m12 + right.m12;
+ dest.m20 = left.m20 + right.m20;
+ dest.m21 = left.m21 + right.m21;
+ dest.m22 = left.m22 + right.m22;
+
+ return dest;
+ }
+
+ /**
+ * Subtract the right matrix from the left and place the result in a third matrix.
+ * @param left The left source matrix
+ * @param right The right source matrix
+ * @param dest The destination matrix, or null if a new one is to be created
+ * @return the destination matrix
+ */
+ public static Matrix3f sub(Matrix3f left, Matrix3f right, Matrix3f dest) {
+ if (dest == null)
+ dest = new Matrix3f();
+
+ dest.m00 = left.m00 - right.m00;
+ dest.m01 = left.m01 - right.m01;
+ dest.m02 = left.m02 - right.m02;
+ dest.m10 = left.m10 - right.m10;
+ dest.m11 = left.m11 - right.m11;
+ dest.m12 = left.m12 - right.m12;
+ dest.m20 = left.m20 - right.m20;
+ dest.m21 = left.m21 - right.m21;
+ dest.m22 = left.m22 - right.m22;
+
+ return dest;
+ }
+
+ /**
+ * Multiply the right matrix by the left and place the result in a third matrix.
+ * @param left The left source matrix
+ * @param right The right source matrix
+ * @param dest The destination matrix, or null if a new one is to be created
+ * @return the destination matrix
+ */
+ public static Matrix3f mul(Matrix3f left, Matrix3f right, Matrix3f dest) {
+ if (dest == null)
+ dest = new Matrix3f();
+
+ float m00 =
+ left.m00 * right.m00 + left.m10 * right.m01 + left.m20 * right.m02;
+ float m01 =
+ left.m01 * right.m00 + left.m11 * right.m01 + left.m21 * right.m02;
+ float m02 =
+ left.m02 * right.m00 + left.m12 * right.m01 + left.m22 * right.m02;
+ float m10 =
+ left.m00 * right.m10 + left.m10 * right.m11 + left.m20 * right.m12;
+ float m11 =
+ left.m01 * right.m10 + left.m11 * right.m11 + left.m21 * right.m12;
+ float m12 =
+ left.m02 * right.m10 + left.m12 * right.m11 + left.m22 * right.m12;
+ float m20 =
+ left.m00 * right.m20 + left.m10 * right.m21 + left.m20 * right.m22;
+ float m21 =
+ left.m01 * right.m20 + left.m11 * right.m21 + left.m21 * right.m22;
+ float m22 =
+ left.m02 * right.m20 + left.m12 * right.m21 + left.m22 * right.m22;
+
+ dest.m00 = m00;
+ dest.m01 = m01;
+ dest.m02 = m02;
+ dest.m10 = m10;
+ dest.m11 = m11;
+ dest.m12 = m12;
+ dest.m20 = m20;
+ dest.m21 = m21;
+ dest.m22 = m22;
+
+ return dest;
+ }
+
+ /**
+ * Transform a Vector by a matrix and return the result in a destination
+ * vector.
+ * @param left The left matrix
+ * @param right The right vector
+ * @param dest The destination vector, or null if a new one is to be created
+ * @return the destination vector
+ */
+ public static Vector3f transform(Matrix3f left, Vector3f right, Vector3f dest) {
+ if (dest == null)
+ dest = new Vector3f();
+
+ float x = left.m00 * right.x + left.m10 * right.y + left.m20 * right.z;
+ float y = left.m01 * right.x + left.m11 * right.y + left.m21 * right.z;
+ float z = left.m02 * right.x + left.m12 * right.y + left.m22 * right.z;
+
+ dest.x = x;
+ dest.y = y;
+ dest.z = z;
+
+ return dest;
+ }
+
+ /**
+ * Transpose this matrix
+ * @return this
+ */
+ public Matrix transpose() {
+ return transpose(this, this);
+ }
+
+ /**
+ * Transpose this matrix and place the result in another matrix
+ * @param dest The destination matrix or null if a new matrix is to be created
+ * @return the transposed matrix
+ */
+ public Matrix3f transpose(Matrix3f dest) {
+ return transpose(this, dest);
+ }
+
+ /**
+ * Transpose the source matrix and place the result into the destination matrix
+ * @param src The source matrix to be transposed
+ * @param dest The destination matrix or null if a new matrix is to be created
+ * @return the transposed matrix
+ */
+ public static Matrix3f transpose(Matrix3f src, Matrix3f dest) {
+ if (dest == null)
+ dest = new Matrix3f();
+ float m00 = src.m00;
+ float m01 = src.m10;
+ float m02 = src.m20;
+ float m10 = src.m01;
+ float m11 = src.m11;
+ float m12 = src.m21;
+ float m20 = src.m02;
+ float m21 = src.m12;
+ float m22 = src.m22;
+
+ dest.m00 = m00;
+ dest.m01 = m01;
+ dest.m02 = m02;
+ dest.m10 = m10;
+ dest.m11 = m11;
+ dest.m12 = m12;
+ dest.m20 = m20;
+ dest.m21 = m21;
+ dest.m22 = m22;
+ return dest;
+ }
+
+ /**
+ * @return the determinant of the matrix
+ */
+ public float determinant() {
+ float f =
+ m00 * (m11 * m22 - m12 * m21)
+ + m01 * (m12 * m20 - m10 * m22)
+ + m02 * (m10 * m21 - m11 * m20);
+ return f;
+ }
+
+ /**
+ * Returns a string representation of this matrix
+ */
+ public String toString() {
+ StringBuffer buf = new StringBuffer();
+ buf.append(m00).append(' ').append(m10).append(' ').append(m20).append(' ').append('\n');
+ buf.append(m01).append(' ').append(m11).append(' ').append(m21).append(' ').append('\n');
+ buf.append(m02).append(' ').append(m12).append(' ').append(m22).append(' ').append('\n');
+ return buf.toString();
+ }
+
+ /**
+ * Invert this matrix
+ * @return this if successful, null otherwise
+ */
+ public Matrix invert() {
+ return invert(this, this);
+ }
+
+ /**
+ * Invert the source matrix and put the result into the destination matrix
+ * @param src The source matrix to be inverted
+ * @param dest The destination matrix, or null if a new one is to be created
+ * @return The inverted matrix if successful, null otherwise
+ */
+ public static Matrix3f invert(Matrix3f src, Matrix3f dest) {
+ float determinant = src.determinant();
+
+ if (determinant != 0) {
+ if (dest == null)
+ dest = new Matrix3f();
+ /* do it the ordinary way
+ *
+ * inv(A) = 1/det(A) * adj(T), where adj(T) = transpose(Conjugate Matrix)
+ *
+ * m00 m01 m02
+ * m10 m11 m12
+ * m20 m21 m22
+ */
+ float determinant_inv = 1f/determinant;
+
+ // get the conjugate matrix
+ float t00 = src.m11 * src.m22 - src.m12* src.m21;
+ float t01 = - src.m10 * src.m22 + src.m12 * src.m20;
+ float t02 = src.m10 * src.m21 - src.m11 * src.m20;
+ float t10 = - src.m01 * src.m22 + src.m02 * src.m21;
+ float t11 = src.m00 * src.m22 - src.m02 * src.m20;
+ float t12 = - src.m00 * src.m21 + src.m01 * src.m20;
+ float t20 = src.m01 * src.m12 - src.m02 * src.m11;
+ float t21 = -src.m00 * src.m12 + src.m02 * src.m10;
+ float t22 = src.m00 * src.m11 - src.m01 * src.m10;
+
+ dest.m00 = t00*determinant_inv;
+ dest.m11 = t11*determinant_inv;
+ dest.m22 = t22*determinant_inv;
+ dest.m01 = t10*determinant_inv;
+ dest.m10 = t01*determinant_inv;
+ dest.m20 = t02*determinant_inv;
+ dest.m02 = t20*determinant_inv;
+ dest.m12 = t21*determinant_inv;
+ dest.m21 = t12*determinant_inv;
+ return dest;
+ } else
+ return null;
+ }
+
+
+ /**
+ * Negate this matrix
+ * @return this
+ */
+ public Matrix negate() {
+ return negate(this);
+ }
+
+ /**
+ * Negate this matrix and place the result in a destination matrix.
+ * @param dest The destination matrix, or null if a new matrix is to be created
+ * @return the negated matrix
+ */
+ public Matrix3f negate(Matrix3f dest) {
+ return negate(this, this);
+ }
+
+ /**
+ * Negate the source matrix and place the result in the destination matrix.
+ * @param src The source matrix
+ * @param dest The destination matrix, or null if a new matrix is to be created
+ * @return the negated matrix
+ */
+ public static Matrix3f negate(Matrix3f src, Matrix3f dest) {
+ if (dest == null)
+ dest = new Matrix3f();
+
+ dest.m00 = -src.m00;
+ dest.m01 = -src.m02;
+ dest.m02 = -src.m01;
+ dest.m10 = -src.m10;
+ dest.m11 = -src.m12;
+ dest.m12 = -src.m11;
+ dest.m20 = -src.m20;
+ dest.m21 = -src.m22;
+ dest.m22 = -src.m21;
+ return dest;
+ }
+
+ /**
+ * Set this matrix to be the identity matrix.
+ * @return this
+ */
+ public Matrix setIdentity() {
+ return setIdentity(this);
+ }
+
+ /**
+ * Set the matrix to be the identity matrix.
+ * @param m The matrix to be set to the identity
+ * @return m
+ */
+ public static Matrix3f setIdentity(Matrix3f m) {
+ m.m00 = 1.0f;
+ m.m01 = 0.0f;
+ m.m02 = 0.0f;
+ m.m10 = 0.0f;
+ m.m11 = 1.0f;
+ m.m12 = 0.0f;
+ m.m20 = 0.0f;
+ m.m21 = 0.0f;
+ m.m22 = 1.0f;
+ return m;
+ }
+
+ /**
+ * Set this matrix to 0.
+ * @return this
+ */
+ public Matrix setZero() {
+ return setZero(this);
+ }
+
+ /**
+ * Set the matrix matrix to 0.
+ * @param m The matrix to be set to 0
+ * @return m
+ */
+ public static Matrix3f setZero(Matrix3f m) {
+ m.m00 = 0.0f;
+ m.m01 = 0.0f;
+ m.m02 = 0.0f;
+ m.m10 = 0.0f;
+ m.m11 = 0.0f;
+ m.m12 = 0.0f;
+ m.m20 = 0.0f;
+ m.m21 = 0.0f;
+ m.m22 = 0.0f;
+ return m;
+ }
+}
diff --git a/src/java/org/lwjgl/util/vector/Matrix4f.java b/src/java/org/lwjgl/util/vector/Matrix4f.java
index 254f3a8..e4c4e78 100644
--- a/src/java/org/lwjgl/util/vector/Matrix4f.java
+++ b/src/java/org/lwjgl/util/vector/Matrix4f.java
@@ -1,827 +1,827 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.vector;
-
-import java.io.Serializable;
-import java.nio.FloatBuffer;
-
-/**
- * Holds a 4x4 float matrix.
- *
- * @author foo
- */
-public class Matrix4f extends Matrix implements Serializable {
- private static final long serialVersionUID = 1L;
-
- public float m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33;
-
- /**
- * Construct a new matrix, initialized to the identity.
- */
- public Matrix4f() {
- super();
- setIdentity();
- }
-
- /**
- * Returns a string representation of this matrix
- */
- public String toString() {
- StringBuffer buf = new StringBuffer();
- buf.append(m00).append(' ').append(m10).append(' ').append(m20).append(' ').append(m30).append('\n');
- buf.append(m01).append(' ').append(m11).append(' ').append(m21).append(' ').append(m31).append('\n');
- buf.append(m02).append(' ').append(m12).append(' ').append(m22).append(' ').append(m32).append('\n');
- buf.append(m03).append(' ').append(m13).append(' ').append(m23).append(' ').append(m33).append('\n');
- return buf.toString();
- }
-
- /**
- * Set this matrix to be the identity matrix.
- * @return this
- */
- public Matrix setIdentity() {
- return setIdentity(this);
- }
-
- /**
- * Set the given matrix to be the identity matrix.
- * @param m The matrix to set to the identity
- * @return m
- */
- public static Matrix4f setIdentity(Matrix4f m) {
- m.m00 = 1.0f;
- m.m01 = 0.0f;
- m.m02 = 0.0f;
- m.m03 = 0.0f;
- m.m10 = 0.0f;
- m.m11 = 1.0f;
- m.m12 = 0.0f;
- m.m13 = 0.0f;
- m.m20 = 0.0f;
- m.m21 = 0.0f;
- m.m22 = 1.0f;
- m.m23 = 0.0f;
- m.m30 = 0.0f;
- m.m31 = 0.0f;
- m.m32 = 0.0f;
- m.m33 = 1.0f;
-
- return m;
- }
-
- /**
- * Set this matrix to 0.
- * @return this
- */
- public Matrix setZero() {
- return setZero(this);
- }
-
- /**
- * Set the given matrix to 0.
- * @param m The matrix to set to 0
- * @return m
- */
- public static Matrix4f setZero(Matrix4f m) {
- m.m00 = 0.0f;
- m.m01 = 0.0f;
- m.m02 = 0.0f;
- m.m03 = 0.0f;
- m.m10 = 0.0f;
- m.m11 = 0.0f;
- m.m12 = 0.0f;
- m.m13 = 0.0f;
- m.m20 = 0.0f;
- m.m21 = 0.0f;
- m.m22 = 0.0f;
- m.m23 = 0.0f;
- m.m30 = 0.0f;
- m.m31 = 0.0f;
- m.m32 = 0.0f;
- m.m33 = 0.0f;
-
- return m;
- }
-
- /**
- * Load from another matrix4f
- * @param src The source matrix
- * @return this
- */
- public Matrix4f load(Matrix4f src) {
- return load(src, this);
- }
-
- /**
- * Copy the source matrix to the destination matrix
- * @param src The source matrix
- * @param dest The destination matrix, or null of a new one is to be created
- * @return The copied matrix
- */
- public static Matrix4f load(Matrix4f src, Matrix4f dest) {
- if (dest == null)
- dest = new Matrix4f();
- dest.m00 = src.m00;
- dest.m01 = src.m01;
- dest.m02 = src.m02;
- dest.m03 = src.m03;
- dest.m10 = src.m10;
- dest.m11 = src.m11;
- dest.m12 = src.m12;
- dest.m13 = src.m13;
- dest.m20 = src.m20;
- dest.m21 = src.m21;
- dest.m22 = src.m22;
- dest.m23 = src.m23;
- dest.m30 = src.m30;
- dest.m31 = src.m31;
- dest.m32 = src.m32;
- dest.m33 = src.m33;
-
- return dest;
- }
-
- /**
- * Load from a float buffer. The buffer stores the matrix in column major
- * (OpenGL) order.
- *
- * @param buf A float buffer to read from
- * @return this
- */
- public Matrix load(FloatBuffer buf) {
-
- m00 = buf.get();
- m01 = buf.get();
- m02 = buf.get();
- m03 = buf.get();
- m10 = buf.get();
- m11 = buf.get();
- m12 = buf.get();
- m13 = buf.get();
- m20 = buf.get();
- m21 = buf.get();
- m22 = buf.get();
- m23 = buf.get();
- m30 = buf.get();
- m31 = buf.get();
- m32 = buf.get();
- m33 = buf.get();
-
- return this;
- }
-
- /**
- * Load from a float buffer. The buffer stores the matrix in row major
- * (maths) order.
- *
- * @param buf A float buffer to read from
- * @return this
- */
- public Matrix loadTranspose(FloatBuffer buf) {
-
- m00 = buf.get();
- m10 = buf.get();
- m20 = buf.get();
- m30 = buf.get();
- m01 = buf.get();
- m11 = buf.get();
- m21 = buf.get();
- m31 = buf.get();
- m02 = buf.get();
- m12 = buf.get();
- m22 = buf.get();
- m32 = buf.get();
- m03 = buf.get();
- m13 = buf.get();
- m23 = buf.get();
- m33 = buf.get();
-
- return this;
- }
-
- /**
- * Store this matrix in a float buffer. The matrix is stored in column
- * major (openGL) order.
- * @param buf The buffer to store this matrix in
- */
- public Matrix store(FloatBuffer buf) {
- buf.put(m00);
- buf.put(m01);
- buf.put(m02);
- buf.put(m03);
- buf.put(m10);
- buf.put(m11);
- buf.put(m12);
- buf.put(m13);
- buf.put(m20);
- buf.put(m21);
- buf.put(m22);
- buf.put(m23);
- buf.put(m30);
- buf.put(m31);
- buf.put(m32);
- buf.put(m33);
- return this;
- }
-
- /**
- * Store this matrix in a float buffer. The matrix is stored in row
- * major (maths) order.
- * @param buf The buffer to store this matrix in
- */
- public Matrix storeTranspose(FloatBuffer buf) {
- buf.put(m00);
- buf.put(m10);
- buf.put(m20);
- buf.put(m30);
- buf.put(m01);
- buf.put(m11);
- buf.put(m21);
- buf.put(m31);
- buf.put(m02);
- buf.put(m12);
- buf.put(m22);
- buf.put(m32);
- buf.put(m03);
- buf.put(m13);
- buf.put(m23);
- buf.put(m33);
- return this;
- }
-
-
- /**
- * Add two matrices together and place the result in a third matrix.
- * @param left The left source matrix
- * @param right The right source matrix
- * @param dest The destination matrix, or null if a new one is to be created
- * @return the destination matrix
- */
- public static Matrix4f add(Matrix4f left, Matrix4f right, Matrix4f dest) {
- if (dest == null)
- dest = new Matrix4f();
-
- dest.m00 = left.m00 + right.m00;
- dest.m01 = left.m01 + right.m01;
- dest.m02 = left.m02 + right.m02;
- dest.m03 = left.m03 + right.m03;
- dest.m10 = left.m10 + right.m10;
- dest.m11 = left.m11 + right.m11;
- dest.m12 = left.m12 + right.m12;
- dest.m13 = left.m13 + right.m13;
- dest.m20 = left.m20 + right.m20;
- dest.m21 = left.m21 + right.m21;
- dest.m22 = left.m22 + right.m22;
- dest.m23 = left.m23 + right.m23;
- dest.m30 = left.m30 + right.m30;
- dest.m31 = left.m31 + right.m31;
- dest.m32 = left.m32 + right.m32;
- dest.m33 = left.m33 + right.m33;
-
- return dest;
- }
-
- /**
- * Subtract the right matrix from the left and place the result in a third matrix.
- * @param left The left source matrix
- * @param right The right source matrix
- * @param dest The destination matrix, or null if a new one is to be created
- * @return the destination matrix
- */
- public static Matrix4f sub(Matrix4f left, Matrix4f right, Matrix4f dest) {
- if (dest == null)
- dest = new Matrix4f();
-
- dest.m00 = left.m00 - right.m00;
- dest.m01 = left.m01 - right.m01;
- dest.m02 = left.m02 - right.m02;
- dest.m03 = left.m03 - right.m03;
- dest.m10 = left.m10 - right.m10;
- dest.m11 = left.m11 - right.m11;
- dest.m12 = left.m12 - right.m12;
- dest.m13 = left.m13 - right.m13;
- dest.m20 = left.m20 - right.m20;
- dest.m21 = left.m21 - right.m21;
- dest.m22 = left.m22 - right.m22;
- dest.m23 = left.m23 - right.m23;
- dest.m30 = left.m30 - right.m30;
- dest.m31 = left.m31 - right.m31;
- dest.m32 = left.m32 - right.m32;
- dest.m33 = left.m33 - right.m33;
-
- return dest;
- }
-
- /**
- * Multiply the right matrix by the left and place the result in a third matrix.
- * @param left The left source matrix
- * @param right The right source matrix
- * @param dest The destination matrix, or null if a new one is to be created
- * @return the destination matrix
- */
- public static Matrix4f mul(Matrix4f left, Matrix4f right, Matrix4f dest) {
- if (dest == null)
- dest = new Matrix4f();
-
- float m00 = left.m00 * right.m00 + left.m10 * right.m01 + left.m20 * right.m02 + left.m30 * right.m03;
- float m01 = left.m01 * right.m00 + left.m11 * right.m01 + left.m21 * right.m02 + left.m31 * right.m03;
- float m02 = left.m02 * right.m00 + left.m12 * right.m01 + left.m22 * right.m02 + left.m32 * right.m03;
- float m03 = left.m03 * right.m00 + left.m13 * right.m01 + left.m23 * right.m02 + left.m33 * right.m03;
- float m10 = left.m00 * right.m10 + left.m10 * right.m11 + left.m20 * right.m12 + left.m30 * right.m13;
- float m11 = left.m01 * right.m10 + left.m11 * right.m11 + left.m21 * right.m12 + left.m31 * right.m13;
- float m12 = left.m02 * right.m10 + left.m12 * right.m11 + left.m22 * right.m12 + left.m32 * right.m13;
- float m13 = left.m03 * right.m10 + left.m13 * right.m11 + left.m23 * right.m12 + left.m33 * right.m13;
- float m20 = left.m00 * right.m20 + left.m10 * right.m21 + left.m20 * right.m22 + left.m30 * right.m23;
- float m21 = left.m01 * right.m20 + left.m11 * right.m21 + left.m21 * right.m22 + left.m31 * right.m23;
- float m22 = left.m02 * right.m20 + left.m12 * right.m21 + left.m22 * right.m22 + left.m32 * right.m23;
- float m23 = left.m03 * right.m20 + left.m13 * right.m21 + left.m23 * right.m22 + left.m33 * right.m23;
- float m30 = left.m00 * right.m30 + left.m10 * right.m31 + left.m20 * right.m32 + left.m30 * right.m33;
- float m31 = left.m01 * right.m30 + left.m11 * right.m31 + left.m21 * right.m32 + left.m31 * right.m33;
- float m32 = left.m02 * right.m30 + left.m12 * right.m31 + left.m22 * right.m32 + left.m32 * right.m33;
- float m33 = left.m03 * right.m30 + left.m13 * right.m31 + left.m23 * right.m32 + left.m33 * right.m33;
-
- dest.m00 = m00;
- dest.m01 = m01;
- dest.m02 = m02;
- dest.m03 = m03;
- dest.m10 = m10;
- dest.m11 = m11;
- dest.m12 = m12;
- dest.m13 = m13;
- dest.m20 = m20;
- dest.m21 = m21;
- dest.m22 = m22;
- dest.m23 = m23;
- dest.m30 = m30;
- dest.m31 = m31;
- dest.m32 = m32;
- dest.m33 = m33;
-
- return dest;
- }
-
- /**
- * Transform a Vector by a matrix and return the result in a destination
- * vector.
- * @param left The left matrix
- * @param right The right vector
- * @param dest The destination vector, or null if a new one is to be created
- * @return the destination vector
- */
- public static Vector4f transform(Matrix4f left, Vector4f right, Vector4f dest) {
- if (dest == null)
- dest = new Vector4f();
-
- float x = left.m00 * right.x + left.m10 * right.y + left.m20 * right.z + left.m30 * right.w;
- float y = left.m01 * right.x + left.m11 * right.y + left.m21 * right.z + left.m31 * right.w;
- float z = left.m02 * right.x + left.m12 * right.y + left.m22 * right.z + left.m32 * right.w;
- float w = left.m03 * right.x + left.m13 * right.y + left.m23 * right.z + left.m33 * right.w;
-
- dest.x = x;
- dest.y = y;
- dest.z = z;
- dest.w = w;
-
- return dest;
- }
-
- /**
- * Transpose this matrix
- * @return this
- */
- public Matrix transpose() {
- return transpose(this);
- }
-
- /**
- * Translate this matrix
- * @param vec The vector to translate by
- * @return this
- */
- public Matrix4f translate(Vector2f vec) {
- return translate(vec, this);
- }
-
- /**
- * Translate this matrix
- * @param vec The vector to translate by
- * @return this
- */
- public Matrix4f translate(Vector3f vec) {
- return translate(vec, this);
- }
-
- /**
- * Scales this matrix
- * @param vec The vector to scale by
- * @return this
- */
- public Matrix4f scale(Vector3f vec) {
- return scale(vec, this, this);
- }
-
- /**
- * Scales the source matrix and put the result in the destination matrix
- * @param vec The vector to scale by
- * @param src The source matrix
- * @param dest The destination matrix, or null if a new matrix is to be created
- * @return The scaled matrix
- */
- public static Matrix4f scale(Vector3f vec, Matrix4f src, Matrix4f dest) {
- if (dest == null)
- dest = new Matrix4f();
- dest.m00 = src.m00 * vec.x;
- dest.m01 = src.m01 * vec.x;
- dest.m02 = src.m02 * vec.x;
- dest.m03 = src.m03 * vec.x;
- dest.m10 = src.m10 * vec.y;
- dest.m11 = src.m11 * vec.y;
- dest.m12 = src.m12 * vec.y;
- dest.m13 = src.m13 * vec.y;
- dest.m20 = src.m20 * vec.z;
- dest.m21 = src.m21 * vec.z;
- dest.m22 = src.m22 * vec.z;
- dest.m23 = src.m23 * vec.z;
- return dest;
- }
-
- /**
- * Rotates the matrix around the given axis the specified angle
- * @param angle the angle, in radians.
- * @param axis The vector representing the rotation axis. Must be normalized.
- * @return this
- */
- public Matrix4f rotate(float angle, Vector3f axis) {
- return rotate(angle, axis, this);
- }
-
- /**
- * Rotates the matrix around the given axis the specified angle
- * @param angle the angle, in radians.
- * @param axis The vector representing the rotation axis. Must be normalized.
- * @param dest The matrix to put the result, or null if a new matrix is to be created
- * @return The rotated matrix
- */
- public Matrix4f rotate(float angle, Vector3f axis, Matrix4f dest) {
- return rotate(angle, axis, this, dest);
- }
-
- /**
- * Rotates the source matrix around the given axis the specified angle and
- * put the result in the destination matrix.
- * @param angle the angle, in radians.
- * @param axis The vector representing the rotation axis. Must be normalized.
- * @param src The matrix to rotate
- * @param dest The matrix to put the result, or null if a new matrix is to be created
- * @return The rotated matrix
- */
- public static Matrix4f rotate(float angle, Vector3f axis, Matrix4f src, Matrix4f dest) {
- if (dest == null)
- dest = new Matrix4f();
- float c = (float) Math.cos(angle);
- float s = (float) Math.sin(angle);
- float oneminusc = 1.0f - c;
- float xy = axis.x*axis.y;
- float yz = axis.y*axis.z;
- float xz = axis.x*axis.z;
- float xs = axis.x*s;
- float ys = axis.y*s;
- float zs = axis.z*s;
-
- float f00 = axis.x*axis.x*oneminusc+c;
- float f01 = xy*oneminusc+zs;
- float f02 = xz*oneminusc-ys;
- // n[3] not used
- float f10 = xy*oneminusc-zs;
- float f11 = axis.y*axis.y*oneminusc+c;
- float f12 = yz*oneminusc+xs;
- // n[7] not used
- float f20 = xz*oneminusc+ys;
- float f21 = yz*oneminusc-xs;
- float f22 = axis.z*axis.z*oneminusc+c;
-
- float t00 = src.m00 * f00 + src.m10 * f01 + src.m20 * f02;
- float t01 = src.m01 * f00 + src.m11 * f01 + src.m21 * f02;
- float t02 = src.m02 * f00 + src.m12 * f01 + src.m22 * f02;
- float t03 = src.m03 * f00 + src.m13 * f01 + src.m23 * f02;
- float t10 = src.m00 * f10 + src.m10 * f11 + src.m20 * f12;
- float t11 = src.m01 * f10 + src.m11 * f11 + src.m21 * f12;
- float t12 = src.m02 * f10 + src.m12 * f11 + src.m22 * f12;
- float t13 = src.m03 * f10 + src.m13 * f11 + src.m23 * f12;
- dest.m20 = src.m00 * f20 + src.m10 * f21 + src.m20 * f22;
- dest.m21 = src.m01 * f20 + src.m11 * f21 + src.m21 * f22;
- dest.m22 = src.m02 * f20 + src.m12 * f21 + src.m22 * f22;
- dest.m23 = src.m03 * f20 + src.m13 * f21 + src.m23 * f22;
- dest.m00 = t00;
- dest.m01 = t01;
- dest.m02 = t02;
- dest.m03 = t03;
- dest.m10 = t10;
- dest.m11 = t11;
- dest.m12 = t12;
- dest.m13 = t13;
- return dest;
- }
-
- /**
- * Translate this matrix and stash the result in another matrix
- * @param vec The vector to translate by
- * @param dest The destination matrix or null if a new matrix is to be created
- * @return the translated matrix
- */
- public Matrix4f translate(Vector3f vec, Matrix4f dest) {
- return translate(vec, this, dest);
- }
-
- /**
- * Translate the source matrix and stash the result in the destination matrix
- * @param vec The vector to translate by
- * @param src The source matrix
- * @param dest The destination matrix or null if a new matrix is to be created
- * @return The translated matrix
- */
- public static Matrix4f translate(Vector3f vec, Matrix4f src, Matrix4f dest) {
- if (dest == null)
- dest = new Matrix4f();
-
- dest.m30 += src.m00 * vec.x + src.m10 * vec.y + src.m20 * vec.z;
- dest.m31 += src.m01 * vec.x + src.m11 * vec.y + src.m21 * vec.z;
- dest.m32 += src.m02 * vec.x + src.m12 * vec.y + src.m22 * vec.z;
- dest.m33 += src.m03 * vec.x + src.m13 * vec.y + src.m23 * vec.z;
-
- return dest;
- }
-
- /**
- * Translate this matrix and stash the result in another matrix
- * @param vec The vector to translate by
- * @param dest The destination matrix or null if a new matrix is to be created
- * @return the translated matrix
- */
- public Matrix4f translate(Vector2f vec, Matrix4f dest) {
- return translate(vec, this, dest);
- }
-
- /**
- * Translate the source matrix and stash the result in the destination matrix
- * @param vec The vector to translate by
- * @param src The source matrix
- * @param dest The destination matrix or null if a new matrix is to be created
- * @return The translated matrix
- */
- public static Matrix4f translate(Vector2f vec, Matrix4f src, Matrix4f dest) {
- if (dest == null)
- dest = new Matrix4f();
-
- dest.m30 += src.m00 * vec.x + src.m10 * vec.y;
- dest.m31 += src.m01 * vec.x + src.m11 * vec.y;
- dest.m32 += src.m02 * vec.x + src.m12 * vec.y;
- dest.m33 += src.m03 * vec.x + src.m13 * vec.y;
-
- return dest;
- }
-
- /**
- * Transpose this matrix and place the result in another matrix
- * @param dest The destination matrix or null if a new matrix is to be created
- * @return the transposed matrix
- */
- public Matrix4f transpose(Matrix4f dest) {
- return transpose(this, dest);
- }
-
- /**
- * Transpose the source matrix and place the result in the destination matrix
- * @param src The source matrix
- * @param dest The destination matrix or null if a new matrix is to be created
- * @return the transposed matrix
- */
- public static Matrix4f transpose(Matrix4f src, Matrix4f dest) {
- if (dest == null)
- dest = new Matrix4f();
- float m00 = src.m00;
- float m01 = src.m10;
- float m02 = src.m20;
- float m03 = src.m30;
- float m10 = src.m01;
- float m11 = src.m11;
- float m12 = src.m21;
- float m13 = src.m31;
- float m20 = src.m02;
- float m21 = src.m12;
- float m22 = src.m22;
- float m23 = src.m32;
- float m30 = src.m03;
- float m31 = src.m13;
- float m32 = src.m23;
- float m33 = src.m33;
-
- dest.m00 = m00;
- dest.m01 = m01;
- dest.m02 = m02;
- dest.m03 = m03;
- dest.m10 = m10;
- dest.m11 = m11;
- dest.m12 = m12;
- dest.m13 = m13;
- dest.m20 = m20;
- dest.m21 = m21;
- dest.m22 = m22;
- dest.m23 = m23;
- dest.m30 = m30;
- dest.m31 = m31;
- dest.m32 = m32;
- dest.m33 = m33;
-
- return dest;
- }
-
- /**
- * @return the determinant of the matrix
- */
- public float determinant() {
- float f =
- m00
- * ((m11 * m22 * m33 + m12 * m23 * m31 + m13 * m21 * m32)
- - m13 * m22 * m31
- - m11 * m23 * m32
- - m12 * m21 * m33);
- f -= m01
- * ((m10 * m22 * m33 + m12 * m23 * m30 + m13 * m20 * m32)
- - m13 * m22 * m30
- - m10 * m23 * m32
- - m12 * m20 * m33);
- f += m02
- * ((m10 * m21 * m33 + m11 * m23 * m30 + m13 * m20 * m31)
- - m13 * m21 * m30
- - m10 * m23 * m31
- - m11 * m20 * m33);
- f -= m03
- * ((m10 * m21 * m32 + m11 * m22 * m30 + m12 * m20 * m31)
- - m12 * m21 * m30
- - m10 * m22 * m31
- - m11 * m20 * m32);
- return f;
- }
-
- /**
- * Calculate the determinant of a 3x3 matrix
- * @return result
- */
-
- private static float determinant3x3(float t00, float t01, float t02,
- float t10, float t11, float t12,
- float t20, float t21, float t22)
- {
- return t00 * (t11 * t22 - t12 * t21)
- + t01 * (t12 * t20 - t10 * t22)
- + t02 * (t10 * t21 - t11 * t20);
- }
-
- /**
- * Invert this matrix
- * @return this if successful, null otherwise
- */
- public Matrix invert() {
- return invert(this, this);
- }
-
- /**
- * Invert the source matrix and put the result in the destination
- * @param src The source matrix
- * @param dest The destination matrix, or null if a new matrix is to be created
- * @return The inverted matrix if successful, null otherwise
- */
- public static Matrix4f invert(Matrix4f src, Matrix4f dest) {
- float determinant = src.determinant();
-
- if (determinant != 0) {
- /*
- * m00 m01 m02 m03
- * m10 m11 m12 m13
- * m20 m21 m22 m23
- * m30 m31 m32 m33
- */
- if (dest == null)
- dest = new Matrix4f();
- float determinant_inv = 1f/determinant;
-
- // first row
- float t00 = determinant3x3(src.m11, src.m12, src.m13, src.m21, src.m22, src.m23, src.m31, src.m32, src.m33);
- float t01 = -determinant3x3(src.m10, src.m12, src.m13, src.m20, src.m22, src.m23, src.m30, src.m32, src.m33);
- float t02 = determinant3x3(src.m10, src.m11, src.m13, src.m20, src.m21, src.m23, src.m30, src.m31, src.m33);
- float t03 = -determinant3x3(src.m10, src.m11, src.m12, src.m20, src.m21, src.m22, src.m30, src.m31, src.m32);
- // second row
- float t10 = -determinant3x3(src.m01, src.m02, src.m03, src.m21, src.m22, src.m23, src.m31, src.m32, src.m33);
- float t11 = determinant3x3(src.m00, src.m02, src.m03, src.m20, src.m22, src.m23, src.m30, src.m32, src.m33);
- float t12 = -determinant3x3(src.m00, src.m01, src.m03, src.m20, src.m21, src.m23, src.m30, src.m31, src.m33);
- float t13 = determinant3x3(src.m00, src.m01, src.m02, src.m20, src.m21, src.m22, src.m30, src.m31, src.m32);
- // third row
- float t20 = determinant3x3(src.m01, src.m02, src.m03, src.m11, src.m12, src.m13, src.m31, src.m32, src.m33);
- float t21 = -determinant3x3(src.m00, src.m02, src.m03, src.m10, src.m12, src.m13, src.m30, src.m32, src.m33);
- float t22 = determinant3x3(src.m00, src.m01, src.m03, src.m10, src.m11, src.m13, src.m30, src.m31, src.m33);
- float t23 = -determinant3x3(src.m00, src.m01, src.m02, src.m10, src.m11, src.m12, src.m30, src.m31, src.m32);
- // fourth row
- float t30 = -determinant3x3(src.m01, src.m02, src.m03, src.m11, src.m12, src.m13, src.m21, src.m22, src.m23);
- float t31 = determinant3x3(src.m00, src.m02, src.m03, src.m10, src.m12, src.m13, src.m20, src.m22, src.m23);
- float t32 = -determinant3x3(src.m00, src.m01, src.m03, src.m10, src.m11, src.m13, src.m20, src.m21, src.m23);
- float t33 = determinant3x3(src.m00, src.m01, src.m02, src.m10, src.m11, src.m12, src.m20, src.m21, src.m22);
-
- // transpose and divide by the determinant
- dest.m00 = t00*determinant_inv;
- dest.m11 = t11*determinant_inv;
- dest.m22 = t22*determinant_inv;
- dest.m33 = t33*determinant_inv;
- dest.m01 = t10*determinant_inv;
- dest.m10 = t01*determinant_inv;
- dest.m20 = t02*determinant_inv;
- dest.m02 = t20*determinant_inv;
- dest.m12 = t21*determinant_inv;
- dest.m21 = t12*determinant_inv;
- dest.m03 = t30*determinant_inv;
- dest.m30 = t03*determinant_inv;
- dest.m13 = t31*determinant_inv;
- dest.m31 = t13*determinant_inv;
- dest.m32 = t23*determinant_inv;
- dest.m23 = t32*determinant_inv;
- return dest;
- } else
- return null;
- }
-
- /**
- * Negate this matrix
- * @return this
- */
- public Matrix negate() {
- return negate(this);
- }
-
- /**
- * Negate this matrix and place the result in a destination matrix.
- * @param dest The destination matrix, or null if a new matrix is to be created
- * @return the negated matrix
- */
- public Matrix4f negate(Matrix4f dest) {
- return negate(this, this);
- }
-
- /**
- * Negate this matrix and place the result in a destination matrix.
- * @param src The source matrix
- * @param dest The destination matrix, or null if a new matrix is to be created
- * @return The negated matrix
- */
- public static Matrix4f negate(Matrix4f src, Matrix4f dest) {
- if (dest == null)
- dest = new Matrix4f();
-
- dest.m00 = -src.m00;
- dest.m01 = -src.m01;
- dest.m02 = -src.m02;
- dest.m03 = -src.m03;
- dest.m10 = -src.m10;
- dest.m11 = -src.m11;
- dest.m12 = -src.m12;
- dest.m13 = -src.m13;
- dest.m20 = -src.m20;
- dest.m21 = -src.m21;
- dest.m22 = -src.m22;
- dest.m23 = -src.m23;
- dest.m30 = -src.m30;
- dest.m31 = -src.m31;
- dest.m32 = -src.m32;
- dest.m33 = -src.m33;
-
- return dest;
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.vector;
+
+import java.io.Serializable;
+import java.nio.FloatBuffer;
+
+/**
+ * Holds a 4x4 float matrix.
+ *
+ * @author foo
+ */
+public class Matrix4f extends Matrix implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ public float m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33;
+
+ /**
+ * Construct a new matrix, initialized to the identity.
+ */
+ public Matrix4f() {
+ super();
+ setIdentity();
+ }
+
+ /**
+ * Returns a string representation of this matrix
+ */
+ public String toString() {
+ StringBuffer buf = new StringBuffer();
+ buf.append(m00).append(' ').append(m10).append(' ').append(m20).append(' ').append(m30).append('\n');
+ buf.append(m01).append(' ').append(m11).append(' ').append(m21).append(' ').append(m31).append('\n');
+ buf.append(m02).append(' ').append(m12).append(' ').append(m22).append(' ').append(m32).append('\n');
+ buf.append(m03).append(' ').append(m13).append(' ').append(m23).append(' ').append(m33).append('\n');
+ return buf.toString();
+ }
+
+ /**
+ * Set this matrix to be the identity matrix.
+ * @return this
+ */
+ public Matrix setIdentity() {
+ return setIdentity(this);
+ }
+
+ /**
+ * Set the given matrix to be the identity matrix.
+ * @param m The matrix to set to the identity
+ * @return m
+ */
+ public static Matrix4f setIdentity(Matrix4f m) {
+ m.m00 = 1.0f;
+ m.m01 = 0.0f;
+ m.m02 = 0.0f;
+ m.m03 = 0.0f;
+ m.m10 = 0.0f;
+ m.m11 = 1.0f;
+ m.m12 = 0.0f;
+ m.m13 = 0.0f;
+ m.m20 = 0.0f;
+ m.m21 = 0.0f;
+ m.m22 = 1.0f;
+ m.m23 = 0.0f;
+ m.m30 = 0.0f;
+ m.m31 = 0.0f;
+ m.m32 = 0.0f;
+ m.m33 = 1.0f;
+
+ return m;
+ }
+
+ /**
+ * Set this matrix to 0.
+ * @return this
+ */
+ public Matrix setZero() {
+ return setZero(this);
+ }
+
+ /**
+ * Set the given matrix to 0.
+ * @param m The matrix to set to 0
+ * @return m
+ */
+ public static Matrix4f setZero(Matrix4f m) {
+ m.m00 = 0.0f;
+ m.m01 = 0.0f;
+ m.m02 = 0.0f;
+ m.m03 = 0.0f;
+ m.m10 = 0.0f;
+ m.m11 = 0.0f;
+ m.m12 = 0.0f;
+ m.m13 = 0.0f;
+ m.m20 = 0.0f;
+ m.m21 = 0.0f;
+ m.m22 = 0.0f;
+ m.m23 = 0.0f;
+ m.m30 = 0.0f;
+ m.m31 = 0.0f;
+ m.m32 = 0.0f;
+ m.m33 = 0.0f;
+
+ return m;
+ }
+
+ /**
+ * Load from another matrix4f
+ * @param src The source matrix
+ * @return this
+ */
+ public Matrix4f load(Matrix4f src) {
+ return load(src, this);
+ }
+
+ /**
+ * Copy the source matrix to the destination matrix
+ * @param src The source matrix
+ * @param dest The destination matrix, or null of a new one is to be created
+ * @return The copied matrix
+ */
+ public static Matrix4f load(Matrix4f src, Matrix4f dest) {
+ if (dest == null)
+ dest = new Matrix4f();
+ dest.m00 = src.m00;
+ dest.m01 = src.m01;
+ dest.m02 = src.m02;
+ dest.m03 = src.m03;
+ dest.m10 = src.m10;
+ dest.m11 = src.m11;
+ dest.m12 = src.m12;
+ dest.m13 = src.m13;
+ dest.m20 = src.m20;
+ dest.m21 = src.m21;
+ dest.m22 = src.m22;
+ dest.m23 = src.m23;
+ dest.m30 = src.m30;
+ dest.m31 = src.m31;
+ dest.m32 = src.m32;
+ dest.m33 = src.m33;
+
+ return dest;
+ }
+
+ /**
+ * Load from a float buffer. The buffer stores the matrix in column major
+ * (OpenGL) order.
+ *
+ * @param buf A float buffer to read from
+ * @return this
+ */
+ public Matrix load(FloatBuffer buf) {
+
+ m00 = buf.get();
+ m01 = buf.get();
+ m02 = buf.get();
+ m03 = buf.get();
+ m10 = buf.get();
+ m11 = buf.get();
+ m12 = buf.get();
+ m13 = buf.get();
+ m20 = buf.get();
+ m21 = buf.get();
+ m22 = buf.get();
+ m23 = buf.get();
+ m30 = buf.get();
+ m31 = buf.get();
+ m32 = buf.get();
+ m33 = buf.get();
+
+ return this;
+ }
+
+ /**
+ * Load from a float buffer. The buffer stores the matrix in row major
+ * (maths) order.
+ *
+ * @param buf A float buffer to read from
+ * @return this
+ */
+ public Matrix loadTranspose(FloatBuffer buf) {
+
+ m00 = buf.get();
+ m10 = buf.get();
+ m20 = buf.get();
+ m30 = buf.get();
+ m01 = buf.get();
+ m11 = buf.get();
+ m21 = buf.get();
+ m31 = buf.get();
+ m02 = buf.get();
+ m12 = buf.get();
+ m22 = buf.get();
+ m32 = buf.get();
+ m03 = buf.get();
+ m13 = buf.get();
+ m23 = buf.get();
+ m33 = buf.get();
+
+ return this;
+ }
+
+ /**
+ * Store this matrix in a float buffer. The matrix is stored in column
+ * major (openGL) order.
+ * @param buf The buffer to store this matrix in
+ */
+ public Matrix store(FloatBuffer buf) {
+ buf.put(m00);
+ buf.put(m01);
+ buf.put(m02);
+ buf.put(m03);
+ buf.put(m10);
+ buf.put(m11);
+ buf.put(m12);
+ buf.put(m13);
+ buf.put(m20);
+ buf.put(m21);
+ buf.put(m22);
+ buf.put(m23);
+ buf.put(m30);
+ buf.put(m31);
+ buf.put(m32);
+ buf.put(m33);
+ return this;
+ }
+
+ /**
+ * Store this matrix in a float buffer. The matrix is stored in row
+ * major (maths) order.
+ * @param buf The buffer to store this matrix in
+ */
+ public Matrix storeTranspose(FloatBuffer buf) {
+ buf.put(m00);
+ buf.put(m10);
+ buf.put(m20);
+ buf.put(m30);
+ buf.put(m01);
+ buf.put(m11);
+ buf.put(m21);
+ buf.put(m31);
+ buf.put(m02);
+ buf.put(m12);
+ buf.put(m22);
+ buf.put(m32);
+ buf.put(m03);
+ buf.put(m13);
+ buf.put(m23);
+ buf.put(m33);
+ return this;
+ }
+
+
+ /**
+ * Add two matrices together and place the result in a third matrix.
+ * @param left The left source matrix
+ * @param right The right source matrix
+ * @param dest The destination matrix, or null if a new one is to be created
+ * @return the destination matrix
+ */
+ public static Matrix4f add(Matrix4f left, Matrix4f right, Matrix4f dest) {
+ if (dest == null)
+ dest = new Matrix4f();
+
+ dest.m00 = left.m00 + right.m00;
+ dest.m01 = left.m01 + right.m01;
+ dest.m02 = left.m02 + right.m02;
+ dest.m03 = left.m03 + right.m03;
+ dest.m10 = left.m10 + right.m10;
+ dest.m11 = left.m11 + right.m11;
+ dest.m12 = left.m12 + right.m12;
+ dest.m13 = left.m13 + right.m13;
+ dest.m20 = left.m20 + right.m20;
+ dest.m21 = left.m21 + right.m21;
+ dest.m22 = left.m22 + right.m22;
+ dest.m23 = left.m23 + right.m23;
+ dest.m30 = left.m30 + right.m30;
+ dest.m31 = left.m31 + right.m31;
+ dest.m32 = left.m32 + right.m32;
+ dest.m33 = left.m33 + right.m33;
+
+ return dest;
+ }
+
+ /**
+ * Subtract the right matrix from the left and place the result in a third matrix.
+ * @param left The left source matrix
+ * @param right The right source matrix
+ * @param dest The destination matrix, or null if a new one is to be created
+ * @return the destination matrix
+ */
+ public static Matrix4f sub(Matrix4f left, Matrix4f right, Matrix4f dest) {
+ if (dest == null)
+ dest = new Matrix4f();
+
+ dest.m00 = left.m00 - right.m00;
+ dest.m01 = left.m01 - right.m01;
+ dest.m02 = left.m02 - right.m02;
+ dest.m03 = left.m03 - right.m03;
+ dest.m10 = left.m10 - right.m10;
+ dest.m11 = left.m11 - right.m11;
+ dest.m12 = left.m12 - right.m12;
+ dest.m13 = left.m13 - right.m13;
+ dest.m20 = left.m20 - right.m20;
+ dest.m21 = left.m21 - right.m21;
+ dest.m22 = left.m22 - right.m22;
+ dest.m23 = left.m23 - right.m23;
+ dest.m30 = left.m30 - right.m30;
+ dest.m31 = left.m31 - right.m31;
+ dest.m32 = left.m32 - right.m32;
+ dest.m33 = left.m33 - right.m33;
+
+ return dest;
+ }
+
+ /**
+ * Multiply the right matrix by the left and place the result in a third matrix.
+ * @param left The left source matrix
+ * @param right The right source matrix
+ * @param dest The destination matrix, or null if a new one is to be created
+ * @return the destination matrix
+ */
+ public static Matrix4f mul(Matrix4f left, Matrix4f right, Matrix4f dest) {
+ if (dest == null)
+ dest = new Matrix4f();
+
+ float m00 = left.m00 * right.m00 + left.m10 * right.m01 + left.m20 * right.m02 + left.m30 * right.m03;
+ float m01 = left.m01 * right.m00 + left.m11 * right.m01 + left.m21 * right.m02 + left.m31 * right.m03;
+ float m02 = left.m02 * right.m00 + left.m12 * right.m01 + left.m22 * right.m02 + left.m32 * right.m03;
+ float m03 = left.m03 * right.m00 + left.m13 * right.m01 + left.m23 * right.m02 + left.m33 * right.m03;
+ float m10 = left.m00 * right.m10 + left.m10 * right.m11 + left.m20 * right.m12 + left.m30 * right.m13;
+ float m11 = left.m01 * right.m10 + left.m11 * right.m11 + left.m21 * right.m12 + left.m31 * right.m13;
+ float m12 = left.m02 * right.m10 + left.m12 * right.m11 + left.m22 * right.m12 + left.m32 * right.m13;
+ float m13 = left.m03 * right.m10 + left.m13 * right.m11 + left.m23 * right.m12 + left.m33 * right.m13;
+ float m20 = left.m00 * right.m20 + left.m10 * right.m21 + left.m20 * right.m22 + left.m30 * right.m23;
+ float m21 = left.m01 * right.m20 + left.m11 * right.m21 + left.m21 * right.m22 + left.m31 * right.m23;
+ float m22 = left.m02 * right.m20 + left.m12 * right.m21 + left.m22 * right.m22 + left.m32 * right.m23;
+ float m23 = left.m03 * right.m20 + left.m13 * right.m21 + left.m23 * right.m22 + left.m33 * right.m23;
+ float m30 = left.m00 * right.m30 + left.m10 * right.m31 + left.m20 * right.m32 + left.m30 * right.m33;
+ float m31 = left.m01 * right.m30 + left.m11 * right.m31 + left.m21 * right.m32 + left.m31 * right.m33;
+ float m32 = left.m02 * right.m30 + left.m12 * right.m31 + left.m22 * right.m32 + left.m32 * right.m33;
+ float m33 = left.m03 * right.m30 + left.m13 * right.m31 + left.m23 * right.m32 + left.m33 * right.m33;
+
+ dest.m00 = m00;
+ dest.m01 = m01;
+ dest.m02 = m02;
+ dest.m03 = m03;
+ dest.m10 = m10;
+ dest.m11 = m11;
+ dest.m12 = m12;
+ dest.m13 = m13;
+ dest.m20 = m20;
+ dest.m21 = m21;
+ dest.m22 = m22;
+ dest.m23 = m23;
+ dest.m30 = m30;
+ dest.m31 = m31;
+ dest.m32 = m32;
+ dest.m33 = m33;
+
+ return dest;
+ }
+
+ /**
+ * Transform a Vector by a matrix and return the result in a destination
+ * vector.
+ * @param left The left matrix
+ * @param right The right vector
+ * @param dest The destination vector, or null if a new one is to be created
+ * @return the destination vector
+ */
+ public static Vector4f transform(Matrix4f left, Vector4f right, Vector4f dest) {
+ if (dest == null)
+ dest = new Vector4f();
+
+ float x = left.m00 * right.x + left.m10 * right.y + left.m20 * right.z + left.m30 * right.w;
+ float y = left.m01 * right.x + left.m11 * right.y + left.m21 * right.z + left.m31 * right.w;
+ float z = left.m02 * right.x + left.m12 * right.y + left.m22 * right.z + left.m32 * right.w;
+ float w = left.m03 * right.x + left.m13 * right.y + left.m23 * right.z + left.m33 * right.w;
+
+ dest.x = x;
+ dest.y = y;
+ dest.z = z;
+ dest.w = w;
+
+ return dest;
+ }
+
+ /**
+ * Transpose this matrix
+ * @return this
+ */
+ public Matrix transpose() {
+ return transpose(this);
+ }
+
+ /**
+ * Translate this matrix
+ * @param vec The vector to translate by
+ * @return this
+ */
+ public Matrix4f translate(Vector2f vec) {
+ return translate(vec, this);
+ }
+
+ /**
+ * Translate this matrix
+ * @param vec The vector to translate by
+ * @return this
+ */
+ public Matrix4f translate(Vector3f vec) {
+ return translate(vec, this);
+ }
+
+ /**
+ * Scales this matrix
+ * @param vec The vector to scale by
+ * @return this
+ */
+ public Matrix4f scale(Vector3f vec) {
+ return scale(vec, this, this);
+ }
+
+ /**
+ * Scales the source matrix and put the result in the destination matrix
+ * @param vec The vector to scale by
+ * @param src The source matrix
+ * @param dest The destination matrix, or null if a new matrix is to be created
+ * @return The scaled matrix
+ */
+ public static Matrix4f scale(Vector3f vec, Matrix4f src, Matrix4f dest) {
+ if (dest == null)
+ dest = new Matrix4f();
+ dest.m00 = src.m00 * vec.x;
+ dest.m01 = src.m01 * vec.x;
+ dest.m02 = src.m02 * vec.x;
+ dest.m03 = src.m03 * vec.x;
+ dest.m10 = src.m10 * vec.y;
+ dest.m11 = src.m11 * vec.y;
+ dest.m12 = src.m12 * vec.y;
+ dest.m13 = src.m13 * vec.y;
+ dest.m20 = src.m20 * vec.z;
+ dest.m21 = src.m21 * vec.z;
+ dest.m22 = src.m22 * vec.z;
+ dest.m23 = src.m23 * vec.z;
+ return dest;
+ }
+
+ /**
+ * Rotates the matrix around the given axis the specified angle
+ * @param angle the angle, in radians.
+ * @param axis The vector representing the rotation axis. Must be normalized.
+ * @return this
+ */
+ public Matrix4f rotate(float angle, Vector3f axis) {
+ return rotate(angle, axis, this);
+ }
+
+ /**
+ * Rotates the matrix around the given axis the specified angle
+ * @param angle the angle, in radians.
+ * @param axis The vector representing the rotation axis. Must be normalized.
+ * @param dest The matrix to put the result, or null if a new matrix is to be created
+ * @return The rotated matrix
+ */
+ public Matrix4f rotate(float angle, Vector3f axis, Matrix4f dest) {
+ return rotate(angle, axis, this, dest);
+ }
+
+ /**
+ * Rotates the source matrix around the given axis the specified angle and
+ * put the result in the destination matrix.
+ * @param angle the angle, in radians.
+ * @param axis The vector representing the rotation axis. Must be normalized.
+ * @param src The matrix to rotate
+ * @param dest The matrix to put the result, or null if a new matrix is to be created
+ * @return The rotated matrix
+ */
+ public static Matrix4f rotate(float angle, Vector3f axis, Matrix4f src, Matrix4f dest) {
+ if (dest == null)
+ dest = new Matrix4f();
+ float c = (float) Math.cos(angle);
+ float s = (float) Math.sin(angle);
+ float oneminusc = 1.0f - c;
+ float xy = axis.x*axis.y;
+ float yz = axis.y*axis.z;
+ float xz = axis.x*axis.z;
+ float xs = axis.x*s;
+ float ys = axis.y*s;
+ float zs = axis.z*s;
+
+ float f00 = axis.x*axis.x*oneminusc+c;
+ float f01 = xy*oneminusc+zs;
+ float f02 = xz*oneminusc-ys;
+ // n[3] not used
+ float f10 = xy*oneminusc-zs;
+ float f11 = axis.y*axis.y*oneminusc+c;
+ float f12 = yz*oneminusc+xs;
+ // n[7] not used
+ float f20 = xz*oneminusc+ys;
+ float f21 = yz*oneminusc-xs;
+ float f22 = axis.z*axis.z*oneminusc+c;
+
+ float t00 = src.m00 * f00 + src.m10 * f01 + src.m20 * f02;
+ float t01 = src.m01 * f00 + src.m11 * f01 + src.m21 * f02;
+ float t02 = src.m02 * f00 + src.m12 * f01 + src.m22 * f02;
+ float t03 = src.m03 * f00 + src.m13 * f01 + src.m23 * f02;
+ float t10 = src.m00 * f10 + src.m10 * f11 + src.m20 * f12;
+ float t11 = src.m01 * f10 + src.m11 * f11 + src.m21 * f12;
+ float t12 = src.m02 * f10 + src.m12 * f11 + src.m22 * f12;
+ float t13 = src.m03 * f10 + src.m13 * f11 + src.m23 * f12;
+ dest.m20 = src.m00 * f20 + src.m10 * f21 + src.m20 * f22;
+ dest.m21 = src.m01 * f20 + src.m11 * f21 + src.m21 * f22;
+ dest.m22 = src.m02 * f20 + src.m12 * f21 + src.m22 * f22;
+ dest.m23 = src.m03 * f20 + src.m13 * f21 + src.m23 * f22;
+ dest.m00 = t00;
+ dest.m01 = t01;
+ dest.m02 = t02;
+ dest.m03 = t03;
+ dest.m10 = t10;
+ dest.m11 = t11;
+ dest.m12 = t12;
+ dest.m13 = t13;
+ return dest;
+ }
+
+ /**
+ * Translate this matrix and stash the result in another matrix
+ * @param vec The vector to translate by
+ * @param dest The destination matrix or null if a new matrix is to be created
+ * @return the translated matrix
+ */
+ public Matrix4f translate(Vector3f vec, Matrix4f dest) {
+ return translate(vec, this, dest);
+ }
+
+ /**
+ * Translate the source matrix and stash the result in the destination matrix
+ * @param vec The vector to translate by
+ * @param src The source matrix
+ * @param dest The destination matrix or null if a new matrix is to be created
+ * @return The translated matrix
+ */
+ public static Matrix4f translate(Vector3f vec, Matrix4f src, Matrix4f dest) {
+ if (dest == null)
+ dest = new Matrix4f();
+
+ dest.m30 += src.m00 * vec.x + src.m10 * vec.y + src.m20 * vec.z;
+ dest.m31 += src.m01 * vec.x + src.m11 * vec.y + src.m21 * vec.z;
+ dest.m32 += src.m02 * vec.x + src.m12 * vec.y + src.m22 * vec.z;
+ dest.m33 += src.m03 * vec.x + src.m13 * vec.y + src.m23 * vec.z;
+
+ return dest;
+ }
+
+ /**
+ * Translate this matrix and stash the result in another matrix
+ * @param vec The vector to translate by
+ * @param dest The destination matrix or null if a new matrix is to be created
+ * @return the translated matrix
+ */
+ public Matrix4f translate(Vector2f vec, Matrix4f dest) {
+ return translate(vec, this, dest);
+ }
+
+ /**
+ * Translate the source matrix and stash the result in the destination matrix
+ * @param vec The vector to translate by
+ * @param src The source matrix
+ * @param dest The destination matrix or null if a new matrix is to be created
+ * @return The translated matrix
+ */
+ public static Matrix4f translate(Vector2f vec, Matrix4f src, Matrix4f dest) {
+ if (dest == null)
+ dest = new Matrix4f();
+
+ dest.m30 += src.m00 * vec.x + src.m10 * vec.y;
+ dest.m31 += src.m01 * vec.x + src.m11 * vec.y;
+ dest.m32 += src.m02 * vec.x + src.m12 * vec.y;
+ dest.m33 += src.m03 * vec.x + src.m13 * vec.y;
+
+ return dest;
+ }
+
+ /**
+ * Transpose this matrix and place the result in another matrix
+ * @param dest The destination matrix or null if a new matrix is to be created
+ * @return the transposed matrix
+ */
+ public Matrix4f transpose(Matrix4f dest) {
+ return transpose(this, dest);
+ }
+
+ /**
+ * Transpose the source matrix and place the result in the destination matrix
+ * @param src The source matrix
+ * @param dest The destination matrix or null if a new matrix is to be created
+ * @return the transposed matrix
+ */
+ public static Matrix4f transpose(Matrix4f src, Matrix4f dest) {
+ if (dest == null)
+ dest = new Matrix4f();
+ float m00 = src.m00;
+ float m01 = src.m10;
+ float m02 = src.m20;
+ float m03 = src.m30;
+ float m10 = src.m01;
+ float m11 = src.m11;
+ float m12 = src.m21;
+ float m13 = src.m31;
+ float m20 = src.m02;
+ float m21 = src.m12;
+ float m22 = src.m22;
+ float m23 = src.m32;
+ float m30 = src.m03;
+ float m31 = src.m13;
+ float m32 = src.m23;
+ float m33 = src.m33;
+
+ dest.m00 = m00;
+ dest.m01 = m01;
+ dest.m02 = m02;
+ dest.m03 = m03;
+ dest.m10 = m10;
+ dest.m11 = m11;
+ dest.m12 = m12;
+ dest.m13 = m13;
+ dest.m20 = m20;
+ dest.m21 = m21;
+ dest.m22 = m22;
+ dest.m23 = m23;
+ dest.m30 = m30;
+ dest.m31 = m31;
+ dest.m32 = m32;
+ dest.m33 = m33;
+
+ return dest;
+ }
+
+ /**
+ * @return the determinant of the matrix
+ */
+ public float determinant() {
+ float f =
+ m00
+ * ((m11 * m22 * m33 + m12 * m23 * m31 + m13 * m21 * m32)
+ - m13 * m22 * m31
+ - m11 * m23 * m32
+ - m12 * m21 * m33);
+ f -= m01
+ * ((m10 * m22 * m33 + m12 * m23 * m30 + m13 * m20 * m32)
+ - m13 * m22 * m30
+ - m10 * m23 * m32
+ - m12 * m20 * m33);
+ f += m02
+ * ((m10 * m21 * m33 + m11 * m23 * m30 + m13 * m20 * m31)
+ - m13 * m21 * m30
+ - m10 * m23 * m31
+ - m11 * m20 * m33);
+ f -= m03
+ * ((m10 * m21 * m32 + m11 * m22 * m30 + m12 * m20 * m31)
+ - m12 * m21 * m30
+ - m10 * m22 * m31
+ - m11 * m20 * m32);
+ return f;
+ }
+
+ /**
+ * Calculate the determinant of a 3x3 matrix
+ * @return result
+ */
+
+ private static float determinant3x3(float t00, float t01, float t02,
+ float t10, float t11, float t12,
+ float t20, float t21, float t22)
+ {
+ return t00 * (t11 * t22 - t12 * t21)
+ + t01 * (t12 * t20 - t10 * t22)
+ + t02 * (t10 * t21 - t11 * t20);
+ }
+
+ /**
+ * Invert this matrix
+ * @return this if successful, null otherwise
+ */
+ public Matrix invert() {
+ return invert(this, this);
+ }
+
+ /**
+ * Invert the source matrix and put the result in the destination
+ * @param src The source matrix
+ * @param dest The destination matrix, or null if a new matrix is to be created
+ * @return The inverted matrix if successful, null otherwise
+ */
+ public static Matrix4f invert(Matrix4f src, Matrix4f dest) {
+ float determinant = src.determinant();
+
+ if (determinant != 0) {
+ /*
+ * m00 m01 m02 m03
+ * m10 m11 m12 m13
+ * m20 m21 m22 m23
+ * m30 m31 m32 m33
+ */
+ if (dest == null)
+ dest = new Matrix4f();
+ float determinant_inv = 1f/determinant;
+
+ // first row
+ float t00 = determinant3x3(src.m11, src.m12, src.m13, src.m21, src.m22, src.m23, src.m31, src.m32, src.m33);
+ float t01 = -determinant3x3(src.m10, src.m12, src.m13, src.m20, src.m22, src.m23, src.m30, src.m32, src.m33);
+ float t02 = determinant3x3(src.m10, src.m11, src.m13, src.m20, src.m21, src.m23, src.m30, src.m31, src.m33);
+ float t03 = -determinant3x3(src.m10, src.m11, src.m12, src.m20, src.m21, src.m22, src.m30, src.m31, src.m32);
+ // second row
+ float t10 = -determinant3x3(src.m01, src.m02, src.m03, src.m21, src.m22, src.m23, src.m31, src.m32, src.m33);
+ float t11 = determinant3x3(src.m00, src.m02, src.m03, src.m20, src.m22, src.m23, src.m30, src.m32, src.m33);
+ float t12 = -determinant3x3(src.m00, src.m01, src.m03, src.m20, src.m21, src.m23, src.m30, src.m31, src.m33);
+ float t13 = determinant3x3(src.m00, src.m01, src.m02, src.m20, src.m21, src.m22, src.m30, src.m31, src.m32);
+ // third row
+ float t20 = determinant3x3(src.m01, src.m02, src.m03, src.m11, src.m12, src.m13, src.m31, src.m32, src.m33);
+ float t21 = -determinant3x3(src.m00, src.m02, src.m03, src.m10, src.m12, src.m13, src.m30, src.m32, src.m33);
+ float t22 = determinant3x3(src.m00, src.m01, src.m03, src.m10, src.m11, src.m13, src.m30, src.m31, src.m33);
+ float t23 = -determinant3x3(src.m00, src.m01, src.m02, src.m10, src.m11, src.m12, src.m30, src.m31, src.m32);
+ // fourth row
+ float t30 = -determinant3x3(src.m01, src.m02, src.m03, src.m11, src.m12, src.m13, src.m21, src.m22, src.m23);
+ float t31 = determinant3x3(src.m00, src.m02, src.m03, src.m10, src.m12, src.m13, src.m20, src.m22, src.m23);
+ float t32 = -determinant3x3(src.m00, src.m01, src.m03, src.m10, src.m11, src.m13, src.m20, src.m21, src.m23);
+ float t33 = determinant3x3(src.m00, src.m01, src.m02, src.m10, src.m11, src.m12, src.m20, src.m21, src.m22);
+
+ // transpose and divide by the determinant
+ dest.m00 = t00*determinant_inv;
+ dest.m11 = t11*determinant_inv;
+ dest.m22 = t22*determinant_inv;
+ dest.m33 = t33*determinant_inv;
+ dest.m01 = t10*determinant_inv;
+ dest.m10 = t01*determinant_inv;
+ dest.m20 = t02*determinant_inv;
+ dest.m02 = t20*determinant_inv;
+ dest.m12 = t21*determinant_inv;
+ dest.m21 = t12*determinant_inv;
+ dest.m03 = t30*determinant_inv;
+ dest.m30 = t03*determinant_inv;
+ dest.m13 = t31*determinant_inv;
+ dest.m31 = t13*determinant_inv;
+ dest.m32 = t23*determinant_inv;
+ dest.m23 = t32*determinant_inv;
+ return dest;
+ } else
+ return null;
+ }
+
+ /**
+ * Negate this matrix
+ * @return this
+ */
+ public Matrix negate() {
+ return negate(this);
+ }
+
+ /**
+ * Negate this matrix and place the result in a destination matrix.
+ * @param dest The destination matrix, or null if a new matrix is to be created
+ * @return the negated matrix
+ */
+ public Matrix4f negate(Matrix4f dest) {
+ return negate(this, this);
+ }
+
+ /**
+ * Negate this matrix and place the result in a destination matrix.
+ * @param src The source matrix
+ * @param dest The destination matrix, or null if a new matrix is to be created
+ * @return The negated matrix
+ */
+ public static Matrix4f negate(Matrix4f src, Matrix4f dest) {
+ if (dest == null)
+ dest = new Matrix4f();
+
+ dest.m00 = -src.m00;
+ dest.m01 = -src.m01;
+ dest.m02 = -src.m02;
+ dest.m03 = -src.m03;
+ dest.m10 = -src.m10;
+ dest.m11 = -src.m11;
+ dest.m12 = -src.m12;
+ dest.m13 = -src.m13;
+ dest.m20 = -src.m20;
+ dest.m21 = -src.m21;
+ dest.m22 = -src.m22;
+ dest.m23 = -src.m23;
+ dest.m30 = -src.m30;
+ dest.m31 = -src.m31;
+ dest.m32 = -src.m32;
+ dest.m33 = -src.m33;
+
+ return dest;
+ }
+}
diff --git a/src/java/org/lwjgl/util/vector/Quaternion.java b/src/java/org/lwjgl/util/vector/Quaternion.java
index 50cefdc..72a77f6 100644
--- a/src/java/org/lwjgl/util/vector/Quaternion.java
+++ b/src/java/org/lwjgl/util/vector/Quaternion.java
@@ -1,530 +1,530 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.vector;
-
-/**
- *
- * Quaternions for LWJGL!
- *
- * @author fbi
- * @version $Revision: 2983 $
- * $Id: Quaternion.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-import java.nio.FloatBuffer;
-
-public class Quaternion extends Vector implements ReadableVector4f {
- private static final long serialVersionUID = 1L;
-
- public float x, y, z, w;
-
- /**
- * C'tor. The quaternion will be initialized to the identity.
- */
- public Quaternion() {
- super();
- setIdentity();
- }
-
- /**
- * C'tor
- *
- * @param src
- */
- public Quaternion(ReadableVector4f src) {
- set(src);
- }
-
- /**
- * C'tor
- *
- */
- public Quaternion(float x, float y, float z, float w) {
- set(x, y, z, w);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.lwjgl.util.vector.WritableVector2f#set(float, float)
- */
- public void set(float x, float y) {
- this.x = x;
- this.y = y;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.lwjgl.util.vector.WritableVector3f#set(float, float, float)
- */
- public void set(float x, float y, float z) {
- this.x = x;
- this.y = y;
- this.z = z;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.lwjgl.util.vector.WritableVector4f#set(float, float, float,
- * float)
- */
- public void set(float x, float y, float z, float w) {
- this.x = x;
- this.y = y;
- this.z = z;
- this.w = w;
- }
-
- /**
- * Load from another Vector4f
- *
- * @param src
- * The source vector
- * @return this
- */
- public Quaternion set(ReadableVector4f src) {
- x = src.getX();
- y = src.getY();
- z = src.getZ();
- w = src.getW();
- return this;
- }
-
- /**
- * Set this quaternion to the multiplication identity.
- * @return this
- */
- public Quaternion setIdentity() {
- return setIdentity(this);
- }
-
- /**
- * Set the given quaternion to the multiplication identity.
- * @param q The quaternion
- * @return q
- */
- public static Quaternion setIdentity(Quaternion q) {
- q.x = 0;
- q.y = 0;
- q.z = 0;
- q.w = 1;
- return q;
- }
-
- /**
- * @return the length squared of the quaternion
- */
- public float lengthSquared() {
- return x * x + y * y + z * z + w * w;
- }
-
- /**
- * Normalise the source quaternion and place the result in another quaternion.
- *
- * @param src
- * The source quaternion
- * @param dest
- * The destination quaternion, or null if a new quaternion is to be
- * created
- * @return The normalised quaternion
- */
- public static Quaternion normalise(Quaternion src, Quaternion dest) {
- float inv_l = 1f/src.length();
-
- if (dest == null)
- dest = new Quaternion();
-
- dest.set(src.x * inv_l, src.y * inv_l, src.z * inv_l, src.w * inv_l);
-
- return dest;
- }
-
- /**
- * Normalise this quaternion and place the result in another quaternion.
- *
- * @param dest
- * The destination quaternion, or null if a new quaternion is to be
- * created
- * @return the normalised quaternion
- */
- public Quaternion normalise(Quaternion dest) {
- return normalise(this, dest);
- }
-
- /**
- * The dot product of two quaternions
- *
- * @param left
- * The LHS quat
- * @param right
- * The RHS quat
- * @return left dot right
- */
- public static float dot(Quaternion left, Quaternion right) {
- return left.x * right.x + left.y * right.y + left.z * right.z + left.w
- * right.w;
- }
-
- /**
- * Calculate the conjugate of this quaternion and put it into the given one
- *
- * @param dest
- * The quaternion which should be set to the conjugate of this
- * quaternion
- */
- public Quaternion negate(Quaternion dest) {
- return negate(this, dest);
- }
-
- /**
- * Calculate the conjugate of this quaternion and put it into the given one
- *
- * @param src
- * The source quaternion
- * @param dest
- * The quaternion which should be set to the conjugate of this
- * quaternion
- */
- public static Quaternion negate(Quaternion src, Quaternion dest) {
- if (dest == null)
- dest = new Quaternion();
-
- dest.x = -src.x;
- dest.y = -src.y;
- dest.z = -src.z;
- dest.w = src.w;
-
- return dest;
- }
-
- /**
- * Calculate the conjugate of this quaternion
- */
- public Vector negate() {
- return negate(this, this);
- }
-
- /* (non-Javadoc)
- * @see org.lwjgl.util.vector.Vector#load(java.nio.FloatBuffer)
- */
- public Vector load(FloatBuffer buf) {
- x = buf.get();
- y = buf.get();
- z = buf.get();
- w = buf.get();
- return this;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.lwjgl.vector.Vector#scale(float)
- */
- public Vector scale(float scale) {
- return scale(scale, this, this);
- }
-
- /**
- * Scale the source quaternion by scale and put the result in the destination
- * @param scale The amount to scale by
- * @param src The source quaternion
- * @param dest The destination quaternion, or null if a new quaternion is to be created
- * @return The scaled quaternion
- */
- public static Quaternion scale(float scale, Quaternion src, Quaternion dest) {
- if (dest == null)
- dest = new Quaternion();
- dest.x = src.x * scale;
- dest.y = src.y * scale;
- dest.z = src.z * scale;
- dest.w = src.w * scale;
- return dest;
- }
-
- /* (non-Javadoc)
- * @see org.lwjgl.util.vector.ReadableVector#store(java.nio.FloatBuffer)
- */
- public Vector store(FloatBuffer buf) {
- buf.put(x);
- buf.put(y);
- buf.put(z);
- buf.put(w);
-
- return this;
- }
-
- /**
- * @return x
- */
- public final float getX() {
- return x;
- }
-
- /**
- * @return y
- */
- public final float getY() {
- return y;
- }
-
- /**
- * Set X
- *
- * @param x
- */
- public final void setX(float x) {
- this.x = x;
- }
-
- /**
- * Set Y
- *
- * @param y
- */
- public final void setY(float y) {
- this.y = y;
- }
-
- /**
- * Set Z
- *
- * @param z
- */
- public void setZ(float z) {
- this.z = z;
- }
-
- /*
- * (Overrides)
- *
- * @see org.lwjgl.vector.ReadableVector3f#getZ()
- */
- public float getZ() {
- return z;
- }
-
- /**
- * Set W
- *
- * @param w
- */
- public void setW(float w) {
- this.w = w;
- }
-
- /*
- * (Overrides)
- *
- * @see org.lwjgl.vector.ReadableVector3f#getW()
- */
- public float getW() {
- return w;
- }
-
- public String toString() {
- return "Quaternion: " + x + " " + y + " " + z + " " + w;
- }
-
- /**
- * Sets the value of this quaternion to the quaternion product of
- * quaternions left and right (this = left * right). Note that this is safe
- * for aliasing (e.g. this can be left or right).
- *
- * @param left
- * the first quaternion
- * @param right
- * the second quaternion
- */
- public static Quaternion mul(Quaternion left, Quaternion right,
- Quaternion dest) {
- if (dest == null)
- dest = new Quaternion();
- dest.set(left.x * right.w + left.w * right.x + left.y * right.z
- - left.z * right.y, left.y * right.w + left.w * right.y
- + left.z * right.x - left.x * right.z, left.z * right.w
- + left.w * right.z + left.x * right.y - left.y * right.x,
- left.w * right.w - left.x * right.x - left.y * right.y
- - left.z * right.z);
- return dest;
- }
-
- /**
- *
- * Multiplies quaternion left by the inverse of quaternion right and places
- * the value into this quaternion. The value of both argument quaternions is
- * preservered (this = left * right^-1).
- *
- * @param left
- * the left quaternion
- * @param right
- * the right quaternion
- */
- public static Quaternion mulInverse(Quaternion left, Quaternion right,
- Quaternion dest) {
- float n = right.lengthSquared();
- // zero-div may occur.
- n = (n == 0.0 ? n : 1 / n);
- // store on stack once for aliasing-safty
- if (dest == null)
- dest = new Quaternion();
- dest
- .set((left.x * right.w - left.w * right.x - left.y
- * right.z + left.z * right.y)
- * n, (left.y * right.w - left.w * right.y - left.z
- * right.x + left.x * right.z)
- * n, (left.z * right.w - left.w * right.z - left.x
- * right.y + left.y * right.x)
- * n, (left.w * right.w + left.x * right.x + left.y
- * right.y + left.z * right.z)
- * n);
-
- return dest;
- }
-
- /**
- * Sets the value of this quaternion to the equivalent rotation of the
- * Axis-Angle argument.
- *
- * @param a1
- * the axis-angle: (x,y,z) is the axis and w is the angle
- */
- public final void setFromAxisAngle(Vector4f a1) {
- x = a1.x;
- y = a1.y;
- z = a1.z;
- float n = (float) Math.sqrt(x * x + y * y + z * z);
- // zero-div may occur.
- float s = (float) (Math.sin(0.5 * a1.w) / n);
- x *= s;
- y *= s;
- z *= s;
- w = (float) Math.cos(0.5 * a1.w);
- }
-
- /**
- * Sets the value of this quaternion using the rotational component of the
- * passed matrix.
- *
- * @param m
- * The matrix
- * @return this
- */
- public final Quaternion setFromMatrix(Matrix4f m) {
- return setFromMatrix(m, this);
- }
-
- /**
- * Sets the value of the source quaternion using the rotational component of the
- * passed matrix.
- *
- * @param m
- * The source matrix
- * @param q
- * The destination quaternion, or null if a new quaternion is to be created
- * @return q
- */
- public final static Quaternion setFromMatrix(Matrix4f m, Quaternion q) {
- return q.setFromMat(m.m00, m.m01, m.m02, m.m10, m.m11, m.m12, m.m20,
- m.m21, m.m22);
- }
-
- /**
- * Sets the value of this quaternion using the rotational component of the
- * passed matrix.
- *
- * @param m
- * The source matrix
- */
- public final Quaternion setFromMatrix(Matrix3f m) {
- return setFromMatrix(m, this);
- }
-
- /**
- * Sets the value of the source quaternion using the rotational component of the
- * passed matrix.
- *
- * @param m
- * The source matrix
- * @param q
- * The destination quaternion, or null if a new quaternion is to be created
- * @return q
- */
- public static final Quaternion setFromMatrix(Matrix3f m, Quaternion q) {
- return q.setFromMat(m.m00, m.m01, m.m02, m.m10, m.m11, m.m12, m.m20,
- m.m21, m.m22);
- }
-
- /**
- * Private method to perform the matrix-to-quaternion conversion
- */
- private Quaternion setFromMat(float m00, float m01, float m02, float m10,
- float m11, float m12, float m20, float m21, float m22) {
-
- float s;
- float tr = m00 + m11 + m22;
- if (tr >= 0.0) {
- s = (float) Math.sqrt(tr + 1.0);
- w = s * 0.5f;
- s = 0.5f / s;
- x = (m21 - m12) * s;
- y = (m02 - m20) * s;
- z = (m10 - m01) * s;
- } else {
- float max = Math.max(Math.max(m00, m11), m22);
- if (max == m00) {
- s = (float) Math.sqrt(m00 - (m11 + m22) + 1.0);
- x = s * 0.5f;
- s = 0.5f / s;
- y = (m01 + m10) * s;
- z = (m20 + m02) * s;
- w = (m21 - m12) * s;
- } else if (max == m11) {
- s = (float) Math.sqrt(m11 - (m22 + m00) + 1.0);
- y = s * 0.5f;
- s = 0.5f / s;
- z = (m12 + m21) * s;
- x = (m01 + m10) * s;
- w = (m02 - m20) * s;
- } else {
- s = (float) Math.sqrt(m22 - (m00 + m11) + 1.0);
- z = s * 0.5f;
- s = 0.5f / s;
- x = (m20 + m02) * s;
- y = (m12 + m21) * s;
- w = (m10 - m01) * s;
- }
- }
- return this;
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.vector;
+
+/**
+ *
+ * Quaternions for LWJGL!
+ *
+ * @author fbi
+ * @version $Revision: 2983 $
+ * $Id: Quaternion.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+import java.nio.FloatBuffer;
+
+public class Quaternion extends Vector implements ReadableVector4f {
+ private static final long serialVersionUID = 1L;
+
+ public float x, y, z, w;
+
+ /**
+ * C'tor. The quaternion will be initialized to the identity.
+ */
+ public Quaternion() {
+ super();
+ setIdentity();
+ }
+
+ /**
+ * C'tor
+ *
+ * @param src
+ */
+ public Quaternion(ReadableVector4f src) {
+ set(src);
+ }
+
+ /**
+ * C'tor
+ *
+ */
+ public Quaternion(float x, float y, float z, float w) {
+ set(x, y, z, w);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.lwjgl.util.vector.WritableVector2f#set(float, float)
+ */
+ public void set(float x, float y) {
+ this.x = x;
+ this.y = y;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.lwjgl.util.vector.WritableVector3f#set(float, float, float)
+ */
+ public void set(float x, float y, float z) {
+ this.x = x;
+ this.y = y;
+ this.z = z;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.lwjgl.util.vector.WritableVector4f#set(float, float, float,
+ * float)
+ */
+ public void set(float x, float y, float z, float w) {
+ this.x = x;
+ this.y = y;
+ this.z = z;
+ this.w = w;
+ }
+
+ /**
+ * Load from another Vector4f
+ *
+ * @param src
+ * The source vector
+ * @return this
+ */
+ public Quaternion set(ReadableVector4f src) {
+ x = src.getX();
+ y = src.getY();
+ z = src.getZ();
+ w = src.getW();
+ return this;
+ }
+
+ /**
+ * Set this quaternion to the multiplication identity.
+ * @return this
+ */
+ public Quaternion setIdentity() {
+ return setIdentity(this);
+ }
+
+ /**
+ * Set the given quaternion to the multiplication identity.
+ * @param q The quaternion
+ * @return q
+ */
+ public static Quaternion setIdentity(Quaternion q) {
+ q.x = 0;
+ q.y = 0;
+ q.z = 0;
+ q.w = 1;
+ return q;
+ }
+
+ /**
+ * @return the length squared of the quaternion
+ */
+ public float lengthSquared() {
+ return x * x + y * y + z * z + w * w;
+ }
+
+ /**
+ * Normalise the source quaternion and place the result in another quaternion.
+ *
+ * @param src
+ * The source quaternion
+ * @param dest
+ * The destination quaternion, or null if a new quaternion is to be
+ * created
+ * @return The normalised quaternion
+ */
+ public static Quaternion normalise(Quaternion src, Quaternion dest) {
+ float inv_l = 1f/src.length();
+
+ if (dest == null)
+ dest = new Quaternion();
+
+ dest.set(src.x * inv_l, src.y * inv_l, src.z * inv_l, src.w * inv_l);
+
+ return dest;
+ }
+
+ /**
+ * Normalise this quaternion and place the result in another quaternion.
+ *
+ * @param dest
+ * The destination quaternion, or null if a new quaternion is to be
+ * created
+ * @return the normalised quaternion
+ */
+ public Quaternion normalise(Quaternion dest) {
+ return normalise(this, dest);
+ }
+
+ /**
+ * The dot product of two quaternions
+ *
+ * @param left
+ * The LHS quat
+ * @param right
+ * The RHS quat
+ * @return left dot right
+ */
+ public static float dot(Quaternion left, Quaternion right) {
+ return left.x * right.x + left.y * right.y + left.z * right.z + left.w
+ * right.w;
+ }
+
+ /**
+ * Calculate the conjugate of this quaternion and put it into the given one
+ *
+ * @param dest
+ * The quaternion which should be set to the conjugate of this
+ * quaternion
+ */
+ public Quaternion negate(Quaternion dest) {
+ return negate(this, dest);
+ }
+
+ /**
+ * Calculate the conjugate of this quaternion and put it into the given one
+ *
+ * @param src
+ * The source quaternion
+ * @param dest
+ * The quaternion which should be set to the conjugate of this
+ * quaternion
+ */
+ public static Quaternion negate(Quaternion src, Quaternion dest) {
+ if (dest == null)
+ dest = new Quaternion();
+
+ dest.x = -src.x;
+ dest.y = -src.y;
+ dest.z = -src.z;
+ dest.w = src.w;
+
+ return dest;
+ }
+
+ /**
+ * Calculate the conjugate of this quaternion
+ */
+ public Vector negate() {
+ return negate(this, this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.lwjgl.util.vector.Vector#load(java.nio.FloatBuffer)
+ */
+ public Vector load(FloatBuffer buf) {
+ x = buf.get();
+ y = buf.get();
+ z = buf.get();
+ w = buf.get();
+ return this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.lwjgl.vector.Vector#scale(float)
+ */
+ public Vector scale(float scale) {
+ return scale(scale, this, this);
+ }
+
+ /**
+ * Scale the source quaternion by scale and put the result in the destination
+ * @param scale The amount to scale by
+ * @param src The source quaternion
+ * @param dest The destination quaternion, or null if a new quaternion is to be created
+ * @return The scaled quaternion
+ */
+ public static Quaternion scale(float scale, Quaternion src, Quaternion dest) {
+ if (dest == null)
+ dest = new Quaternion();
+ dest.x = src.x * scale;
+ dest.y = src.y * scale;
+ dest.z = src.z * scale;
+ dest.w = src.w * scale;
+ return dest;
+ }
+
+ /* (non-Javadoc)
+ * @see org.lwjgl.util.vector.ReadableVector#store(java.nio.FloatBuffer)
+ */
+ public Vector store(FloatBuffer buf) {
+ buf.put(x);
+ buf.put(y);
+ buf.put(z);
+ buf.put(w);
+
+ return this;
+ }
+
+ /**
+ * @return x
+ */
+ public final float getX() {
+ return x;
+ }
+
+ /**
+ * @return y
+ */
+ public final float getY() {
+ return y;
+ }
+
+ /**
+ * Set X
+ *
+ * @param x
+ */
+ public final void setX(float x) {
+ this.x = x;
+ }
+
+ /**
+ * Set Y
+ *
+ * @param y
+ */
+ public final void setY(float y) {
+ this.y = y;
+ }
+
+ /**
+ * Set Z
+ *
+ * @param z
+ */
+ public void setZ(float z) {
+ this.z = z;
+ }
+
+ /*
+ * (Overrides)
+ *
+ * @see org.lwjgl.vector.ReadableVector3f#getZ()
+ */
+ public float getZ() {
+ return z;
+ }
+
+ /**
+ * Set W
+ *
+ * @param w
+ */
+ public void setW(float w) {
+ this.w = w;
+ }
+
+ /*
+ * (Overrides)
+ *
+ * @see org.lwjgl.vector.ReadableVector3f#getW()
+ */
+ public float getW() {
+ return w;
+ }
+
+ public String toString() {
+ return "Quaternion: " + x + " " + y + " " + z + " " + w;
+ }
+
+ /**
+ * Sets the value of this quaternion to the quaternion product of
+ * quaternions left and right (this = left * right). Note that this is safe
+ * for aliasing (e.g. this can be left or right).
+ *
+ * @param left
+ * the first quaternion
+ * @param right
+ * the second quaternion
+ */
+ public static Quaternion mul(Quaternion left, Quaternion right,
+ Quaternion dest) {
+ if (dest == null)
+ dest = new Quaternion();
+ dest.set(left.x * right.w + left.w * right.x + left.y * right.z
+ - left.z * right.y, left.y * right.w + left.w * right.y
+ + left.z * right.x - left.x * right.z, left.z * right.w
+ + left.w * right.z + left.x * right.y - left.y * right.x,
+ left.w * right.w - left.x * right.x - left.y * right.y
+ - left.z * right.z);
+ return dest;
+ }
+
+ /**
+ *
+ * Multiplies quaternion left by the inverse of quaternion right and places
+ * the value into this quaternion. The value of both argument quaternions is
+ * preservered (this = left * right^-1).
+ *
+ * @param left
+ * the left quaternion
+ * @param right
+ * the right quaternion
+ */
+ public static Quaternion mulInverse(Quaternion left, Quaternion right,
+ Quaternion dest) {
+ float n = right.lengthSquared();
+ // zero-div may occur.
+ n = (n == 0.0 ? n : 1 / n);
+ // store on stack once for aliasing-safty
+ if (dest == null)
+ dest = new Quaternion();
+ dest
+ .set((left.x * right.w - left.w * right.x - left.y
+ * right.z + left.z * right.y)
+ * n, (left.y * right.w - left.w * right.y - left.z
+ * right.x + left.x * right.z)
+ * n, (left.z * right.w - left.w * right.z - left.x
+ * right.y + left.y * right.x)
+ * n, (left.w * right.w + left.x * right.x + left.y
+ * right.y + left.z * right.z)
+ * n);
+
+ return dest;
+ }
+
+ /**
+ * Sets the value of this quaternion to the equivalent rotation of the
+ * Axis-Angle argument.
+ *
+ * @param a1
+ * the axis-angle: (x,y,z) is the axis and w is the angle
+ */
+ public final void setFromAxisAngle(Vector4f a1) {
+ x = a1.x;
+ y = a1.y;
+ z = a1.z;
+ float n = (float) Math.sqrt(x * x + y * y + z * z);
+ // zero-div may occur.
+ float s = (float) (Math.sin(0.5 * a1.w) / n);
+ x *= s;
+ y *= s;
+ z *= s;
+ w = (float) Math.cos(0.5 * a1.w);
+ }
+
+ /**
+ * Sets the value of this quaternion using the rotational component of the
+ * passed matrix.
+ *
+ * @param m
+ * The matrix
+ * @return this
+ */
+ public final Quaternion setFromMatrix(Matrix4f m) {
+ return setFromMatrix(m, this);
+ }
+
+ /**
+ * Sets the value of the source quaternion using the rotational component of the
+ * passed matrix.
+ *
+ * @param m
+ * The source matrix
+ * @param q
+ * The destination quaternion, or null if a new quaternion is to be created
+ * @return q
+ */
+ public final static Quaternion setFromMatrix(Matrix4f m, Quaternion q) {
+ return q.setFromMat(m.m00, m.m01, m.m02, m.m10, m.m11, m.m12, m.m20,
+ m.m21, m.m22);
+ }
+
+ /**
+ * Sets the value of this quaternion using the rotational component of the
+ * passed matrix.
+ *
+ * @param m
+ * The source matrix
+ */
+ public final Quaternion setFromMatrix(Matrix3f m) {
+ return setFromMatrix(m, this);
+ }
+
+ /**
+ * Sets the value of the source quaternion using the rotational component of the
+ * passed matrix.
+ *
+ * @param m
+ * The source matrix
+ * @param q
+ * The destination quaternion, or null if a new quaternion is to be created
+ * @return q
+ */
+ public static final Quaternion setFromMatrix(Matrix3f m, Quaternion q) {
+ return q.setFromMat(m.m00, m.m01, m.m02, m.m10, m.m11, m.m12, m.m20,
+ m.m21, m.m22);
+ }
+
+ /**
+ * Private method to perform the matrix-to-quaternion conversion
+ */
+ private Quaternion setFromMat(float m00, float m01, float m02, float m10,
+ float m11, float m12, float m20, float m21, float m22) {
+
+ float s;
+ float tr = m00 + m11 + m22;
+ if (tr >= 0.0) {
+ s = (float) Math.sqrt(tr + 1.0);
+ w = s * 0.5f;
+ s = 0.5f / s;
+ x = (m21 - m12) * s;
+ y = (m02 - m20) * s;
+ z = (m10 - m01) * s;
+ } else {
+ float max = Math.max(Math.max(m00, m11), m22);
+ if (max == m00) {
+ s = (float) Math.sqrt(m00 - (m11 + m22) + 1.0);
+ x = s * 0.5f;
+ s = 0.5f / s;
+ y = (m01 + m10) * s;
+ z = (m20 + m02) * s;
+ w = (m21 - m12) * s;
+ } else if (max == m11) {
+ s = (float) Math.sqrt(m11 - (m22 + m00) + 1.0);
+ y = s * 0.5f;
+ s = 0.5f / s;
+ z = (m12 + m21) * s;
+ x = (m01 + m10) * s;
+ w = (m02 - m20) * s;
+ } else {
+ s = (float) Math.sqrt(m22 - (m00 + m11) + 1.0);
+ z = s * 0.5f;
+ s = 0.5f / s;
+ x = (m20 + m02) * s;
+ y = (m12 + m21) * s;
+ w = (m10 - m01) * s;
+ }
+ }
+ return this;
+ }
+}
diff --git a/src/java/org/lwjgl/util/vector/ReadableVector.java b/src/java/org/lwjgl/util/vector/ReadableVector.java
index 20194af..61abdb6 100644
--- a/src/java/org/lwjgl/util/vector/ReadableVector.java
+++ b/src/java/org/lwjgl/util/vector/ReadableVector.java
@@ -1,54 +1,54 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.vector;
-
-import java.nio.FloatBuffer;
-
-/**
- * @author foo
- */
-public interface ReadableVector {
- /**
- * @return the length of the vector
- */
- public float length();
- /**
- * @return the length squared of the vector
- */
- public float lengthSquared();
- /**
- * Store this vector in a FloatBuffer
- * @param buf The buffer to store it in, at the current position
- * @return this
- */
- public Vector store(FloatBuffer buf);
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.vector;
+
+import java.nio.FloatBuffer;
+
+/**
+ * @author foo
+ */
+public interface ReadableVector {
+ /**
+ * @return the length of the vector
+ */
+ public float length();
+ /**
+ * @return the length squared of the vector
+ */
+ public float lengthSquared();
+ /**
+ * Store this vector in a FloatBuffer
+ * @param buf The buffer to store it in, at the current position
+ * @return this
+ */
+ public Vector store(FloatBuffer buf);
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/util/vector/ReadableVector2f.java b/src/java/org/lwjgl/util/vector/ReadableVector2f.java
index f6e883a..686ace5 100644
--- a/src/java/org/lwjgl/util/vector/ReadableVector2f.java
+++ b/src/java/org/lwjgl/util/vector/ReadableVector2f.java
@@ -1,46 +1,46 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.vector;
-
-/**
- * @author foo
- */
-public interface ReadableVector2f extends ReadableVector {
- /**
- * @return x
- */
- public float getX();
- /**
- * @return y
- */
- public float getY();
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.vector;
+
+/**
+ * @author foo
+ */
+public interface ReadableVector2f extends ReadableVector {
+ /**
+ * @return x
+ */
+ public float getX();
+ /**
+ * @return y
+ */
+ public float getY();
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/util/vector/ReadableVector3f.java b/src/java/org/lwjgl/util/vector/ReadableVector3f.java
index c877bd1..53ae9fe 100644
--- a/src/java/org/lwjgl/util/vector/ReadableVector3f.java
+++ b/src/java/org/lwjgl/util/vector/ReadableVector3f.java
@@ -1,42 +1,42 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.vector;
-
-/**
- * @author foo
- */
-public interface ReadableVector3f extends ReadableVector2f {
- /**
- * @return z
- */
- public float getZ();
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.vector;
+
+/**
+ * @author foo
+ */
+public interface ReadableVector3f extends ReadableVector2f {
+ /**
+ * @return z
+ */
+ public float getZ();
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/util/vector/ReadableVector4f.java b/src/java/org/lwjgl/util/vector/ReadableVector4f.java
index 3ca837c..d7adeba 100644
--- a/src/java/org/lwjgl/util/vector/ReadableVector4f.java
+++ b/src/java/org/lwjgl/util/vector/ReadableVector4f.java
@@ -1,44 +1,44 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.vector;
-
-/**
- * @author foo
- */
-public interface ReadableVector4f extends ReadableVector3f {
-
- /**
- * @return w
- */
- public float getW();
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.vector;
+
+/**
+ * @author foo
+ */
+public interface ReadableVector4f extends ReadableVector3f {
+
+ /**
+ * @return w
+ */
+ public float getW();
+
+}
diff --git a/src/java/org/lwjgl/util/vector/Vector.java b/src/java/org/lwjgl/util/vector/Vector.java
index ea5b8d8..106cc2a 100644
--- a/src/java/org/lwjgl/util/vector/Vector.java
+++ b/src/java/org/lwjgl/util/vector/Vector.java
@@ -1,112 +1,112 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.vector;
-
-import java.io.Serializable;
-import java.nio.FloatBuffer;
-
-/**
- *
- * Base class for vectors.
- *
- * @author cix_foo <cix_foo at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: Vector.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public abstract class Vector implements Serializable, ReadableVector {
-
- /**
- * Constructor for Vector.
- */
- public Vector() {
- super();
- }
-
- /**
- * @return the length of the vector
- */
- public final float length() {
- return (float) Math.sqrt(lengthSquared());
- }
-
-
- /**
- * @return the length squared of the vector
- */
- public abstract float lengthSquared();
-
- /**
- * Load this vector from a FloatBuffer
- * @param buf The buffer to load it from, at the current position
- * @return this
- */
- public abstract Vector load(FloatBuffer buf);
-
- /**
- * Negate a vector
- * @return this
- */
- public abstract Vector negate();
-
-
- /**
- * Normalise this vector
- * @return this
- */
- public final Vector normalise() {
- float len = length();
- if (len != 0.0f) {
- float l = 1.0f / len;
- return scale(l);
- } else
- throw new IllegalStateException("Zero length vector");
- }
-
-
- /**
- * Store this vector in a FloatBuffer
- * @param buf The buffer to store it in, at the current position
- * @return this
- */
- public abstract Vector store(FloatBuffer buf);
-
-
- /**
- * Scale this vector
- * @param scale The scale factor
- * @return this
- */
- public abstract Vector scale(float scale);
-
-
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.vector;
+
+import java.io.Serializable;
+import java.nio.FloatBuffer;
+
+/**
+ *
+ * Base class for vectors.
+ *
+ * @author cix_foo <cix_foo at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: Vector.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public abstract class Vector implements Serializable, ReadableVector {
+
+ /**
+ * Constructor for Vector.
+ */
+ public Vector() {
+ super();
+ }
+
+ /**
+ * @return the length of the vector
+ */
+ public final float length() {
+ return (float) Math.sqrt(lengthSquared());
+ }
+
+
+ /**
+ * @return the length squared of the vector
+ */
+ public abstract float lengthSquared();
+
+ /**
+ * Load this vector from a FloatBuffer
+ * @param buf The buffer to load it from, at the current position
+ * @return this
+ */
+ public abstract Vector load(FloatBuffer buf);
+
+ /**
+ * Negate a vector
+ * @return this
+ */
+ public abstract Vector negate();
+
+
+ /**
+ * Normalise this vector
+ * @return this
+ */
+ public final Vector normalise() {
+ float len = length();
+ if (len != 0.0f) {
+ float l = 1.0f / len;
+ return scale(l);
+ } else
+ throw new IllegalStateException("Zero length vector");
+ }
+
+
+ /**
+ * Store this vector in a FloatBuffer
+ * @param buf The buffer to store it in, at the current position
+ * @return this
+ */
+ public abstract Vector store(FloatBuffer buf);
+
+
+ /**
+ * Scale this vector
+ * @param scale The scale factor
+ * @return this
+ */
+ public abstract Vector scale(float scale);
+
+
+
+}
diff --git a/src/java/org/lwjgl/util/vector/Vector2f.java b/src/java/org/lwjgl/util/vector/Vector2f.java
index 59d5f13..363f492 100644
--- a/src/java/org/lwjgl/util/vector/Vector2f.java
+++ b/src/java/org/lwjgl/util/vector/Vector2f.java
@@ -1,290 +1,290 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.vector;
-
-import java.io.Serializable;
-import java.nio.FloatBuffer;
-
-/**
- *
- * Holds a 2-tuple vector.
- *
- * @author cix_foo <cix_foo at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: Vector2f.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-public class Vector2f extends Vector implements Serializable, ReadableVector2f, WritableVector2f {
-
- private static final long serialVersionUID = 1L;
-
- public float x, y;
-
- /**
- * Constructor for Vector3f.
- */
- public Vector2f() {
- super();
- }
-
- /**
- * Constructor
- */
- public Vector2f(ReadableVector2f src) {
- set(src);
- }
-
- /**
- * Constructor
- */
- public Vector2f(float x, float y) {
- set(x, y);
- }
-
- /* (non-Javadoc)
- * @see org.lwjgl.util.vector.WritableVector2f#set(float, float)
- */
- public void set(float x, float y) {
- this.x = x;
- this.y = y;
- }
-
- /**
- * Load from another Vector2f
- * @param src The source vector
- * @return this
- */
- public Vector2f set(ReadableVector2f src) {
- x = src.getX();
- y = src.getY();
- return this;
- }
-
- /**
- * @return the length squared of the vector
- */
- public float lengthSquared() {
- return x * x + y * y;
- }
-
- /**
- * Translate a vector
- * @param x The translation in x
- * @param y the translation in y
- * @return this
- */
- public Vector2f translate(float x, float y) {
- this.x += x;
- this.y += y;
- return this;
- }
-
- /**
- * Negate a vector
- * @return this
- */
- public Vector negate() {
- x = -x;
- y = -y;
- return this;
- }
-
- /**
- * Negate a vector and place the result in a destination vector.
- * @param dest The destination vector or null if a new vector is to be created
- * @return the negated vector
- */
- public Vector2f negate(Vector2f dest) {
- if (dest == null)
- dest = new Vector2f();
- dest.x = -x;
- dest.y = -y;
- return dest;
- }
-
-
- /**
- * Normalise this vector and place the result in another vector.
- * @param dest The destination vector, or null if a new vector is to be created
- * @return the normalised vector
- */
- public Vector2f normalise(Vector2f dest) {
- float l = length();
-
- if (dest == null)
- dest = new Vector2f(x / l, y / l);
- else
- dest.set(x / l, y / l);
-
- return dest;
- }
-
- /**
- * The dot product of two vectors is calculated as
- * v1.x * v2.x + v1.y * v2.y + v1.z * v2.z
- * @param left The LHS vector
- * @param right The RHS vector
- * @return left dot right
- */
- public static float dot(Vector2f left, Vector2f right) {
- return left.x * right.x + left.y * right.y;
- }
-
-
-
- /**
- * Calculate the angle between two vectors, in radians
- * @param a A vector
- * @param b The other vector
- * @return the angle between the two vectors, in radians
- */
- public static float angle(Vector2f a, Vector2f b) {
- float dls = dot(a, b) / (a.length() * b.length());
- if (dls < -1f)
- dls = -1f;
- else if (dls > 1.0f)
- dls = 1.0f;
- return (float)Math.acos(dls);
- }
-
- /**
- * Add a vector to another vector and place the result in a destination
- * vector.
- * @param left The LHS vector
- * @param right The RHS vector
- * @param dest The destination vector, or null if a new vector is to be created
- * @return the sum of left and right in dest
- */
- public static Vector2f add(Vector2f left, Vector2f right, Vector2f dest) {
- if (dest == null)
- return new Vector2f(left.x + right.x, left.y + right.y);
- else {
- dest.set(left.x + right.x, left.y + right.y);
- return dest;
- }
- }
-
- /**
- * Subtract a vector from another vector and place the result in a destination
- * vector.
- * @param left The LHS vector
- * @param right The RHS vector
- * @param dest The destination vector, or null if a new vector is to be created
- * @return left minus right in dest
- */
- public static Vector2f sub(Vector2f left, Vector2f right, Vector2f dest) {
- if (dest == null)
- return new Vector2f(left.x - right.x, left.y - right.y);
- else {
- dest.set(left.x - right.x, left.y - right.y);
- return dest;
- }
- }
-
- /**
- * Store this vector in a FloatBuffer
- * @param buf The buffer to store it in, at the current position
- * @return this
- */
- public Vector store(FloatBuffer buf) {
- buf.put(x);
- buf.put(y);
- return this;
- }
-
- /**
- * Load this vector from a FloatBuffer
- * @param buf The buffer to load it from, at the current position
- * @return this
- */
- public Vector load(FloatBuffer buf) {
- x = buf.get();
- y = buf.get();
- return this;
- }
-
- /* (non-Javadoc)
- * @see org.lwjgl.vector.Vector#scale(float)
- */
- public Vector scale(float scale) {
-
- x *= scale;
- y *= scale;
-
- return this;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer sb = new StringBuffer(64);
-
- sb.append("Vector2f[");
- sb.append(x);
- sb.append(", ");
- sb.append(y);
- sb.append(']');
- return sb.toString();
- }
-
- /**
- * @return x
- */
- public final float getX() {
- return x;
- }
-
- /**
- * @return y
- */
- public final float getY() {
- return y;
- }
-
- /**
- * Set X
- * @param x
- */
- public final void setX(float x) {
- this.x = x;
- }
-
- /**
- * Set Y
- * @param y
- */
- public final void setY(float y) {
- this.y = y;
- }
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.vector;
+
+import java.io.Serializable;
+import java.nio.FloatBuffer;
+
+/**
+ *
+ * Holds a 2-tuple vector.
+ *
+ * @author cix_foo <cix_foo at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: Vector2f.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+public class Vector2f extends Vector implements Serializable, ReadableVector2f, WritableVector2f {
+
+ private static final long serialVersionUID = 1L;
+
+ public float x, y;
+
+ /**
+ * Constructor for Vector3f.
+ */
+ public Vector2f() {
+ super();
+ }
+
+ /**
+ * Constructor
+ */
+ public Vector2f(ReadableVector2f src) {
+ set(src);
+ }
+
+ /**
+ * Constructor
+ */
+ public Vector2f(float x, float y) {
+ set(x, y);
+ }
+
+ /* (non-Javadoc)
+ * @see org.lwjgl.util.vector.WritableVector2f#set(float, float)
+ */
+ public void set(float x, float y) {
+ this.x = x;
+ this.y = y;
+ }
+
+ /**
+ * Load from another Vector2f
+ * @param src The source vector
+ * @return this
+ */
+ public Vector2f set(ReadableVector2f src) {
+ x = src.getX();
+ y = src.getY();
+ return this;
+ }
+
+ /**
+ * @return the length squared of the vector
+ */
+ public float lengthSquared() {
+ return x * x + y * y;
+ }
+
+ /**
+ * Translate a vector
+ * @param x The translation in x
+ * @param y the translation in y
+ * @return this
+ */
+ public Vector2f translate(float x, float y) {
+ this.x += x;
+ this.y += y;
+ return this;
+ }
+
+ /**
+ * Negate a vector
+ * @return this
+ */
+ public Vector negate() {
+ x = -x;
+ y = -y;
+ return this;
+ }
+
+ /**
+ * Negate a vector and place the result in a destination vector.
+ * @param dest The destination vector or null if a new vector is to be created
+ * @return the negated vector
+ */
+ public Vector2f negate(Vector2f dest) {
+ if (dest == null)
+ dest = new Vector2f();
+ dest.x = -x;
+ dest.y = -y;
+ return dest;
+ }
+
+
+ /**
+ * Normalise this vector and place the result in another vector.
+ * @param dest The destination vector, or null if a new vector is to be created
+ * @return the normalised vector
+ */
+ public Vector2f normalise(Vector2f dest) {
+ float l = length();
+
+ if (dest == null)
+ dest = new Vector2f(x / l, y / l);
+ else
+ dest.set(x / l, y / l);
+
+ return dest;
+ }
+
+ /**
+ * The dot product of two vectors is calculated as
+ * v1.x * v2.x + v1.y * v2.y + v1.z * v2.z
+ * @param left The LHS vector
+ * @param right The RHS vector
+ * @return left dot right
+ */
+ public static float dot(Vector2f left, Vector2f right) {
+ return left.x * right.x + left.y * right.y;
+ }
+
+
+
+ /**
+ * Calculate the angle between two vectors, in radians
+ * @param a A vector
+ * @param b The other vector
+ * @return the angle between the two vectors, in radians
+ */
+ public static float angle(Vector2f a, Vector2f b) {
+ float dls = dot(a, b) / (a.length() * b.length());
+ if (dls < -1f)
+ dls = -1f;
+ else if (dls > 1.0f)
+ dls = 1.0f;
+ return (float)Math.acos(dls);
+ }
+
+ /**
+ * Add a vector to another vector and place the result in a destination
+ * vector.
+ * @param left The LHS vector
+ * @param right The RHS vector
+ * @param dest The destination vector, or null if a new vector is to be created
+ * @return the sum of left and right in dest
+ */
+ public static Vector2f add(Vector2f left, Vector2f right, Vector2f dest) {
+ if (dest == null)
+ return new Vector2f(left.x + right.x, left.y + right.y);
+ else {
+ dest.set(left.x + right.x, left.y + right.y);
+ return dest;
+ }
+ }
+
+ /**
+ * Subtract a vector from another vector and place the result in a destination
+ * vector.
+ * @param left The LHS vector
+ * @param right The RHS vector
+ * @param dest The destination vector, or null if a new vector is to be created
+ * @return left minus right in dest
+ */
+ public static Vector2f sub(Vector2f left, Vector2f right, Vector2f dest) {
+ if (dest == null)
+ return new Vector2f(left.x - right.x, left.y - right.y);
+ else {
+ dest.set(left.x - right.x, left.y - right.y);
+ return dest;
+ }
+ }
+
+ /**
+ * Store this vector in a FloatBuffer
+ * @param buf The buffer to store it in, at the current position
+ * @return this
+ */
+ public Vector store(FloatBuffer buf) {
+ buf.put(x);
+ buf.put(y);
+ return this;
+ }
+
+ /**
+ * Load this vector from a FloatBuffer
+ * @param buf The buffer to load it from, at the current position
+ * @return this
+ */
+ public Vector load(FloatBuffer buf) {
+ x = buf.get();
+ y = buf.get();
+ return this;
+ }
+
+ /* (non-Javadoc)
+ * @see org.lwjgl.vector.Vector#scale(float)
+ */
+ public Vector scale(float scale) {
+
+ x *= scale;
+ y *= scale;
+
+ return this;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ public String toString() {
+ StringBuffer sb = new StringBuffer(64);
+
+ sb.append("Vector2f[");
+ sb.append(x);
+ sb.append(", ");
+ sb.append(y);
+ sb.append(']');
+ return sb.toString();
+ }
+
+ /**
+ * @return x
+ */
+ public final float getX() {
+ return x;
+ }
+
+ /**
+ * @return y
+ */
+ public final float getY() {
+ return y;
+ }
+
+ /**
+ * Set X
+ * @param x
+ */
+ public final void setX(float x) {
+ this.x = x;
+ }
+
+ /**
+ * Set Y
+ * @param y
+ */
+ public final void setY(float y) {
+ this.y = y;
+ }
+
+}
diff --git a/src/java/org/lwjgl/util/vector/Vector3f.java b/src/java/org/lwjgl/util/vector/Vector3f.java
index 2396bbf..8a9809e 100644
--- a/src/java/org/lwjgl/util/vector/Vector3f.java
+++ b/src/java/org/lwjgl/util/vector/Vector3f.java
@@ -1,347 +1,347 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.vector;
-
-import java.io.Serializable;
-import java.nio.FloatBuffer;
-
-/**
- *
- * Holds a 3-tuple vector.
- *
- * @author cix_foo <cix_foo at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: Vector3f.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-public class Vector3f extends Vector implements Serializable, ReadableVector3f, WritableVector3f {
-
- private static final long serialVersionUID = 1L;
-
- public float x, y, z;
-
- /**
- * Constructor for Vector3f.
- */
- public Vector3f() {
- super();
- }
-
- /**
- * Constructor
- */
- public Vector3f(ReadableVector3f src) {
- set(src);
- }
-
- /**
- * Constructor
- */
- public Vector3f(float x, float y, float z) {
- set(x, y, z);
- }
-
- /* (non-Javadoc)
- * @see org.lwjgl.util.vector.WritableVector2f#set(float, float)
- */
- public void set(float x, float y) {
- this.x = x;
- this.y = y;
- }
-
- /* (non-Javadoc)
- * @see org.lwjgl.util.vector.WritableVector3f#set(float, float, float)
- */
- public void set(float x, float y, float z) {
- this.x = x;
- this.y = y;
- this.z = z;
- }
-
- /**
- * Load from another Vector3f
- * @param src The source vector
- * @return this
- */
- public Vector3f set(ReadableVector3f src) {
- x = src.getX();
- y = src.getY();
- z = src.getZ();
- return this;
- }
-
- /**
- * @return the length squared of the vector
- */
- public float lengthSquared() {
- return x * x + y * y + z * z;
- }
-
- /**
- * Translate a vector
- * @param x The translation in x
- * @param y the translation in y
- * @return this
- */
- public Vector3f translate(float x, float y, float z) {
- this.x += x;
- this.y += y;
- this.z += z;
- return this;
- }
-
- /**
- * Add a vector to another vector and place the result in a destination
- * vector.
- * @param left The LHS vector
- * @param right The RHS vector
- * @param dest The destination vector, or null if a new vector is to be created
- * @return the sum of left and right in dest
- */
- public static Vector3f add(Vector3f left, Vector3f right, Vector3f dest) {
- if (dest == null)
- return new Vector3f(left.x + right.x, left.y + right.y, left.z + right.z);
- else {
- dest.set(left.x + right.x, left.y + right.y, left.z + right.z);
- return dest;
- }
- }
-
- /**
- * Subtract a vector from another vector and place the result in a destination
- * vector.
- * @param left The LHS vector
- * @param right The RHS vector
- * @param dest The destination vector, or null if a new vector is to be created
- * @return left minus right in dest
- */
- public static Vector3f sub(Vector3f left, Vector3f right, Vector3f dest) {
- if (dest == null)
- return new Vector3f(left.x - right.x, left.y - right.y, left.z - right.z);
- else {
- dest.set(left.x - right.x, left.y - right.y, left.z - right.z);
- return dest;
- }
- }
-
- /**
- * The cross product of two vectors.
- *
- * @param left The LHS vector
- * @param right The RHS vector
- * @param dest The destination result, or null if a new vector is to be created
- * @return left cross right
- */
- public static Vector3f cross(
- Vector3f left,
- Vector3f right,
- Vector3f dest)
- {
-
- if (dest == null)
- dest = new Vector3f();
-
- dest.set(
- left.y * right.z - left.z * right.y,
- right.x * left.z - right.z * left.x,
- left.x * right.y - left.y * right.x
- );
-
- return dest;
- }
-
-
-
- /**
- * Negate a vector
- * @return this
- */
- public Vector negate() {
- x = -x;
- y = -y;
- z = -z;
- return this;
- }
-
- /**
- * Negate a vector and place the result in a destination vector.
- * @param dest The destination vector or null if a new vector is to be created
- * @return the negated vector
- */
- public Vector3f negate(Vector3f dest) {
- if (dest == null)
- dest = new Vector3f();
- dest.x = -x;
- dest.y = -y;
- dest.z = -z;
- return dest;
- }
-
-
- /**
- * Normalise this vector and place the result in another vector.
- * @param dest The destination vector, or null if a new vector is to be created
- * @return the normalised vector
- */
- public Vector3f normalise(Vector3f dest) {
- float l = length();
-
- if (dest == null)
- dest = new Vector3f(x / l, y / l, z / l);
- else
- dest.set(x / l, y / l, z / l);
-
- return dest;
- }
-
- /**
- * The dot product of two vectors is calculated as
- * v1.x * v2.x + v1.y * v2.y + v1.z * v2.z
- * @param left The LHS vector
- * @param right The RHS vector
- * @return left dot right
- */
- public static float dot(Vector3f left, Vector3f right) {
- return left.x * right.x + left.y * right.y + left.z * right.z;
- }
-
- /**
- * Calculate the angle between two vectors, in radians
- * @param a A vector
- * @param b The other vector
- * @return the angle between the two vectors, in radians
- */
- public static float angle(Vector3f a, Vector3f b) {
- float dls = dot(a, b) / (a.length() * b.length());
- if (dls < -1f)
- dls = -1f;
- else if (dls > 1.0f)
- dls = 1.0f;
- return (float)Math.acos(dls);
- }
-
- /* (non-Javadoc)
- * @see org.lwjgl.vector.Vector#load(FloatBuffer)
- */
- public Vector load(FloatBuffer buf) {
- x = buf.get();
- y = buf.get();
- z = buf.get();
- return this;
- }
-
- /* (non-Javadoc)
- * @see org.lwjgl.vector.Vector#scale(float)
- */
- public Vector scale(float scale) {
-
- x *= scale;
- y *= scale;
- z *= scale;
-
- return this;
-
- }
-
- /* (non-Javadoc)
- * @see org.lwjgl.vector.Vector#store(FloatBuffer)
- */
- public Vector store(FloatBuffer buf) {
-
- buf.put(x);
- buf.put(y);
- buf.put(z);
-
- return this;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer sb = new StringBuffer(64);
-
- sb.append("Vector3f[");
- sb.append(x);
- sb.append(", ");
- sb.append(y);
- sb.append(", ");
- sb.append(z);
- sb.append(']');
- return sb.toString();
- }
-
- /**
- * @return x
- */
- public final float getX() {
- return x;
- }
-
- /**
- * @return y
- */
- public final float getY() {
- return y;
- }
-
- /**
- * Set X
- * @param x
- */
- public final void setX(float x) {
- this.x = x;
- }
-
- /**
- * Set Y
- * @param y
- */
- public final void setY(float y) {
- this.y = y;
- }
-
- /**
- * Set Z
- * @param z
- */
- public void setZ(float z) {
- this.z = z;
- }
-
- /* (Overrides)
- * @see org.lwjgl.vector.ReadableVector3f#getZ()
- */
- public float getZ() {
- return z;
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.vector;
+
+import java.io.Serializable;
+import java.nio.FloatBuffer;
+
+/**
+ *
+ * Holds a 3-tuple vector.
+ *
+ * @author cix_foo <cix_foo at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: Vector3f.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+public class Vector3f extends Vector implements Serializable, ReadableVector3f, WritableVector3f {
+
+ private static final long serialVersionUID = 1L;
+
+ public float x, y, z;
+
+ /**
+ * Constructor for Vector3f.
+ */
+ public Vector3f() {
+ super();
+ }
+
+ /**
+ * Constructor
+ */
+ public Vector3f(ReadableVector3f src) {
+ set(src);
+ }
+
+ /**
+ * Constructor
+ */
+ public Vector3f(float x, float y, float z) {
+ set(x, y, z);
+ }
+
+ /* (non-Javadoc)
+ * @see org.lwjgl.util.vector.WritableVector2f#set(float, float)
+ */
+ public void set(float x, float y) {
+ this.x = x;
+ this.y = y;
+ }
+
+ /* (non-Javadoc)
+ * @see org.lwjgl.util.vector.WritableVector3f#set(float, float, float)
+ */
+ public void set(float x, float y, float z) {
+ this.x = x;
+ this.y = y;
+ this.z = z;
+ }
+
+ /**
+ * Load from another Vector3f
+ * @param src The source vector
+ * @return this
+ */
+ public Vector3f set(ReadableVector3f src) {
+ x = src.getX();
+ y = src.getY();
+ z = src.getZ();
+ return this;
+ }
+
+ /**
+ * @return the length squared of the vector
+ */
+ public float lengthSquared() {
+ return x * x + y * y + z * z;
+ }
+
+ /**
+ * Translate a vector
+ * @param x The translation in x
+ * @param y the translation in y
+ * @return this
+ */
+ public Vector3f translate(float x, float y, float z) {
+ this.x += x;
+ this.y += y;
+ this.z += z;
+ return this;
+ }
+
+ /**
+ * Add a vector to another vector and place the result in a destination
+ * vector.
+ * @param left The LHS vector
+ * @param right The RHS vector
+ * @param dest The destination vector, or null if a new vector is to be created
+ * @return the sum of left and right in dest
+ */
+ public static Vector3f add(Vector3f left, Vector3f right, Vector3f dest) {
+ if (dest == null)
+ return new Vector3f(left.x + right.x, left.y + right.y, left.z + right.z);
+ else {
+ dest.set(left.x + right.x, left.y + right.y, left.z + right.z);
+ return dest;
+ }
+ }
+
+ /**
+ * Subtract a vector from another vector and place the result in a destination
+ * vector.
+ * @param left The LHS vector
+ * @param right The RHS vector
+ * @param dest The destination vector, or null if a new vector is to be created
+ * @return left minus right in dest
+ */
+ public static Vector3f sub(Vector3f left, Vector3f right, Vector3f dest) {
+ if (dest == null)
+ return new Vector3f(left.x - right.x, left.y - right.y, left.z - right.z);
+ else {
+ dest.set(left.x - right.x, left.y - right.y, left.z - right.z);
+ return dest;
+ }
+ }
+
+ /**
+ * The cross product of two vectors.
+ *
+ * @param left The LHS vector
+ * @param right The RHS vector
+ * @param dest The destination result, or null if a new vector is to be created
+ * @return left cross right
+ */
+ public static Vector3f cross(
+ Vector3f left,
+ Vector3f right,
+ Vector3f dest)
+ {
+
+ if (dest == null)
+ dest = new Vector3f();
+
+ dest.set(
+ left.y * right.z - left.z * right.y,
+ right.x * left.z - right.z * left.x,
+ left.x * right.y - left.y * right.x
+ );
+
+ return dest;
+ }
+
+
+
+ /**
+ * Negate a vector
+ * @return this
+ */
+ public Vector negate() {
+ x = -x;
+ y = -y;
+ z = -z;
+ return this;
+ }
+
+ /**
+ * Negate a vector and place the result in a destination vector.
+ * @param dest The destination vector or null if a new vector is to be created
+ * @return the negated vector
+ */
+ public Vector3f negate(Vector3f dest) {
+ if (dest == null)
+ dest = new Vector3f();
+ dest.x = -x;
+ dest.y = -y;
+ dest.z = -z;
+ return dest;
+ }
+
+
+ /**
+ * Normalise this vector and place the result in another vector.
+ * @param dest The destination vector, or null if a new vector is to be created
+ * @return the normalised vector
+ */
+ public Vector3f normalise(Vector3f dest) {
+ float l = length();
+
+ if (dest == null)
+ dest = new Vector3f(x / l, y / l, z / l);
+ else
+ dest.set(x / l, y / l, z / l);
+
+ return dest;
+ }
+
+ /**
+ * The dot product of two vectors is calculated as
+ * v1.x * v2.x + v1.y * v2.y + v1.z * v2.z
+ * @param left The LHS vector
+ * @param right The RHS vector
+ * @return left dot right
+ */
+ public static float dot(Vector3f left, Vector3f right) {
+ return left.x * right.x + left.y * right.y + left.z * right.z;
+ }
+
+ /**
+ * Calculate the angle between two vectors, in radians
+ * @param a A vector
+ * @param b The other vector
+ * @return the angle between the two vectors, in radians
+ */
+ public static float angle(Vector3f a, Vector3f b) {
+ float dls = dot(a, b) / (a.length() * b.length());
+ if (dls < -1f)
+ dls = -1f;
+ else if (dls > 1.0f)
+ dls = 1.0f;
+ return (float)Math.acos(dls);
+ }
+
+ /* (non-Javadoc)
+ * @see org.lwjgl.vector.Vector#load(FloatBuffer)
+ */
+ public Vector load(FloatBuffer buf) {
+ x = buf.get();
+ y = buf.get();
+ z = buf.get();
+ return this;
+ }
+
+ /* (non-Javadoc)
+ * @see org.lwjgl.vector.Vector#scale(float)
+ */
+ public Vector scale(float scale) {
+
+ x *= scale;
+ y *= scale;
+ z *= scale;
+
+ return this;
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.lwjgl.vector.Vector#store(FloatBuffer)
+ */
+ public Vector store(FloatBuffer buf) {
+
+ buf.put(x);
+ buf.put(y);
+ buf.put(z);
+
+ return this;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ public String toString() {
+ StringBuffer sb = new StringBuffer(64);
+
+ sb.append("Vector3f[");
+ sb.append(x);
+ sb.append(", ");
+ sb.append(y);
+ sb.append(", ");
+ sb.append(z);
+ sb.append(']');
+ return sb.toString();
+ }
+
+ /**
+ * @return x
+ */
+ public final float getX() {
+ return x;
+ }
+
+ /**
+ * @return y
+ */
+ public final float getY() {
+ return y;
+ }
+
+ /**
+ * Set X
+ * @param x
+ */
+ public final void setX(float x) {
+ this.x = x;
+ }
+
+ /**
+ * Set Y
+ * @param y
+ */
+ public final void setY(float y) {
+ this.y = y;
+ }
+
+ /**
+ * Set Z
+ * @param z
+ */
+ public void setZ(float z) {
+ this.z = z;
+ }
+
+ /* (Overrides)
+ * @see org.lwjgl.vector.ReadableVector3f#getZ()
+ */
+ public float getZ() {
+ return z;
+ }
+}
diff --git a/src/java/org/lwjgl/util/vector/Vector4f.java b/src/java/org/lwjgl/util/vector/Vector4f.java
index 3ab7db7..712dc0a 100644
--- a/src/java/org/lwjgl/util/vector/Vector4f.java
+++ b/src/java/org/lwjgl/util/vector/Vector4f.java
@@ -1,340 +1,340 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.vector;
-
-import java.io.Serializable;
-import java.nio.FloatBuffer;
-
-/**
- *
- * Holds a 4-tuple vector.
- *
- * @author cix_foo <cix_foo at users.sourceforge.net>
- * @version $Revision: 2983 $
- * $Id: Vector4f.java 2983 2008-04-07 18:36:09Z matzon $
- */
-
-public class Vector4f extends Vector implements Serializable, ReadableVector4f, WritableVector4f {
-
- private static final long serialVersionUID = 1L;
-
- public float x, y, z, w;
-
- /**
- * Constructor for Vector4f.
- */
- public Vector4f() {
- super();
- }
-
- /**
- * Constructor
- */
- public Vector4f(ReadableVector4f src) {
- set(src);
- }
-
- /**
- * Constructor
- */
- public Vector4f(float x, float y, float z, float w) {
- set(x, y, z, w);
- }
-
- /* (non-Javadoc)
- * @see org.lwjgl.util.vector.WritableVector2f#set(float, float)
- */
- public void set(float x, float y) {
- this.x = x;
- this.y = y;
- }
-
- /* (non-Javadoc)
- * @see org.lwjgl.util.vector.WritableVector3f#set(float, float, float)
- */
- public void set(float x, float y, float z) {
- this.x = x;
- this.y = y;
- this.z = z;
- }
-
- /* (non-Javadoc)
- * @see org.lwjgl.util.vector.WritableVector4f#set(float, float, float, float)
- */
- public void set(float x, float y, float z, float w) {
- this.x = x;
- this.y = y;
- this.z = z;
- this.w = w;
- }
-
- /**
- * Load from another Vector4f
- * @param src The source vector
- * @return this
- */
- public Vector4f set(ReadableVector4f src) {
- x = src.getX();
- y = src.getY();
- z = src.getZ();
- w = src.getW();
- return this;
- }
-
- /**
- * @return the length squared of the vector
- */
- public float lengthSquared() {
- return x * x + y * y + z * z + w * w;
- }
-
- /**
- * Translate a vector
- * @param x The translation in x
- * @param y the translation in y
- * @return this
- */
- public Vector4f translate(float x, float y, float z, float w) {
- this.x += x;
- this.y += y;
- this.z += z;
- this.w += w;
- return this;
- }
-
- /**
- * Add a vector to another vector and place the result in a destination
- * vector.
- * @param left The LHS vector
- * @param right The RHS vector
- * @param dest The destination vector, or null if a new vector is to be created
- * @return the sum of left and right in dest
- */
- public static Vector4f add(Vector4f left, Vector4f right, Vector4f dest) {
- if (dest == null)
- return new Vector4f(left.x + right.x, left.y + right.y, left.z + right.z, left.w + right.w);
- else {
- dest.set(left.x + right.x, left.y + right.y, left.z + right.z, left.w + right.w);
- return dest;
- }
- }
-
- /**
- * Subtract a vector from another vector and place the result in a destination
- * vector.
- * @param left The LHS vector
- * @param right The RHS vector
- * @param dest The destination vector, or null if a new vector is to be created
- * @return left minus right in dest
- */
- public static Vector4f sub(Vector4f left, Vector4f right, Vector4f dest) {
- if (dest == null)
- return new Vector4f(left.x - right.x, left.y - right.y, left.z - right.z, left.w - right.w);
- else {
- dest.set(left.x - right.x, left.y - right.y, left.z - right.z, left.w - right.w);
- return dest;
- }
- }
-
-
- /**
- * Negate a vector
- * @return this
- */
- public Vector negate() {
- x = -x;
- y = -y;
- z = -z;
- w = -w;
- return this;
- }
-
- /**
- * Negate a vector and place the result in a destination vector.
- * @param dest The destination vector or null if a new vector is to be created
- * @return the negated vector
- */
- public Vector4f negate(Vector4f dest) {
- if (dest == null)
- dest = new Vector4f();
- dest.x = -x;
- dest.y = -y;
- dest.z = -z;
- dest.w = -w;
- return dest;
- }
-
-
- /**
- * Normalise this vector and place the result in another vector.
- * @param dest The destination vector, or null if a new vector is to be created
- * @return the normalised vector
- */
- public Vector4f normalise(Vector4f dest) {
- float l = length();
-
- if (dest == null)
- dest = new Vector4f(x / l, y / l, z / l, w / l);
- else
- dest.set(x / l, y / l, z / l, w / l);
-
- return dest;
- }
-
- /**
- * The dot product of two vectors is calculated as
- * v1.x * v2.x + v1.y * v2.y + v1.z * v2.z + v1.w * v2.w
- * @param left The LHS vector
- * @param right The RHS vector
- * @return left dot right
- */
- public static float dot(Vector4f left, Vector4f right) {
- return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w;
- }
-
- /**
- * Calculate the angle between two vectors, in radians
- * @param a A vector
- * @param b The other vector
- * @return the angle between the two vectors, in radians
- */
- public static float angle(Vector4f a, Vector4f b) {
- float dls = dot(a, b) / (a.length() * b.length());
- if (dls < -1f)
- dls = -1f;
- else if (dls > 1.0f)
- dls = 1.0f;
- return (float)Math.acos(dls);
- }
-
- /* (non-Javadoc)
- * @see org.lwjgl.vector.Vector#load(FloatBuffer)
- */
- public Vector load(FloatBuffer buf) {
- x = buf.get();
- y = buf.get();
- z = buf.get();
- w = buf.get();
- return this;
- }
-
- /* (non-Javadoc)
- * @see org.lwjgl.vector.Vector#scale(float)
- */
- public Vector scale(float scale) {
- x *= scale;
- y *= scale;
- z *= scale;
- w *= scale;
- return this;
- }
-
- /* (non-Javadoc)
- * @see org.lwjgl.vector.Vector#store(FloatBuffer)
- */
- public Vector store(FloatBuffer buf) {
-
- buf.put(x);
- buf.put(y);
- buf.put(z);
- buf.put(w);
-
- return this;
- }
-
- public String toString() {
- return "Vector4f: " + x + " " + y + " " + z + " " + w;
- }
-
- /**
- * @return x
- */
- public final float getX() {
- return x;
- }
-
- /**
- * @return y
- */
- public final float getY() {
- return y;
- }
-
- /**
- * Set X
- * @param x
- */
- public final void setX(float x) {
- this.x = x;
- }
-
- /**
- * Set Y
- * @param y
- */
- public final void setY(float y) {
- this.y = y;
- }
-
- /**
- * Set Z
- * @param z
- */
- public void setZ(float z) {
- this.z = z;
- }
-
-
- /* (Overrides)
- * @see org.lwjgl.vector.ReadableVector3f#getZ()
- */
- public float getZ() {
- return z;
- }
-
- /**
- * Set W
- * @param w
- */
- public void setW(float w) {
- this.w = w;
- }
-
- /* (Overrides)
- * @see org.lwjgl.vector.ReadableVector3f#getZ()
- */
- public float getW() {
- return w;
- }
-
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.vector;
+
+import java.io.Serializable;
+import java.nio.FloatBuffer;
+
+/**
+ *
+ * Holds a 4-tuple vector.
+ *
+ * @author cix_foo <cix_foo at users.sourceforge.net>
+ * @version $Revision: 2983 $
+ * $Id: Vector4f.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+
+public class Vector4f extends Vector implements Serializable, ReadableVector4f, WritableVector4f {
+
+ private static final long serialVersionUID = 1L;
+
+ public float x, y, z, w;
+
+ /**
+ * Constructor for Vector4f.
+ */
+ public Vector4f() {
+ super();
+ }
+
+ /**
+ * Constructor
+ */
+ public Vector4f(ReadableVector4f src) {
+ set(src);
+ }
+
+ /**
+ * Constructor
+ */
+ public Vector4f(float x, float y, float z, float w) {
+ set(x, y, z, w);
+ }
+
+ /* (non-Javadoc)
+ * @see org.lwjgl.util.vector.WritableVector2f#set(float, float)
+ */
+ public void set(float x, float y) {
+ this.x = x;
+ this.y = y;
+ }
+
+ /* (non-Javadoc)
+ * @see org.lwjgl.util.vector.WritableVector3f#set(float, float, float)
+ */
+ public void set(float x, float y, float z) {
+ this.x = x;
+ this.y = y;
+ this.z = z;
+ }
+
+ /* (non-Javadoc)
+ * @see org.lwjgl.util.vector.WritableVector4f#set(float, float, float, float)
+ */
+ public void set(float x, float y, float z, float w) {
+ this.x = x;
+ this.y = y;
+ this.z = z;
+ this.w = w;
+ }
+
+ /**
+ * Load from another Vector4f
+ * @param src The source vector
+ * @return this
+ */
+ public Vector4f set(ReadableVector4f src) {
+ x = src.getX();
+ y = src.getY();
+ z = src.getZ();
+ w = src.getW();
+ return this;
+ }
+
+ /**
+ * @return the length squared of the vector
+ */
+ public float lengthSquared() {
+ return x * x + y * y + z * z + w * w;
+ }
+
+ /**
+ * Translate a vector
+ * @param x The translation in x
+ * @param y the translation in y
+ * @return this
+ */
+ public Vector4f translate(float x, float y, float z, float w) {
+ this.x += x;
+ this.y += y;
+ this.z += z;
+ this.w += w;
+ return this;
+ }
+
+ /**
+ * Add a vector to another vector and place the result in a destination
+ * vector.
+ * @param left The LHS vector
+ * @param right The RHS vector
+ * @param dest The destination vector, or null if a new vector is to be created
+ * @return the sum of left and right in dest
+ */
+ public static Vector4f add(Vector4f left, Vector4f right, Vector4f dest) {
+ if (dest == null)
+ return new Vector4f(left.x + right.x, left.y + right.y, left.z + right.z, left.w + right.w);
+ else {
+ dest.set(left.x + right.x, left.y + right.y, left.z + right.z, left.w + right.w);
+ return dest;
+ }
+ }
+
+ /**
+ * Subtract a vector from another vector and place the result in a destination
+ * vector.
+ * @param left The LHS vector
+ * @param right The RHS vector
+ * @param dest The destination vector, or null if a new vector is to be created
+ * @return left minus right in dest
+ */
+ public static Vector4f sub(Vector4f left, Vector4f right, Vector4f dest) {
+ if (dest == null)
+ return new Vector4f(left.x - right.x, left.y - right.y, left.z - right.z, left.w - right.w);
+ else {
+ dest.set(left.x - right.x, left.y - right.y, left.z - right.z, left.w - right.w);
+ return dest;
+ }
+ }
+
+
+ /**
+ * Negate a vector
+ * @return this
+ */
+ public Vector negate() {
+ x = -x;
+ y = -y;
+ z = -z;
+ w = -w;
+ return this;
+ }
+
+ /**
+ * Negate a vector and place the result in a destination vector.
+ * @param dest The destination vector or null if a new vector is to be created
+ * @return the negated vector
+ */
+ public Vector4f negate(Vector4f dest) {
+ if (dest == null)
+ dest = new Vector4f();
+ dest.x = -x;
+ dest.y = -y;
+ dest.z = -z;
+ dest.w = -w;
+ return dest;
+ }
+
+
+ /**
+ * Normalise this vector and place the result in another vector.
+ * @param dest The destination vector, or null if a new vector is to be created
+ * @return the normalised vector
+ */
+ public Vector4f normalise(Vector4f dest) {
+ float l = length();
+
+ if (dest == null)
+ dest = new Vector4f(x / l, y / l, z / l, w / l);
+ else
+ dest.set(x / l, y / l, z / l, w / l);
+
+ return dest;
+ }
+
+ /**
+ * The dot product of two vectors is calculated as
+ * v1.x * v2.x + v1.y * v2.y + v1.z * v2.z + v1.w * v2.w
+ * @param left The LHS vector
+ * @param right The RHS vector
+ * @return left dot right
+ */
+ public static float dot(Vector4f left, Vector4f right) {
+ return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w;
+ }
+
+ /**
+ * Calculate the angle between two vectors, in radians
+ * @param a A vector
+ * @param b The other vector
+ * @return the angle between the two vectors, in radians
+ */
+ public static float angle(Vector4f a, Vector4f b) {
+ float dls = dot(a, b) / (a.length() * b.length());
+ if (dls < -1f)
+ dls = -1f;
+ else if (dls > 1.0f)
+ dls = 1.0f;
+ return (float)Math.acos(dls);
+ }
+
+ /* (non-Javadoc)
+ * @see org.lwjgl.vector.Vector#load(FloatBuffer)
+ */
+ public Vector load(FloatBuffer buf) {
+ x = buf.get();
+ y = buf.get();
+ z = buf.get();
+ w = buf.get();
+ return this;
+ }
+
+ /* (non-Javadoc)
+ * @see org.lwjgl.vector.Vector#scale(float)
+ */
+ public Vector scale(float scale) {
+ x *= scale;
+ y *= scale;
+ z *= scale;
+ w *= scale;
+ return this;
+ }
+
+ /* (non-Javadoc)
+ * @see org.lwjgl.vector.Vector#store(FloatBuffer)
+ */
+ public Vector store(FloatBuffer buf) {
+
+ buf.put(x);
+ buf.put(y);
+ buf.put(z);
+ buf.put(w);
+
+ return this;
+ }
+
+ public String toString() {
+ return "Vector4f: " + x + " " + y + " " + z + " " + w;
+ }
+
+ /**
+ * @return x
+ */
+ public final float getX() {
+ return x;
+ }
+
+ /**
+ * @return y
+ */
+ public final float getY() {
+ return y;
+ }
+
+ /**
+ * Set X
+ * @param x
+ */
+ public final void setX(float x) {
+ this.x = x;
+ }
+
+ /**
+ * Set Y
+ * @param y
+ */
+ public final void setY(float y) {
+ this.y = y;
+ }
+
+ /**
+ * Set Z
+ * @param z
+ */
+ public void setZ(float z) {
+ this.z = z;
+ }
+
+
+ /* (Overrides)
+ * @see org.lwjgl.vector.ReadableVector3f#getZ()
+ */
+ public float getZ() {
+ return z;
+ }
+
+ /**
+ * Set W
+ * @param w
+ */
+ public void setW(float w) {
+ this.w = w;
+ }
+
+ /* (Overrides)
+ * @see org.lwjgl.vector.ReadableVector3f#getZ()
+ */
+ public float getW() {
+ return w;
+ }
+
+
+}
diff --git a/src/java/org/lwjgl/util/vector/WritableVector2f.java b/src/java/org/lwjgl/util/vector/WritableVector2f.java
index 23f23ca..bf9dc52 100644
--- a/src/java/org/lwjgl/util/vector/WritableVector2f.java
+++ b/src/java/org/lwjgl/util/vector/WritableVector2f.java
@@ -1,61 +1,61 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.vector;
-
-/**
- * Writable interface to Vector2fs
- * @author $author$
- * @version $revision$
- * $Id: WritableVector2f.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public interface WritableVector2f {
-
- /**
- * Set the X value
- * @param x
- */
- public void setX(float x);
-
- /**
- * Set the Y value
- * @param y
- */
- public void setY(float y);
-
- /**
- * Set the X,Y values
- * @param x
- * @param y
- */
- public void set(float x, float y);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.vector;
+
+/**
+ * Writable interface to Vector2fs
+ * @author $author$
+ * @version $revision$
+ * $Id: WritableVector2f.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public interface WritableVector2f {
+
+ /**
+ * Set the X value
+ * @param x
+ */
+ public void setX(float x);
+
+ /**
+ * Set the Y value
+ * @param y
+ */
+ public void setY(float y);
+
+ /**
+ * Set the X,Y values
+ * @param x
+ * @param y
+ */
+ public void set(float x, float y);
+
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/util/vector/WritableVector3f.java b/src/java/org/lwjgl/util/vector/WritableVector3f.java
index 0f895bf..63dffb3 100644
--- a/src/java/org/lwjgl/util/vector/WritableVector3f.java
+++ b/src/java/org/lwjgl/util/vector/WritableVector3f.java
@@ -1,56 +1,56 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.vector;
-
-/**
- * Writable interface to Vector3fs
- * @author $author$
- * @version $revision$
- * $Id: WritableVector3f.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public interface WritableVector3f extends WritableVector2f {
-
- /**
- * Set the Z value
- * @param z
- */
- public void setZ(float z);
-
- /**
- * Set the X,Y,Z values
- * @param x
- * @param y
- * @param z
- */
- public void set(float x, float y, float z);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.vector;
+
+/**
+ * Writable interface to Vector3fs
+ * @author $author$
+ * @version $revision$
+ * $Id: WritableVector3f.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public interface WritableVector3f extends WritableVector2f {
+
+ /**
+ * Set the Z value
+ * @param z
+ */
+ public void setZ(float z);
+
+ /**
+ * Set the X,Y,Z values
+ * @param x
+ * @param y
+ * @param z
+ */
+ public void set(float x, float y, float z);
+
}
\ No newline at end of file
diff --git a/src/java/org/lwjgl/util/vector/WritableVector4f.java b/src/java/org/lwjgl/util/vector/WritableVector4f.java
index 7ea492c..a784146 100644
--- a/src/java/org/lwjgl/util/vector/WritableVector4f.java
+++ b/src/java/org/lwjgl/util/vector/WritableVector4f.java
@@ -1,57 +1,57 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.util.vector;
-
-/**
- * Writable interface to Vector4fs
- * @author $author$
- * @version $revision$
- * $Id: WritableVector4f.java 2983 2008-04-07 18:36:09Z matzon $
- */
-public interface WritableVector4f extends WritableVector3f {
-
- /**
- * Set the W value
- * @param w
- */
- public void setW(float w);
-
- /**
- * Set the X,Y,Z,W values
- * @param x
- * @param y
- * @param z
- * @param w
- */
- public void set(float x, float y, float z, float w);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.util.vector;
+
+/**
+ * Writable interface to Vector4fs
+ * @author $author$
+ * @version $revision$
+ * $Id: WritableVector4f.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public interface WritableVector4f extends WritableVector3f {
+
+ /**
+ * Set the W value
+ * @param w
+ */
+ public void setW(float w);
+
+ /**
+ * Set the X,Y,Z,W values
+ * @param x
+ * @param y
+ * @param z
+ * @param w
+ */
+ public void set(float x, float y, float z, float w);
+
}
\ No newline at end of file
diff --git a/src/native/common/awt_tools.h b/src/native/common/awt_tools.h
index f8479e0..3fa0916 100644
--- a/src/native/common/awt_tools.h
+++ b/src/native/common/awt_tools.h
@@ -1,53 +1,53 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: awt_tools.h 2985 2008-04-07 18:42:36Z matzon $
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2985 $
- */
-
-#ifndef __LWJGL_AWT_TOOLS_H
-#define __LWJGL_AWT_TOOLS_H
-
-#include <jni.h>
-#include <jawt_md.h>
-
-typedef struct {
- JAWT awt;
- JAWT_DrawingSurface* ds;
- JAWT_DrawingSurfaceInfo *dsi;
-} AWTSurfaceLock;
-
-#endif
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: awt_tools.h 2985 2008-04-07 18:42:36Z matzon $
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2985 $
+ */
+
+#ifndef __LWJGL_AWT_TOOLS_H
+#define __LWJGL_AWT_TOOLS_H
+
+#include <jni.h>
+#include <jawt_md.h>
+
+typedef struct {
+ JAWT awt;
+ JAWT_DrawingSurface* ds;
+ JAWT_DrawingSurfaceInfo *dsi;
+} AWTSurfaceLock;
+
+#endif
+
diff --git a/src/native/common/common_tools.c b/src/native/common/common_tools.c
index e2ba2ac..86ec126 100644
--- a/src/native/common/common_tools.c
+++ b/src/native/common/common_tools.c
@@ -1,356 +1,356 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: common_tools.c 3167 2008-12-22 16:38:57Z elias_naur $
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3167 $
- */
-
-#include <jni.h>
-#include <stdlib.h>
-#include "common_tools.h"
-#include "org_lwjgl_DefaultSysImplementation.h"
-
-static bool debug = false;
-static JavaVM *jvm;
-
-void initAttribList(attrib_list_t *list) {
- list->current_index = 0;
-}
-
-void putAttrib(attrib_list_t *list, int attrib) {
- if (list->current_index == ATTRIB_LIST_SIZE) {
- printfDebug("Ignoring attrib %d: attrib list size too small", attrib);
- return;
- }
- list->attribs[list->current_index] = attrib;
- list->current_index++;
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_DefaultSysImplementation_setDebug
- (JNIEnv *env, jobject ignored, jboolean enable) {
- debug = enable == JNI_TRUE ? true : false;
-}
-
-bool isDebugEnabled(void) {
- return debug;
-}
-
-static int do_vsnprintf(char* buffer, size_t buffer_size, const char *format, va_list ap) {
-#ifdef _MSC_VER
- return vsnprintf_s(buffer, buffer_size, _TRUNCATE, format, ap);
-#else
- va_list cp_ap;
- va_copy(cp_ap, ap);
- int res = vsnprintf(buffer, buffer_size, format, cp_ap);
- va_end(cp_ap);
- return res;
-#endif
-}
-
-static jstring sprintfJavaString(JNIEnv *env, const char *format, va_list ap) {
- int buffer_size = 2;
- char *buffer;
- jstring str;
- int str_size;
- buffer = (char *)malloc(sizeof(char)*buffer_size);
- if (buffer == NULL)
- return NULL;
- str_size = do_vsnprintf(buffer, buffer_size, format, ap);
- if (str_size > buffer_size) {
- free(buffer);
- buffer_size = str_size + 1;
- buffer = (char *)malloc(sizeof(char)*buffer_size);
- if (buffer == NULL)
- return NULL;
- do_vsnprintf(buffer, buffer_size, format, ap);
- }
- str = (*env)->NewStringUTF(env, buffer);
- free(buffer);
- return str;
-}
-
-void printfDebugJava(JNIEnv *env, const char *format, ...) {
- jstring str;
- jclass org_lwjgl_LWJGLUtil_class;
- jmethodID log_method;
- va_list ap;
- if (isDebugEnabled() && !(*env)->ExceptionOccurred(env)) {
- va_start(ap, format);
- str = sprintfJavaString(env, format, ap);
- va_end(ap);
- org_lwjgl_LWJGLUtil_class = (*env)->FindClass(env, "org/lwjgl/LWJGLUtil");
- if (org_lwjgl_LWJGLUtil_class == NULL)
- return;
- log_method = (*env)->GetStaticMethodID(env, org_lwjgl_LWJGLUtil_class, "log", "(Ljava/lang/String;)V");
- if (log_method == NULL)
- return;
- (*env)->CallStaticVoidMethod(env, org_lwjgl_LWJGLUtil_class, log_method, str);
- }
-}
-
-void printfDebug(const char *format, ...) {
- va_list ap;
- va_start(ap, format);
- if (isDebugEnabled())
- vfprintf(stderr, format, ap);
- va_end(ap);
-}
-
-static void throwFormattedGeneralException(JNIEnv * env, const char *exception_name, const char *format, va_list ap) {
- jclass cls;
- jstring str;
- jmethodID exception_constructor;
- jobject exception;
-
- if ((*env)->ExceptionCheck(env) == JNI_TRUE)
- return; // The JVM crashes if we try to throw two exceptions from one native call
- str = sprintfJavaString(env, format, ap);
- cls = (*env)->FindClass(env, exception_name);
- exception_constructor = (*env)->GetMethodID(env, cls, "<init>", "(Ljava/lang/String;)V");
- exception = (*env)->NewObject(env, cls, exception_constructor, str);
- (*env)->Throw(env, exception);
-}
-
-void throwGeneralException(JNIEnv * env, const char *exception_name, const char * err) {
- jclass cls;
-
- if ((*env)->ExceptionCheck(env) == JNI_TRUE)
- return; // The JVM crashes if we try to throw two exceptions from one native call
- cls = (*env)->FindClass(env, exception_name);
- (*env)->ThrowNew(env, cls, err);
-}
-
-void throwFMODException(JNIEnv * env, const char * err) {
- throwGeneralException(env, "org/lwjgl/fmod3/FMODException", err);
-}
-
-void throwFormattedRuntimeException(JNIEnv * env, const char *format, ...) {
- va_list ap;
- va_start(ap, format);
- throwFormattedGeneralException(env, "java/lang/RuntimeException", format, ap);
- va_end(ap);
-}
-
-void throwFormattedException(JNIEnv * env, const char *format, ...) {
- va_list ap;
- va_start(ap, format);
- throwFormattedGeneralException(env, "org/lwjgl/LWJGLException", format, ap);
- va_end(ap);
-}
-
-void throwException(JNIEnv * env, const char * err) {
- throwGeneralException(env, "org/lwjgl/LWJGLException", err);
-}
-
-// retrieves the locale-specific C string
-char * GetStringNativeChars(JNIEnv *env, jstring jstr) {
- jbyteArray bytes = 0;
- jthrowable exc;
- char *result = 0;
- jclass jcls_str;
- jmethodID MID_String_getBytes;
-
- /* out of memory error? */
- if ((*env)->EnsureLocalCapacity(env, 2) < 0) {
- return 0;
- }
-
- // aquire getBytes method
- jcls_str = (*env)->FindClass(env, "java/lang/String");
- MID_String_getBytes = (*env)->GetMethodID(env, jcls_str, "getBytes", "()[B");
-
- // get the bytes
- bytes = (jbyteArray) (*env)->CallObjectMethod(env, jstr, MID_String_getBytes);
- exc = (*env)->ExceptionOccurred(env);
-
- // if no exception occured while getting bytes - continue
- if (!exc) {
- jint len = (*env)->GetArrayLength(env, bytes);
- result = (char *) malloc(len + 1);
- if (result == 0) {
- throwGeneralException(env, "java/lang/OutOfMemoryError", NULL);
- (*env)->DeleteLocalRef(env, bytes);
- return 0;
- }
- (*env)->GetByteArrayRegion(env, bytes, 0, len, (jbyte *) result);
- result[len] = 0; /* NULL-terminate */
- } else {
- (*env)->DeleteLocalRef(env, exc);
- }
- (*env)->DeleteLocalRef(env, bytes);
- return (char*) result;
-}
-
-/* creates locale specific string, unsigned argument to
- * match GLuchar and ALuchar types
- */
-jstring NewStringNativeUnsigned(JNIEnv *env, const unsigned char *ustr) {
- const char *str = (const char *)ustr;
- if (str == NULL)
- return NULL;
- return NewStringNativeWithLength(env, str, strlen(str));
-}
-
-// creates locale specific string
-jstring NewStringNativeWithLength(JNIEnv *env, const char *str, int length) {
- jclass jcls_str;
- jmethodID jmethod_str;
- jstring result;
- jbyteArray bytes;
- if (str==NULL) {
- return NULL;
- }
-
- jcls_str = (*env)->FindClass(env,"java/lang/String");
- if (jcls_str == NULL)
- return NULL;
- jmethod_str = (*env)->GetMethodID(env,jcls_str, "<init>", "([B)V");
- if (jmethod_str == NULL)
- return NULL;
-
- bytes = 0;
-
- if ((*env)->EnsureLocalCapacity(env,2) < 0) {
- return NULL; /* out of memory error */
- }
-
- bytes = (*env)->NewByteArray(env,length);
- if (bytes != NULL) {
- (*env)->SetByteArrayRegion(env,bytes, 0, length, (jbyte *)str);
- result = (jstring)(*env)->NewObject(env,jcls_str, jmethod_str, bytes);
- (*env)->DeleteLocalRef(env,bytes);
- return result;
- } /* else fall through */
- return NULL;
-}
-
-bool ext_InitializeFunctions(ExtGetProcAddressPROC gpa, int num_functions, ExtFunction *functions) {
- int i;
- void **ext_function_pointer_pointer;
- for (i = 0; i < num_functions; i++) {
- ExtFunction *function = functions + i;
- if (function->ext_function_name != NULL) {
- void *ext_func_pointer = gpa(function->ext_function_name);
- if (ext_func_pointer == NULL)
- return false;
- ext_function_pointer_pointer = function->ext_function_pointer;
- *ext_function_pointer_pointer = ext_func_pointer;
- }
- }
- return true;
-}
-
-jobject newJavaManagedByteBuffer(JNIEnv *env, const int size) {
- jclass bufferutils_class = (*env)->FindClass(env, "org/lwjgl/BufferUtils");
- jmethodID createByteBuffer = (*env)->GetStaticMethodID(env, bufferutils_class, "createByteBuffer", "(I)Ljava/nio/ByteBuffer;");
- jobject buffer = (*env)->CallStaticObjectMethod(env, bufferutils_class, createByteBuffer, size);
- return buffer;
-}
-
-void ext_InitializeClass(JNIEnv *env, jclass clazz, ExtGetProcAddressPROC gpa, int num_functions, JavaMethodAndExtFunction *functions) {
- JNINativeMethod *methods;
- JavaMethodAndExtFunction *function;
- void *ext_func_pointer;
- void **ext_function_pointer_pointer;
- JNINativeMethod *method;
- int i;
- if (clazz == NULL) {
- throwException(env, "Null class");
- return;
- }
- methods = (JNINativeMethod *)malloc(num_functions*sizeof(JNINativeMethod));
- for (i = 0; i < num_functions; i++) {
- function = functions + i;
- if (function->ext_function_name != NULL) {
- ext_func_pointer = gpa(function->ext_function_name);
- if (ext_func_pointer == NULL) {
- free(methods);
- throwException(env, "Missing driver symbols");
- return;
- }
- ext_function_pointer_pointer = function->ext_function_pointer;
- *ext_function_pointer_pointer = ext_func_pointer;
- }
- method = methods + i;
- method->name = function->method_name;
- method->signature = function->signature;
- method->fnPtr = function->method_pointer;
- }
- (*env)->RegisterNatives(env, clazz, methods, num_functions);
- free(methods);
-}
-
-bool getBooleanProperty(JNIEnv *env, const char* propertyName) {
- jstring property = NewStringNativeWithLength(env, propertyName, strlen(propertyName));
- jclass org_lwjgl_LWJGLUtil_class;
- jmethodID getBoolean;
- if (property == NULL)
- return false;
- org_lwjgl_LWJGLUtil_class = (*env)->FindClass(env, "org/lwjgl/LWJGLUtil");
- if (org_lwjgl_LWJGLUtil_class == NULL)
- return false;
- getBoolean = (*env)->GetStaticMethodID(env, org_lwjgl_LWJGLUtil_class, "getPrivilegedBoolean", "(Ljava/lang/String;)Z");
- if (getBoolean == NULL)
- return false;
- return (*env)->CallStaticBooleanMethod(env, org_lwjgl_LWJGLUtil_class, getBoolean, property) ? true : false;
-}
-
-JNIEnv *getThreadEnv() {
- JNIEnv *env;
- (*jvm)->GetEnv(jvm, (void *)&env, JNI_VERSION_1_4);
- return env;
-}
-
-JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) {
- jvm = vm;
- return JNI_VERSION_1_4;
-}
-
-JNIEXPORT void JNICALL JNI_OnUnload(JavaVM *vm, void *reserved) {
-}
-
-bool positionBuffer(JNIEnv *env, jobject buffer, jint position) {
- jclass buffer_class;
- jmethodID position_method;
-
- buffer_class = (*env)->GetObjectClass(env, buffer);
- if (buffer_class == NULL)
- return false;
- position_method = (*env)->GetMethodID(env, buffer_class, "position", "(I)Ljava/nio/Buffer;");
- if (position_method == NULL)
- return false;
- (*env)->CallObjectMethod(env, buffer, position_method, position);
- return true;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: common_tools.c 3167 2008-12-22 16:38:57Z elias_naur $
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3167 $
+ */
+
+#include <jni.h>
+#include <stdlib.h>
+#include "common_tools.h"
+#include "org_lwjgl_DefaultSysImplementation.h"
+
+static bool debug = false;
+static JavaVM *jvm;
+
+void initAttribList(attrib_list_t *list) {
+ list->current_index = 0;
+}
+
+void putAttrib(attrib_list_t *list, int attrib) {
+ if (list->current_index == ATTRIB_LIST_SIZE) {
+ printfDebug("Ignoring attrib %d: attrib list size too small", attrib);
+ return;
+ }
+ list->attribs[list->current_index] = attrib;
+ list->current_index++;
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_DefaultSysImplementation_setDebug
+ (JNIEnv *env, jobject ignored, jboolean enable) {
+ debug = enable == JNI_TRUE ? true : false;
+}
+
+bool isDebugEnabled(void) {
+ return debug;
+}
+
+static int do_vsnprintf(char* buffer, size_t buffer_size, const char *format, va_list ap) {
+#ifdef _MSC_VER
+ return vsnprintf_s(buffer, buffer_size, _TRUNCATE, format, ap);
+#else
+ va_list cp_ap;
+ va_copy(cp_ap, ap);
+ int res = vsnprintf(buffer, buffer_size, format, cp_ap);
+ va_end(cp_ap);
+ return res;
+#endif
+}
+
+static jstring sprintfJavaString(JNIEnv *env, const char *format, va_list ap) {
+ int buffer_size = 2;
+ char *buffer;
+ jstring str;
+ int str_size;
+ buffer = (char *)malloc(sizeof(char)*buffer_size);
+ if (buffer == NULL)
+ return NULL;
+ str_size = do_vsnprintf(buffer, buffer_size, format, ap);
+ if (str_size > buffer_size) {
+ free(buffer);
+ buffer_size = str_size + 1;
+ buffer = (char *)malloc(sizeof(char)*buffer_size);
+ if (buffer == NULL)
+ return NULL;
+ do_vsnprintf(buffer, buffer_size, format, ap);
+ }
+ str = (*env)->NewStringUTF(env, buffer);
+ free(buffer);
+ return str;
+}
+
+void printfDebugJava(JNIEnv *env, const char *format, ...) {
+ jstring str;
+ jclass org_lwjgl_LWJGLUtil_class;
+ jmethodID log_method;
+ va_list ap;
+ if (isDebugEnabled() && !(*env)->ExceptionOccurred(env)) {
+ va_start(ap, format);
+ str = sprintfJavaString(env, format, ap);
+ va_end(ap);
+ org_lwjgl_LWJGLUtil_class = (*env)->FindClass(env, "org/lwjgl/LWJGLUtil");
+ if (org_lwjgl_LWJGLUtil_class == NULL)
+ return;
+ log_method = (*env)->GetStaticMethodID(env, org_lwjgl_LWJGLUtil_class, "log", "(Ljava/lang/String;)V");
+ if (log_method == NULL)
+ return;
+ (*env)->CallStaticVoidMethod(env, org_lwjgl_LWJGLUtil_class, log_method, str);
+ }
+}
+
+void printfDebug(const char *format, ...) {
+ va_list ap;
+ va_start(ap, format);
+ if (isDebugEnabled())
+ vfprintf(stderr, format, ap);
+ va_end(ap);
+}
+
+static void throwFormattedGeneralException(JNIEnv * env, const char *exception_name, const char *format, va_list ap) {
+ jclass cls;
+ jstring str;
+ jmethodID exception_constructor;
+ jobject exception;
+
+ if ((*env)->ExceptionCheck(env) == JNI_TRUE)
+ return; // The JVM crashes if we try to throw two exceptions from one native call
+ str = sprintfJavaString(env, format, ap);
+ cls = (*env)->FindClass(env, exception_name);
+ exception_constructor = (*env)->GetMethodID(env, cls, "<init>", "(Ljava/lang/String;)V");
+ exception = (*env)->NewObject(env, cls, exception_constructor, str);
+ (*env)->Throw(env, exception);
+}
+
+void throwGeneralException(JNIEnv * env, const char *exception_name, const char * err) {
+ jclass cls;
+
+ if ((*env)->ExceptionCheck(env) == JNI_TRUE)
+ return; // The JVM crashes if we try to throw two exceptions from one native call
+ cls = (*env)->FindClass(env, exception_name);
+ (*env)->ThrowNew(env, cls, err);
+}
+
+void throwFMODException(JNIEnv * env, const char * err) {
+ throwGeneralException(env, "org/lwjgl/fmod3/FMODException", err);
+}
+
+void throwFormattedRuntimeException(JNIEnv * env, const char *format, ...) {
+ va_list ap;
+ va_start(ap, format);
+ throwFormattedGeneralException(env, "java/lang/RuntimeException", format, ap);
+ va_end(ap);
+}
+
+void throwFormattedException(JNIEnv * env, const char *format, ...) {
+ va_list ap;
+ va_start(ap, format);
+ throwFormattedGeneralException(env, "org/lwjgl/LWJGLException", format, ap);
+ va_end(ap);
+}
+
+void throwException(JNIEnv * env, const char * err) {
+ throwGeneralException(env, "org/lwjgl/LWJGLException", err);
+}
+
+// retrieves the locale-specific C string
+char * GetStringNativeChars(JNIEnv *env, jstring jstr) {
+ jbyteArray bytes = 0;
+ jthrowable exc;
+ char *result = 0;
+ jclass jcls_str;
+ jmethodID MID_String_getBytes;
+
+ /* out of memory error? */
+ if ((*env)->EnsureLocalCapacity(env, 2) < 0) {
+ return 0;
+ }
+
+ // aquire getBytes method
+ jcls_str = (*env)->FindClass(env, "java/lang/String");
+ MID_String_getBytes = (*env)->GetMethodID(env, jcls_str, "getBytes", "()[B");
+
+ // get the bytes
+ bytes = (jbyteArray) (*env)->CallObjectMethod(env, jstr, MID_String_getBytes);
+ exc = (*env)->ExceptionOccurred(env);
+
+ // if no exception occured while getting bytes - continue
+ if (!exc) {
+ jint len = (*env)->GetArrayLength(env, bytes);
+ result = (char *) malloc(len + 1);
+ if (result == 0) {
+ throwGeneralException(env, "java/lang/OutOfMemoryError", NULL);
+ (*env)->DeleteLocalRef(env, bytes);
+ return 0;
+ }
+ (*env)->GetByteArrayRegion(env, bytes, 0, len, (jbyte *) result);
+ result[len] = 0; /* NULL-terminate */
+ } else {
+ (*env)->DeleteLocalRef(env, exc);
+ }
+ (*env)->DeleteLocalRef(env, bytes);
+ return (char*) result;
+}
+
+/* creates locale specific string, unsigned argument to
+ * match GLuchar and ALuchar types
+ */
+jstring NewStringNativeUnsigned(JNIEnv *env, const unsigned char *ustr) {
+ const char *str = (const char *)ustr;
+ if (str == NULL)
+ return NULL;
+ return NewStringNativeWithLength(env, str, strlen(str));
+}
+
+// creates locale specific string
+jstring NewStringNativeWithLength(JNIEnv *env, const char *str, int length) {
+ jclass jcls_str;
+ jmethodID jmethod_str;
+ jstring result;
+ jbyteArray bytes;
+ if (str==NULL) {
+ return NULL;
+ }
+
+ jcls_str = (*env)->FindClass(env,"java/lang/String");
+ if (jcls_str == NULL)
+ return NULL;
+ jmethod_str = (*env)->GetMethodID(env,jcls_str, "<init>", "([B)V");
+ if (jmethod_str == NULL)
+ return NULL;
+
+ bytes = 0;
+
+ if ((*env)->EnsureLocalCapacity(env,2) < 0) {
+ return NULL; /* out of memory error */
+ }
+
+ bytes = (*env)->NewByteArray(env,length);
+ if (bytes != NULL) {
+ (*env)->SetByteArrayRegion(env,bytes, 0, length, (jbyte *)str);
+ result = (jstring)(*env)->NewObject(env,jcls_str, jmethod_str, bytes);
+ (*env)->DeleteLocalRef(env,bytes);
+ return result;
+ } /* else fall through */
+ return NULL;
+}
+
+bool ext_InitializeFunctions(ExtGetProcAddressPROC gpa, int num_functions, ExtFunction *functions) {
+ int i;
+ void **ext_function_pointer_pointer;
+ for (i = 0; i < num_functions; i++) {
+ ExtFunction *function = functions + i;
+ if (function->ext_function_name != NULL) {
+ void *ext_func_pointer = gpa(function->ext_function_name);
+ if (ext_func_pointer == NULL)
+ return false;
+ ext_function_pointer_pointer = function->ext_function_pointer;
+ *ext_function_pointer_pointer = ext_func_pointer;
+ }
+ }
+ return true;
+}
+
+jobject newJavaManagedByteBuffer(JNIEnv *env, const int size) {
+ jclass bufferutils_class = (*env)->FindClass(env, "org/lwjgl/BufferUtils");
+ jmethodID createByteBuffer = (*env)->GetStaticMethodID(env, bufferutils_class, "createByteBuffer", "(I)Ljava/nio/ByteBuffer;");
+ jobject buffer = (*env)->CallStaticObjectMethod(env, bufferutils_class, createByteBuffer, size);
+ return buffer;
+}
+
+void ext_InitializeClass(JNIEnv *env, jclass clazz, ExtGetProcAddressPROC gpa, int num_functions, JavaMethodAndExtFunction *functions) {
+ JNINativeMethod *methods;
+ JavaMethodAndExtFunction *function;
+ void *ext_func_pointer;
+ void **ext_function_pointer_pointer;
+ JNINativeMethod *method;
+ int i;
+ if (clazz == NULL) {
+ throwException(env, "Null class");
+ return;
+ }
+ methods = (JNINativeMethod *)malloc(num_functions*sizeof(JNINativeMethod));
+ for (i = 0; i < num_functions; i++) {
+ function = functions + i;
+ if (function->ext_function_name != NULL) {
+ ext_func_pointer = gpa(function->ext_function_name);
+ if (ext_func_pointer == NULL) {
+ free(methods);
+ throwException(env, "Missing driver symbols");
+ return;
+ }
+ ext_function_pointer_pointer = function->ext_function_pointer;
+ *ext_function_pointer_pointer = ext_func_pointer;
+ }
+ method = methods + i;
+ method->name = function->method_name;
+ method->signature = function->signature;
+ method->fnPtr = function->method_pointer;
+ }
+ (*env)->RegisterNatives(env, clazz, methods, num_functions);
+ free(methods);
+}
+
+bool getBooleanProperty(JNIEnv *env, const char* propertyName) {
+ jstring property = NewStringNativeWithLength(env, propertyName, strlen(propertyName));
+ jclass org_lwjgl_LWJGLUtil_class;
+ jmethodID getBoolean;
+ if (property == NULL)
+ return false;
+ org_lwjgl_LWJGLUtil_class = (*env)->FindClass(env, "org/lwjgl/LWJGLUtil");
+ if (org_lwjgl_LWJGLUtil_class == NULL)
+ return false;
+ getBoolean = (*env)->GetStaticMethodID(env, org_lwjgl_LWJGLUtil_class, "getPrivilegedBoolean", "(Ljava/lang/String;)Z");
+ if (getBoolean == NULL)
+ return false;
+ return (*env)->CallStaticBooleanMethod(env, org_lwjgl_LWJGLUtil_class, getBoolean, property) ? true : false;
+}
+
+JNIEnv *getThreadEnv() {
+ JNIEnv *env;
+ (*jvm)->GetEnv(jvm, (void *)&env, JNI_VERSION_1_4);
+ return env;
+}
+
+JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) {
+ jvm = vm;
+ return JNI_VERSION_1_4;
+}
+
+JNIEXPORT void JNICALL JNI_OnUnload(JavaVM *vm, void *reserved) {
+}
+
+bool positionBuffer(JNIEnv *env, jobject buffer, jint position) {
+ jclass buffer_class;
+ jmethodID position_method;
+
+ buffer_class = (*env)->GetObjectClass(env, buffer);
+ if (buffer_class == NULL)
+ return false;
+ position_method = (*env)->GetMethodID(env, buffer_class, "position", "(I)Ljava/nio/Buffer;");
+ if (position_method == NULL)
+ return false;
+ (*env)->CallObjectMethod(env, buffer, position_method, position);
+ return true;
+}
diff --git a/src/native/common/common_tools.h b/src/native/common/common_tools.h
index c14f640..df18bfa 100644
--- a/src/native/common/common_tools.h
+++ b/src/native/common/common_tools.h
@@ -1,154 +1,154 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: common_tools.h 2988 2008-04-07 19:31:23Z elias_naur $
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2988 $
- */
-
-#ifndef _COMMON_TOOLS_H
-#define _COMMON_TOOLS_H
-
-#include <jni.h>
-#include <string.h>
-#include <stdlib.h>
-
-#define ATTRIB_LIST_SIZE (256)
-
-typedef struct {
- int current_index;
- int attribs[ATTRIB_LIST_SIZE];
-} attrib_list_t;
-
-#ifndef __cplusplus
-#ifndef bool
-typedef enum {false, true} bool;
-#endif
-#endif
-
-#ifdef _MSC_VER
-#define inline __inline
-#include <Basetsd.h>
-#else
-#include <inttypes.h>
-#endif
-
-static inline void * safeGetBufferAddress(JNIEnv *env, jobject buffer) {
- if (buffer != NULL) {
-#ifdef __cplusplus
- return (void *)((char *)env->GetDirectBufferAddress(buffer));
-#else
- return (void *)((char *)(*env)->GetDirectBufferAddress(env, buffer));
-#endif
- } else
- return NULL;
-}
-
-static inline jobject safeNewBuffer(JNIEnv *env, void *p, int size) {
- if (p != NULL) {
-#ifdef __cplusplus
- return env->NewDirectByteBuffer(p, size);
-#else
- return (*env)->NewDirectByteBuffer(env, p, size);
-#endif
- } else
- return NULL;
-}
-
-static inline jobject safeNewBufferCached(JNIEnv *env, void *p, int size, jobject old_buffer) {
- if (old_buffer != NULL) {
- void *old_buffer_address = (*env)->GetDirectBufferAddress(env, old_buffer);
- jlong capacity = (*env)->GetDirectBufferCapacity(env, old_buffer);
- if (old_buffer_address == p && capacity == size)
- return old_buffer;
- }
- return safeNewBuffer(env, p, size);
-
-}
-
-static inline void *offsetToPointer(jlong offset) {
- return (char *)NULL + offset;
-}
-
-typedef void *(* ExtGetProcAddressPROC) (const char *func_name);
-typedef struct {
- char *method_name;
- char *signature;
- void *method_pointer;
-
- char *ext_function_name;
- void **ext_function_pointer;
-} JavaMethodAndExtFunction;
-
-typedef struct {
- char *ext_function_name;
- void **ext_function_pointer;
-} ExtFunction;
-
-#define NUMFUNCTIONS(x) (sizeof(x)/sizeof(JavaMethodAndExtFunction));
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern JNIEnv *getThreadEnv();
-extern void initAttribList(attrib_list_t *list);
-extern void putAttrib(attrib_list_t *list, int attrib);
-
-extern bool isDebugEnabled(void);
-extern jstring getVersionString(JNIEnv *env);
-extern void throwGeneralException(JNIEnv * env, const char *exception_name, const char * err);
-extern void throwFormattedRuntimeException(JNIEnv * env, const char *format, ...);
-extern void throwException(JNIEnv *env, const char *msg);
-extern void throwFormattedException(JNIEnv * env, const char *format, ...);
-extern void throwFMODException(JNIEnv * env, const char * err);
-extern void setDebugEnabled(bool enable);
-extern void printfDebugJava(JNIEnv *env, const char *format, ...);
-extern void printfDebug(const char *format, ...);
-extern bool getBooleanProperty(JNIEnv *env, const char* propertyName);
-extern char * GetStringNativeChars(JNIEnv *env, jstring jstr);
-extern jstring NewStringNativeWithLength(JNIEnv *env, const char *str, int length);
-extern jstring NewStringNativeUnsigned(JNIEnv *env, const unsigned char *str);
-extern jobject newJavaManagedByteBuffer(JNIEnv *env, const int size);
-extern bool positionBuffer(JNIEnv *env, jobject buffer, jint position);
-
-extern void ext_InitializeClass(JNIEnv *env, jclass clazz, ExtGetProcAddressPROC gpa, int num_functions, JavaMethodAndExtFunction *functions);
-extern bool ext_InitializeFunctions(ExtGetProcAddressPROC gpa, int num_functions, ExtFunction *functions);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: common_tools.h 2988 2008-04-07 19:31:23Z elias_naur $
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2988 $
+ */
+
+#ifndef _COMMON_TOOLS_H
+#define _COMMON_TOOLS_H
+
+#include <jni.h>
+#include <string.h>
+#include <stdlib.h>
+
+#define ATTRIB_LIST_SIZE (256)
+
+typedef struct {
+ int current_index;
+ int attribs[ATTRIB_LIST_SIZE];
+} attrib_list_t;
+
+#ifndef __cplusplus
+#ifndef bool
+typedef enum {false, true} bool;
+#endif
+#endif
+
+#ifdef _MSC_VER
+#define inline __inline
+#include <Basetsd.h>
+#else
+#include <inttypes.h>
+#endif
+
+static inline void * safeGetBufferAddress(JNIEnv *env, jobject buffer) {
+ if (buffer != NULL) {
+#ifdef __cplusplus
+ return (void *)((char *)env->GetDirectBufferAddress(buffer));
+#else
+ return (void *)((char *)(*env)->GetDirectBufferAddress(env, buffer));
+#endif
+ } else
+ return NULL;
+}
+
+static inline jobject safeNewBuffer(JNIEnv *env, void *p, int size) {
+ if (p != NULL) {
+#ifdef __cplusplus
+ return env->NewDirectByteBuffer(p, size);
+#else
+ return (*env)->NewDirectByteBuffer(env, p, size);
+#endif
+ } else
+ return NULL;
+}
+
+static inline jobject safeNewBufferCached(JNIEnv *env, void *p, int size, jobject old_buffer) {
+ if (old_buffer != NULL) {
+ void *old_buffer_address = (*env)->GetDirectBufferAddress(env, old_buffer);
+ jlong capacity = (*env)->GetDirectBufferCapacity(env, old_buffer);
+ if (old_buffer_address == p && capacity == size)
+ return old_buffer;
+ }
+ return safeNewBuffer(env, p, size);
+
+}
+
+static inline void *offsetToPointer(jlong offset) {
+ return (char *)NULL + offset;
+}
+
+typedef void *(* ExtGetProcAddressPROC) (const char *func_name);
+typedef struct {
+ char *method_name;
+ char *signature;
+ void *method_pointer;
+
+ char *ext_function_name;
+ void **ext_function_pointer;
+} JavaMethodAndExtFunction;
+
+typedef struct {
+ char *ext_function_name;
+ void **ext_function_pointer;
+} ExtFunction;
+
+#define NUMFUNCTIONS(x) (sizeof(x)/sizeof(JavaMethodAndExtFunction));
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern JNIEnv *getThreadEnv();
+extern void initAttribList(attrib_list_t *list);
+extern void putAttrib(attrib_list_t *list, int attrib);
+
+extern bool isDebugEnabled(void);
+extern jstring getVersionString(JNIEnv *env);
+extern void throwGeneralException(JNIEnv * env, const char *exception_name, const char * err);
+extern void throwFormattedRuntimeException(JNIEnv * env, const char *format, ...);
+extern void throwException(JNIEnv *env, const char *msg);
+extern void throwFormattedException(JNIEnv * env, const char *format, ...);
+extern void throwFMODException(JNIEnv * env, const char * err);
+extern void setDebugEnabled(bool enable);
+extern void printfDebugJava(JNIEnv *env, const char *format, ...);
+extern void printfDebug(const char *format, ...);
+extern bool getBooleanProperty(JNIEnv *env, const char* propertyName);
+extern char * GetStringNativeChars(JNIEnv *env, jstring jstr);
+extern jstring NewStringNativeWithLength(JNIEnv *env, const char *str, int length);
+extern jstring NewStringNativeUnsigned(JNIEnv *env, const unsigned char *str);
+extern jobject newJavaManagedByteBuffer(JNIEnv *env, const int size);
+extern bool positionBuffer(JNIEnv *env, jobject buffer, jint position);
+
+extern void ext_InitializeClass(JNIEnv *env, jclass clazz, ExtGetProcAddressPROC gpa, int num_functions, JavaMethodAndExtFunction *functions);
+extern bool ext_InitializeFunctions(ExtGetProcAddressPROC gpa, int num_functions, ExtFunction *functions);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/src/native/common/extal.c b/src/native/common/extal.c
index 4e04c8b..a2b98b8 100644
--- a/src/native/common/extal.c
+++ b/src/native/common/extal.c
@@ -1,78 +1,78 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-#include <jni.h>
-#include "extal.h"
-
-typedef ALvoid* (ALAPIENTRY *alGetProcAddressPROC)(const ALubyte* fname);
-/* alGetProcAddress is commented out, since we don't use it anyway */
-//static alGetProcAddressPROC alGetProcAddress = NULL;
-
-/**
- * Initializes OpenAL by loading the library
- */
-/*void InitializeOpenAL(JNIEnv *env, jstring oalPath) {
- //load our library
- if (!tryLoadLibrary(env, oalPath)) {
- throwException(env, "Could not load openal library.");
- return;
- }
- alGetProcAddress = (alGetProcAddressPROC)NativeGetFunctionPointer("alGetProcAddress");
- if (alGetProcAddress == NULL) {
- UnLoadOpenAL();
- throwException(env, "Could not load alGetProcAddress function pointer.");
- return;
- }
-}*/
-
-/**
- * Retrieves a pointer to the named function
- *
- * @param function Name of function
- * @return pointer to named function, or NULL if not found
- */
-void* extal_GetProcAddress(const char* function) {
- void *p;
-/* p = alGetProcAddress((const ALubyte*)function);
- if (p == NULL) {*/
- p = NativeGetFunctionPointer(function);
- if (p == NULL) {
- printfDebug("Could not locate symbol %s\n", function);
- }
-// }
- return p;
-}
-
-void extal_InitializeClass(JNIEnv *env, jclass clazz, int num_functions, JavaMethodAndExtFunction *functions) {
- ext_InitializeClass(env, clazz, &extal_GetProcAddress, num_functions, functions);
-}
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+#include <jni.h>
+#include "extal.h"
+
+typedef ALvoid* (ALAPIENTRY *alGetProcAddressPROC)(const ALubyte* fname);
+/* alGetProcAddress is commented out, since we don't use it anyway */
+//static alGetProcAddressPROC alGetProcAddress = NULL;
+
+/**
+ * Initializes OpenAL by loading the library
+ */
+/*void InitializeOpenAL(JNIEnv *env, jstring oalPath) {
+ //load our library
+ if (!tryLoadLibrary(env, oalPath)) {
+ throwException(env, "Could not load openal library.");
+ return;
+ }
+ alGetProcAddress = (alGetProcAddressPROC)NativeGetFunctionPointer("alGetProcAddress");
+ if (alGetProcAddress == NULL) {
+ UnLoadOpenAL();
+ throwException(env, "Could not load alGetProcAddress function pointer.");
+ return;
+ }
+}*/
+
+/**
+ * Retrieves a pointer to the named function
+ *
+ * @param function Name of function
+ * @return pointer to named function, or NULL if not found
+ */
+void* extal_GetProcAddress(const char* function) {
+ void *p;
+/* p = alGetProcAddress((const ALubyte*)function);
+ if (p == NULL) {*/
+ p = NativeGetFunctionPointer(function);
+ if (p == NULL) {
+ printfDebug("Could not locate symbol %s\n", function);
+ }
+// }
+ return p;
+}
+
+void extal_InitializeClass(JNIEnv *env, jclass clazz, int num_functions, JavaMethodAndExtFunction *functions) {
+ ext_InitializeClass(env, clazz, &extal_GetProcAddress, num_functions, functions);
+}
+
diff --git a/src/native/common/extal.h b/src/native/common/extal.h
index d0b62f8..1eac883 100644
--- a/src/native/common/extal.h
+++ b/src/native/common/extal.h
@@ -1,172 +1,172 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-#ifndef _AL_TEST_H
-#define _AL_TEST_H
-
-#ifdef _WIN32
-#include <windows.h>
-#endif
-
-#include <jni.h>
-#include "common_tools.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if defined(_WIN32)
- #ifdef _OPENAL32LIB
- #define ALCAPI __declspec(dllexport)
- #else
- #define ALCAPI __declspec(dllimport)
- #endif
-
- #define ALCAPIENTRY __cdecl
-#else
- #define ALCAPI
- #define ALCAPIENTRY
-
-#endif
-
-#ifdef _WIN32
- #ifdef _OPENAL32LIB
- #define ALAPI __declspec(dllexport)
- #else
- #define ALAPI __declspec(dllimport)
- #endif
- #define ALAPIENTRY __cdecl
- #define AL_CALLBACK
-#else
- #define ALAPI
- #define ALAPIENTRY
- #define AL_CALLBACK
-#endif
-
-#define INITGUID
-#define OPENAL
-
-// ALC typedefs
-typedef struct ALCdevice_struct ALCdevice;
-typedef struct ALCcontext_struct ALCcontext;
-/** 8-bit boolean */
-typedef char ALCboolean;
-
-/** character */
-typedef char ALCchar;
-
-/** signed 8-bit 2's complement integer */
-typedef char ALCbyte;
-
-/** unsigned 8-bit integer */
-typedef unsigned char ALCubyte;
-
-/** signed 16-bit 2's complement integer */
-typedef short ALCshort;
-
-/** unsigned 16-bit integer */
-typedef unsigned short ALCushort;
-
-/** signed 32-bit 2's complement integer */
-typedef int ALCint;
-
-/** unsigned 32-bit integer */
-typedef unsigned int ALCuint;
-
-/** non-negative 32-bit binary integer size */
-typedef int ALCsizei;
-
-/** enumerated 32-bit value */
-typedef int ALCenum;
-
-/** 32-bit IEEE754 floating-point */
-typedef float ALCfloat;
-
-/** 64-bit IEEE754 floating-point */
-typedef double ALCdouble;
-
-/** void type (for opaque pointers only) */
-typedef void ALCvoid;
-
-// AL typedefs
-/** 8-bit boolean */
-typedef char ALboolean;
-
-/** character */
-typedef char ALchar;
-
-/** signed 8-bit 2's complement integer */
-typedef char ALbyte;
-
-/** unsigned 8-bit integer */
-typedef unsigned char ALubyte;
-
-/** signed 16-bit 2's complement integer */
-typedef short ALshort;
-
-/** unsigned 16-bit integer */
-typedef unsigned short ALushort;
-
-/** signed 32-bit 2's complement integer */
-typedef int ALint;
-
-/** unsigned 32-bit integer */
-typedef unsigned int ALuint;
-
-/** non-negative 32-bit binary integer size */
-typedef int ALsizei;
-
-/** enumerated 32-bit value */
-typedef int ALenum;
-
-/** 32-bit IEEE754 floating-point */
-typedef float ALfloat;
-
-/** 64-bit IEEE754 floating-point */
-typedef double ALdouble;
-
-/** void type (for opaque pointers only) */
-typedef void ALvoid;
-
-void* extal_GetProcAddress(const char* function);
-void extal_InitializeClass(JNIEnv *env, jclass clazz, int num_functions, JavaMethodAndExtFunction *functions);
-
-/* Platform dependent functions */
-void *NativeGetFunctionPointer(const char *function);
-void tryLoadLibrary(JNIEnv *env, jstring path);
-void UnLoadOpenAL();
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+#ifndef _AL_TEST_H
+#define _AL_TEST_H
+
+#ifdef _WIN32
+#include <windows.h>
+#endif
+
+#include <jni.h>
+#include "common_tools.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined(_WIN32)
+ #ifdef _OPENAL32LIB
+ #define ALCAPI __declspec(dllexport)
+ #else
+ #define ALCAPI __declspec(dllimport)
+ #endif
+
+ #define ALCAPIENTRY __cdecl
+#else
+ #define ALCAPI
+ #define ALCAPIENTRY
+
+#endif
+
+#ifdef _WIN32
+ #ifdef _OPENAL32LIB
+ #define ALAPI __declspec(dllexport)
+ #else
+ #define ALAPI __declspec(dllimport)
+ #endif
+ #define ALAPIENTRY __cdecl
+ #define AL_CALLBACK
+#else
+ #define ALAPI
+ #define ALAPIENTRY
+ #define AL_CALLBACK
+#endif
+
+#define INITGUID
+#define OPENAL
+
+// ALC typedefs
+typedef struct ALCdevice_struct ALCdevice;
+typedef struct ALCcontext_struct ALCcontext;
+/** 8-bit boolean */
+typedef char ALCboolean;
+
+/** character */
+typedef char ALCchar;
+
+/** signed 8-bit 2's complement integer */
+typedef char ALCbyte;
+
+/** unsigned 8-bit integer */
+typedef unsigned char ALCubyte;
+
+/** signed 16-bit 2's complement integer */
+typedef short ALCshort;
+
+/** unsigned 16-bit integer */
+typedef unsigned short ALCushort;
+
+/** signed 32-bit 2's complement integer */
+typedef int ALCint;
+
+/** unsigned 32-bit integer */
+typedef unsigned int ALCuint;
+
+/** non-negative 32-bit binary integer size */
+typedef int ALCsizei;
+
+/** enumerated 32-bit value */
+typedef int ALCenum;
+
+/** 32-bit IEEE754 floating-point */
+typedef float ALCfloat;
+
+/** 64-bit IEEE754 floating-point */
+typedef double ALCdouble;
+
+/** void type (for opaque pointers only) */
+typedef void ALCvoid;
+
+// AL typedefs
+/** 8-bit boolean */
+typedef char ALboolean;
+
+/** character */
+typedef char ALchar;
+
+/** signed 8-bit 2's complement integer */
+typedef char ALbyte;
+
+/** unsigned 8-bit integer */
+typedef unsigned char ALubyte;
+
+/** signed 16-bit 2's complement integer */
+typedef short ALshort;
+
+/** unsigned 16-bit integer */
+typedef unsigned short ALushort;
+
+/** signed 32-bit 2's complement integer */
+typedef int ALint;
+
+/** unsigned 32-bit integer */
+typedef unsigned int ALuint;
+
+/** non-negative 32-bit binary integer size */
+typedef int ALsizei;
+
+/** enumerated 32-bit value */
+typedef int ALenum;
+
+/** 32-bit IEEE754 floating-point */
+typedef float ALfloat;
+
+/** 64-bit IEEE754 floating-point */
+typedef double ALdouble;
+
+/** void type (for opaque pointers only) */
+typedef void ALvoid;
+
+void* extal_GetProcAddress(const char* function);
+void extal_InitializeClass(JNIEnv *env, jclass clazz, int num_functions, JavaMethodAndExtFunction *functions);
+
+/* Platform dependent functions */
+void *NativeGetFunctionPointer(const char *function);
+void tryLoadLibrary(JNIEnv *env, jstring path);
+void UnLoadOpenAL();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/native/common/extgl.c b/src/native/common/extgl.c
index c965ede..cc30190 100644
--- a/src/native/common/extgl.c
+++ b/src/native/common/extgl.c
@@ -1,83 +1,83 @@
-/* ----------------------------------------------------------------------------
-Copyright (c) 2001-2002, Lev Povalahev
-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.
- * The name of the author 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.
-------------------------------------------------------------------------------*/
-/*
- Lev Povalahev
-
- levp at gmx.net
-
- http://www.uni-karlsruhe.de/~uli2/
-
-*/
-
-#include <stdio.h>
-#include <string.h>
-#include "extgl.h"
-#include "common_tools.h"
-
-void extgl_InitializeClass(JNIEnv *env, jclass clazz, int num_functions, JavaMethodAndExtFunction *functions) {
- ext_InitializeClass(env, clazz, &extgl_GetProcAddress, num_functions, functions);
-}
-
-bool extgl_InitializeFunctions(int num_functions, ExtFunction *functions) {
- return ext_InitializeFunctions(&extgl_GetProcAddress, num_functions, functions);
-}
-
-bool extgl_QueryExtension(const GLubyte*extensions, const char *name)
-{
- const GLubyte *start;
- GLubyte *where, *terminator;
-
- if (extensions == NULL) {
- printfDebug("NULL extension string\n");
- return false;
- }
-
- /* Extension names should not have spaces. */
- where = (GLubyte *) strchr(name, ' ');
- if (where || *name == '\0')
- return false;
-
- /* It takes a bit of care to be fool-proof about parsing the
- OpenGL extensions string. Don't be fooled by sub-strings,
- etc. */
- start = extensions;
- for (;;)
- {
- where = (GLubyte *) strstr((const char *) start, name);
- if (!where)
- break;
- terminator = where + strlen(name);
- if (where == start || *(where - 1) == ' ')
- if (*terminator == ' ' || *terminator == '\0') {
- return true;
- }
- start = terminator;
- }
- return false;
-
-}
-
+/* ----------------------------------------------------------------------------
+Copyright (c) 2001-2002, Lev Povalahev
+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.
+ * The name of the author 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.
+------------------------------------------------------------------------------*/
+/*
+ Lev Povalahev
+
+ levp at gmx.net
+
+ http://www.uni-karlsruhe.de/~uli2/
+
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include "extgl.h"
+#include "common_tools.h"
+
+void extgl_InitializeClass(JNIEnv *env, jclass clazz, int num_functions, JavaMethodAndExtFunction *functions) {
+ ext_InitializeClass(env, clazz, &extgl_GetProcAddress, num_functions, functions);
+}
+
+bool extgl_InitializeFunctions(int num_functions, ExtFunction *functions) {
+ return ext_InitializeFunctions(&extgl_GetProcAddress, num_functions, functions);
+}
+
+bool extgl_QueryExtension(const GLubyte*extensions, const char *name)
+{
+ const GLubyte *start;
+ GLubyte *where, *terminator;
+
+ if (extensions == NULL) {
+ printfDebug("NULL extension string\n");
+ return false;
+ }
+
+ /* Extension names should not have spaces. */
+ where = (GLubyte *) strchr(name, ' ');
+ if (where || *name == '\0')
+ return false;
+
+ /* It takes a bit of care to be fool-proof about parsing the
+ OpenGL extensions string. Don't be fooled by sub-strings,
+ etc. */
+ start = extensions;
+ for (;;)
+ {
+ where = (GLubyte *) strstr((const char *) start, name);
+ if (!where)
+ break;
+ terminator = where + strlen(name);
+ if (where == start || *(where - 1) == ' ')
+ if (*terminator == ' ' || *terminator == '\0') {
+ return true;
+ }
+ start = terminator;
+ }
+ return false;
+
+}
+
diff --git a/src/native/common/extgl.h b/src/native/common/extgl.h
index de01b10..b26b92b 100644
--- a/src/native/common/extgl.h
+++ b/src/native/common/extgl.h
@@ -1,146 +1,146 @@
-/* Small parts were taken from Mesa's glext.h and gl.h, here's the license: */
-
-/*
- * Mesa 3-D graphics library
- * Version: 6.5.1
- *
- * Copyright (C) 1999-2006 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.
- */
-
-/* Some parts derived from files copyright (c) 2001-2002 Lev Povalahev under this license: */
-
-/* ----------------------------------------------------------------------------
-Copyright (c) 2002, Lev Povalahev
-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.
- * The name of the author 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.
-------------------------------------------------------------------------------*/
-/*
- GL_draw_range_elements support added by Benjamin Karaban
-
- Lev Povalahev contact information:
-
- levp at gmx.net
-
- http://www.uni-karlsruhe.de/~uli2/
-*/
-
-#ifndef __EXTGL_H__
-#define __EXTGL_H__
-
-#include <jni.h>
-
-#include <string.h>
-#include <stddef.h>
-
-#include "common_tools.h"
-
-#if defined(_WIN32) || defined(_WIN64)
- #include <windows.h> // fix APIENTRY macro redefinition
- # define int64_t __int64
- # define uint64_t unsigned __int64
-#endif
-
-#ifndef APIENTRY
-#define APIENTRY
-#endif
-
-#ifdef _MACOSX
- typedef unsigned long GLenum;
- typedef unsigned char GLboolean;
- typedef unsigned long GLbitfield;
- typedef signed char GLbyte;
- typedef short GLshort;
- typedef long GLint;
- typedef long GLsizei;
- typedef unsigned char GLubyte;
- typedef unsigned short GLushort;
- typedef unsigned long GLuint;
- typedef float GLfloat;
- typedef float GLclampf;
- typedef double GLdouble;
- typedef double GLclampd;
- typedef void GLvoid;
-#else
- 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] */
-#endif
-
-typedef char GLchar; /* native character */
-
-typedef ptrdiff_t GLintptr;
-typedef ptrdiff_t GLsizeiptr;
-typedef ptrdiff_t GLintptrARB;
-typedef ptrdiff_t GLsizeiptrARB;
-typedef char GLcharARB; /* native character */
-typedef unsigned int GLhandleARB; /* shader object handle */
-typedef unsigned short GLhalfARB;
-typedef unsigned short GLhalfNV;
-typedef unsigned short GLhalf;
-typedef int64_t GLint64EXT;
-typedef uint64_t GLuint64EXT;
-typedef int64_t GLint64;
-typedef uint64_t GLuint64;
-typedef struct __GLsync *GLsync;
-
-/* helper stuff */
-
-/* initializes everything, call this right after the rc is created. the function returns true if successful */
-extern bool extgl_Open(JNIEnv *env);
-extern void extgl_Close(void);
-extern void extgl_InitializeClass(JNIEnv *env, jclass clazz, int num_functions, JavaMethodAndExtFunction *functions);
-extern bool extgl_InitializeFunctions(int num_functions, ExtFunction *functions);
-extern bool extgl_QueryExtension(const GLubyte*extensions, const char *name);
-extern void *extgl_GetProcAddress(const char *name);
-
-#endif /* __EXTGL_H__ */
+/* Small parts were taken from Mesa's glext.h and gl.h, here's the license: */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5.1
+ *
+ * Copyright (C) 1999-2006 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.
+ */
+
+/* Some parts derived from files copyright (c) 2001-2002 Lev Povalahev under this license: */
+
+/* ----------------------------------------------------------------------------
+Copyright (c) 2002, Lev Povalahev
+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.
+ * The name of the author 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.
+------------------------------------------------------------------------------*/
+/*
+ GL_draw_range_elements support added by Benjamin Karaban
+
+ Lev Povalahev contact information:
+
+ levp at gmx.net
+
+ http://www.uni-karlsruhe.de/~uli2/
+*/
+
+#ifndef __EXTGL_H__
+#define __EXTGL_H__
+
+#include <jni.h>
+
+#include <string.h>
+#include <stddef.h>
+
+#include "common_tools.h"
+
+#if defined(_WIN32) || defined(_WIN64)
+ #include <windows.h> // fix APIENTRY macro redefinition
+ # define int64_t __int64
+ # define uint64_t unsigned __int64
+#endif
+
+#ifndef APIENTRY
+#define APIENTRY
+#endif
+
+#ifdef _MACOSX
+ typedef unsigned long GLenum;
+ typedef unsigned char GLboolean;
+ typedef unsigned long GLbitfield;
+ typedef signed char GLbyte;
+ typedef short GLshort;
+ typedef long GLint;
+ typedef long GLsizei;
+ typedef unsigned char GLubyte;
+ typedef unsigned short GLushort;
+ typedef unsigned long GLuint;
+ typedef float GLfloat;
+ typedef float GLclampf;
+ typedef double GLdouble;
+ typedef double GLclampd;
+ typedef void GLvoid;
+#else
+ 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] */
+#endif
+
+typedef char GLchar; /* native character */
+
+typedef ptrdiff_t GLintptr;
+typedef ptrdiff_t GLsizeiptr;
+typedef ptrdiff_t GLintptrARB;
+typedef ptrdiff_t GLsizeiptrARB;
+typedef char GLcharARB; /* native character */
+typedef unsigned int GLhandleARB; /* shader object handle */
+typedef unsigned short GLhalfARB;
+typedef unsigned short GLhalfNV;
+typedef unsigned short GLhalf;
+typedef int64_t GLint64EXT;
+typedef uint64_t GLuint64EXT;
+typedef int64_t GLint64;
+typedef uint64_t GLuint64;
+typedef struct __GLsync *GLsync;
+
+/* helper stuff */
+
+/* initializes everything, call this right after the rc is created. the function returns true if successful */
+extern bool extgl_Open(JNIEnv *env);
+extern void extgl_Close(void);
+extern void extgl_InitializeClass(JNIEnv *env, jclass clazz, int num_functions, JavaMethodAndExtFunction *functions);
+extern bool extgl_InitializeFunctions(int num_functions, ExtFunction *functions);
+extern bool extgl_QueryExtension(const GLubyte*extensions, const char *name);
+extern void *extgl_GetProcAddress(const char *name);
+
+#endif /* __EXTGL_H__ */
diff --git a/src/native/common/org_lwjgl_openal_AL.c b/src/native/common/org_lwjgl_openal_AL.c
index 67fda88..20b3243 100644
--- a/src/native/common/org_lwjgl_openal_AL.c
+++ b/src/native/common/org_lwjgl_openal_AL.c
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-#include <jni.h>
-#include "org_lwjgl_openal_AL.h"
-#include "extal.h"
-
-JNIEXPORT void JNICALL Java_org_lwjgl_openal_AL_nCreate(JNIEnv *env, jclass clazz, jstring oalPath) {
- tryLoadLibrary(env, oalPath);
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_openal_AL_nDestroy(JNIEnv *env, jclass clazz) {
- UnLoadOpenAL();
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_openal_AL_resetNativeStubs(JNIEnv *env, jclass clazz, jclass al_class) {
- (*env)->UnregisterNatives(env, al_class);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+#include <jni.h>
+#include "org_lwjgl_openal_AL.h"
+#include "extal.h"
+
+JNIEXPORT void JNICALL Java_org_lwjgl_openal_AL_nCreate(JNIEnv *env, jclass clazz, jstring oalPath) {
+ tryLoadLibrary(env, oalPath);
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_openal_AL_nDestroy(JNIEnv *env, jclass clazz) {
+ UnLoadOpenAL();
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_openal_AL_resetNativeStubs(JNIEnv *env, jclass clazz, jclass al_class) {
+ (*env)->UnregisterNatives(env, al_class);
+}
diff --git a/src/native/common/org_lwjgl_openal_ALC10.c b/src/native/common/org_lwjgl_openal_ALC10.c
index cbf9db3..33b9b81 100644
--- a/src/native/common/org_lwjgl_openal_ALC10.c
+++ b/src/native/common/org_lwjgl_openal_ALC10.c
@@ -1,315 +1,315 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: org_lwjgl_openal_ALC.c 2279 2006-02-23 19:22:00Z elias_naur $
- *
- * This is the actual JNI implementation of the OpenAL context/device library.
- *
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 2279 $
- */
-
-/* OpenAL includes */
-#include "extal.h"
-
-//alc
-typedef ALCubyte* (ALCAPIENTRY *alcGetStringPROC)(ALCdevice *device,ALCenum param);
-typedef ALCvoid (ALCAPIENTRY *alcGetIntegervPROC)(ALCdevice *device,ALCenum param,ALCsizei size,ALCint *data);
-typedef ALCdevice* (ALCAPIENTRY *alcOpenDevicePROC)(ALCubyte *deviceName);
-typedef ALCboolean (ALCAPIENTRY *alcCloseDevicePROC)(ALCdevice *device);
-typedef ALCcontext* (ALCAPIENTRY *alcCreateContextPROC)(ALCdevice *device,ALCint *attrList);
-typedef ALCenum (ALCAPIENTRY *alcMakeContextCurrentPROC)(ALCcontext *context);
-typedef ALCvoid (ALCAPIENTRY *alcProcessContextPROC)(ALCcontext *context);
-typedef ALCdevice* (ALCAPIENTRY *alcGetContextsDevicePROC)(ALCcontext *context);
-typedef ALCvoid (ALCAPIENTRY *alcSuspendContextPROC)(ALCcontext *context);
-typedef ALCvoid (ALCAPIENTRY *alcDestroyContextPROC)(ALCcontext *context);
-typedef ALCenum (ALCAPIENTRY *alcGetErrorPROC)(ALCdevice *device);
-typedef ALCboolean (ALCAPIENTRY *alcIsExtensionPresentPROC)(ALCdevice *device,ALCubyte *extName);
-//typedef ALCvoid* (ALCAPIENTRY *alcGetProcAddressPROC)(ALCdevice *device,ALCubyte *funcName);
-typedef ALCenum (ALCAPIENTRY *alcGetEnumValuePROC)(ALCdevice *device,ALCubyte *enumName);
-typedef ALCcontext* (ALCAPIENTRY *alcGetCurrentContextPROC)(ALCvoid);
-
-static alcGetCurrentContextPROC alcGetCurrentContext = NULL;
-static alcGetStringPROC alcGetString;
-static alcGetIntegervPROC alcGetIntegerv;
-static alcOpenDevicePROC alcOpenDevice;
-static alcCloseDevicePROC alcCloseDevice;
-static alcCreateContextPROC alcCreateContext;
-static alcMakeContextCurrentPROC alcMakeContextCurrent;
-static alcProcessContextPROC alcProcessContext;
-static alcGetContextsDevicePROC alcGetContextsDevice;
-static alcSuspendContextPROC alcSuspendContext;
-static alcDestroyContextPROC alcDestroyContext;
-static alcGetErrorPROC alcGetError;
-static alcIsExtensionPresentPROC alcIsExtensionPresent;
-//static alcGetProcAddressPROC alcGetProcAddress;
-static alcGetEnumValuePROC alcGetEnumValue;
-
-/**
- * This function returns strings related to the context.
- *
- * C Specification:
- * ALubyte * alcGetString(ALCdevice *device, ALenum token);
- */
-static jstring JNICALL Java_org_lwjgl_openal_ALC10_nalcGetString (JNIEnv *env, jclass clazz, jlong deviceaddress, jint token) {
- const char* alcString = (const char*) alcGetString((ALCdevice*)((intptr_t)deviceaddress), (ALenum) token);
- int length;
- int i=1;
-
- if(alcString == NULL) {
- return NULL;
- }
-
- // Special treatment of enumeration tokens
- // These are encoded using \0 between elements and a finishing \0\0
- switch(token) {
- case 0x1005: // ALC_DEVICE_SPECIFIER
- case 0x310: // ALC_CAPTURE_DEVICE_SPECIFIER
- case 0x1013: // ALC_ALL_DEVICES_SPECIFIER
- while (alcString[i - 1] != '\0' || alcString[i] != '\0') {
- i++;
- }
- length = i + 1;
- break;
- default:
- length = strlen(alcString);
- }
- return NewStringNativeWithLength(env, alcString, length);
-}
-
-/**
- * This function returns integers related to the context.
- *
- * C Specification:
- * ALvoid alcGetIntegerv(ALCdevice *device, ALenum token, ALsizei size, ALint *dest);
- */
-static void JNICALL Java_org_lwjgl_openal_ALC10_nalcGetIntegerv (JNIEnv *env, jclass clazz, jlong deviceaddress, jint token, jint size, jobject dest, jint offset) {
- ALint* address = NULL;
- if (dest != NULL) {
- address = offset + (ALint*) (*env)->GetDirectBufferAddress(env, dest);
- }
- alcGetIntegerv((ALCdevice*)((intptr_t)deviceaddress), (ALenum) token, (ALsizei) size, address);
-}
-
-/**
- * This function opens a device by name.
- *
- * C Specification:
- * ALCdevice *alcOpenDevice( const ALubyte *tokstr );
- */
-static jlong JNICALL Java_org_lwjgl_openal_ALC10_nalcOpenDevice (JNIEnv *env, jclass clazz, jstring tokstr) {
- char * tokenstring;
- ALCdevice* device;
-
- if(tokstr != NULL) {
- tokenstring = GetStringNativeChars(env, tokstr);
- } else {
- tokenstring = NULL;
- }
-
- /* get device */
- device = alcOpenDevice((ALubyte *) tokenstring);
-
- if(tokenstring != NULL) {
- free(tokenstring);
- }
-
- return (jlong)((intptr_t)device);
-}
-
-/**
- * This function closes a device by name.
- *
- * C Specification:
- * bool alcCloseDevice( ALCdevice *dev );
- */
-static jboolean JNICALL Java_org_lwjgl_openal_ALC10_nalcCloseDevice (JNIEnv *env, jclass clazz, jlong deviceaddress) {
- return alcCloseDevice((ALCdevice*)((intptr_t)deviceaddress));
-}
-
-/**
- * This function creates a context using a specified device.
- *
- * C Specification:
- * ALCcontext* alcCreateContext( ALCdevice *dev, ALint* attrlist );
- */
-static jlong JNICALL Java_org_lwjgl_openal_ALC10_nalcCreateContext (JNIEnv *env, jclass clazz, jlong deviceaddress, jobject attrlist) {
- ALint* address = NULL;
- ALCcontext* context;
-
- if (attrlist != NULL) {
- address = (ALint*) safeGetBufferAddress(env, attrlist);
- }
- context = alcCreateContext((ALCdevice*)((intptr_t)deviceaddress), address);
-
- return (jlong)((intptr_t)context);
-}
-
-/**
- * This function makes a specified context the current context.
- *
- * C Specification:
- * ALCboolean alcMakeContextCurrent(ALCcontext *context);
- */
-static jint JNICALL Java_org_lwjgl_openal_ALC10_nalcMakeContextCurrent (JNIEnv *env, jclass clazz, jlong contextaddress) {
- ALCcontext* context = (ALCcontext*)((intptr_t)contextaddress);
- return alcMakeContextCurrent(context);
-}
-
-/**
- * This function tells a context to begin processing.
- *
- * C Specification:
- * void alcProcessContext(ALCcontext *context);
- */
-static void JNICALL Java_org_lwjgl_openal_ALC10_nalcProcessContext (JNIEnv *env, jclass clazz, jlong contextaddress) {
- alcProcessContext((ALCcontext*)((intptr_t)contextaddress));
-}
-
-/**
- * This function retrieves the current context.
- *
- * C Specification:
- * ALCcontext* alcGetCurrentContext( ALvoid );
- */
-static jlong JNICALL Java_org_lwjgl_openal_ALC10_nalcGetCurrentContext (JNIEnv *env, jclass clazz) {
- ALCcontext* context = alcGetCurrentContext();
- return (jlong)((intptr_t)context);
-}
-
-/**
- * This function retrieves the specified contexts device
- *
- * C Specification:
- * ALCdevice* alcGetContextsDevice(ALCcontext *context);
- */
-static jlong JNICALL Java_org_lwjgl_openal_ALC10_nalcGetContextsDevice (JNIEnv *env, jclass clazz, jlong contextaddress) {
- ALCdevice* device = alcGetContextsDevice((ALCcontext*)((intptr_t)contextaddress));
- return (jlong)((intptr_t)device);
-}
-
-/**
- * This function suspends processing on a specified context.
- *
- * C Specification:
- * void alcSuspendContext(ALCcontext *context);
- */
-static void JNICALL Java_org_lwjgl_openal_ALC10_nalcSuspendContext (JNIEnv *env, jclass clazz, jlong contextaddress) {
- alcSuspendContext((ALCcontext*)((intptr_t)contextaddress));
-}
-
-/**
- * This function destroys a context.
- *
- * C Specification:
- * void alcDestroyContext(ALCcontext *context);
- */
-static void JNICALL Java_org_lwjgl_openal_ALC10_nalcDestroyContext (JNIEnv *env, jclass clazz, jlong contextaddress) {
- alcDestroyContext((ALCcontext*)((intptr_t)contextaddress));
-}
-
-/**
- * This function retrieves the specified devices context error state.
- *
- * C Specification:
- * ALCenum alcGetError(ALCdevice *device);
- */
-static jint JNICALL Java_org_lwjgl_openal_ALC10_nalcGetError (JNIEnv *env, jclass clazz, jlong deviceaddress) {
- return alcGetError((ALCdevice*)((intptr_t)deviceaddress));
-}
-
-/**
- * This function queries if a specified context extension is available.
- *
- * C Specification:
- * ALboolean alcIsExtensionPresent(ALCdevice *device, ALubyte *extName);
- */
-static jboolean JNICALL Java_org_lwjgl_openal_ALC10_nalcIsExtensionPresent (JNIEnv *env, jclass clazz, jlong deviceaddress, jstring extName) {
- /* get extension */
- ALubyte* functionname = (ALubyte*) GetStringNativeChars(env, extName);
-
- jboolean result = (jboolean) alcIsExtensionPresent((ALCdevice*)((intptr_t)deviceaddress), functionname);
-
- free(functionname);
-
- return result;
-}
-
-/**
- * This function retrieves the enum value for a specified enumeration name.
- *
- * C Specification:
- * ALenum alcGetEnumValue(ALCdevice *device, ALubyte *enumName);
- */
-static jint JNICALL Java_org_lwjgl_openal_ALC10_nalcGetEnumValue (JNIEnv *env, jclass clazz, jlong deviceaddress, jstring enumName) {
- /* get extension */
- ALubyte* enumerationname = (ALubyte*) GetStringNativeChars(env, enumName);
-
- jint result = (jint) alcGetEnumValue((ALCdevice*)((intptr_t)deviceaddress), enumerationname);
-
- free(enumerationname);
-
- return result;
-}
-
-/**
- * Loads the context OpenAL functions
- *
- * @return true if all methods were loaded, false if one of the methods could not be loaded
- */
-#ifdef __cplusplus
-extern "C" {
-#endif
-JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC10_initNativeStubs(JNIEnv *env, jclass clazz) {
- JavaMethodAndExtFunction functions[] = {
- {"nalcGetString", "(JI)Ljava/lang/String;", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetString, "alcGetString", (void*)&alcGetString},
- {"nalcGetIntegerv", "(JIILjava/nio/Buffer;I)V", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetIntegerv, "alcGetIntegerv", (void*)&alcGetIntegerv},
- {"nalcOpenDevice", "(Ljava/lang/String;)J", (void*)&Java_org_lwjgl_openal_ALC10_nalcOpenDevice, "alcOpenDevice", (void*)&alcOpenDevice},
- {"nalcCloseDevice", "(J)Z", (void*)&Java_org_lwjgl_openal_ALC10_nalcCloseDevice, "alcCloseDevice", (void*)&alcCloseDevice},
- {"nalcCreateContext", "(JLjava/nio/IntBuffer;)J", (void*)&Java_org_lwjgl_openal_ALC10_nalcCreateContext, "alcCreateContext", (void*)&alcCreateContext},
- {"nalcMakeContextCurrent", "(J)I", (void*)&Java_org_lwjgl_openal_ALC10_nalcMakeContextCurrent, "alcMakeContextCurrent", (void*)&alcMakeContextCurrent},
- {"nalcProcessContext", "(J)V", (void*)&Java_org_lwjgl_openal_ALC10_nalcProcessContext, "alcProcessContext", (void*)&alcProcessContext},
- {"nalcGetCurrentContext", "()J", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetCurrentContext, "alcGetCurrentContext", (void*)&alcGetCurrentContext},
- {"nalcGetContextsDevice", "(J)J", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetContextsDevice, "alcGetContextsDevice", (void*)&alcGetContextsDevice},
- {"nalcSuspendContext", "(J)V", (void*)&Java_org_lwjgl_openal_ALC10_nalcSuspendContext, "alcSuspendContext", (void*)&alcSuspendContext},
- {"nalcDestroyContext", "(J)V", (void*)&Java_org_lwjgl_openal_ALC10_nalcDestroyContext, "alcDestroyContext", (void*)&alcDestroyContext},
- {"nalcGetError", "(J)I", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetError, "alcGetError", (void*)&alcGetError},
- {"nalcIsExtensionPresent", "(JLjava/lang/String;)Z", (void*)&Java_org_lwjgl_openal_ALC10_nalcIsExtensionPresent, "alcIsExtensionPresent", (void*)&alcIsExtensionPresent},
- {"nalcGetEnumValue", "(JLjava/lang/String;)I", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetEnumValue, "alcGetEnumValue", (void*)&alcGetEnumValue}
- };
- int num_functions = NUMFUNCTIONS(functions);
- extal_InitializeClass(env, clazz, num_functions, functions);
-}
-#ifdef __cplusplus
-}
-#endif
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: org_lwjgl_openal_ALC.c 2279 2006-02-23 19:22:00Z elias_naur $
+ *
+ * This is the actual JNI implementation of the OpenAL context/device library.
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 2279 $
+ */
+
+/* OpenAL includes */
+#include "extal.h"
+
+//alc
+typedef ALCubyte* (ALCAPIENTRY *alcGetStringPROC)(ALCdevice *device,ALCenum param);
+typedef ALCvoid (ALCAPIENTRY *alcGetIntegervPROC)(ALCdevice *device,ALCenum param,ALCsizei size,ALCint *data);
+typedef ALCdevice* (ALCAPIENTRY *alcOpenDevicePROC)(ALCubyte *deviceName);
+typedef ALCboolean (ALCAPIENTRY *alcCloseDevicePROC)(ALCdevice *device);
+typedef ALCcontext* (ALCAPIENTRY *alcCreateContextPROC)(ALCdevice *device,ALCint *attrList);
+typedef ALCenum (ALCAPIENTRY *alcMakeContextCurrentPROC)(ALCcontext *context);
+typedef ALCvoid (ALCAPIENTRY *alcProcessContextPROC)(ALCcontext *context);
+typedef ALCdevice* (ALCAPIENTRY *alcGetContextsDevicePROC)(ALCcontext *context);
+typedef ALCvoid (ALCAPIENTRY *alcSuspendContextPROC)(ALCcontext *context);
+typedef ALCvoid (ALCAPIENTRY *alcDestroyContextPROC)(ALCcontext *context);
+typedef ALCenum (ALCAPIENTRY *alcGetErrorPROC)(ALCdevice *device);
+typedef ALCboolean (ALCAPIENTRY *alcIsExtensionPresentPROC)(ALCdevice *device,ALCubyte *extName);
+//typedef ALCvoid* (ALCAPIENTRY *alcGetProcAddressPROC)(ALCdevice *device,ALCubyte *funcName);
+typedef ALCenum (ALCAPIENTRY *alcGetEnumValuePROC)(ALCdevice *device,ALCubyte *enumName);
+typedef ALCcontext* (ALCAPIENTRY *alcGetCurrentContextPROC)(ALCvoid);
+
+static alcGetCurrentContextPROC alcGetCurrentContext = NULL;
+static alcGetStringPROC alcGetString;
+static alcGetIntegervPROC alcGetIntegerv;
+static alcOpenDevicePROC alcOpenDevice;
+static alcCloseDevicePROC alcCloseDevice;
+static alcCreateContextPROC alcCreateContext;
+static alcMakeContextCurrentPROC alcMakeContextCurrent;
+static alcProcessContextPROC alcProcessContext;
+static alcGetContextsDevicePROC alcGetContextsDevice;
+static alcSuspendContextPROC alcSuspendContext;
+static alcDestroyContextPROC alcDestroyContext;
+static alcGetErrorPROC alcGetError;
+static alcIsExtensionPresentPROC alcIsExtensionPresent;
+//static alcGetProcAddressPROC alcGetProcAddress;
+static alcGetEnumValuePROC alcGetEnumValue;
+
+/**
+ * This function returns strings related to the context.
+ *
+ * C Specification:
+ * ALubyte * alcGetString(ALCdevice *device, ALenum token);
+ */
+static jstring JNICALL Java_org_lwjgl_openal_ALC10_nalcGetString (JNIEnv *env, jclass clazz, jlong deviceaddress, jint token) {
+ const char* alcString = (const char*) alcGetString((ALCdevice*)((intptr_t)deviceaddress), (ALenum) token);
+ int length;
+ int i=1;
+
+ if(alcString == NULL) {
+ return NULL;
+ }
+
+ // Special treatment of enumeration tokens
+ // These are encoded using \0 between elements and a finishing \0\0
+ switch(token) {
+ case 0x1005: // ALC_DEVICE_SPECIFIER
+ case 0x310: // ALC_CAPTURE_DEVICE_SPECIFIER
+ case 0x1013: // ALC_ALL_DEVICES_SPECIFIER
+ while (alcString[i - 1] != '\0' || alcString[i] != '\0') {
+ i++;
+ }
+ length = i + 1;
+ break;
+ default:
+ length = strlen(alcString);
+ }
+ return NewStringNativeWithLength(env, alcString, length);
+}
+
+/**
+ * This function returns integers related to the context.
+ *
+ * C Specification:
+ * ALvoid alcGetIntegerv(ALCdevice *device, ALenum token, ALsizei size, ALint *dest);
+ */
+static void JNICALL Java_org_lwjgl_openal_ALC10_nalcGetIntegerv (JNIEnv *env, jclass clazz, jlong deviceaddress, jint token, jint size, jobject dest, jint offset) {
+ ALint* address = NULL;
+ if (dest != NULL) {
+ address = offset + (ALint*) (*env)->GetDirectBufferAddress(env, dest);
+ }
+ alcGetIntegerv((ALCdevice*)((intptr_t)deviceaddress), (ALenum) token, (ALsizei) size, address);
+}
+
+/**
+ * This function opens a device by name.
+ *
+ * C Specification:
+ * ALCdevice *alcOpenDevice( const ALubyte *tokstr );
+ */
+static jlong JNICALL Java_org_lwjgl_openal_ALC10_nalcOpenDevice (JNIEnv *env, jclass clazz, jstring tokstr) {
+ char * tokenstring;
+ ALCdevice* device;
+
+ if(tokstr != NULL) {
+ tokenstring = GetStringNativeChars(env, tokstr);
+ } else {
+ tokenstring = NULL;
+ }
+
+ /* get device */
+ device = alcOpenDevice((ALubyte *) tokenstring);
+
+ if(tokenstring != NULL) {
+ free(tokenstring);
+ }
+
+ return (jlong)((intptr_t)device);
+}
+
+/**
+ * This function closes a device by name.
+ *
+ * C Specification:
+ * bool alcCloseDevice( ALCdevice *dev );
+ */
+static jboolean JNICALL Java_org_lwjgl_openal_ALC10_nalcCloseDevice (JNIEnv *env, jclass clazz, jlong deviceaddress) {
+ return alcCloseDevice((ALCdevice*)((intptr_t)deviceaddress));
+}
+
+/**
+ * This function creates a context using a specified device.
+ *
+ * C Specification:
+ * ALCcontext* alcCreateContext( ALCdevice *dev, ALint* attrlist );
+ */
+static jlong JNICALL Java_org_lwjgl_openal_ALC10_nalcCreateContext (JNIEnv *env, jclass clazz, jlong deviceaddress, jobject attrlist) {
+ ALint* address = NULL;
+ ALCcontext* context;
+
+ if (attrlist != NULL) {
+ address = (ALint*) safeGetBufferAddress(env, attrlist);
+ }
+ context = alcCreateContext((ALCdevice*)((intptr_t)deviceaddress), address);
+
+ return (jlong)((intptr_t)context);
+}
+
+/**
+ * This function makes a specified context the current context.
+ *
+ * C Specification:
+ * ALCboolean alcMakeContextCurrent(ALCcontext *context);
+ */
+static jint JNICALL Java_org_lwjgl_openal_ALC10_nalcMakeContextCurrent (JNIEnv *env, jclass clazz, jlong contextaddress) {
+ ALCcontext* context = (ALCcontext*)((intptr_t)contextaddress);
+ return alcMakeContextCurrent(context);
+}
+
+/**
+ * This function tells a context to begin processing.
+ *
+ * C Specification:
+ * void alcProcessContext(ALCcontext *context);
+ */
+static void JNICALL Java_org_lwjgl_openal_ALC10_nalcProcessContext (JNIEnv *env, jclass clazz, jlong contextaddress) {
+ alcProcessContext((ALCcontext*)((intptr_t)contextaddress));
+}
+
+/**
+ * This function retrieves the current context.
+ *
+ * C Specification:
+ * ALCcontext* alcGetCurrentContext( ALvoid );
+ */
+static jlong JNICALL Java_org_lwjgl_openal_ALC10_nalcGetCurrentContext (JNIEnv *env, jclass clazz) {
+ ALCcontext* context = alcGetCurrentContext();
+ return (jlong)((intptr_t)context);
+}
+
+/**
+ * This function retrieves the specified contexts device
+ *
+ * C Specification:
+ * ALCdevice* alcGetContextsDevice(ALCcontext *context);
+ */
+static jlong JNICALL Java_org_lwjgl_openal_ALC10_nalcGetContextsDevice (JNIEnv *env, jclass clazz, jlong contextaddress) {
+ ALCdevice* device = alcGetContextsDevice((ALCcontext*)((intptr_t)contextaddress));
+ return (jlong)((intptr_t)device);
+}
+
+/**
+ * This function suspends processing on a specified context.
+ *
+ * C Specification:
+ * void alcSuspendContext(ALCcontext *context);
+ */
+static void JNICALL Java_org_lwjgl_openal_ALC10_nalcSuspendContext (JNIEnv *env, jclass clazz, jlong contextaddress) {
+ alcSuspendContext((ALCcontext*)((intptr_t)contextaddress));
+}
+
+/**
+ * This function destroys a context.
+ *
+ * C Specification:
+ * void alcDestroyContext(ALCcontext *context);
+ */
+static void JNICALL Java_org_lwjgl_openal_ALC10_nalcDestroyContext (JNIEnv *env, jclass clazz, jlong contextaddress) {
+ alcDestroyContext((ALCcontext*)((intptr_t)contextaddress));
+}
+
+/**
+ * This function retrieves the specified devices context error state.
+ *
+ * C Specification:
+ * ALCenum alcGetError(ALCdevice *device);
+ */
+static jint JNICALL Java_org_lwjgl_openal_ALC10_nalcGetError (JNIEnv *env, jclass clazz, jlong deviceaddress) {
+ return alcGetError((ALCdevice*)((intptr_t)deviceaddress));
+}
+
+/**
+ * This function queries if a specified context extension is available.
+ *
+ * C Specification:
+ * ALboolean alcIsExtensionPresent(ALCdevice *device, ALubyte *extName);
+ */
+static jboolean JNICALL Java_org_lwjgl_openal_ALC10_nalcIsExtensionPresent (JNIEnv *env, jclass clazz, jlong deviceaddress, jstring extName) {
+ /* get extension */
+ ALubyte* functionname = (ALubyte*) GetStringNativeChars(env, extName);
+
+ jboolean result = (jboolean) alcIsExtensionPresent((ALCdevice*)((intptr_t)deviceaddress), functionname);
+
+ free(functionname);
+
+ return result;
+}
+
+/**
+ * This function retrieves the enum value for a specified enumeration name.
+ *
+ * C Specification:
+ * ALenum alcGetEnumValue(ALCdevice *device, ALubyte *enumName);
+ */
+static jint JNICALL Java_org_lwjgl_openal_ALC10_nalcGetEnumValue (JNIEnv *env, jclass clazz, jlong deviceaddress, jstring enumName) {
+ /* get extension */
+ ALubyte* enumerationname = (ALubyte*) GetStringNativeChars(env, enumName);
+
+ jint result = (jint) alcGetEnumValue((ALCdevice*)((intptr_t)deviceaddress), enumerationname);
+
+ free(enumerationname);
+
+ return result;
+}
+
+/**
+ * Loads the context OpenAL functions
+ *
+ * @return true if all methods were loaded, false if one of the methods could not be loaded
+ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC10_initNativeStubs(JNIEnv *env, jclass clazz) {
+ JavaMethodAndExtFunction functions[] = {
+ {"nalcGetString", "(JI)Ljava/lang/String;", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetString, "alcGetString", (void*)&alcGetString},
+ {"nalcGetIntegerv", "(JIILjava/nio/Buffer;I)V", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetIntegerv, "alcGetIntegerv", (void*)&alcGetIntegerv},
+ {"nalcOpenDevice", "(Ljava/lang/String;)J", (void*)&Java_org_lwjgl_openal_ALC10_nalcOpenDevice, "alcOpenDevice", (void*)&alcOpenDevice},
+ {"nalcCloseDevice", "(J)Z", (void*)&Java_org_lwjgl_openal_ALC10_nalcCloseDevice, "alcCloseDevice", (void*)&alcCloseDevice},
+ {"nalcCreateContext", "(JLjava/nio/IntBuffer;)J", (void*)&Java_org_lwjgl_openal_ALC10_nalcCreateContext, "alcCreateContext", (void*)&alcCreateContext},
+ {"nalcMakeContextCurrent", "(J)I", (void*)&Java_org_lwjgl_openal_ALC10_nalcMakeContextCurrent, "alcMakeContextCurrent", (void*)&alcMakeContextCurrent},
+ {"nalcProcessContext", "(J)V", (void*)&Java_org_lwjgl_openal_ALC10_nalcProcessContext, "alcProcessContext", (void*)&alcProcessContext},
+ {"nalcGetCurrentContext", "()J", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetCurrentContext, "alcGetCurrentContext", (void*)&alcGetCurrentContext},
+ {"nalcGetContextsDevice", "(J)J", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetContextsDevice, "alcGetContextsDevice", (void*)&alcGetContextsDevice},
+ {"nalcSuspendContext", "(J)V", (void*)&Java_org_lwjgl_openal_ALC10_nalcSuspendContext, "alcSuspendContext", (void*)&alcSuspendContext},
+ {"nalcDestroyContext", "(J)V", (void*)&Java_org_lwjgl_openal_ALC10_nalcDestroyContext, "alcDestroyContext", (void*)&alcDestroyContext},
+ {"nalcGetError", "(J)I", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetError, "alcGetError", (void*)&alcGetError},
+ {"nalcIsExtensionPresent", "(JLjava/lang/String;)Z", (void*)&Java_org_lwjgl_openal_ALC10_nalcIsExtensionPresent, "alcIsExtensionPresent", (void*)&alcIsExtensionPresent},
+ {"nalcGetEnumValue", "(JLjava/lang/String;)I", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetEnumValue, "alcGetEnumValue", (void*)&alcGetEnumValue}
+ };
+ int num_functions = NUMFUNCTIONS(functions);
+ extal_InitializeClass(env, clazz, num_functions, functions);
+}
+#ifdef __cplusplus
+}
+#endif
diff --git a/src/native/common/org_lwjgl_openal_ALC11.c b/src/native/common/org_lwjgl_openal_ALC11.c
index a67396e..5b10343 100644
--- a/src/native/common/org_lwjgl_openal_ALC11.c
+++ b/src/native/common/org_lwjgl_openal_ALC11.c
@@ -1,135 +1,135 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: org_lwjgl_openal_ALC.c 2279 2006-02-23 19:22:00Z elias_naur $
- *
- * This is the actual JNI implementation of the OpenAL context/device library.
- *
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 2279 $
- */
-
-/* OpenAL includes */
-#include "extal.h"
-
-//alc
-typedef ALCdevice * (ALCAPIENTRY *alcCaptureOpenDevicePROC)( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize );
-typedef ALCboolean (ALCAPIENTRY *alcCaptureCloseDevicePROC)( ALCdevice *device );
-typedef void (ALCAPIENTRY *alcCaptureStartPROC)( ALCdevice *device );
-typedef void (ALCAPIENTRY *alcCaptureStopPROC)( ALCdevice *device );
-typedef void (ALCAPIENTRY *alcCaptureSamplesPROC)( ALCdevice *device, ALCvoid *buffer, ALCsizei samples );
-
-static alcCaptureOpenDevicePROC alcCaptureOpenDevice;
-static alcCaptureCloseDevicePROC alcCaptureCloseDevice;
-static alcCaptureStartPROC alcCaptureStart;
-static alcCaptureStopPROC alcCaptureStop;
-static alcCaptureSamplesPROC alcCaptureSamples;
-
-/*
- * Class: org_lwjgl_openal_ALC11
- * Method: nalcCaptureOpenDevice
- * Signature: (Ljava/lang/String;III)J
- */
-static jlong JNICALL Java_org_lwjgl_openal_ALC11_nalcCaptureOpenDevice(JNIEnv *env, jclass clazz, jstring devicename, jint frequency, jint format, jint buffersize) {
- ALubyte* dev_name = NULL;
- ALCdevice* device = NULL;
-
- if(devicename != NULL) {
- dev_name = (ALubyte*) GetStringNativeChars(env, devicename);
- }
-
- device = alcCaptureOpenDevice((const char *)dev_name, (unsigned int) frequency, format, buffersize);
-
- free(dev_name);
- return (jlong) ((intptr_t)device);
-}
-
-/*
- * Class: org_lwjgl_openal_ALC11
- * Method: nalcCaptureCloseDevice
- * Signature: (J)Z
- */
-static jboolean JNICALL Java_org_lwjgl_openal_ALC11_nalcCaptureCloseDevice(JNIEnv *env, jclass clazz, jlong device) {
- return (jboolean) alcCaptureCloseDevice((ALCdevice*) ((intptr_t)device));
-}
-
-/*
- * Class: org_lwjgl_openal_ALC11
- * Method: nalcCaptureStart
- * Signature: (J)V
- */
-static void JNICALL Java_org_lwjgl_openal_ALC11_nalcCaptureStart(JNIEnv *env, jclass clazz, jlong device) {
- alcCaptureStart((ALCdevice*) ((intptr_t)device));
-}
-
-/*
- * Class: org_lwjgl_openal_ALC11
- * Method: nalcCaptureStop
- * Signature: (J)V
- */
-static void JNICALL Java_org_lwjgl_openal_ALC11_nalcCaptureStop(JNIEnv * env, jclass clazz, jlong device) {
- alcCaptureStop((ALCdevice*) ((intptr_t)device));
-}
-
-/*
- * Class: org_lwjgl_openal_ALC11
- * Method: nalcCaptureSamples
- * Signature: (JLjava/nio/ByteBuffer;I)V
- */
-static void JNICALL Java_org_lwjgl_openal_ALC11_nalcCaptureSamples(JNIEnv *env, jclass clazz, jlong device, jobject buffer, jint position, jint samples) {
- ALvoid *buffer_address = ((ALbyte *)(((char*)(*env)->GetDirectBufferAddress(env, buffer)) + position));
- alcCaptureSamples((ALCdevice*) ((intptr_t)device), buffer_address, samples);
-}
-
-/**
- * Loads the context OpenAL functions
- *
- * @return true if all methods were loaded, false if one of the methods could not be loaded
- */
-#ifdef __cplusplus
-extern "C" {
-#endif
-JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC11_initNativeStubs(JNIEnv *env, jclass clazz) {
- JavaMethodAndExtFunction functions[] = {
- {"nalcCaptureOpenDevice", "(Ljava/lang/String;III)J", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureOpenDevice, "alcCaptureOpenDevice", (void*)&alcCaptureOpenDevice},
- {"nalcCaptureCloseDevice", "(J)Z", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureCloseDevice, "alcCaptureCloseDevice", (void*)&alcCaptureCloseDevice},
- {"nalcCaptureStart", "(J)V", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureStart, "alcCaptureStart", (void*)&alcCaptureStart},
- {"nalcCaptureStop", "(J)V", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureStop, "alcCaptureStop", (void*)&alcCaptureStop},
- {"nalcCaptureSamples", "(JLjava/nio/ByteBuffer;II)V", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureSamples, "alcCaptureSamples", (void*)&alcCaptureSamples}
- };
- int num_functions = NUMFUNCTIONS(functions);
- extal_InitializeClass(env, clazz, num_functions, functions);
-}
-#ifdef __cplusplus
-}
-#endif
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: org_lwjgl_openal_ALC.c 2279 2006-02-23 19:22:00Z elias_naur $
+ *
+ * This is the actual JNI implementation of the OpenAL context/device library.
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 2279 $
+ */
+
+/* OpenAL includes */
+#include "extal.h"
+
+//alc
+typedef ALCdevice * (ALCAPIENTRY *alcCaptureOpenDevicePROC)( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize );
+typedef ALCboolean (ALCAPIENTRY *alcCaptureCloseDevicePROC)( ALCdevice *device );
+typedef void (ALCAPIENTRY *alcCaptureStartPROC)( ALCdevice *device );
+typedef void (ALCAPIENTRY *alcCaptureStopPROC)( ALCdevice *device );
+typedef void (ALCAPIENTRY *alcCaptureSamplesPROC)( ALCdevice *device, ALCvoid *buffer, ALCsizei samples );
+
+static alcCaptureOpenDevicePROC alcCaptureOpenDevice;
+static alcCaptureCloseDevicePROC alcCaptureCloseDevice;
+static alcCaptureStartPROC alcCaptureStart;
+static alcCaptureStopPROC alcCaptureStop;
+static alcCaptureSamplesPROC alcCaptureSamples;
+
+/*
+ * Class: org_lwjgl_openal_ALC11
+ * Method: nalcCaptureOpenDevice
+ * Signature: (Ljava/lang/String;III)J
+ */
+static jlong JNICALL Java_org_lwjgl_openal_ALC11_nalcCaptureOpenDevice(JNIEnv *env, jclass clazz, jstring devicename, jint frequency, jint format, jint buffersize) {
+ ALubyte* dev_name = NULL;
+ ALCdevice* device = NULL;
+
+ if(devicename != NULL) {
+ dev_name = (ALubyte*) GetStringNativeChars(env, devicename);
+ }
+
+ device = alcCaptureOpenDevice((const char *)dev_name, (unsigned int) frequency, format, buffersize);
+
+ free(dev_name);
+ return (jlong) ((intptr_t)device);
+}
+
+/*
+ * Class: org_lwjgl_openal_ALC11
+ * Method: nalcCaptureCloseDevice
+ * Signature: (J)Z
+ */
+static jboolean JNICALL Java_org_lwjgl_openal_ALC11_nalcCaptureCloseDevice(JNIEnv *env, jclass clazz, jlong device) {
+ return (jboolean) alcCaptureCloseDevice((ALCdevice*) ((intptr_t)device));
+}
+
+/*
+ * Class: org_lwjgl_openal_ALC11
+ * Method: nalcCaptureStart
+ * Signature: (J)V
+ */
+static void JNICALL Java_org_lwjgl_openal_ALC11_nalcCaptureStart(JNIEnv *env, jclass clazz, jlong device) {
+ alcCaptureStart((ALCdevice*) ((intptr_t)device));
+}
+
+/*
+ * Class: org_lwjgl_openal_ALC11
+ * Method: nalcCaptureStop
+ * Signature: (J)V
+ */
+static void JNICALL Java_org_lwjgl_openal_ALC11_nalcCaptureStop(JNIEnv * env, jclass clazz, jlong device) {
+ alcCaptureStop((ALCdevice*) ((intptr_t)device));
+}
+
+/*
+ * Class: org_lwjgl_openal_ALC11
+ * Method: nalcCaptureSamples
+ * Signature: (JLjava/nio/ByteBuffer;I)V
+ */
+static void JNICALL Java_org_lwjgl_openal_ALC11_nalcCaptureSamples(JNIEnv *env, jclass clazz, jlong device, jobject buffer, jint position, jint samples) {
+ ALvoid *buffer_address = ((ALbyte *)(((char*)(*env)->GetDirectBufferAddress(env, buffer)) + position));
+ alcCaptureSamples((ALCdevice*) ((intptr_t)device), buffer_address, samples);
+}
+
+/**
+ * Loads the context OpenAL functions
+ *
+ * @return true if all methods were loaded, false if one of the methods could not be loaded
+ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC11_initNativeStubs(JNIEnv *env, jclass clazz) {
+ JavaMethodAndExtFunction functions[] = {
+ {"nalcCaptureOpenDevice", "(Ljava/lang/String;III)J", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureOpenDevice, "alcCaptureOpenDevice", (void*)&alcCaptureOpenDevice},
+ {"nalcCaptureCloseDevice", "(J)Z", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureCloseDevice, "alcCaptureCloseDevice", (void*)&alcCaptureCloseDevice},
+ {"nalcCaptureStart", "(J)V", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureStart, "alcCaptureStart", (void*)&alcCaptureStart},
+ {"nalcCaptureStop", "(J)V", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureStop, "alcCaptureStop", (void*)&alcCaptureStop},
+ {"nalcCaptureSamples", "(JLjava/nio/ByteBuffer;II)V", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureSamples, "alcCaptureSamples", (void*)&alcCaptureSamples}
+ };
+ int num_functions = NUMFUNCTIONS(functions);
+ extal_InitializeClass(env, clazz, num_functions, functions);
+}
+#ifdef __cplusplus
+}
+#endif
diff --git a/src/native/common/org_lwjgl_opengl_AWTSurfaceLock.c b/src/native/common/org_lwjgl_opengl_AWTSurfaceLock.c
index 83b945c..232df0a 100644
--- a/src/native/common/org_lwjgl_opengl_AWTSurfaceLock.c
+++ b/src/native/common/org_lwjgl_opengl_AWTSurfaceLock.c
@@ -1,94 +1,94 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: org_lwjgl_opengl_AWTSurfaceLock.c 2985 2008-04-07 18:42:36Z matzon $
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2985 $
- */
-
-#include <jni.h>
-#include <jawt_md.h>
-#include "org_lwjgl_opengl_AWTSurfaceLock.h"
-#include "awt_tools.h"
-#include "common_tools.h"
-
-JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_AWTSurfaceLock_createHandle
- (JNIEnv *env, jclass clazz) {
- return newJavaManagedByteBuffer(env, sizeof(AWTSurfaceLock));
-}
-
-JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_AWTSurfaceLock_lockAndInitHandle
- (JNIEnv *env, jclass clazz, jobject lock_buffer_handle, jobject canvas) {
- JAWT awt;
- JAWT_DrawingSurface* ds;
- JAWT_DrawingSurfaceInfo *dsi;
- AWTSurfaceLock *awt_lock = (AWTSurfaceLock *)(*env)->GetDirectBufferAddress(env, lock_buffer_handle);
- awt.version = JAWT_VERSION_1_4;
- if (JAWT_GetAWT(env, &awt) == JNI_FALSE) {
- throwException(env, "Could not get the JAWT interface");
- return JNI_FALSE;
- }
-
- ds = awt.GetDrawingSurface(env, canvas);
- if (ds == NULL) {
- throwException(env, "Could not get the drawing surface");
- return JNI_FALSE;
- }
-
- if((ds->Lock(ds) & JAWT_LOCK_ERROR) != 0) {
- awt.FreeDrawingSurface(ds);
- throwException(env, "Could not lock the drawing surface");
- return JNI_FALSE;
- }
-
- dsi = ds->GetDrawingSurfaceInfo(ds);
- if (dsi != NULL) {
- awt_lock->awt = awt;
- awt_lock->ds = ds;
- awt_lock->dsi = dsi;
- return JNI_TRUE;
- }
- ds->Unlock(ds);
- awt.FreeDrawingSurface(ds);
- return JNI_FALSE;
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_AWTSurfaceLock_nUnlock
- (JNIEnv *env, jclass clazz, jobject lock_buffer_handle) {
- AWTSurfaceLock *awt_lock = (AWTSurfaceLock *)(*env)->GetDirectBufferAddress(env, lock_buffer_handle);
- awt_lock->ds->FreeDrawingSurfaceInfo(awt_lock->dsi);
- awt_lock->ds->Unlock(awt_lock->ds);
- awt_lock->awt.FreeDrawingSurface(awt_lock->ds);
-}
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: org_lwjgl_opengl_AWTSurfaceLock.c 2985 2008-04-07 18:42:36Z matzon $
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2985 $
+ */
+
+#include <jni.h>
+#include <jawt_md.h>
+#include "org_lwjgl_opengl_AWTSurfaceLock.h"
+#include "awt_tools.h"
+#include "common_tools.h"
+
+JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_AWTSurfaceLock_createHandle
+ (JNIEnv *env, jclass clazz) {
+ return newJavaManagedByteBuffer(env, sizeof(AWTSurfaceLock));
+}
+
+JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_AWTSurfaceLock_lockAndInitHandle
+ (JNIEnv *env, jclass clazz, jobject lock_buffer_handle, jobject canvas) {
+ JAWT awt;
+ JAWT_DrawingSurface* ds;
+ JAWT_DrawingSurfaceInfo *dsi;
+ AWTSurfaceLock *awt_lock = (AWTSurfaceLock *)(*env)->GetDirectBufferAddress(env, lock_buffer_handle);
+ awt.version = JAWT_VERSION_1_4;
+ if (JAWT_GetAWT(env, &awt) == JNI_FALSE) {
+ throwException(env, "Could not get the JAWT interface");
+ return JNI_FALSE;
+ }
+
+ ds = awt.GetDrawingSurface(env, canvas);
+ if (ds == NULL) {
+ throwException(env, "Could not get the drawing surface");
+ return JNI_FALSE;
+ }
+
+ if((ds->Lock(ds) & JAWT_LOCK_ERROR) != 0) {
+ awt.FreeDrawingSurface(ds);
+ throwException(env, "Could not lock the drawing surface");
+ return JNI_FALSE;
+ }
+
+ dsi = ds->GetDrawingSurfaceInfo(ds);
+ if (dsi != NULL) {
+ awt_lock->awt = awt;
+ awt_lock->ds = ds;
+ awt_lock->dsi = dsi;
+ return JNI_TRUE;
+ }
+ ds->Unlock(ds);
+ awt.FreeDrawingSurface(ds);
+ return JNI_FALSE;
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_AWTSurfaceLock_nUnlock
+ (JNIEnv *env, jclass clazz, jobject lock_buffer_handle) {
+ AWTSurfaceLock *awt_lock = (AWTSurfaceLock *)(*env)->GetDirectBufferAddress(env, lock_buffer_handle);
+ awt_lock->ds->FreeDrawingSurfaceInfo(awt_lock->dsi);
+ awt_lock->ds->Unlock(awt_lock->ds);
+ awt_lock->awt.FreeDrawingSurface(awt_lock->ds);
+}
+
diff --git a/src/native/common/org_lwjgl_opengl_GLContext.c b/src/native/common/org_lwjgl_opengl_GLContext.c
index 2c9b178..20c9ef9 100644
--- a/src/native/common/org_lwjgl_opengl_GLContext.c
+++ b/src/native/common/org_lwjgl_opengl_GLContext.c
@@ -1,57 +1,57 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-#include <jni.h>
-#include "common_tools.h"
-#include "org_lwjgl_opengl_GLContext.h"
-#include "extgl.h"
-
-JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_GLContext_getFunctionAddress(JNIEnv *env, jclass clazz, jstring function_name) {
- jlong address_jlong;
- char *function_name_pointer = GetStringNativeChars(env, function_name);
- void *address = extgl_GetProcAddress(function_name_pointer);
- free(function_name_pointer);
- address_jlong = (jlong)(intptr_t)address;
- return address_jlong;
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GLContext_nLoadOpenGLLibrary(JNIEnv * env, jclass clazz) {
- extgl_Open(env);
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GLContext_nUnloadOpenGLLibrary(JNIEnv * env, jclass clazz) {
- extgl_Close();
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GLContext_resetNativeStubs(JNIEnv *env, jclass clazz, jclass gl_class) {
- (*env)->UnregisterNatives(env, gl_class);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+#include <jni.h>
+#include "common_tools.h"
+#include "org_lwjgl_opengl_GLContext.h"
+#include "extgl.h"
+
+JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_GLContext_getFunctionAddress(JNIEnv *env, jclass clazz, jstring function_name) {
+ jlong address_jlong;
+ char *function_name_pointer = GetStringNativeChars(env, function_name);
+ void *address = extgl_GetProcAddress(function_name_pointer);
+ free(function_name_pointer);
+ address_jlong = (jlong)(intptr_t)address;
+ return address_jlong;
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GLContext_nLoadOpenGLLibrary(JNIEnv * env, jclass clazz) {
+ extgl_Open(env);
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GLContext_nUnloadOpenGLLibrary(JNIEnv * env, jclass clazz) {
+ extgl_Close();
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GLContext_resetNativeStubs(JNIEnv *env, jclass clazz, jclass gl_class) {
+ (*env)->UnregisterNatives(env, gl_class);
+}
diff --git a/src/native/linux/context.c b/src/native/linux/context.c
index 727b706..32af315 100644
--- a/src/native/linux/context.c
+++ b/src/native/linux/context.c
@@ -1,347 +1,347 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: context.c 3116 2008-08-19 16:46:03Z spasi $
- *
- * Include file to access public window features
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3116 $
- */
-
-#include <jni.h>
-#include <X11/X.h>
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include "extgl_glx.h"
-#include "context.h"
-
-XVisualInfo *getVisualInfoFromPeerInfo(JNIEnv *env, X11PeerInfo *peer_info) {
- XVisualInfo *vis_info;
- if (!peer_info->glx13) {
- XVisualInfo template;
- template.visualid = peer_info->config.glx_config.visualid;
- template.depth = peer_info->config.glx_config.depth;
- template.screen = peer_info->screen;
- int num_infos;
- vis_info = XGetVisualInfo(peer_info->display, VisualIDMask | VisualScreenMask | VisualDepthMask, &template, &num_infos);
- if (vis_info == NULL) {
- throwException(env, "Could not find VisualInfo from peer info");
- return NULL;
- }
- // Check the assumption from GLX 1.3 docs that a VisualInfo is uniquely identified by its
- // {VisualID, screen, depth} tuple
- if (num_infos != 1) {
- XFree(vis_info);
- throwException(env, "No unique VisualInfo matches peer info");
- return NULL;
- }
- } else {
- GLXFBConfig *configs = getFBConfigFromPeerInfo(env, peer_info);
- if (configs == NULL)
- return NULL;
- vis_info = lwjgl_glXGetVisualFromFBConfig(peer_info->display, configs[0]);
- if (vis_info == NULL)
- throwException(env, "Could not get VisualInfo from GLX 1.3 config");
- XFree(configs);
- }
- return vis_info;
-}
-
-GLXFBConfig *getFBConfigFromPeerInfo(JNIEnv *env, X11PeerInfo *peer_info) {
- int attribs[] = {GLX_FBCONFIG_ID, peer_info->config.glx13_config.config_id, None, None};
- int num_elements;
- GLXFBConfig *configs = lwjgl_glXChooseFBConfig(peer_info->display, peer_info->screen, attribs, &num_elements);
- if (configs == NULL) {
- throwException(env, "Could not find GLX 1.3 config from peer info");
- return NULL;
- }
- // Check that only one FBConfig matches the config id
- if (num_elements != 1) {
- XFree(configs);
- throwException(env, "No unique GLX 1.3 config matches peer info");
- return NULL;
- }
- return configs;
-}
-
-static int convertToBPE(int bpp) {
- int bpe;
- switch (bpp) {
- case 0:
- bpe = 0;
- break;
- case 32:
- case 24:
- bpe = 8;
- break;
- case 16: /* Fall through */
- default:
- bpe = 4;
- break;
- }
- return bpe;
-}
-
-static GLXFBConfig *chooseVisualGLX13FromBPP(JNIEnv *env, Display *disp, int screen, jobject pixel_format, int bpp, int drawable_type, bool double_buffer) {
- jclass cls_pixel_format = (*env)->GetObjectClass(env, pixel_format);
- int alpha = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "alpha", "I"));
- int depth = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "depth", "I"));
- int stencil = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "stencil", "I"));
- int samples = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "samples", "I"));
- int num_aux_buffers = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "num_aux_buffers", "I"));
- int accum_bpp = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "accum_bpp", "I"));
- int accum_alpha = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "accum_alpha", "I"));
-
- bool stereo = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "stereo", "Z"));
- bool floating_point = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "floating_point", "Z"));
- bool floating_point_packed = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "floating_point_packed", "Z"));
- bool sRGB = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "sRGB", "Z"));
-
- int bpe = convertToBPE(bpp);
- int accum_bpe = convertToBPE(accum_bpp);
- attrib_list_t attrib_list;
- initAttribList(&attrib_list);
- int render_type;
-
- if ( floating_point )
- render_type = GLX_RGBA_FLOAT_BIT;
- else if ( floating_point_packed )
- render_type = GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT;
- else
- render_type = GLX_RGBA_BIT;
-
- putAttrib(&attrib_list, GLX_RENDER_TYPE); putAttrib(&attrib_list, render_type);
- putAttrib(&attrib_list, GLX_DOUBLEBUFFER); putAttrib(&attrib_list, double_buffer ? True : False);
- putAttrib(&attrib_list, GLX_DRAWABLE_TYPE); putAttrib(&attrib_list, drawable_type);
- putAttrib(&attrib_list, GLX_DEPTH_SIZE); putAttrib(&attrib_list, depth);
- putAttrib(&attrib_list, GLX_RED_SIZE); putAttrib(&attrib_list, bpe);
- putAttrib(&attrib_list, GLX_GREEN_SIZE); putAttrib(&attrib_list, bpe);
- putAttrib(&attrib_list, GLX_BLUE_SIZE); putAttrib(&attrib_list, bpe);
- putAttrib(&attrib_list, GLX_ALPHA_SIZE); putAttrib(&attrib_list, alpha);
- putAttrib(&attrib_list, GLX_STENCIL_SIZE); putAttrib(&attrib_list, stencil);
- putAttrib(&attrib_list, GLX_AUX_BUFFERS); putAttrib(&attrib_list, num_aux_buffers);
- putAttrib(&attrib_list, GLX_ACCUM_RED_SIZE); putAttrib(&attrib_list, accum_bpe);
- putAttrib(&attrib_list, GLX_ACCUM_GREEN_SIZE); putAttrib(&attrib_list, accum_bpe);
- putAttrib(&attrib_list, GLX_ACCUM_BLUE_SIZE); putAttrib(&attrib_list, accum_bpe);
- putAttrib(&attrib_list, GLX_ACCUM_ALPHA_SIZE); putAttrib(&attrib_list, accum_alpha);
- if (stereo) {
- putAttrib(&attrib_list, GLX_STEREO); putAttrib(&attrib_list, True);
- }
- // Assume the caller has checked support for multisample
- if (samples > 0) {
- putAttrib(&attrib_list, GLX_SAMPLE_BUFFERS_ARB); putAttrib(&attrib_list, 1);
- putAttrib(&attrib_list, GLX_SAMPLES_ARB); putAttrib(&attrib_list, samples);
- }
- if (sRGB) {
- putAttrib(&attrib_list, GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB); putAttrib(&attrib_list, True);
- }
- putAttrib(&attrib_list, None); putAttrib(&attrib_list, None);
- int num_formats = 0;
- GLXFBConfig* configs = lwjgl_glXChooseFBConfig(disp, screen, attrib_list.attribs, &num_formats);
- if (num_formats > 0) {
- return configs;
- } else {
- if (configs != NULL)
- XFree(configs);
- return NULL;
- }
-}
-
-GLXFBConfig *chooseVisualGLX13(JNIEnv *env, Display *disp, int screen, jobject pixel_format, bool use_display_bpp, int drawable_type, bool double_buffer) {
- jclass cls_pixel_format = (*env)->GetObjectClass(env, pixel_format);
- int bpp;
- if (use_display_bpp) {
- bpp = XDefaultDepthOfScreen(XScreenOfDisplay(disp, screen));
- GLXFBConfig *configs = chooseVisualGLX13FromBPP(env, disp, screen, pixel_format, bpp, drawable_type, double_buffer);
- if (configs != NULL)
- return configs;
- else
- bpp = 16;
- } else
- bpp = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "bpp", "I"));
- return chooseVisualGLX13FromBPP(env, disp, screen, pixel_format, bpp, drawable_type, double_buffer);
-}
-
-static XVisualInfo *chooseVisualGLXFromBPP(JNIEnv *env, Display *disp, int screen, jobject pixel_format, int bpp, bool double_buffer) {
- jclass cls_pixel_format = (*env)->GetObjectClass(env, pixel_format);
- int alpha = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "alpha", "I"));
- int depth = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "depth", "I"));
- int stencil = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "stencil", "I"));
- int samples = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "samples", "I"));
- int num_aux_buffers = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "num_aux_buffers", "I"));
- int accum_bpp = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "accum_bpp", "I"));
- int accum_alpha = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "accum_alpha", "I"));
-
- bool stereo = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "stereo", "Z"));
- bool sRGB = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "sRGB", "Z"));
-
- int bpe = convertToBPE(bpp);
- int accum_bpe = convertToBPE(accum_bpp);
- attrib_list_t attrib_list;
- initAttribList(&attrib_list);
- putAttrib(&attrib_list, GLX_RGBA);
- putAttrib(&attrib_list, GLX_DOUBLEBUFFER);
- putAttrib(&attrib_list, GLX_DEPTH_SIZE); putAttrib(&attrib_list, depth);
- putAttrib(&attrib_list, GLX_RED_SIZE); putAttrib(&attrib_list, bpe);
- putAttrib(&attrib_list, GLX_GREEN_SIZE); putAttrib(&attrib_list, bpe);
- putAttrib(&attrib_list, GLX_BLUE_SIZE); putAttrib(&attrib_list, bpe);
- putAttrib(&attrib_list, GLX_ALPHA_SIZE); putAttrib(&attrib_list, alpha);
- putAttrib(&attrib_list, GLX_STENCIL_SIZE); putAttrib(&attrib_list, stencil);
- putAttrib(&attrib_list, GLX_AUX_BUFFERS); putAttrib(&attrib_list, num_aux_buffers);
- putAttrib(&attrib_list, GLX_ACCUM_RED_SIZE); putAttrib(&attrib_list, accum_bpe);
- putAttrib(&attrib_list, GLX_ACCUM_GREEN_SIZE); putAttrib(&attrib_list, accum_bpe);
- putAttrib(&attrib_list, GLX_ACCUM_BLUE_SIZE); putAttrib(&attrib_list, accum_bpe);
- putAttrib(&attrib_list, GLX_ACCUM_ALPHA_SIZE); putAttrib(&attrib_list, accum_alpha);
- if (stereo)
- putAttrib(&attrib_list, GLX_STEREO);
- // Assume the caller has checked support for multisample
- if (samples > 0) {
- putAttrib(&attrib_list, GLX_SAMPLE_BUFFERS_ARB); putAttrib(&attrib_list, 1);
- putAttrib(&attrib_list, GLX_SAMPLES_ARB); putAttrib(&attrib_list, samples);
- }
- if (sRGB)
- putAttrib(&attrib_list, GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB);
- putAttrib(&attrib_list, None);
- return lwjgl_glXChooseVisual(disp, screen, attrib_list.attribs);
-}
-
-XVisualInfo *chooseVisualGLX(JNIEnv *env, Display *disp, int screen, jobject pixel_format, bool use_display_bpp, bool double_buffer) {
- jclass cls_pixel_format = (*env)->GetObjectClass(env, pixel_format);
- int bpp;
- if (use_display_bpp) {
- bpp = XDefaultDepthOfScreen(XScreenOfDisplay(disp, screen));
- XVisualInfo *vis_info = chooseVisualGLXFromBPP(env, disp, screen, pixel_format, bpp, double_buffer);
- if (vis_info != NULL)
- return vis_info;
- else
- bpp = 16;
- } else
- bpp = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "bpp", "I"));
- return chooseVisualGLXFromBPP(env, disp, screen, pixel_format, bpp, double_buffer);
-}
-
-static void dumpVisualInfo(JNIEnv *env, Display *display, GLXExtensions *extension_flags, XVisualInfo *vis_info) {
- int alpha, depth, stencil, r, g, b;
- int sample_buffers = 0;
- int samples = 0;
- lwjgl_glXGetConfig(display, vis_info, GLX_RED_SIZE, &r);
- lwjgl_glXGetConfig(display, vis_info, GLX_GREEN_SIZE, &g);
- lwjgl_glXGetConfig(display, vis_info, GLX_BLUE_SIZE, &b);
- lwjgl_glXGetConfig(display, vis_info, GLX_ALPHA_SIZE, &alpha);
- lwjgl_glXGetConfig(display, vis_info, GLX_DEPTH_SIZE, &depth);
- lwjgl_glXGetConfig(display, vis_info, GLX_STENCIL_SIZE, &stencil);
- if (extension_flags->GLX_ARB_multisample) {
- lwjgl_glXGetConfig(display, vis_info, GLX_SAMPLE_BUFFERS_ARB, &sample_buffers);
- lwjgl_glXGetConfig(display, vis_info, GLX_SAMPLES_ARB, &samples);
- }
- printfDebugJava(env, "Pixel format info: r = %d, g = %d, b = %d, a = %d, depth = %d, stencil = %d, sample buffers = %d, samples = %d", r, g, b, alpha, depth, stencil, sample_buffers, samples);
-}
-
-bool initPeerInfo(JNIEnv *env, jobject peer_info_handle, Display *display, int screen, jobject pixel_format, bool use_display_bpp, int drawable_type, bool double_buffered, bool force_glx13) {
- if ((*env)->GetDirectBufferCapacity(env, peer_info_handle) < sizeof(X11PeerInfo)) {
- throwException(env, "Handle too small");
- return false;
- }
- X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle);
- GLXExtensions extension_flags;
- if (!extgl_InitGLX(display, screen, &extension_flags)) {
- throwException(env, "Could not init GLX");
- return false;
- }
- if (!extension_flags.GLX13 && force_glx13) {
- throwException(env, "GLX13 is required, but is not available");
- return false;
- }
- jclass cls_pixel_format = (*env)->GetObjectClass(env, pixel_format);
- int samples = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "samples", "I"));
- if (samples > 0 && !extension_flags.GLX_ARB_multisample) {
- throwException(env, "Samples > 0 specified but there's no support for GLX_ARB_multisample");
- return false;
- }
- bool floating_point = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "floating_point", "Z"));
- if (floating_point && !(extension_flags.GLX13 && extension_flags.GLX_ARB_fbconfig_float)) { // We need GLX13 to support floating point
- throwException(env, "Floating point specified but there's no support for GLX_ARB_fbconfig_float");
- return false;
- }
- bool floating_point_packed = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "floating_point_packed", "Z"));
- if (floating_point_packed && !(extension_flags.GLX13 && extension_flags.GLX_EXT_fbconfig_packed_float)) { // We need GLX13 to support packed floating point
- throwException(env, "Packed floating point specified but there's no support for GLX_EXT_fbconfig_packed_float");
- return false;
- }
- bool sRGB = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "sRGB", "Z"));
- if (sRGB && !extension_flags.GLX_ARB_framebuffer_sRGB) {
- throwException(env, "sRGB specified but there's no support for GLX_ARB_framebuffer_sRGB");
- return false;
- }
-
- peer_info->glx13 = extension_flags.GLX13;
- if (peer_info->glx13) {
- GLXFBConfig *configs = chooseVisualGLX13(env, display, screen, pixel_format, use_display_bpp, drawable_type, double_buffered);
- if (configs == NULL) {
- throwException(env, "Could not choose GLX13 config");
- return false;
- }
- if (isDebugEnabled()) {
- XVisualInfo *vis_info = lwjgl_glXGetVisualFromFBConfig(display, configs[0]);
- if (vis_info != NULL) {
- dumpVisualInfo(env, display, &extension_flags, vis_info);
- XFree(vis_info);
- }
- }
- int config_id;
- int result = lwjgl_glXGetFBConfigAttrib(display, configs[0], GLX_FBCONFIG_ID, &config_id);
- XFree(configs);
- if (result != Success) {
- throwException(env, "Could not get GLX_FBCONFIG_ID from GLXFBConfig");
- return false;
- }
- peer_info->config.glx13_config.config_id = config_id;
- } else {
- XVisualInfo *vis_info = chooseVisualGLX(env, display, screen, pixel_format, use_display_bpp, double_buffered);
- if (vis_info == NULL) {
- throwException(env, "Could not choose visual");
- return false;
- }
- peer_info->config.glx_config.visualid = vis_info->visualid;
- peer_info->config.glx_config.depth = vis_info->depth;
- peer_info->screen = vis_info->screen;
- if (isDebugEnabled())
- dumpVisualInfo(env, display, &extension_flags, vis_info);
- XFree(vis_info);
- }
- peer_info->display = display;
- peer_info->screen = screen;
- peer_info->drawable = None;
- return true;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: context.c 3116 2008-08-19 16:46:03Z spasi $
+ *
+ * Include file to access public window features
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3116 $
+ */
+
+#include <jni.h>
+#include <X11/X.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include "extgl_glx.h"
+#include "context.h"
+
+XVisualInfo *getVisualInfoFromPeerInfo(JNIEnv *env, X11PeerInfo *peer_info) {
+ XVisualInfo *vis_info;
+ if (!peer_info->glx13) {
+ XVisualInfo template;
+ template.visualid = peer_info->config.glx_config.visualid;
+ template.depth = peer_info->config.glx_config.depth;
+ template.screen = peer_info->screen;
+ int num_infos;
+ vis_info = XGetVisualInfo(peer_info->display, VisualIDMask | VisualScreenMask | VisualDepthMask, &template, &num_infos);
+ if (vis_info == NULL) {
+ throwException(env, "Could not find VisualInfo from peer info");
+ return NULL;
+ }
+ // Check the assumption from GLX 1.3 docs that a VisualInfo is uniquely identified by its
+ // {VisualID, screen, depth} tuple
+ if (num_infos != 1) {
+ XFree(vis_info);
+ throwException(env, "No unique VisualInfo matches peer info");
+ return NULL;
+ }
+ } else {
+ GLXFBConfig *configs = getFBConfigFromPeerInfo(env, peer_info);
+ if (configs == NULL)
+ return NULL;
+ vis_info = lwjgl_glXGetVisualFromFBConfig(peer_info->display, configs[0]);
+ if (vis_info == NULL)
+ throwException(env, "Could not get VisualInfo from GLX 1.3 config");
+ XFree(configs);
+ }
+ return vis_info;
+}
+
+GLXFBConfig *getFBConfigFromPeerInfo(JNIEnv *env, X11PeerInfo *peer_info) {
+ int attribs[] = {GLX_FBCONFIG_ID, peer_info->config.glx13_config.config_id, None, None};
+ int num_elements;
+ GLXFBConfig *configs = lwjgl_glXChooseFBConfig(peer_info->display, peer_info->screen, attribs, &num_elements);
+ if (configs == NULL) {
+ throwException(env, "Could not find GLX 1.3 config from peer info");
+ return NULL;
+ }
+ // Check that only one FBConfig matches the config id
+ if (num_elements != 1) {
+ XFree(configs);
+ throwException(env, "No unique GLX 1.3 config matches peer info");
+ return NULL;
+ }
+ return configs;
+}
+
+static int convertToBPE(int bpp) {
+ int bpe;
+ switch (bpp) {
+ case 0:
+ bpe = 0;
+ break;
+ case 32:
+ case 24:
+ bpe = 8;
+ break;
+ case 16: /* Fall through */
+ default:
+ bpe = 4;
+ break;
+ }
+ return bpe;
+}
+
+static GLXFBConfig *chooseVisualGLX13FromBPP(JNIEnv *env, Display *disp, int screen, jobject pixel_format, int bpp, int drawable_type, bool double_buffer) {
+ jclass cls_pixel_format = (*env)->GetObjectClass(env, pixel_format);
+ int alpha = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "alpha", "I"));
+ int depth = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "depth", "I"));
+ int stencil = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "stencil", "I"));
+ int samples = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "samples", "I"));
+ int num_aux_buffers = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "num_aux_buffers", "I"));
+ int accum_bpp = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "accum_bpp", "I"));
+ int accum_alpha = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "accum_alpha", "I"));
+
+ bool stereo = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "stereo", "Z"));
+ bool floating_point = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "floating_point", "Z"));
+ bool floating_point_packed = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "floating_point_packed", "Z"));
+ bool sRGB = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "sRGB", "Z"));
+
+ int bpe = convertToBPE(bpp);
+ int accum_bpe = convertToBPE(accum_bpp);
+ attrib_list_t attrib_list;
+ initAttribList(&attrib_list);
+ int render_type;
+
+ if ( floating_point )
+ render_type = GLX_RGBA_FLOAT_BIT;
+ else if ( floating_point_packed )
+ render_type = GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT;
+ else
+ render_type = GLX_RGBA_BIT;
+
+ putAttrib(&attrib_list, GLX_RENDER_TYPE); putAttrib(&attrib_list, render_type);
+ putAttrib(&attrib_list, GLX_DOUBLEBUFFER); putAttrib(&attrib_list, double_buffer ? True : False);
+ putAttrib(&attrib_list, GLX_DRAWABLE_TYPE); putAttrib(&attrib_list, drawable_type);
+ putAttrib(&attrib_list, GLX_DEPTH_SIZE); putAttrib(&attrib_list, depth);
+ putAttrib(&attrib_list, GLX_RED_SIZE); putAttrib(&attrib_list, bpe);
+ putAttrib(&attrib_list, GLX_GREEN_SIZE); putAttrib(&attrib_list, bpe);
+ putAttrib(&attrib_list, GLX_BLUE_SIZE); putAttrib(&attrib_list, bpe);
+ putAttrib(&attrib_list, GLX_ALPHA_SIZE); putAttrib(&attrib_list, alpha);
+ putAttrib(&attrib_list, GLX_STENCIL_SIZE); putAttrib(&attrib_list, stencil);
+ putAttrib(&attrib_list, GLX_AUX_BUFFERS); putAttrib(&attrib_list, num_aux_buffers);
+ putAttrib(&attrib_list, GLX_ACCUM_RED_SIZE); putAttrib(&attrib_list, accum_bpe);
+ putAttrib(&attrib_list, GLX_ACCUM_GREEN_SIZE); putAttrib(&attrib_list, accum_bpe);
+ putAttrib(&attrib_list, GLX_ACCUM_BLUE_SIZE); putAttrib(&attrib_list, accum_bpe);
+ putAttrib(&attrib_list, GLX_ACCUM_ALPHA_SIZE); putAttrib(&attrib_list, accum_alpha);
+ if (stereo) {
+ putAttrib(&attrib_list, GLX_STEREO); putAttrib(&attrib_list, True);
+ }
+ // Assume the caller has checked support for multisample
+ if (samples > 0) {
+ putAttrib(&attrib_list, GLX_SAMPLE_BUFFERS_ARB); putAttrib(&attrib_list, 1);
+ putAttrib(&attrib_list, GLX_SAMPLES_ARB); putAttrib(&attrib_list, samples);
+ }
+ if (sRGB) {
+ putAttrib(&attrib_list, GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB); putAttrib(&attrib_list, True);
+ }
+ putAttrib(&attrib_list, None); putAttrib(&attrib_list, None);
+ int num_formats = 0;
+ GLXFBConfig* configs = lwjgl_glXChooseFBConfig(disp, screen, attrib_list.attribs, &num_formats);
+ if (num_formats > 0) {
+ return configs;
+ } else {
+ if (configs != NULL)
+ XFree(configs);
+ return NULL;
+ }
+}
+
+GLXFBConfig *chooseVisualGLX13(JNIEnv *env, Display *disp, int screen, jobject pixel_format, bool use_display_bpp, int drawable_type, bool double_buffer) {
+ jclass cls_pixel_format = (*env)->GetObjectClass(env, pixel_format);
+ int bpp;
+ if (use_display_bpp) {
+ bpp = XDefaultDepthOfScreen(XScreenOfDisplay(disp, screen));
+ GLXFBConfig *configs = chooseVisualGLX13FromBPP(env, disp, screen, pixel_format, bpp, drawable_type, double_buffer);
+ if (configs != NULL)
+ return configs;
+ else
+ bpp = 16;
+ } else
+ bpp = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "bpp", "I"));
+ return chooseVisualGLX13FromBPP(env, disp, screen, pixel_format, bpp, drawable_type, double_buffer);
+}
+
+static XVisualInfo *chooseVisualGLXFromBPP(JNIEnv *env, Display *disp, int screen, jobject pixel_format, int bpp, bool double_buffer) {
+ jclass cls_pixel_format = (*env)->GetObjectClass(env, pixel_format);
+ int alpha = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "alpha", "I"));
+ int depth = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "depth", "I"));
+ int stencil = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "stencil", "I"));
+ int samples = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "samples", "I"));
+ int num_aux_buffers = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "num_aux_buffers", "I"));
+ int accum_bpp = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "accum_bpp", "I"));
+ int accum_alpha = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "accum_alpha", "I"));
+
+ bool stereo = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "stereo", "Z"));
+ bool sRGB = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "sRGB", "Z"));
+
+ int bpe = convertToBPE(bpp);
+ int accum_bpe = convertToBPE(accum_bpp);
+ attrib_list_t attrib_list;
+ initAttribList(&attrib_list);
+ putAttrib(&attrib_list, GLX_RGBA);
+ putAttrib(&attrib_list, GLX_DOUBLEBUFFER);
+ putAttrib(&attrib_list, GLX_DEPTH_SIZE); putAttrib(&attrib_list, depth);
+ putAttrib(&attrib_list, GLX_RED_SIZE); putAttrib(&attrib_list, bpe);
+ putAttrib(&attrib_list, GLX_GREEN_SIZE); putAttrib(&attrib_list, bpe);
+ putAttrib(&attrib_list, GLX_BLUE_SIZE); putAttrib(&attrib_list, bpe);
+ putAttrib(&attrib_list, GLX_ALPHA_SIZE); putAttrib(&attrib_list, alpha);
+ putAttrib(&attrib_list, GLX_STENCIL_SIZE); putAttrib(&attrib_list, stencil);
+ putAttrib(&attrib_list, GLX_AUX_BUFFERS); putAttrib(&attrib_list, num_aux_buffers);
+ putAttrib(&attrib_list, GLX_ACCUM_RED_SIZE); putAttrib(&attrib_list, accum_bpe);
+ putAttrib(&attrib_list, GLX_ACCUM_GREEN_SIZE); putAttrib(&attrib_list, accum_bpe);
+ putAttrib(&attrib_list, GLX_ACCUM_BLUE_SIZE); putAttrib(&attrib_list, accum_bpe);
+ putAttrib(&attrib_list, GLX_ACCUM_ALPHA_SIZE); putAttrib(&attrib_list, accum_alpha);
+ if (stereo)
+ putAttrib(&attrib_list, GLX_STEREO);
+ // Assume the caller has checked support for multisample
+ if (samples > 0) {
+ putAttrib(&attrib_list, GLX_SAMPLE_BUFFERS_ARB); putAttrib(&attrib_list, 1);
+ putAttrib(&attrib_list, GLX_SAMPLES_ARB); putAttrib(&attrib_list, samples);
+ }
+ if (sRGB)
+ putAttrib(&attrib_list, GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB);
+ putAttrib(&attrib_list, None);
+ return lwjgl_glXChooseVisual(disp, screen, attrib_list.attribs);
+}
+
+XVisualInfo *chooseVisualGLX(JNIEnv *env, Display *disp, int screen, jobject pixel_format, bool use_display_bpp, bool double_buffer) {
+ jclass cls_pixel_format = (*env)->GetObjectClass(env, pixel_format);
+ int bpp;
+ if (use_display_bpp) {
+ bpp = XDefaultDepthOfScreen(XScreenOfDisplay(disp, screen));
+ XVisualInfo *vis_info = chooseVisualGLXFromBPP(env, disp, screen, pixel_format, bpp, double_buffer);
+ if (vis_info != NULL)
+ return vis_info;
+ else
+ bpp = 16;
+ } else
+ bpp = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "bpp", "I"));
+ return chooseVisualGLXFromBPP(env, disp, screen, pixel_format, bpp, double_buffer);
+}
+
+static void dumpVisualInfo(JNIEnv *env, Display *display, GLXExtensions *extension_flags, XVisualInfo *vis_info) {
+ int alpha, depth, stencil, r, g, b;
+ int sample_buffers = 0;
+ int samples = 0;
+ lwjgl_glXGetConfig(display, vis_info, GLX_RED_SIZE, &r);
+ lwjgl_glXGetConfig(display, vis_info, GLX_GREEN_SIZE, &g);
+ lwjgl_glXGetConfig(display, vis_info, GLX_BLUE_SIZE, &b);
+ lwjgl_glXGetConfig(display, vis_info, GLX_ALPHA_SIZE, &alpha);
+ lwjgl_glXGetConfig(display, vis_info, GLX_DEPTH_SIZE, &depth);
+ lwjgl_glXGetConfig(display, vis_info, GLX_STENCIL_SIZE, &stencil);
+ if (extension_flags->GLX_ARB_multisample) {
+ lwjgl_glXGetConfig(display, vis_info, GLX_SAMPLE_BUFFERS_ARB, &sample_buffers);
+ lwjgl_glXGetConfig(display, vis_info, GLX_SAMPLES_ARB, &samples);
+ }
+ printfDebugJava(env, "Pixel format info: r = %d, g = %d, b = %d, a = %d, depth = %d, stencil = %d, sample buffers = %d, samples = %d", r, g, b, alpha, depth, stencil, sample_buffers, samples);
+}
+
+bool initPeerInfo(JNIEnv *env, jobject peer_info_handle, Display *display, int screen, jobject pixel_format, bool use_display_bpp, int drawable_type, bool double_buffered, bool force_glx13) {
+ if ((*env)->GetDirectBufferCapacity(env, peer_info_handle) < sizeof(X11PeerInfo)) {
+ throwException(env, "Handle too small");
+ return false;
+ }
+ X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle);
+ GLXExtensions extension_flags;
+ if (!extgl_InitGLX(display, screen, &extension_flags)) {
+ throwException(env, "Could not init GLX");
+ return false;
+ }
+ if (!extension_flags.GLX13 && force_glx13) {
+ throwException(env, "GLX13 is required, but is not available");
+ return false;
+ }
+ jclass cls_pixel_format = (*env)->GetObjectClass(env, pixel_format);
+ int samples = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "samples", "I"));
+ if (samples > 0 && !extension_flags.GLX_ARB_multisample) {
+ throwException(env, "Samples > 0 specified but there's no support for GLX_ARB_multisample");
+ return false;
+ }
+ bool floating_point = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "floating_point", "Z"));
+ if (floating_point && !(extension_flags.GLX13 && extension_flags.GLX_ARB_fbconfig_float)) { // We need GLX13 to support floating point
+ throwException(env, "Floating point specified but there's no support for GLX_ARB_fbconfig_float");
+ return false;
+ }
+ bool floating_point_packed = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "floating_point_packed", "Z"));
+ if (floating_point_packed && !(extension_flags.GLX13 && extension_flags.GLX_EXT_fbconfig_packed_float)) { // We need GLX13 to support packed floating point
+ throwException(env, "Packed floating point specified but there's no support for GLX_EXT_fbconfig_packed_float");
+ return false;
+ }
+ bool sRGB = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "sRGB", "Z"));
+ if (sRGB && !extension_flags.GLX_ARB_framebuffer_sRGB) {
+ throwException(env, "sRGB specified but there's no support for GLX_ARB_framebuffer_sRGB");
+ return false;
+ }
+
+ peer_info->glx13 = extension_flags.GLX13;
+ if (peer_info->glx13) {
+ GLXFBConfig *configs = chooseVisualGLX13(env, display, screen, pixel_format, use_display_bpp, drawable_type, double_buffered);
+ if (configs == NULL) {
+ throwException(env, "Could not choose GLX13 config");
+ return false;
+ }
+ if (isDebugEnabled()) {
+ XVisualInfo *vis_info = lwjgl_glXGetVisualFromFBConfig(display, configs[0]);
+ if (vis_info != NULL) {
+ dumpVisualInfo(env, display, &extension_flags, vis_info);
+ XFree(vis_info);
+ }
+ }
+ int config_id;
+ int result = lwjgl_glXGetFBConfigAttrib(display, configs[0], GLX_FBCONFIG_ID, &config_id);
+ XFree(configs);
+ if (result != Success) {
+ throwException(env, "Could not get GLX_FBCONFIG_ID from GLXFBConfig");
+ return false;
+ }
+ peer_info->config.glx13_config.config_id = config_id;
+ } else {
+ XVisualInfo *vis_info = chooseVisualGLX(env, display, screen, pixel_format, use_display_bpp, double_buffered);
+ if (vis_info == NULL) {
+ throwException(env, "Could not choose visual");
+ return false;
+ }
+ peer_info->config.glx_config.visualid = vis_info->visualid;
+ peer_info->config.glx_config.depth = vis_info->depth;
+ peer_info->screen = vis_info->screen;
+ if (isDebugEnabled())
+ dumpVisualInfo(env, display, &extension_flags, vis_info);
+ XFree(vis_info);
+ }
+ peer_info->display = display;
+ peer_info->screen = screen;
+ peer_info->drawable = None;
+ return true;
+}
diff --git a/src/native/linux/context.h b/src/native/linux/context.h
index 476d904..28278f5 100644
--- a/src/native/linux/context.h
+++ b/src/native/linux/context.h
@@ -1,83 +1,83 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: context.h 2985 2008-04-07 18:42:36Z matzon $
- *
- * Include file to access public window features
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2985 $
- */
-
-#ifndef _LWJGL_CONTEXT_H_INCLUDED_
-#define _LWJGL_CONTEXT_H_INCLUDED_
-
-#include <jni.h>
-#include <X11/X.h>
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include "extgl_glx.h"
-
-typedef struct {
- VisualID visualid;
- int depth;
-} GLXConfig;
-
-typedef struct {
- GLXFBConfigID config_id;
-} GLX13Config;
-
-typedef struct {
- Display *display;
- int screen;
- GLXDrawable drawable;
- // This flag determines the appropriate glx struct
- bool glx13;
- union {
- GLXConfig glx_config;
- GLX13Config glx13_config;
- } config;
-} X11PeerInfo;
-
-/* GLX 1.3 chooser */
-extern GLXFBConfig *chooseVisualGLX13(JNIEnv *env, Display *disp, int screen, jobject pixel_format, bool use_display_bpp, int drawable_type, bool double_buffer);
-
-/* Default GLX chooser*/
-extern XVisualInfo *chooseVisualGLX(JNIEnv *env, Display *disp, int screen, jobject pixel_format, bool use_display_bpp, bool double_buffer);
-
-extern XVisualInfo *getVisualInfoFromPeerInfo(JNIEnv *env, X11PeerInfo *peer_info);
-extern GLXFBConfig *getFBConfigFromPeerInfo(JNIEnv *env, X11PeerInfo *peer_info);
-
-extern bool initPeerInfo(JNIEnv *env, jobject peer_info_handle, Display *display, int screen, jobject pixel_format, bool use_display_bpp, int drawable_type, bool double_buffered, bool force_glx13);
-
-#endif /* _LWJGL_CONTEXT_H_INCLUDED_ */
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: context.h 2985 2008-04-07 18:42:36Z matzon $
+ *
+ * Include file to access public window features
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2985 $
+ */
+
+#ifndef _LWJGL_CONTEXT_H_INCLUDED_
+#define _LWJGL_CONTEXT_H_INCLUDED_
+
+#include <jni.h>
+#include <X11/X.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include "extgl_glx.h"
+
+typedef struct {
+ VisualID visualid;
+ int depth;
+} GLXConfig;
+
+typedef struct {
+ GLXFBConfigID config_id;
+} GLX13Config;
+
+typedef struct {
+ Display *display;
+ int screen;
+ GLXDrawable drawable;
+ // This flag determines the appropriate glx struct
+ bool glx13;
+ union {
+ GLXConfig glx_config;
+ GLX13Config glx13_config;
+ } config;
+} X11PeerInfo;
+
+/* GLX 1.3 chooser */
+extern GLXFBConfig *chooseVisualGLX13(JNIEnv *env, Display *disp, int screen, jobject pixel_format, bool use_display_bpp, int drawable_type, bool double_buffer);
+
+/* Default GLX chooser*/
+extern XVisualInfo *chooseVisualGLX(JNIEnv *env, Display *disp, int screen, jobject pixel_format, bool use_display_bpp, bool double_buffer);
+
+extern XVisualInfo *getVisualInfoFromPeerInfo(JNIEnv *env, X11PeerInfo *peer_info);
+extern GLXFBConfig *getFBConfigFromPeerInfo(JNIEnv *env, X11PeerInfo *peer_info);
+
+extern bool initPeerInfo(JNIEnv *env, jobject peer_info_handle, Display *display, int screen, jobject pixel_format, bool use_display_bpp, int drawable_type, bool double_buffered, bool force_glx13);
+
+#endif /* _LWJGL_CONTEXT_H_INCLUDED_ */
diff --git a/src/native/linux/display.c b/src/native/linux/display.c
index 4f74682..56899d7 100644
--- a/src/native/linux/display.c
+++ b/src/native/linux/display.c
@@ -1,411 +1,411 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: display.c 2985 2008-04-07 18:42:36Z matzon $
- *
- * Linux specific library for display handling.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2985 $
- */
-
-#include <X11/X.h>
-#include <X11/Xlib.h>
-#include <X11/extensions/xf86vmode.h>
-#include <X11/extensions/Xrandr.h>
-#include <X11/Xutil.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include "common_tools.h"
-#include "org_lwjgl_opengl_LinuxDisplay.h"
-
-#define NUM_XRANDR_RETRIES 5
-
-typedef struct {
- int width;
- int height;
- int freq;
- union {
- int size_index; // Data for Xrandr extension
- XF86VidModeModeInfo xf86vm_modeinfo; // Data for XF86VidMode extension
- } mode_data;
-} mode_info;
-
-static bool getXF86VidModeVersion(JNIEnv *env, Display *disp, int *major, int *minor) {
- int event_base, error_base;
-
- if (!XF86VidModeQueryExtension(disp, &event_base, &error_base)) {
- printfDebugJava(env, "XF86VidMode extension not available");
- return false;
- }
- if (!XF86VidModeQueryVersion(disp, major, minor)) {
- throwException(env, "Could not query XF86VidMode version");
- return false;
- }
- printfDebugJava(env, "XF86VidMode extension version %i.%i", *major, *minor);
- return true;
-}
-
-static bool getXrandrVersion(JNIEnv *env, Display *disp, int *major, int *minor) {
- int event_base, error_base;
-
- if (!XRRQueryExtension(disp, &event_base, &error_base)) {
- printfDebugJava(env, "Xrandr extension not available");
- return false;
- }
- if (!XRRQueryVersion(disp, major, minor)) {
- throwException(env, "Could not query Xrandr version");
- return false;
- }
- printfDebugJava(env, "Xrandr extension version %i.%i", *major, *minor);
- return true;
-}
-
-static bool isXrandrSupported(JNIEnv *env, Display *disp) {
- int major, minor;
- if (!getXrandrVersion(env, disp, &major, &minor))
- return false;
- return major >= 1;
-}
-
-static bool isXF86VidModeSupported(JNIEnv *env, Display *disp) {
- int minor_ver, major_ver;
- if (!getXF86VidModeVersion(env, disp, &major_ver, &minor_ver))
- return false;
- return major_ver >= 2;
-}
-
-JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nIsXrandrSupported(JNIEnv *env, jclass unused, jlong display) {
- Display *disp = (Display *)(intptr_t)display;
- jboolean result = isXrandrSupported(env, disp) ? JNI_TRUE : JNI_FALSE;
- return result;
-}
-
-JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nIsXF86VidModeSupported(JNIEnv *env, jclass unused, jlong display) {
- Display *disp = (Display *)(intptr_t)display;
- jboolean result = isXF86VidModeSupported(env, disp) ? JNI_TRUE : JNI_FALSE;
- return result;
-}
-
-static mode_info *getXrandrDisplayModes(Display *disp, int screen, int *num_modes) {
- int num_randr_sizes;
- XRRScreenSize *sizes = XRRSizes(disp, screen, &num_randr_sizes);
- mode_info *avail_modes = NULL;
- int list_size = 0;
- /* Count number of modes */
- int i;
- int mode_index = 0;
- for (i = 0; i < num_randr_sizes; i++) {
- int num_randr_rates;
- short *freqs = XRRRates(disp, screen, i, &num_randr_rates);
- int j;
- for (j = 0; j < num_randr_rates; j++) {
- if (list_size <= mode_index) {
- list_size += 1;
- avail_modes = (mode_info *)realloc(avail_modes, sizeof(mode_info)*list_size);
- if (avail_modes == NULL)
- return NULL;
- }
- avail_modes[mode_index].width = sizes[i].width;
- avail_modes[mode_index].height = sizes[i].height;
- avail_modes[mode_index].freq = freqs[j];
- avail_modes[mode_index].mode_data.size_index = i;
- mode_index++;
- }
- }
- *num_modes = mode_index;
- return avail_modes;
-}
-
-static mode_info *getXF86VidModeDisplayModes(Display *disp, int screen, int *num_modes) {
- int num_xf86vm_modes;
- XF86VidModeModeInfo **avail_xf86vm_modes;
- XF86VidModeGetAllModeLines(disp, screen, &num_xf86vm_modes, &avail_xf86vm_modes);
- mode_info *avail_modes = (mode_info *)malloc(sizeof(mode_info)*num_xf86vm_modes);
- if (avail_modes == NULL) {
- XFree(avail_xf86vm_modes);
- return NULL;
- }
- int i;
- for (i = 0; i < num_xf86vm_modes; i++) {
- avail_modes[i].width = avail_xf86vm_modes[i]->hdisplay;
- avail_modes[i].height = avail_xf86vm_modes[i]->vdisplay;
- avail_modes[i].freq = 0; // No frequency support in XF86VidMode
- avail_modes[i].mode_data.xf86vm_modeinfo = *avail_xf86vm_modes[i];
- }
- XFree(avail_xf86vm_modes);
- *num_modes = num_xf86vm_modes;
- return avail_modes;
-}
-
-static mode_info *getDisplayModes(Display *disp, int screen, jint extension, int *num_modes) {
- switch (extension) {
- case org_lwjgl_opengl_LinuxDisplay_XF86VIDMODE:
- return getXF86VidModeDisplayModes(disp, screen, num_modes);
- case org_lwjgl_opengl_LinuxDisplay_XRANDR:
- return getXrandrDisplayModes(disp, screen, num_modes);
- case org_lwjgl_opengl_LinuxDisplay_NONE:
- // fall through
- default:
- return NULL;
- }
-}
-
-static bool setXF86VidModeMode(Display *disp, int screen, mode_info *mode) {
- return True == XF86VidModeSwitchToMode(disp, screen, &mode->mode_data.xf86vm_modeinfo);
-}
-
-/* Try to set the mode specified through XRandR.
- * Return value is the Status code of the mode switch
- * The timestamp parameter is filled with the latest timestamp returned from XRRConfigTimes
- */
-static Status trySetXrandrMode(Display *disp, int screen, mode_info *mode, Time *timestamp) {
- Status status;
- Drawable root_window = RootWindow(disp, screen);
- XRRScreenConfiguration *screen_configuration = XRRGetScreenInfo(disp, root_window);
- Time config_time;
- *timestamp = XRRConfigTimes(screen_configuration, &config_time);
- Rotation current_rotation;
- XRRConfigCurrentConfiguration(screen_configuration, ¤t_rotation);
- status = XRRSetScreenConfigAndRate(disp, screen_configuration, root_window, mode->mode_data.size_index, current_rotation, mode->freq, *timestamp);
- XRRFreeScreenConfigInfo(screen_configuration);
- return status;
-}
-
-static bool setXrandrMode(Display *disp, int screen, mode_info *mode) {
- int iteration;
- Time timestamp;
- Status status = trySetXrandrMode(disp, screen, mode, ×tamp);
- if (status == 0)
- return true; // Success
- Time new_timestamp;
- for (iteration = 0; iteration < NUM_XRANDR_RETRIES; iteration++) {
- status = trySetXrandrMode(disp, screen, mode, &new_timestamp);
- if (status == 0)
- return true; // Success
- if (new_timestamp == timestamp) {
- return false; // Failure, and the stamps are equal meaning that the failure is not merely transient
- }
- timestamp = new_timestamp;
- }
- return false;
-}
-
-static bool setMode(JNIEnv *env, Display *disp, int screen, jint extension, int width, int height, int freq) {
- int num_modes, i;
- mode_info *avail_modes = getDisplayModes(disp, screen, extension, &num_modes);
- if (avail_modes == NULL) {
- printfDebugJava(env, "Could not get display modes");
- return false;
- }
- bool result = false;
- for (i = 0; i < num_modes; ++i) {
- printfDebugJava(env, "Mode %d: %dx%d @%d", i, avail_modes[i].width, avail_modes[i].height, avail_modes[i].freq);
- if (avail_modes[i].width == width && avail_modes[i].height == height && avail_modes[i].freq == freq) {
- switch (extension) {
- case org_lwjgl_opengl_LinuxDisplay_XF86VIDMODE:
- if (!setXF86VidModeMode(disp, screen, &avail_modes[i])) {
- printfDebugJava(env, "Could not switch mode");
- continue;
- }
- break;
- case org_lwjgl_opengl_LinuxDisplay_XRANDR:
- if (!setXrandrMode(disp, screen, &avail_modes[i])) {
- printfDebugJava(env, "Could not switch mode");
- continue;
- }
- break;
- case org_lwjgl_opengl_LinuxDisplay_NONE: // Should never happen, since NONE imply no available display modes
- default: // Should never happen
- continue;
- }
- result = true;
- break;
- }
- }
- free(avail_modes);
- XFlush(disp);
- return result;
-}
-
-static int getGammaRampLengthOfDisplay(JNIEnv *env, Display *disp, int screen) {
- int ramp_size;
- if (XF86VidModeGetGammaRampSize(disp, screen, &ramp_size) == False) {
- throwException(env, "XF86VidModeGetGammaRampSize call failed");
- return 0;
- }
- return ramp_size;
-}
-
-JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nConvertToNativeRamp(JNIEnv *env, jclass unused, jobject ramp_buffer, jint buffer_offset, jint length) {
- const jfloat *ramp_ptr = (const jfloat *)(*env)->GetDirectBufferAddress(env, ramp_buffer) + buffer_offset;
- jobject native_ramp = newJavaManagedByteBuffer(env, length*3*sizeof(unsigned short));
- if (native_ramp == NULL) {
- throwException(env, "Failed to allocate gamma ramp buffer");
- return NULL;
- }
- unsigned short *native_ramp_ptr = (unsigned short *)(*env)->GetDirectBufferAddress(env, native_ramp);
- int i;
- for (i = 0; i < length; i++) {
- float scaled_gamma = ramp_ptr[i]*0xffff;
- short scaled_gamma_short = (unsigned short)roundf(scaled_gamma);
- native_ramp_ptr[i] = scaled_gamma_short;
- native_ramp_ptr[i + length] = scaled_gamma_short;
- native_ramp_ptr[i + length*2] = scaled_gamma_short;
- }
- return native_ramp;
-}
-
-JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetCurrentGammaRamp(JNIEnv *env, jclass unused, jlong display, jint screen) {
- Display *disp = (Display *)(intptr_t)display;
- int ramp_size = getGammaRampLengthOfDisplay(env, disp, screen);
- jobject ramp_buffer = newJavaManagedByteBuffer(env, sizeof(unsigned short)*3*ramp_size);
- if (ramp_buffer == NULL) {
- throwException(env, "Could not allocate gamma ramp buffer");
- return NULL;
- }
- unsigned short *ramp = (unsigned short *)(*env)->GetDirectBufferAddress(env, ramp_buffer);
- if (!XF86VidModeGetGammaRamp(disp, screen, ramp_size, ramp,
- ramp + ramp_size, ramp + ramp_size*2)) {
- throwException(env, "Could not get the current gamma ramp");
- return NULL;
- }
- return ramp_buffer;
-}
-
-static void setGamma(JNIEnv *env, Display *disp, int screen, jobject ramp_buffer) {
- if (ramp_buffer == NULL)
- return;
- unsigned short *ramp_ptr = (unsigned short *)(*env)->GetDirectBufferAddress(env, ramp_buffer);
- jlong capacity = (*env)->GetDirectBufferCapacity(env, ramp_buffer);
- int size = capacity/(sizeof(unsigned short)*3);
- if (size == 0)
- return;
- if (XF86VidModeSetGammaRamp(disp, screen, size, ramp_ptr, ramp_ptr + size, ramp_ptr + size*2) == False) {
- throwException(env, "Could not set gamma ramp.");
- }
-}
-
-static bool switchDisplayMode(JNIEnv * env, Display *disp, int screen, jint extension, jobject mode) {
- if (mode == NULL) {
- throwException(env, "mode must be non-null");
- return false;
- }
- jclass cls_displayMode = (*env)->GetObjectClass(env, mode);
- jfieldID fid_width = (*env)->GetFieldID(env, cls_displayMode, "width", "I");
- jfieldID fid_height = (*env)->GetFieldID(env, cls_displayMode, "height", "I");
- jfieldID fid_freq = (*env)->GetFieldID(env, cls_displayMode, "freq", "I");
- int width = (*env)->GetIntField(env, mode, fid_width);
- int height = (*env)->GetIntField(env, mode, fid_height);
- int freq = (*env)->GetIntField(env, mode, fid_freq);
- if (!setMode(env, disp, screen, extension, width, height, freq)) {
- throwException(env, "Could not switch mode.");
- return false;
- }
- return true;
-}
-
-static jobjectArray getAvailableDisplayModes(JNIEnv * env, Display *disp, int screen, jint extension) {
- int num_modes, i;
- mode_info *avail_modes;
- int bpp = XDefaultDepth(disp, screen);
- avail_modes = getDisplayModes(disp, screen, extension, &num_modes);
- if (avail_modes == NULL) {
- printfDebugJava(env, "Could not get display modes");
- return NULL;
- }
- // Allocate an array of DisplayModes big enough
- jclass displayModeClass = (*env)->FindClass(env, "org/lwjgl/opengl/DisplayMode");
- jobjectArray ret = (*env)->NewObjectArray(env, num_modes, displayModeClass, NULL);
- jmethodID displayModeConstructor = (*env)->GetMethodID(env, displayModeClass, "<init>", "(IIII)V");
-
- for (i = 0; i < num_modes; i++) {
- jobject displayMode = (*env)->NewObject(env, displayModeClass, displayModeConstructor, avail_modes[i].width, avail_modes[i].height, bpp, avail_modes[i].freq);
- (*env)->SetObjectArrayElement(env, ret, i, displayMode);
- }
- free(avail_modes);
- return ret;
-}
-
-static jobject getCurrentXRandrMode(JNIEnv * env, Display *disp, int screen) {
- Drawable root_window = RootWindow(disp, screen);
- XRRScreenConfiguration *config = XRRGetScreenInfo(disp, root_window);
- if (config == NULL) {
- throwException(env, "Could not get current screen configuration.");
- return NULL;
- }
- short rate = XRRConfigCurrentRate(config);
- Rotation current_rotation;
- SizeID size_index = XRRConfigCurrentConfiguration(config, ¤t_rotation);
- int n_sizes;
- XRRScreenSize *sizes = XRRConfigSizes(config, &n_sizes);
- if (size_index >= n_sizes) {
- throwFormattedException(env, "Xrandr current index (%d) is larger than or equals to the number of sizes (%d).", size_index, n_sizes);
- XRRFreeScreenConfigInfo(config);
- return NULL;
- }
- XRRScreenSize current_size = sizes[size_index];
- XRRFreeScreenConfigInfo(config);
- int bpp = XDefaultDepth(disp, screen);
- jclass displayModeClass = (*env)->FindClass(env, "org/lwjgl/opengl/DisplayMode");
- jmethodID displayModeConstructor = (*env)->GetMethodID(env, displayModeClass, "<init>", "(IIII)V");
- jobject displayMode = (*env)->NewObject(env, displayModeClass, displayModeConstructor, current_size.width, current_size.height, bpp, rate);
- return displayMode;
-}
-
-JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetCurrentXRandrMode(JNIEnv *env, jclass unused, jlong display, jint screen) {
- Display *disp = (Display *)(intptr_t)display;
- return getCurrentXRandrMode(env, disp, screen);
-}
-
-JNIEXPORT jobjectArray JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetAvailableDisplayModes(JNIEnv *env, jclass clazz, jlong display, jint screen, jint extension) {
- Display *disp = (Display *)(intptr_t)display;
- return getAvailableDisplayModes(env, disp, screen, extension);
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSwitchDisplayMode(JNIEnv *env, jclass clazz, jlong display, jint screen, jint extension, jobject mode) {
- Display *disp = (Display *)(intptr_t)display;
- switchDisplayMode(env, disp, screen, extension, mode);
-}
-
-JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetGammaRampLength(JNIEnv *env, jclass clazz, jlong display_ptr, jint screen) {
- Display *disp = (Display *)(intptr_t)display_ptr;
- return (jint)getGammaRampLengthOfDisplay(env, disp, screen);
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSetGammaRamp(JNIEnv *env, jclass clazz, jlong display, jint screen, jobject gamma_buffer) {
- Display *disp = (Display *)(intptr_t)display;
- setGamma(env, disp, screen, gamma_buffer);
-}
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: display.c 2985 2008-04-07 18:42:36Z matzon $
+ *
+ * Linux specific library for display handling.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2985 $
+ */
+
+#include <X11/X.h>
+#include <X11/Xlib.h>
+#include <X11/extensions/xf86vmode.h>
+#include <X11/extensions/Xrandr.h>
+#include <X11/Xutil.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include "common_tools.h"
+#include "org_lwjgl_opengl_LinuxDisplay.h"
+
+#define NUM_XRANDR_RETRIES 5
+
+typedef struct {
+ int width;
+ int height;
+ int freq;
+ union {
+ int size_index; // Data for Xrandr extension
+ XF86VidModeModeInfo xf86vm_modeinfo; // Data for XF86VidMode extension
+ } mode_data;
+} mode_info;
+
+static bool getXF86VidModeVersion(JNIEnv *env, Display *disp, int *major, int *minor) {
+ int event_base, error_base;
+
+ if (!XF86VidModeQueryExtension(disp, &event_base, &error_base)) {
+ printfDebugJava(env, "XF86VidMode extension not available");
+ return false;
+ }
+ if (!XF86VidModeQueryVersion(disp, major, minor)) {
+ throwException(env, "Could not query XF86VidMode version");
+ return false;
+ }
+ printfDebugJava(env, "XF86VidMode extension version %i.%i", *major, *minor);
+ return true;
+}
+
+static bool getXrandrVersion(JNIEnv *env, Display *disp, int *major, int *minor) {
+ int event_base, error_base;
+
+ if (!XRRQueryExtension(disp, &event_base, &error_base)) {
+ printfDebugJava(env, "Xrandr extension not available");
+ return false;
+ }
+ if (!XRRQueryVersion(disp, major, minor)) {
+ throwException(env, "Could not query Xrandr version");
+ return false;
+ }
+ printfDebugJava(env, "Xrandr extension version %i.%i", *major, *minor);
+ return true;
+}
+
+static bool isXrandrSupported(JNIEnv *env, Display *disp) {
+ int major, minor;
+ if (!getXrandrVersion(env, disp, &major, &minor))
+ return false;
+ return major >= 1;
+}
+
+static bool isXF86VidModeSupported(JNIEnv *env, Display *disp) {
+ int minor_ver, major_ver;
+ if (!getXF86VidModeVersion(env, disp, &major_ver, &minor_ver))
+ return false;
+ return major_ver >= 2;
+}
+
+JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nIsXrandrSupported(JNIEnv *env, jclass unused, jlong display) {
+ Display *disp = (Display *)(intptr_t)display;
+ jboolean result = isXrandrSupported(env, disp) ? JNI_TRUE : JNI_FALSE;
+ return result;
+}
+
+JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nIsXF86VidModeSupported(JNIEnv *env, jclass unused, jlong display) {
+ Display *disp = (Display *)(intptr_t)display;
+ jboolean result = isXF86VidModeSupported(env, disp) ? JNI_TRUE : JNI_FALSE;
+ return result;
+}
+
+static mode_info *getXrandrDisplayModes(Display *disp, int screen, int *num_modes) {
+ int num_randr_sizes;
+ XRRScreenSize *sizes = XRRSizes(disp, screen, &num_randr_sizes);
+ mode_info *avail_modes = NULL;
+ int list_size = 0;
+ /* Count number of modes */
+ int i;
+ int mode_index = 0;
+ for (i = 0; i < num_randr_sizes; i++) {
+ int num_randr_rates;
+ short *freqs = XRRRates(disp, screen, i, &num_randr_rates);
+ int j;
+ for (j = 0; j < num_randr_rates; j++) {
+ if (list_size <= mode_index) {
+ list_size += 1;
+ avail_modes = (mode_info *)realloc(avail_modes, sizeof(mode_info)*list_size);
+ if (avail_modes == NULL)
+ return NULL;
+ }
+ avail_modes[mode_index].width = sizes[i].width;
+ avail_modes[mode_index].height = sizes[i].height;
+ avail_modes[mode_index].freq = freqs[j];
+ avail_modes[mode_index].mode_data.size_index = i;
+ mode_index++;
+ }
+ }
+ *num_modes = mode_index;
+ return avail_modes;
+}
+
+static mode_info *getXF86VidModeDisplayModes(Display *disp, int screen, int *num_modes) {
+ int num_xf86vm_modes;
+ XF86VidModeModeInfo **avail_xf86vm_modes;
+ XF86VidModeGetAllModeLines(disp, screen, &num_xf86vm_modes, &avail_xf86vm_modes);
+ mode_info *avail_modes = (mode_info *)malloc(sizeof(mode_info)*num_xf86vm_modes);
+ if (avail_modes == NULL) {
+ XFree(avail_xf86vm_modes);
+ return NULL;
+ }
+ int i;
+ for (i = 0; i < num_xf86vm_modes; i++) {
+ avail_modes[i].width = avail_xf86vm_modes[i]->hdisplay;
+ avail_modes[i].height = avail_xf86vm_modes[i]->vdisplay;
+ avail_modes[i].freq = 0; // No frequency support in XF86VidMode
+ avail_modes[i].mode_data.xf86vm_modeinfo = *avail_xf86vm_modes[i];
+ }
+ XFree(avail_xf86vm_modes);
+ *num_modes = num_xf86vm_modes;
+ return avail_modes;
+}
+
+static mode_info *getDisplayModes(Display *disp, int screen, jint extension, int *num_modes) {
+ switch (extension) {
+ case org_lwjgl_opengl_LinuxDisplay_XF86VIDMODE:
+ return getXF86VidModeDisplayModes(disp, screen, num_modes);
+ case org_lwjgl_opengl_LinuxDisplay_XRANDR:
+ return getXrandrDisplayModes(disp, screen, num_modes);
+ case org_lwjgl_opengl_LinuxDisplay_NONE:
+ // fall through
+ default:
+ return NULL;
+ }
+}
+
+static bool setXF86VidModeMode(Display *disp, int screen, mode_info *mode) {
+ return True == XF86VidModeSwitchToMode(disp, screen, &mode->mode_data.xf86vm_modeinfo);
+}
+
+/* Try to set the mode specified through XRandR.
+ * Return value is the Status code of the mode switch
+ * The timestamp parameter is filled with the latest timestamp returned from XRRConfigTimes
+ */
+static Status trySetXrandrMode(Display *disp, int screen, mode_info *mode, Time *timestamp) {
+ Status status;
+ Drawable root_window = RootWindow(disp, screen);
+ XRRScreenConfiguration *screen_configuration = XRRGetScreenInfo(disp, root_window);
+ Time config_time;
+ *timestamp = XRRConfigTimes(screen_configuration, &config_time);
+ Rotation current_rotation;
+ XRRConfigCurrentConfiguration(screen_configuration, ¤t_rotation);
+ status = XRRSetScreenConfigAndRate(disp, screen_configuration, root_window, mode->mode_data.size_index, current_rotation, mode->freq, *timestamp);
+ XRRFreeScreenConfigInfo(screen_configuration);
+ return status;
+}
+
+static bool setXrandrMode(Display *disp, int screen, mode_info *mode) {
+ int iteration;
+ Time timestamp;
+ Status status = trySetXrandrMode(disp, screen, mode, ×tamp);
+ if (status == 0)
+ return true; // Success
+ Time new_timestamp;
+ for (iteration = 0; iteration < NUM_XRANDR_RETRIES; iteration++) {
+ status = trySetXrandrMode(disp, screen, mode, &new_timestamp);
+ if (status == 0)
+ return true; // Success
+ if (new_timestamp == timestamp) {
+ return false; // Failure, and the stamps are equal meaning that the failure is not merely transient
+ }
+ timestamp = new_timestamp;
+ }
+ return false;
+}
+
+static bool setMode(JNIEnv *env, Display *disp, int screen, jint extension, int width, int height, int freq) {
+ int num_modes, i;
+ mode_info *avail_modes = getDisplayModes(disp, screen, extension, &num_modes);
+ if (avail_modes == NULL) {
+ printfDebugJava(env, "Could not get display modes");
+ return false;
+ }
+ bool result = false;
+ for (i = 0; i < num_modes; ++i) {
+ printfDebugJava(env, "Mode %d: %dx%d @%d", i, avail_modes[i].width, avail_modes[i].height, avail_modes[i].freq);
+ if (avail_modes[i].width == width && avail_modes[i].height == height && avail_modes[i].freq == freq) {
+ switch (extension) {
+ case org_lwjgl_opengl_LinuxDisplay_XF86VIDMODE:
+ if (!setXF86VidModeMode(disp, screen, &avail_modes[i])) {
+ printfDebugJava(env, "Could not switch mode");
+ continue;
+ }
+ break;
+ case org_lwjgl_opengl_LinuxDisplay_XRANDR:
+ if (!setXrandrMode(disp, screen, &avail_modes[i])) {
+ printfDebugJava(env, "Could not switch mode");
+ continue;
+ }
+ break;
+ case org_lwjgl_opengl_LinuxDisplay_NONE: // Should never happen, since NONE imply no available display modes
+ default: // Should never happen
+ continue;
+ }
+ result = true;
+ break;
+ }
+ }
+ free(avail_modes);
+ XFlush(disp);
+ return result;
+}
+
+static int getGammaRampLengthOfDisplay(JNIEnv *env, Display *disp, int screen) {
+ int ramp_size;
+ if (XF86VidModeGetGammaRampSize(disp, screen, &ramp_size) == False) {
+ throwException(env, "XF86VidModeGetGammaRampSize call failed");
+ return 0;
+ }
+ return ramp_size;
+}
+
+JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nConvertToNativeRamp(JNIEnv *env, jclass unused, jobject ramp_buffer, jint buffer_offset, jint length) {
+ const jfloat *ramp_ptr = (const jfloat *)(*env)->GetDirectBufferAddress(env, ramp_buffer) + buffer_offset;
+ jobject native_ramp = newJavaManagedByteBuffer(env, length*3*sizeof(unsigned short));
+ if (native_ramp == NULL) {
+ throwException(env, "Failed to allocate gamma ramp buffer");
+ return NULL;
+ }
+ unsigned short *native_ramp_ptr = (unsigned short *)(*env)->GetDirectBufferAddress(env, native_ramp);
+ int i;
+ for (i = 0; i < length; i++) {
+ float scaled_gamma = ramp_ptr[i]*0xffff;
+ short scaled_gamma_short = (unsigned short)roundf(scaled_gamma);
+ native_ramp_ptr[i] = scaled_gamma_short;
+ native_ramp_ptr[i + length] = scaled_gamma_short;
+ native_ramp_ptr[i + length*2] = scaled_gamma_short;
+ }
+ return native_ramp;
+}
+
+JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetCurrentGammaRamp(JNIEnv *env, jclass unused, jlong display, jint screen) {
+ Display *disp = (Display *)(intptr_t)display;
+ int ramp_size = getGammaRampLengthOfDisplay(env, disp, screen);
+ jobject ramp_buffer = newJavaManagedByteBuffer(env, sizeof(unsigned short)*3*ramp_size);
+ if (ramp_buffer == NULL) {
+ throwException(env, "Could not allocate gamma ramp buffer");
+ return NULL;
+ }
+ unsigned short *ramp = (unsigned short *)(*env)->GetDirectBufferAddress(env, ramp_buffer);
+ if (!XF86VidModeGetGammaRamp(disp, screen, ramp_size, ramp,
+ ramp + ramp_size, ramp + ramp_size*2)) {
+ throwException(env, "Could not get the current gamma ramp");
+ return NULL;
+ }
+ return ramp_buffer;
+}
+
+static void setGamma(JNIEnv *env, Display *disp, int screen, jobject ramp_buffer) {
+ if (ramp_buffer == NULL)
+ return;
+ unsigned short *ramp_ptr = (unsigned short *)(*env)->GetDirectBufferAddress(env, ramp_buffer);
+ jlong capacity = (*env)->GetDirectBufferCapacity(env, ramp_buffer);
+ int size = capacity/(sizeof(unsigned short)*3);
+ if (size == 0)
+ return;
+ if (XF86VidModeSetGammaRamp(disp, screen, size, ramp_ptr, ramp_ptr + size, ramp_ptr + size*2) == False) {
+ throwException(env, "Could not set gamma ramp.");
+ }
+}
+
+static bool switchDisplayMode(JNIEnv * env, Display *disp, int screen, jint extension, jobject mode) {
+ if (mode == NULL) {
+ throwException(env, "mode must be non-null");
+ return false;
+ }
+ jclass cls_displayMode = (*env)->GetObjectClass(env, mode);
+ jfieldID fid_width = (*env)->GetFieldID(env, cls_displayMode, "width", "I");
+ jfieldID fid_height = (*env)->GetFieldID(env, cls_displayMode, "height", "I");
+ jfieldID fid_freq = (*env)->GetFieldID(env, cls_displayMode, "freq", "I");
+ int width = (*env)->GetIntField(env, mode, fid_width);
+ int height = (*env)->GetIntField(env, mode, fid_height);
+ int freq = (*env)->GetIntField(env, mode, fid_freq);
+ if (!setMode(env, disp, screen, extension, width, height, freq)) {
+ throwException(env, "Could not switch mode.");
+ return false;
+ }
+ return true;
+}
+
+static jobjectArray getAvailableDisplayModes(JNIEnv * env, Display *disp, int screen, jint extension) {
+ int num_modes, i;
+ mode_info *avail_modes;
+ int bpp = XDefaultDepth(disp, screen);
+ avail_modes = getDisplayModes(disp, screen, extension, &num_modes);
+ if (avail_modes == NULL) {
+ printfDebugJava(env, "Could not get display modes");
+ return NULL;
+ }
+ // Allocate an array of DisplayModes big enough
+ jclass displayModeClass = (*env)->FindClass(env, "org/lwjgl/opengl/DisplayMode");
+ jobjectArray ret = (*env)->NewObjectArray(env, num_modes, displayModeClass, NULL);
+ jmethodID displayModeConstructor = (*env)->GetMethodID(env, displayModeClass, "<init>", "(IIII)V");
+
+ for (i = 0; i < num_modes; i++) {
+ jobject displayMode = (*env)->NewObject(env, displayModeClass, displayModeConstructor, avail_modes[i].width, avail_modes[i].height, bpp, avail_modes[i].freq);
+ (*env)->SetObjectArrayElement(env, ret, i, displayMode);
+ }
+ free(avail_modes);
+ return ret;
+}
+
+static jobject getCurrentXRandrMode(JNIEnv * env, Display *disp, int screen) {
+ Drawable root_window = RootWindow(disp, screen);
+ XRRScreenConfiguration *config = XRRGetScreenInfo(disp, root_window);
+ if (config == NULL) {
+ throwException(env, "Could not get current screen configuration.");
+ return NULL;
+ }
+ short rate = XRRConfigCurrentRate(config);
+ Rotation current_rotation;
+ SizeID size_index = XRRConfigCurrentConfiguration(config, ¤t_rotation);
+ int n_sizes;
+ XRRScreenSize *sizes = XRRConfigSizes(config, &n_sizes);
+ if (size_index >= n_sizes) {
+ throwFormattedException(env, "Xrandr current index (%d) is larger than or equals to the number of sizes (%d).", size_index, n_sizes);
+ XRRFreeScreenConfigInfo(config);
+ return NULL;
+ }
+ XRRScreenSize current_size = sizes[size_index];
+ XRRFreeScreenConfigInfo(config);
+ int bpp = XDefaultDepth(disp, screen);
+ jclass displayModeClass = (*env)->FindClass(env, "org/lwjgl/opengl/DisplayMode");
+ jmethodID displayModeConstructor = (*env)->GetMethodID(env, displayModeClass, "<init>", "(IIII)V");
+ jobject displayMode = (*env)->NewObject(env, displayModeClass, displayModeConstructor, current_size.width, current_size.height, bpp, rate);
+ return displayMode;
+}
+
+JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetCurrentXRandrMode(JNIEnv *env, jclass unused, jlong display, jint screen) {
+ Display *disp = (Display *)(intptr_t)display;
+ return getCurrentXRandrMode(env, disp, screen);
+}
+
+JNIEXPORT jobjectArray JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetAvailableDisplayModes(JNIEnv *env, jclass clazz, jlong display, jint screen, jint extension) {
+ Display *disp = (Display *)(intptr_t)display;
+ return getAvailableDisplayModes(env, disp, screen, extension);
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSwitchDisplayMode(JNIEnv *env, jclass clazz, jlong display, jint screen, jint extension, jobject mode) {
+ Display *disp = (Display *)(intptr_t)display;
+ switchDisplayMode(env, disp, screen, extension, mode);
+}
+
+JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetGammaRampLength(JNIEnv *env, jclass clazz, jlong display_ptr, jint screen) {
+ Display *disp = (Display *)(intptr_t)display_ptr;
+ return (jint)getGammaRampLengthOfDisplay(env, disp, screen);
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSetGammaRamp(JNIEnv *env, jclass clazz, jlong display, jint screen, jobject gamma_buffer) {
+ Display *disp = (Display *)(intptr_t)display;
+ setGamma(env, disp, screen, gamma_buffer);
+}
+
diff --git a/src/native/linux/extgl_glx.c b/src/native/linux/extgl_glx.c
index 1603063..1d8fc6c 100644
--- a/src/native/linux/extgl_glx.c
+++ b/src/native/linux/extgl_glx.c
@@ -1,231 +1,231 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-#include <dlfcn.h>
-#include "extgl_glx.h"
-
-glXGetFBConfigsPROC lwjgl_glXGetFBConfigs = NULL;
-glXChooseFBConfigPROC lwjgl_glXChooseFBConfig = NULL;
-glXGetFBConfigAttribPROC lwjgl_glXGetFBConfigAttrib = NULL;
-glXGetVisualFromFBConfigPROC lwjgl_glXGetVisualFromFBConfig = NULL;
-glXCreateWindowPROC lwjgl_glXCreateWindow = NULL;
-glXDestroyWindowPROC lwjgl_glXDestroyWindow = NULL;
-glXCreatePixmapPROC lwjgl_glXCreatePixmap = NULL;
-glXDestroyPixmapPROC lwjgl_glXDestroyPixmap = NULL;
-glXCreatePbufferPROC lwjgl_glXCreatePbuffer = NULL;
-glXDestroyPbufferPROC lwjgl_glXDestroyPbuffer = NULL;
-glXQueryDrawablePROC lwjgl_glXQueryDrawable = NULL;
-glXCreateNewContextPROC lwjgl_glXCreateNewContext = NULL;
-glXMakeContextCurrentPROC lwjgl_glXMakeContextCurrent = NULL;
-glXGetCurrentReadDrawablePROC lwjgl_glXGetCurrentReadDrawable = NULL;
-glXGetCurrentDisplayPROC lwjgl_glXGetCurrentDisplay = NULL;
-glXQueryContextPROC lwjgl_glXQueryContext = NULL;
-glXSelectEventPROC lwjgl_glXSelectEvent = NULL;
-glXGetSelectedEventPROC lwjgl_glXGetSelectedEvent = NULL;
-glXChooseVisualPROC lwjgl_glXChooseVisual = NULL;
-glXCopyContextPROC lwjgl_glXCopyContext = NULL;
-glXCreateContextPROC lwjgl_glXCreateContext = NULL;
-glXCreateGLXPixmapPROC lwjgl_glXCreateGLXPixmap = NULL;
-glXDestroyContextPROC lwjgl_glXDestroyContext = NULL;
-glXDestroyGLXPixmapPROC lwjgl_glXDestroyGLXPixmap = NULL;
-glXGetConfigPROC lwjgl_glXGetConfig = NULL;
-glXGetCurrentContextPROC lwjgl_glXGetCurrentContext = NULL;
-glXGetCurrentDrawablePROC lwjgl_glXGetCurrentDrawable = NULL;
-glXIsDirectPROC lwjgl_glXIsDirect = NULL;
-glXMakeCurrentPROC lwjgl_glXMakeCurrent = NULL;
-glXQueryExtensionPROC lwjgl_glXQueryExtension = NULL;
-glXQueryVersionPROC lwjgl_glXQueryVersion = NULL;
-glXSwapBuffersPROC lwjgl_glXSwapBuffers = NULL;
-glXUseXFontPROC lwjgl_glXUseXFont = NULL;
-glXWaitGLPROC lwjgl_glXWaitGL = NULL;
-glXWaitXPROC lwjgl_glXWaitX = NULL;
-glXGetClientStringPROC lwjgl_glXGetClientString = NULL;
-glXQueryServerStringPROC lwjgl_glXQueryServerString = NULL;
-glXQueryExtensionsStringPROC lwjgl_glXQueryExtensionsString = NULL;
-
-/* GLX_SGI_swap_control */
-glXSwapIntervalSGIPROC lwjgl_glXSwapIntervalSGI = NULL;
-
-/* GLX_ARB_create_context */
-glXCreateContextAttribsARBPROC lwjgl_glXCreateContextAttribsARB = NULL;
-
-static void * lib_gl_handle = NULL;
-
-typedef void * (APIENTRY * glXGetProcAddressARBPROC) (const GLubyte *procName);
-
-static glXGetProcAddressARBPROC lwjgl_glXGetProcAddressARB;
-
-static GLXExtensions symbols_flags;
-
-/** returns true if the extention is available */
-static bool GLXQueryExtension(Display *disp, int screen, const char *name) {
- const GLubyte *exts = (const GLubyte *)lwjgl_glXQueryExtensionsString(disp, screen);
- return extgl_QueryExtension(exts, name);
-}
-
-static void extgl_InitGLX13() {
- ExtFunction functions[] = {
- {"glXGetFBConfigs", (void*)&lwjgl_glXGetFBConfigs},
- {"glXChooseFBConfig", (void*)&lwjgl_glXChooseFBConfig},
- {"glXGetFBConfigAttrib", (void*)&lwjgl_glXGetFBConfigAttrib},
- {"glXGetVisualFromFBConfig", (void*)&lwjgl_glXGetVisualFromFBConfig},
- {"glXCreateWindow", (void*)&lwjgl_glXCreateWindow},
- {"glXDestroyWindow", (void*)&lwjgl_glXDestroyWindow},
- {"glXCreatePixmap", (void*)&lwjgl_glXCreatePixmap},
- {"glXDestroyPixmap", (void*)&lwjgl_glXDestroyPixmap},
- {"glXCreatePbuffer", (void*)&lwjgl_glXCreatePbuffer},
- {"glXDestroyPbuffer", (void*)&lwjgl_glXDestroyPbuffer},
- {"glXQueryDrawable", (void*)&lwjgl_glXQueryDrawable},
- {"glXCreateNewContext", (void*)&lwjgl_glXCreateNewContext},
- {"glXMakeContextCurrent", (void*)&lwjgl_glXMakeContextCurrent},
- {"glXGetCurrentReadDrawable", (void*)&lwjgl_glXGetCurrentReadDrawable},
- {"glXGetCurrentDisplay", (void*)&lwjgl_glXGetCurrentDisplay},
- {"glXQueryContext", (void*)&lwjgl_glXQueryContext},
- {"glXSelectEvent", (void*)&lwjgl_glXSelectEvent},
- {"glXGetSelectedEvent", (void*)&lwjgl_glXGetSelectedEvent}};
- symbols_flags.GLX13 = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions);
-}
-
-static void extgl_InitGLX12(void) {
- ExtFunction functions[] = {
- {"glXChooseVisual", (void*)&lwjgl_glXChooseVisual},
- {"glXCopyContext", (void*)&lwjgl_glXCopyContext},
- {"glXCreateContext", (void*)&lwjgl_glXCreateContext},
- {"glXCreateGLXPixmap", (void*)&lwjgl_glXCreateGLXPixmap},
- {"glXDestroyContext", (void*)&lwjgl_glXDestroyContext},
- {"glXDestroyGLXPixmap", (void*)&lwjgl_glXDestroyGLXPixmap},
- {"glXGetConfig", (void*)&lwjgl_glXGetConfig},
- {"glXGetCurrentContext", (void*)&lwjgl_glXGetCurrentContext},
- {"glXGetCurrentDrawable", (void*)&lwjgl_glXGetCurrentDrawable},
- {"glXIsDirect", (void*)&lwjgl_glXIsDirect},
- {"glXMakeCurrent", (void*)&lwjgl_glXMakeCurrent},
- {"glXQueryExtension", (void*)&lwjgl_glXQueryExtension},
- {"glXQueryVersion", (void*)&lwjgl_glXQueryVersion},
- {"glXSwapBuffers", (void*)&lwjgl_glXSwapBuffers},
- {"glXUseXFont", (void*)&lwjgl_glXUseXFont},
- {"glXWaitGL", (void*)&lwjgl_glXWaitGL},
- {"glXWaitX", (void*)&lwjgl_glXWaitX},
- {"glXGetClientString", (void*)&lwjgl_glXGetClientString},
- {"glXQueryServerString", (void*)&lwjgl_glXQueryServerString},
- {"glXQueryExtensionsString", (void*)&lwjgl_glXQueryExtensionsString}};
- symbols_flags.GLX12 = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions);
-}
-
-static void extgl_InitGLXSGISwapControl() {
- ExtFunction functions[] = {
- {"glXSwapIntervalSGI", (void*)&lwjgl_glXSwapIntervalSGI}};
- symbols_flags.GLX_SGI_swap_control = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions);
-}
-
-static void extgl_InitGLXARBCreateContext() {
- ExtFunction functions[] = {
- {"glXCreateContextAttribsARB", (void*)&lwjgl_glXCreateContextAttribsARB}};
- symbols_flags.GLX_ARB_create_context = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions);
-}
-
-static void extgl_InitGLXSupportedExtensions(Display *disp, int screen, GLXExtensions *extension_flags) {
-/* extension_flags.GLX_EXT_visual_info = GLXQueryExtension(disp, screen, "GLX_EXT_visual_info");
- extension_flags.GLX_EXT_visual_rating = GLXQueryExtension(disp, screen, "GLX_EXT_visual_rating");*/
- extension_flags->GLX_SGI_swap_control = symbols_flags.GLX_SGI_swap_control && GLXQueryExtension(disp, screen, "GLX_SGI_swap_control");
- extension_flags->GLX_ARB_multisample = GLXQueryExtension(disp, screen, "GLX_ARB_multisample");
- extension_flags->GLX_ARB_fbconfig_float = GLXQueryExtension(disp, screen, "GLX_ARB_fbconfig_float");
- extension_flags->GLX_EXT_fbconfig_packed_float = GLXQueryExtension(disp, screen, "GLX_EXT_fbconfig_packed_float");
- extension_flags->GLX_ARB_framebuffer_sRGB = GLXQueryExtension(disp, screen, "GLX_ARB_framebuffer_sRGB") || GLXQueryExtension(disp, screen, "GLX_EXT_framebuffer_sRGB");
- extension_flags->GLX_ARB_create_context = GLXQueryExtension(disp, screen, "GLX_ARB_create_context");
-}
-
-bool extgl_Open(JNIEnv *env) {
- if (lib_gl_handle != NULL)
- return true;
- /*
- * Actually we don't need the RTLD_GLOBAL flag, since the symbols
- * we load should be private to us. However, according to the
- * documentation at
- *
- * http://dri.sourceforge.net/doc/DRIuserguide.html
- *
- * DRI drivers need this flag to work properly
- */
- lib_gl_handle = dlopen("libGL.so.1", RTLD_LAZY | RTLD_GLOBAL);
- if (lib_gl_handle == NULL) {
- throwFormattedException(env, "Error loading libGL.so.1: %s", dlerror());
- return false;
- }
- lwjgl_glXGetProcAddressARB = (glXGetProcAddressARBPROC)dlsym(lib_gl_handle, "glXGetProcAddressARB");
- if (lwjgl_glXGetProcAddressARB == NULL) {
- extgl_Close();
- throwException(env, "Could not get address of glXGetProcAddressARB");
- return false;
- }
- /* Unlike Windows, GLX function addresses are context-independent
- * so we only have to initialize the addresses once at load
- */
- extgl_InitGLX12();
- extgl_InitGLX13();
- extgl_InitGLXSGISwapControl();
- extgl_InitGLXARBCreateContext();
- return true;
-}
-
-void *extgl_GetProcAddress(const char *name) {
- void *t = (void*)lwjgl_glXGetProcAddressARB((const GLubyte*)name);
- if (t == NULL) {
- t = dlsym(lib_gl_handle, name);
- if (t == NULL) {
- printfDebug("Could not locate symbol %s\n", name);
- }
- }
- return t;
-}
-
-void extgl_Close(void) {
- dlclose(lib_gl_handle);
- lib_gl_handle = NULL;
-}
-
-bool extgl_InitGLX(Display *disp, int screen, GLXExtensions *extension_flags) {
- int major, minor;
- /* Assume glx ver >= 1.2 */
- // Check GLX 1.2 symbols available
- if (!symbols_flags.GLX12)
- return false;
- if (lwjgl_glXQueryVersion(disp, &major, &minor) != True)
- return false;
- bool glx12 = major > 1 || (major == 1 && minor >= 2);
- // Check GLX 1.2 version
- if (!glx12)
- return false;
- extension_flags->GLX12 = glx12;
- extension_flags->GLX13 = major > 1 || (major == 1 && minor >= 3);
- extension_flags->GLX14 = major > 1 || (major == 1 && minor >= 4);
- extgl_InitGLXSupportedExtensions(disp, screen, extension_flags);
- return true;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+#include <dlfcn.h>
+#include "extgl_glx.h"
+
+glXGetFBConfigsPROC lwjgl_glXGetFBConfigs = NULL;
+glXChooseFBConfigPROC lwjgl_glXChooseFBConfig = NULL;
+glXGetFBConfigAttribPROC lwjgl_glXGetFBConfigAttrib = NULL;
+glXGetVisualFromFBConfigPROC lwjgl_glXGetVisualFromFBConfig = NULL;
+glXCreateWindowPROC lwjgl_glXCreateWindow = NULL;
+glXDestroyWindowPROC lwjgl_glXDestroyWindow = NULL;
+glXCreatePixmapPROC lwjgl_glXCreatePixmap = NULL;
+glXDestroyPixmapPROC lwjgl_glXDestroyPixmap = NULL;
+glXCreatePbufferPROC lwjgl_glXCreatePbuffer = NULL;
+glXDestroyPbufferPROC lwjgl_glXDestroyPbuffer = NULL;
+glXQueryDrawablePROC lwjgl_glXQueryDrawable = NULL;
+glXCreateNewContextPROC lwjgl_glXCreateNewContext = NULL;
+glXMakeContextCurrentPROC lwjgl_glXMakeContextCurrent = NULL;
+glXGetCurrentReadDrawablePROC lwjgl_glXGetCurrentReadDrawable = NULL;
+glXGetCurrentDisplayPROC lwjgl_glXGetCurrentDisplay = NULL;
+glXQueryContextPROC lwjgl_glXQueryContext = NULL;
+glXSelectEventPROC lwjgl_glXSelectEvent = NULL;
+glXGetSelectedEventPROC lwjgl_glXGetSelectedEvent = NULL;
+glXChooseVisualPROC lwjgl_glXChooseVisual = NULL;
+glXCopyContextPROC lwjgl_glXCopyContext = NULL;
+glXCreateContextPROC lwjgl_glXCreateContext = NULL;
+glXCreateGLXPixmapPROC lwjgl_glXCreateGLXPixmap = NULL;
+glXDestroyContextPROC lwjgl_glXDestroyContext = NULL;
+glXDestroyGLXPixmapPROC lwjgl_glXDestroyGLXPixmap = NULL;
+glXGetConfigPROC lwjgl_glXGetConfig = NULL;
+glXGetCurrentContextPROC lwjgl_glXGetCurrentContext = NULL;
+glXGetCurrentDrawablePROC lwjgl_glXGetCurrentDrawable = NULL;
+glXIsDirectPROC lwjgl_glXIsDirect = NULL;
+glXMakeCurrentPROC lwjgl_glXMakeCurrent = NULL;
+glXQueryExtensionPROC lwjgl_glXQueryExtension = NULL;
+glXQueryVersionPROC lwjgl_glXQueryVersion = NULL;
+glXSwapBuffersPROC lwjgl_glXSwapBuffers = NULL;
+glXUseXFontPROC lwjgl_glXUseXFont = NULL;
+glXWaitGLPROC lwjgl_glXWaitGL = NULL;
+glXWaitXPROC lwjgl_glXWaitX = NULL;
+glXGetClientStringPROC lwjgl_glXGetClientString = NULL;
+glXQueryServerStringPROC lwjgl_glXQueryServerString = NULL;
+glXQueryExtensionsStringPROC lwjgl_glXQueryExtensionsString = NULL;
+
+/* GLX_SGI_swap_control */
+glXSwapIntervalSGIPROC lwjgl_glXSwapIntervalSGI = NULL;
+
+/* GLX_ARB_create_context */
+glXCreateContextAttribsARBPROC lwjgl_glXCreateContextAttribsARB = NULL;
+
+static void * lib_gl_handle = NULL;
+
+typedef void * (APIENTRY * glXGetProcAddressARBPROC) (const GLubyte *procName);
+
+static glXGetProcAddressARBPROC lwjgl_glXGetProcAddressARB;
+
+static GLXExtensions symbols_flags;
+
+/** returns true if the extention is available */
+static bool GLXQueryExtension(Display *disp, int screen, const char *name) {
+ const GLubyte *exts = (const GLubyte *)lwjgl_glXQueryExtensionsString(disp, screen);
+ return extgl_QueryExtension(exts, name);
+}
+
+static void extgl_InitGLX13() {
+ ExtFunction functions[] = {
+ {"glXGetFBConfigs", (void*)&lwjgl_glXGetFBConfigs},
+ {"glXChooseFBConfig", (void*)&lwjgl_glXChooseFBConfig},
+ {"glXGetFBConfigAttrib", (void*)&lwjgl_glXGetFBConfigAttrib},
+ {"glXGetVisualFromFBConfig", (void*)&lwjgl_glXGetVisualFromFBConfig},
+ {"glXCreateWindow", (void*)&lwjgl_glXCreateWindow},
+ {"glXDestroyWindow", (void*)&lwjgl_glXDestroyWindow},
+ {"glXCreatePixmap", (void*)&lwjgl_glXCreatePixmap},
+ {"glXDestroyPixmap", (void*)&lwjgl_glXDestroyPixmap},
+ {"glXCreatePbuffer", (void*)&lwjgl_glXCreatePbuffer},
+ {"glXDestroyPbuffer", (void*)&lwjgl_glXDestroyPbuffer},
+ {"glXQueryDrawable", (void*)&lwjgl_glXQueryDrawable},
+ {"glXCreateNewContext", (void*)&lwjgl_glXCreateNewContext},
+ {"glXMakeContextCurrent", (void*)&lwjgl_glXMakeContextCurrent},
+ {"glXGetCurrentReadDrawable", (void*)&lwjgl_glXGetCurrentReadDrawable},
+ {"glXGetCurrentDisplay", (void*)&lwjgl_glXGetCurrentDisplay},
+ {"glXQueryContext", (void*)&lwjgl_glXQueryContext},
+ {"glXSelectEvent", (void*)&lwjgl_glXSelectEvent},
+ {"glXGetSelectedEvent", (void*)&lwjgl_glXGetSelectedEvent}};
+ symbols_flags.GLX13 = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions);
+}
+
+static void extgl_InitGLX12(void) {
+ ExtFunction functions[] = {
+ {"glXChooseVisual", (void*)&lwjgl_glXChooseVisual},
+ {"glXCopyContext", (void*)&lwjgl_glXCopyContext},
+ {"glXCreateContext", (void*)&lwjgl_glXCreateContext},
+ {"glXCreateGLXPixmap", (void*)&lwjgl_glXCreateGLXPixmap},
+ {"glXDestroyContext", (void*)&lwjgl_glXDestroyContext},
+ {"glXDestroyGLXPixmap", (void*)&lwjgl_glXDestroyGLXPixmap},
+ {"glXGetConfig", (void*)&lwjgl_glXGetConfig},
+ {"glXGetCurrentContext", (void*)&lwjgl_glXGetCurrentContext},
+ {"glXGetCurrentDrawable", (void*)&lwjgl_glXGetCurrentDrawable},
+ {"glXIsDirect", (void*)&lwjgl_glXIsDirect},
+ {"glXMakeCurrent", (void*)&lwjgl_glXMakeCurrent},
+ {"glXQueryExtension", (void*)&lwjgl_glXQueryExtension},
+ {"glXQueryVersion", (void*)&lwjgl_glXQueryVersion},
+ {"glXSwapBuffers", (void*)&lwjgl_glXSwapBuffers},
+ {"glXUseXFont", (void*)&lwjgl_glXUseXFont},
+ {"glXWaitGL", (void*)&lwjgl_glXWaitGL},
+ {"glXWaitX", (void*)&lwjgl_glXWaitX},
+ {"glXGetClientString", (void*)&lwjgl_glXGetClientString},
+ {"glXQueryServerString", (void*)&lwjgl_glXQueryServerString},
+ {"glXQueryExtensionsString", (void*)&lwjgl_glXQueryExtensionsString}};
+ symbols_flags.GLX12 = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions);
+}
+
+static void extgl_InitGLXSGISwapControl() {
+ ExtFunction functions[] = {
+ {"glXSwapIntervalSGI", (void*)&lwjgl_glXSwapIntervalSGI}};
+ symbols_flags.GLX_SGI_swap_control = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions);
+}
+
+static void extgl_InitGLXARBCreateContext() {
+ ExtFunction functions[] = {
+ {"glXCreateContextAttribsARB", (void*)&lwjgl_glXCreateContextAttribsARB}};
+ symbols_flags.GLX_ARB_create_context = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions);
+}
+
+static void extgl_InitGLXSupportedExtensions(Display *disp, int screen, GLXExtensions *extension_flags) {
+/* extension_flags.GLX_EXT_visual_info = GLXQueryExtension(disp, screen, "GLX_EXT_visual_info");
+ extension_flags.GLX_EXT_visual_rating = GLXQueryExtension(disp, screen, "GLX_EXT_visual_rating");*/
+ extension_flags->GLX_SGI_swap_control = symbols_flags.GLX_SGI_swap_control && GLXQueryExtension(disp, screen, "GLX_SGI_swap_control");
+ extension_flags->GLX_ARB_multisample = GLXQueryExtension(disp, screen, "GLX_ARB_multisample");
+ extension_flags->GLX_ARB_fbconfig_float = GLXQueryExtension(disp, screen, "GLX_ARB_fbconfig_float");
+ extension_flags->GLX_EXT_fbconfig_packed_float = GLXQueryExtension(disp, screen, "GLX_EXT_fbconfig_packed_float");
+ extension_flags->GLX_ARB_framebuffer_sRGB = GLXQueryExtension(disp, screen, "GLX_ARB_framebuffer_sRGB") || GLXQueryExtension(disp, screen, "GLX_EXT_framebuffer_sRGB");
+ extension_flags->GLX_ARB_create_context = GLXQueryExtension(disp, screen, "GLX_ARB_create_context");
+}
+
+bool extgl_Open(JNIEnv *env) {
+ if (lib_gl_handle != NULL)
+ return true;
+ /*
+ * Actually we don't need the RTLD_GLOBAL flag, since the symbols
+ * we load should be private to us. However, according to the
+ * documentation at
+ *
+ * http://dri.sourceforge.net/doc/DRIuserguide.html
+ *
+ * DRI drivers need this flag to work properly
+ */
+ lib_gl_handle = dlopen("libGL.so.1", RTLD_LAZY | RTLD_GLOBAL);
+ if (lib_gl_handle == NULL) {
+ throwFormattedException(env, "Error loading libGL.so.1: %s", dlerror());
+ return false;
+ }
+ lwjgl_glXGetProcAddressARB = (glXGetProcAddressARBPROC)dlsym(lib_gl_handle, "glXGetProcAddressARB");
+ if (lwjgl_glXGetProcAddressARB == NULL) {
+ extgl_Close();
+ throwException(env, "Could not get address of glXGetProcAddressARB");
+ return false;
+ }
+ /* Unlike Windows, GLX function addresses are context-independent
+ * so we only have to initialize the addresses once at load
+ */
+ extgl_InitGLX12();
+ extgl_InitGLX13();
+ extgl_InitGLXSGISwapControl();
+ extgl_InitGLXARBCreateContext();
+ return true;
+}
+
+void *extgl_GetProcAddress(const char *name) {
+ void *t = (void*)lwjgl_glXGetProcAddressARB((const GLubyte*)name);
+ if (t == NULL) {
+ t = dlsym(lib_gl_handle, name);
+ if (t == NULL) {
+ printfDebug("Could not locate symbol %s\n", name);
+ }
+ }
+ return t;
+}
+
+void extgl_Close(void) {
+ dlclose(lib_gl_handle);
+ lib_gl_handle = NULL;
+}
+
+bool extgl_InitGLX(Display *disp, int screen, GLXExtensions *extension_flags) {
+ int major, minor;
+ /* Assume glx ver >= 1.2 */
+ // Check GLX 1.2 symbols available
+ if (!symbols_flags.GLX12)
+ return false;
+ if (lwjgl_glXQueryVersion(disp, &major, &minor) != True)
+ return false;
+ bool glx12 = major > 1 || (major == 1 && minor >= 2);
+ // Check GLX 1.2 version
+ if (!glx12)
+ return false;
+ extension_flags->GLX12 = glx12;
+ extension_flags->GLX13 = major > 1 || (major == 1 && minor >= 3);
+ extension_flags->GLX14 = major > 1 || (major == 1 && minor >= 4);
+ extgl_InitGLXSupportedExtensions(disp, screen, extension_flags);
+ return true;
+}
diff --git a/src/native/linux/extgl_glx.h b/src/native/linux/extgl_glx.h
index fba7d0a..56b9860 100644
--- a/src/native/linux/extgl_glx.h
+++ b/src/native/linux/extgl_glx.h
@@ -1,398 +1,398 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-#ifndef EXTGL_GLX_H
-#define EXTGL_GLX_H
-
-#include <X11/Xutil.h>
-#include "extgl.h"
-
-/*
- * Names for attributes to lwjgl_glXGetConfig.
- */
-#define GLX_USE_GL 1 /* support GLX rendering */
-#define GLX_BUFFER_SIZE 2 /* depth of the color buffer */
-#define GLX_LEVEL 3 /* level in plane stacking */
-#define GLX_RGBA 4 /* true if RGBA mode */
-#define GLX_DOUBLEBUFFER 5 /* double buffering supported */
-#define GLX_STEREO 6 /* stereo buffering supported */
-#define GLX_AUX_BUFFERS 7 /* number of aux buffers */
-#define GLX_RED_SIZE 8 /* number of red component bits */
-#define GLX_GREEN_SIZE 9 /* number of green component bits */
-#define GLX_BLUE_SIZE 10 /* number of blue component bits */
-#define GLX_ALPHA_SIZE 11 /* number of alpha component bits */
-#define GLX_DEPTH_SIZE 12 /* number of depth bits */
-#define GLX_STENCIL_SIZE 13 /* number of stencil bits */
-#define GLX_ACCUM_RED_SIZE 14 /* number of red accum bits */
-#define GLX_ACCUM_GREEN_SIZE 15 /* number of green accum bits */
-#define GLX_ACCUM_BLUE_SIZE 16 /* number of blue accum bits */
-#define GLX_ACCUM_ALPHA_SIZE 17 /* number of alpha accum bits */
-
-#define GLX_SAMPLE_BUFFERS_ARB 100000 /* number of multisample buffers */
-#define GLX_SAMPLES_ARB 100001 /* number of multisample samples */
-
-/*
- * FBConfig-specific attributes
- */
-#define GLX_X_VISUAL_TYPE 0x22
-#define GLX_CONFIG_CAVEAT 0x20 /* Like visual_info VISUAL_CAVEAT */
-#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_DRAWABLE_TYPE 0x8010
-#define GLX_RENDER_TYPE 0x8011
-#define GLX_X_RENDERABLE 0x8012
-#define GLX_FBCONFIG_ID 0x8013
-#define GLX_MAX_PBUFFER_WIDTH 0x8016
-#define GLX_MAX_PBUFFER_HEIGHT 0x8017
-#define GLX_MAX_PBUFFER_PIXELS 0x8018
-#define GLX_VISUAL_ID 0x800B
-
-#define GLX_DRAWABLE_TYPE_SGIX GLX_DRAWABLE_TYPE
-#define GLX_RENDER_TYPE_SGIX GLX_RENDER_TYPE
-#define GLX_X_RENDERABLE_SGIX GLX_X_RENDERABLE
-#define GLX_FBCONFIG_ID_SGIX GLX_FBCONFIG_ID
-#define GLX_MAX_PBUFFER_WIDTH_SGIX GLX_MAX_PBUFFER_WIDTH
-#define GLX_MAX_PBUFFER_HEIGHT_SGIX GLX_MAX_PBUFFER_HEIGHT
-#define GLX_MAX_PBUFFER_PIXELS_SGIX GLX_MAX_PBUFFER_PIXELS
-#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019
-#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A
-
-/*
- * Error return values from lwjgl_glXGetConfig. Success is indicated by
- * a value of 0.
- */
-#define GLX_BAD_SCREEN 1 /* screen # is bad */
-#define GLX_BAD_ATTRIBUTE 2 /* attribute to get is bad */
-#define GLX_NO_EXTENSION 3 /* no glx extension on server */
-#define GLX_BAD_VISUAL 4 /* visual # not known by GLX */
-#define GLX_BAD_CONTEXT 5
-#define GLX_BAD_VALUE 6
-#define GLX_BAD_ENUM 7
-
-
-/* FBConfig attribute values */
-
-/*
- * Generic "don't care" value for lwjgl_glX ChooseFBConfig attributes (except
- * GLX_LEVEL).
- */
-#define GLX_DONT_CARE 0xFFFFFFFF
-
-/* GLX_RENDER_TYPE bits */
-#define GLX_RGBA_BIT 0x00000001
-#define GLX_COLOR_INDEX_BIT 0x00000002
-#define GLX_RGBA_BIT_SGIX GLX_RGBA_BIT
-#define GLX_COLOR_INDEX_BIT_SGIX GLX_COLOR_INDEX_BIT
-
-/* GLX_DRAWABLE_TYPE bits */
-#define GLX_WINDOW_BIT 0x00000001
-#define GLX_PIXMAP_BIT 0x00000002
-#define GLX_PBUFFER_BIT 0x00000004
-#define GLX_WINDOW_BIT_SGIX GLX_WINDOW_BIT
-#define GLX_PIXMAP_BIT_SGIX GLX_PIXMAP_BIT
-#define GLX_PBUFFER_BIT_SGIX GLX_PBUFFER_BIT
-
-/* GLX_CONFIG_CAVEAT attribute values */
-#define GLX_NONE 0x8000
-#define GLX_SLOW_CONFIG 0x8001
-#define GLX_NON_CONFORMANT_CONFIG 0x800D
-
-/* GLX_X_VISUAL_TYPE attribute values */
-#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
-
-/* GLX_TRANSPARENT_TYPE attribute values */
-/* #define GLX_NONE 0x8000 */
-#define GLX_TRANSPARENT_RGB 0x8008
-#define GLX_TRANSPARENT_INDEX 0x8009
-
-/* lwjgl_glXCreateGLXPbuffer attributes */
-#define GLX_PRESERVED_CONTENTS 0x801B
-#define GLX_LARGEST_PBUFFER 0x801C
-#define GLX_PBUFFER_HEIGHT 0x8040 /* New for GLX 1.3 */
-#define GLX_PBUFFER_WIDTH 0x8041 /* New for GLX 1.3 */
-#define GLX_PRESERVED_CONTENTS_SGIX GLX_PRESERVED_CONTENTS
-#define GLX_LARGEST_PBUFFER_SGIX GLX_LARGEST_PBUFFER
-
-/* lwjgl_glXQueryGLXPBuffer attributes */
-#define GLX_WIDTH 0x801D
-#define GLX_HEIGHT 0x801E
-#define GLX_EVENT_MASK 0x801F
-#define GLX_WIDTH_SGIX GLX_WIDTH
-#define GLX_HEIGHT_SGIX GLX_HEIGHT
-#define GLX_EVENT_MASK_SGIX GLX_EVENT_MASK
-
-/* lwjgl_glXCreateNewContext render_type attribute values */
-#define GLX_RGBA_TYPE 0x8014
-#define GLX_COLOR_INDEX_TYPE 0x8015
-#define GLX_RGBA_TYPE_SGIX GLX_RGBA_TYPE
-#define GLX_COLOR_INDEX_TYPE_SGIX GLX_COLOR_INDEX_TYPE
-
-/* lwjgl_glXQueryContext attributes */
-/* #define GLX_FBCONFIG_ID 0x8013 */
-/* #define GLX_RENDER_TYPE 0x8011 */
-#define GLX_SCREEN 0x800C
-
-/* lwjgl_glXSelectEvent event mask bits */
-#define GLX_PBUFFER_CLOBBER_MASK 0x08000000
-#define GLX_PBUFFER_CLOBBER_MASK_SGIX GLX_PBUFFER_CLOBBER_MASK
-
-/* GLXPbufferClobberEvent event_type values */
-#define GLX_DAMAGED 0x8020
-#define GLX_SAVED 0x8021
-#define GLX_DAMAGED_SGIX GLX_DAMAGED
-#define GLX_SAVED_SGIX GLX_SAVED
-
-/* GLXPbufferClobberEvent draw_type values */
-#define GLX_WINDOW 0x8022
-#define GLX_PBUFFER 0x8023
-#define GLX_WINDOW_SGIX GLX_WINDOW
-#define GLX_PBUFFER_SGIX GLX_PBUFFER
-
-/* GLXPbufferClobberEvent buffer_mask bits */
-#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_AUX_BUFFERS_BIT 0x00000010
-#define GLX_DEPTH_BUFFER_BIT 0x00000020
-#define GLX_STENCIL_BUFFER_BIT 0x00000040
-#define GLX_ACCUM_BUFFER_BIT 0x00000080
-#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX GLX_FRONT_LEFT_BUFFER_BIT
-#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX GLX_FRONT_RIGHT_BUFFER_BIT
-#define GLX_BACK_LEFT_BUFFER_BIT_SGIX GLX_BACK_LEFT_BUFFER_BIT
-#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX GLX_BACK_RIGHT_BUFFER_BIT
-#define GLX_AUX_BUFFERS_BIT_SGIX GLX_AUX_BUFFERS_BIT
-#define GLX_DEPTH_BUFFER_BIT_SGIX GLX_DEPTH_BUFFER_BIT
-#define GLX_STENCIL_BUFFER_BIT_SGIX GLX_STENCIL_BUFFER_BIT
-#define GLX_ACCUM_BUFFER_BIT_SGIX GLX_ACCUM_BUFFER_BIT
-
-/*
- * Extension return values from lwjgl_glXGetConfig. These are also
- * accepted as parameter values for lwjgl_glXChooseVisual.
- */
-
-#define GLX_X_VISUAL_TYPE_EXT 0x22 /* visual_info extension type */
-#define GLX_TRANSPARENT_TYPE_EXT 0x23 /* visual_info extension */
-#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24 /* visual_info extension */
-#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25 /* visual_info extension */
-#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26 /* visual_info extension */
-#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27 /* visual_info extension */
-#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28 /* visual_info extension */
-
-/* Property values for visual_type */
-#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
-
-/* Property values for transparent pixel */
-#define GLX_NONE_EXT 0x8000
-#define GLX_TRANSPARENT_RGB_EXT 0x8008
-#define GLX_TRANSPARENT_INDEX_EXT 0x8009
-
-/* Property values for visual_rating */
-#define GLX_VISUAL_CAVEAT_EXT 0x20 /* visual_rating extension type */
-#define GLX_SLOW_VISUAL_EXT 0x8001
-#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D
-
-/*
- * Names for attributes to lwjgl_glXGetClientString.
- */
-#define GLX_VENDOR 0x1
-#define GLX_VERSION 0x2
-#define GLX_EXTENSIONS 0x3
-
-/*
- * Names for attributes to lwjgl_glXQueryContextInfoEXT.
- */
-#define GLX_SHARE_CONTEXT_EXT 0x800A /* id of share context */
-#define GLX_VISUAL_ID_EXT 0x800B /* id of context's visual */
-#define GLX_SCREEN_EXT 0x800C /* screen number */
-
-/* NV_float_buffer */
-#define GLX_FLOAT_COMPONENTS_NV 0x20B0
-
-/* GLX_ARB_fbconfig_float */
-#define GLX_RGBA_FLOAT_TYPE 0x20B9
-#define GLX_RGBA_FLOAT_BIT 0x0004
-
-/* GLX_ARB_fbconfig_float */
-#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1
-#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008
-
-/* GLX_ARB_framebuffer_sRGB */
-#define GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20B2
-
-/* GLX_ARB_create_context */
-#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091
-#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092
-#define GLX_CONTEXT_FLAGS_ARB 0x2094
-
-#define GLX_CONTEXT_DEBUG_BIT_ARB 0x0001
-#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002
-
-typedef XID GLXContextID;
-typedef XID GLXPixmap;
-typedef XID GLXDrawable;
-typedef XID GLXPbuffer;
-typedef XID GLXWindow;
-typedef XID GLXFBConfigID;
-
-typedef struct __GLXcontextRec *GLXContext;
-
-typedef struct __GLXFBConfigRec *GLXFBConfig;
-
-typedef GLXFBConfig * (APIENTRY * glXGetFBConfigsPROC) (Display *dpy, int screen, int *nelements);
-typedef GLXFBConfig * (APIENTRY * glXChooseFBConfigPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);
-typedef int (APIENTRY * glXGetFBConfigAttribPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value);
-typedef XVisualInfo * (APIENTRY * glXGetVisualFromFBConfigPROC) (Display *dpy, GLXFBConfig config);
-typedef GLXWindow (APIENTRY * glXCreateWindowPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
-typedef void (APIENTRY * glXDestroyWindowPROC) (Display *dpy, GLXWindow win);
-typedef GLXPixmap (APIENTRY * glXCreatePixmapPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
-typedef void (APIENTRY * glXDestroyPixmapPROC) (Display *dpy, GLXPixmap pixmap);
-typedef GLXPbuffer (APIENTRY * glXCreatePbufferPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list);
-typedef void (APIENTRY * glXDestroyPbufferPROC) (Display *dpy, GLXPbuffer pbuf);
-typedef void (APIENTRY * glXQueryDrawablePROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
-typedef GLXContext (APIENTRY * glXCreateNewContextPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
-typedef Bool (APIENTRY * glXMakeContextCurrentPROC) (Display *display, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
-typedef GLXDrawable (APIENTRY * glXGetCurrentReadDrawablePROC) (void);
-typedef Display * (APIENTRY * glXGetCurrentDisplayPROC) (void);
-typedef int (APIENTRY * glXQueryContextPROC) (Display *dpy, GLXContext ctx, int attribute, int *value);
-typedef void (APIENTRY * glXSelectEventPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask);
-typedef void (APIENTRY * glXGetSelectedEventPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
-
-typedef GLXContextID (APIENTRY * glXGetContextIDEXTPROC) (const GLXContext ctx);
-typedef GLXDrawable (APIENTRY * glXGetCurrentDrawableEXTPROC) (void);
-typedef GLXContext (APIENTRY * glXImportContextEXTPROC) (Display *dpy, GLXContextID contextID);
-typedef void (APIENTRY * glXFreeContextEXTPROC) (Display *dpy, GLXContext ctx);
-typedef int (APIENTRY * glXQueryContextInfoEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value);
-
-typedef XVisualInfo* (APIENTRY * glXChooseVisualPROC) (Display *dpy, int screen, int *attribList);
-typedef void (APIENTRY * glXCopyContextPROC) (Display *dpy, GLXContext src, GLXContext dst, unsigned long mask);
-typedef GLXContext (APIENTRY * glXCreateContextPROC) (Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct);
-typedef GLXPixmap (APIENTRY * glXCreateGLXPixmapPROC) (Display *dpy, XVisualInfo *vis, Pixmap pixmap);
-typedef void (APIENTRY * glXDestroyContextPROC) (Display *dpy, GLXContext ctx);
-typedef void (APIENTRY * glXDestroyGLXPixmapPROC) (Display *dpy, GLXPixmap pix);
-typedef int (APIENTRY * glXGetConfigPROC) (Display *dpy, XVisualInfo *vis, int attrib, int *value);
-typedef GLXContext (APIENTRY * glXGetCurrentContextPROC) (void);
-typedef GLXDrawable (APIENTRY * glXGetCurrentDrawablePROC) (void);
-typedef Bool (APIENTRY * glXIsDirectPROC) (Display *dpy, GLXContext ctx);
-typedef Bool (APIENTRY * glXMakeCurrentPROC) (Display *dpy, GLXDrawable drawable, GLXContext ctx);
-typedef Bool (APIENTRY * glXQueryExtensionPROC) (Display *dpy, int *errorBase, int *eventBase);
-typedef Bool (APIENTRY * glXQueryVersionPROC) (Display *dpy, int *major, int *minor);
-typedef void (APIENTRY * glXSwapBuffersPROC) (Display *dpy, GLXDrawable drawable);
-typedef void (APIENTRY * glXUseXFontPROC) (Font font, int first, int count, int listBase);
-typedef void (APIENTRY * glXWaitGLPROC) (void);
-typedef void (APIENTRY * glXWaitXPROC) (void);
-typedef const char * (APIENTRY * glXGetClientStringPROC) (Display *dpy, int name );
-typedef const char * (APIENTRY * glXQueryServerStringPROC) (Display *dpy, int screen, int name );
-typedef const char * (APIENTRY * glXQueryExtensionsStringPROC) (Display *dpy, int screen );
-
-/* GLX_SGI_swap_control */
-typedef void (APIENTRY * glXSwapIntervalSGIPROC)(int interval);
-
-/* GLX_ARB_create_context */
-typedef GLXContext (APIENTRY * glXCreateContextAttribsARBPROC) (Display *dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list);
-
-typedef struct {
- bool GLX12;
- bool GLX13;
- bool GLX14;
-/* bool GLX_EXT_visual_info;
- bool GLX_EXT_visual_rating;*/
- bool GLX_SGI_swap_control;
- bool GLX_ARB_multisample;
- bool GLX_ARB_fbconfig_float;
- bool GLX_EXT_fbconfig_packed_float;
- bool GLX_ARB_framebuffer_sRGB;
- bool GLX_ARB_create_context;
-} GLXExtensions;
-
-/* Add _ to global symbols to avoid symbol clash with the OpenGL library */
-extern glXGetFBConfigsPROC lwjgl_glXGetFBConfigs;
-extern glXChooseFBConfigPROC lwjgl_glXChooseFBConfig;
-extern glXGetFBConfigAttribPROC lwjgl_glXGetFBConfigAttrib;
-extern glXGetVisualFromFBConfigPROC lwjgl_glXGetVisualFromFBConfig;
-extern glXCreateWindowPROC lwjgl_glXCreateWindow;
-extern glXDestroyWindowPROC lwjgl_glXDestroyWindow;
-extern glXCreatePixmapPROC lwjgl_glXCreatePixmap;
-extern glXDestroyPixmapPROC lwjgl_glXDestroyPixmap;
-extern glXCreatePbufferPROC lwjgl_glXCreatePbuffer;
-extern glXDestroyPbufferPROC lwjgl_glXDestroyPbuffer;
-extern glXQueryDrawablePROC lwjgl_glXQueryDrawable;
-extern glXCreateNewContextPROC lwjgl_glXCreateNewContext;
-extern glXMakeContextCurrentPROC lwjgl_glXMakeContextCurrent;
-extern glXGetCurrentReadDrawablePROC lwjgl_glXGetCurrentReadDrawable;
-extern glXGetCurrentDisplayPROC lwjgl_glXGetCurrentDisplay;
-extern glXQueryContextPROC lwjgl_glXQueryContext;
-extern glXSelectEventPROC lwjgl_glXSelectEvent;
-extern glXGetSelectedEventPROC lwjgl_glXGetSelectedEvent;
-
-extern glXChooseVisualPROC lwjgl_glXChooseVisual;
-extern glXCopyContextPROC lwjgl_glXCopyContext;
-extern glXCreateContextPROC lwjgl_glXCreateContext;
-extern glXCreateGLXPixmapPROC lwjgl_glXCreateGLXPixmap;
-extern glXDestroyContextPROC lwjgl_glXDestroyContext;
-extern glXDestroyGLXPixmapPROC lwjgl_glXDestroyGLXPixmap;
-extern glXGetConfigPROC lwjgl_glXGetConfig;
-extern glXGetCurrentContextPROC lwjgl_glXGetCurrentContext;
-extern glXGetCurrentDrawablePROC lwjgl_glXGetCurrentDrawable;
-extern glXIsDirectPROC lwjgl_glXIsDirect;
-extern glXMakeCurrentPROC lwjgl_glXMakeCurrent;
-extern glXQueryExtensionPROC lwjgl_glXQueryExtension;
-extern glXQueryVersionPROC lwjgl_glXQueryVersion;
-extern glXSwapBuffersPROC lwjgl_glXSwapBuffers;
-extern glXUseXFontPROC lwjgl_glXUseXFont;
-extern glXWaitGLPROC lwjgl_glXWaitGL;
-extern glXWaitXPROC lwjgl_glXWaitX;
-extern glXGetClientStringPROC lwjgl_glXGetClientString;
-extern glXQueryServerStringPROC lwjgl_glXQueryServerString;
-extern glXQueryExtensionsStringPROC lwjgl_glXQueryExtensionsString;
-
-extern glXSwapIntervalSGIPROC lwjgl_glXSwapIntervalSGI;
-
-extern glXCreateContextAttribsARBPROC lwjgl_glXCreateContextAttribsARB;
-
-extern bool extgl_InitGLX(Display *disp, int screen, GLXExtensions *extension_flags);
-
-#endif
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+#ifndef EXTGL_GLX_H
+#define EXTGL_GLX_H
+
+#include <X11/Xutil.h>
+#include "extgl.h"
+
+/*
+ * Names for attributes to lwjgl_glXGetConfig.
+ */
+#define GLX_USE_GL 1 /* support GLX rendering */
+#define GLX_BUFFER_SIZE 2 /* depth of the color buffer */
+#define GLX_LEVEL 3 /* level in plane stacking */
+#define GLX_RGBA 4 /* true if RGBA mode */
+#define GLX_DOUBLEBUFFER 5 /* double buffering supported */
+#define GLX_STEREO 6 /* stereo buffering supported */
+#define GLX_AUX_BUFFERS 7 /* number of aux buffers */
+#define GLX_RED_SIZE 8 /* number of red component bits */
+#define GLX_GREEN_SIZE 9 /* number of green component bits */
+#define GLX_BLUE_SIZE 10 /* number of blue component bits */
+#define GLX_ALPHA_SIZE 11 /* number of alpha component bits */
+#define GLX_DEPTH_SIZE 12 /* number of depth bits */
+#define GLX_STENCIL_SIZE 13 /* number of stencil bits */
+#define GLX_ACCUM_RED_SIZE 14 /* number of red accum bits */
+#define GLX_ACCUM_GREEN_SIZE 15 /* number of green accum bits */
+#define GLX_ACCUM_BLUE_SIZE 16 /* number of blue accum bits */
+#define GLX_ACCUM_ALPHA_SIZE 17 /* number of alpha accum bits */
+
+#define GLX_SAMPLE_BUFFERS_ARB 100000 /* number of multisample buffers */
+#define GLX_SAMPLES_ARB 100001 /* number of multisample samples */
+
+/*
+ * FBConfig-specific attributes
+ */
+#define GLX_X_VISUAL_TYPE 0x22
+#define GLX_CONFIG_CAVEAT 0x20 /* Like visual_info VISUAL_CAVEAT */
+#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_DRAWABLE_TYPE 0x8010
+#define GLX_RENDER_TYPE 0x8011
+#define GLX_X_RENDERABLE 0x8012
+#define GLX_FBCONFIG_ID 0x8013
+#define GLX_MAX_PBUFFER_WIDTH 0x8016
+#define GLX_MAX_PBUFFER_HEIGHT 0x8017
+#define GLX_MAX_PBUFFER_PIXELS 0x8018
+#define GLX_VISUAL_ID 0x800B
+
+#define GLX_DRAWABLE_TYPE_SGIX GLX_DRAWABLE_TYPE
+#define GLX_RENDER_TYPE_SGIX GLX_RENDER_TYPE
+#define GLX_X_RENDERABLE_SGIX GLX_X_RENDERABLE
+#define GLX_FBCONFIG_ID_SGIX GLX_FBCONFIG_ID
+#define GLX_MAX_PBUFFER_WIDTH_SGIX GLX_MAX_PBUFFER_WIDTH
+#define GLX_MAX_PBUFFER_HEIGHT_SGIX GLX_MAX_PBUFFER_HEIGHT
+#define GLX_MAX_PBUFFER_PIXELS_SGIX GLX_MAX_PBUFFER_PIXELS
+#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019
+#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A
+
+/*
+ * Error return values from lwjgl_glXGetConfig. Success is indicated by
+ * a value of 0.
+ */
+#define GLX_BAD_SCREEN 1 /* screen # is bad */
+#define GLX_BAD_ATTRIBUTE 2 /* attribute to get is bad */
+#define GLX_NO_EXTENSION 3 /* no glx extension on server */
+#define GLX_BAD_VISUAL 4 /* visual # not known by GLX */
+#define GLX_BAD_CONTEXT 5
+#define GLX_BAD_VALUE 6
+#define GLX_BAD_ENUM 7
+
+
+/* FBConfig attribute values */
+
+/*
+ * Generic "don't care" value for lwjgl_glX ChooseFBConfig attributes (except
+ * GLX_LEVEL).
+ */
+#define GLX_DONT_CARE 0xFFFFFFFF
+
+/* GLX_RENDER_TYPE bits */
+#define GLX_RGBA_BIT 0x00000001
+#define GLX_COLOR_INDEX_BIT 0x00000002
+#define GLX_RGBA_BIT_SGIX GLX_RGBA_BIT
+#define GLX_COLOR_INDEX_BIT_SGIX GLX_COLOR_INDEX_BIT
+
+/* GLX_DRAWABLE_TYPE bits */
+#define GLX_WINDOW_BIT 0x00000001
+#define GLX_PIXMAP_BIT 0x00000002
+#define GLX_PBUFFER_BIT 0x00000004
+#define GLX_WINDOW_BIT_SGIX GLX_WINDOW_BIT
+#define GLX_PIXMAP_BIT_SGIX GLX_PIXMAP_BIT
+#define GLX_PBUFFER_BIT_SGIX GLX_PBUFFER_BIT
+
+/* GLX_CONFIG_CAVEAT attribute values */
+#define GLX_NONE 0x8000
+#define GLX_SLOW_CONFIG 0x8001
+#define GLX_NON_CONFORMANT_CONFIG 0x800D
+
+/* GLX_X_VISUAL_TYPE attribute values */
+#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
+
+/* GLX_TRANSPARENT_TYPE attribute values */
+/* #define GLX_NONE 0x8000 */
+#define GLX_TRANSPARENT_RGB 0x8008
+#define GLX_TRANSPARENT_INDEX 0x8009
+
+/* lwjgl_glXCreateGLXPbuffer attributes */
+#define GLX_PRESERVED_CONTENTS 0x801B
+#define GLX_LARGEST_PBUFFER 0x801C
+#define GLX_PBUFFER_HEIGHT 0x8040 /* New for GLX 1.3 */
+#define GLX_PBUFFER_WIDTH 0x8041 /* New for GLX 1.3 */
+#define GLX_PRESERVED_CONTENTS_SGIX GLX_PRESERVED_CONTENTS
+#define GLX_LARGEST_PBUFFER_SGIX GLX_LARGEST_PBUFFER
+
+/* lwjgl_glXQueryGLXPBuffer attributes */
+#define GLX_WIDTH 0x801D
+#define GLX_HEIGHT 0x801E
+#define GLX_EVENT_MASK 0x801F
+#define GLX_WIDTH_SGIX GLX_WIDTH
+#define GLX_HEIGHT_SGIX GLX_HEIGHT
+#define GLX_EVENT_MASK_SGIX GLX_EVENT_MASK
+
+/* lwjgl_glXCreateNewContext render_type attribute values */
+#define GLX_RGBA_TYPE 0x8014
+#define GLX_COLOR_INDEX_TYPE 0x8015
+#define GLX_RGBA_TYPE_SGIX GLX_RGBA_TYPE
+#define GLX_COLOR_INDEX_TYPE_SGIX GLX_COLOR_INDEX_TYPE
+
+/* lwjgl_glXQueryContext attributes */
+/* #define GLX_FBCONFIG_ID 0x8013 */
+/* #define GLX_RENDER_TYPE 0x8011 */
+#define GLX_SCREEN 0x800C
+
+/* lwjgl_glXSelectEvent event mask bits */
+#define GLX_PBUFFER_CLOBBER_MASK 0x08000000
+#define GLX_PBUFFER_CLOBBER_MASK_SGIX GLX_PBUFFER_CLOBBER_MASK
+
+/* GLXPbufferClobberEvent event_type values */
+#define GLX_DAMAGED 0x8020
+#define GLX_SAVED 0x8021
+#define GLX_DAMAGED_SGIX GLX_DAMAGED
+#define GLX_SAVED_SGIX GLX_SAVED
+
+/* GLXPbufferClobberEvent draw_type values */
+#define GLX_WINDOW 0x8022
+#define GLX_PBUFFER 0x8023
+#define GLX_WINDOW_SGIX GLX_WINDOW
+#define GLX_PBUFFER_SGIX GLX_PBUFFER
+
+/* GLXPbufferClobberEvent buffer_mask bits */
+#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_AUX_BUFFERS_BIT 0x00000010
+#define GLX_DEPTH_BUFFER_BIT 0x00000020
+#define GLX_STENCIL_BUFFER_BIT 0x00000040
+#define GLX_ACCUM_BUFFER_BIT 0x00000080
+#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX GLX_FRONT_LEFT_BUFFER_BIT
+#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX GLX_FRONT_RIGHT_BUFFER_BIT
+#define GLX_BACK_LEFT_BUFFER_BIT_SGIX GLX_BACK_LEFT_BUFFER_BIT
+#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX GLX_BACK_RIGHT_BUFFER_BIT
+#define GLX_AUX_BUFFERS_BIT_SGIX GLX_AUX_BUFFERS_BIT
+#define GLX_DEPTH_BUFFER_BIT_SGIX GLX_DEPTH_BUFFER_BIT
+#define GLX_STENCIL_BUFFER_BIT_SGIX GLX_STENCIL_BUFFER_BIT
+#define GLX_ACCUM_BUFFER_BIT_SGIX GLX_ACCUM_BUFFER_BIT
+
+/*
+ * Extension return values from lwjgl_glXGetConfig. These are also
+ * accepted as parameter values for lwjgl_glXChooseVisual.
+ */
+
+#define GLX_X_VISUAL_TYPE_EXT 0x22 /* visual_info extension type */
+#define GLX_TRANSPARENT_TYPE_EXT 0x23 /* visual_info extension */
+#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24 /* visual_info extension */
+#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25 /* visual_info extension */
+#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26 /* visual_info extension */
+#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27 /* visual_info extension */
+#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28 /* visual_info extension */
+
+/* Property values for visual_type */
+#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
+
+/* Property values for transparent pixel */
+#define GLX_NONE_EXT 0x8000
+#define GLX_TRANSPARENT_RGB_EXT 0x8008
+#define GLX_TRANSPARENT_INDEX_EXT 0x8009
+
+/* Property values for visual_rating */
+#define GLX_VISUAL_CAVEAT_EXT 0x20 /* visual_rating extension type */
+#define GLX_SLOW_VISUAL_EXT 0x8001
+#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D
+
+/*
+ * Names for attributes to lwjgl_glXGetClientString.
+ */
+#define GLX_VENDOR 0x1
+#define GLX_VERSION 0x2
+#define GLX_EXTENSIONS 0x3
+
+/*
+ * Names for attributes to lwjgl_glXQueryContextInfoEXT.
+ */
+#define GLX_SHARE_CONTEXT_EXT 0x800A /* id of share context */
+#define GLX_VISUAL_ID_EXT 0x800B /* id of context's visual */
+#define GLX_SCREEN_EXT 0x800C /* screen number */
+
+/* NV_float_buffer */
+#define GLX_FLOAT_COMPONENTS_NV 0x20B0
+
+/* GLX_ARB_fbconfig_float */
+#define GLX_RGBA_FLOAT_TYPE 0x20B9
+#define GLX_RGBA_FLOAT_BIT 0x0004
+
+/* GLX_ARB_fbconfig_float */
+#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1
+#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008
+
+/* GLX_ARB_framebuffer_sRGB */
+#define GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20B2
+
+/* GLX_ARB_create_context */
+#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091
+#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092
+#define GLX_CONTEXT_FLAGS_ARB 0x2094
+
+#define GLX_CONTEXT_DEBUG_BIT_ARB 0x0001
+#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002
+
+typedef XID GLXContextID;
+typedef XID GLXPixmap;
+typedef XID GLXDrawable;
+typedef XID GLXPbuffer;
+typedef XID GLXWindow;
+typedef XID GLXFBConfigID;
+
+typedef struct __GLXcontextRec *GLXContext;
+
+typedef struct __GLXFBConfigRec *GLXFBConfig;
+
+typedef GLXFBConfig * (APIENTRY * glXGetFBConfigsPROC) (Display *dpy, int screen, int *nelements);
+typedef GLXFBConfig * (APIENTRY * glXChooseFBConfigPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);
+typedef int (APIENTRY * glXGetFBConfigAttribPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value);
+typedef XVisualInfo * (APIENTRY * glXGetVisualFromFBConfigPROC) (Display *dpy, GLXFBConfig config);
+typedef GLXWindow (APIENTRY * glXCreateWindowPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
+typedef void (APIENTRY * glXDestroyWindowPROC) (Display *dpy, GLXWindow win);
+typedef GLXPixmap (APIENTRY * glXCreatePixmapPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
+typedef void (APIENTRY * glXDestroyPixmapPROC) (Display *dpy, GLXPixmap pixmap);
+typedef GLXPbuffer (APIENTRY * glXCreatePbufferPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list);
+typedef void (APIENTRY * glXDestroyPbufferPROC) (Display *dpy, GLXPbuffer pbuf);
+typedef void (APIENTRY * glXQueryDrawablePROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
+typedef GLXContext (APIENTRY * glXCreateNewContextPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
+typedef Bool (APIENTRY * glXMakeContextCurrentPROC) (Display *display, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
+typedef GLXDrawable (APIENTRY * glXGetCurrentReadDrawablePROC) (void);
+typedef Display * (APIENTRY * glXGetCurrentDisplayPROC) (void);
+typedef int (APIENTRY * glXQueryContextPROC) (Display *dpy, GLXContext ctx, int attribute, int *value);
+typedef void (APIENTRY * glXSelectEventPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask);
+typedef void (APIENTRY * glXGetSelectedEventPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
+
+typedef GLXContextID (APIENTRY * glXGetContextIDEXTPROC) (const GLXContext ctx);
+typedef GLXDrawable (APIENTRY * glXGetCurrentDrawableEXTPROC) (void);
+typedef GLXContext (APIENTRY * glXImportContextEXTPROC) (Display *dpy, GLXContextID contextID);
+typedef void (APIENTRY * glXFreeContextEXTPROC) (Display *dpy, GLXContext ctx);
+typedef int (APIENTRY * glXQueryContextInfoEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value);
+
+typedef XVisualInfo* (APIENTRY * glXChooseVisualPROC) (Display *dpy, int screen, int *attribList);
+typedef void (APIENTRY * glXCopyContextPROC) (Display *dpy, GLXContext src, GLXContext dst, unsigned long mask);
+typedef GLXContext (APIENTRY * glXCreateContextPROC) (Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct);
+typedef GLXPixmap (APIENTRY * glXCreateGLXPixmapPROC) (Display *dpy, XVisualInfo *vis, Pixmap pixmap);
+typedef void (APIENTRY * glXDestroyContextPROC) (Display *dpy, GLXContext ctx);
+typedef void (APIENTRY * glXDestroyGLXPixmapPROC) (Display *dpy, GLXPixmap pix);
+typedef int (APIENTRY * glXGetConfigPROC) (Display *dpy, XVisualInfo *vis, int attrib, int *value);
+typedef GLXContext (APIENTRY * glXGetCurrentContextPROC) (void);
+typedef GLXDrawable (APIENTRY * glXGetCurrentDrawablePROC) (void);
+typedef Bool (APIENTRY * glXIsDirectPROC) (Display *dpy, GLXContext ctx);
+typedef Bool (APIENTRY * glXMakeCurrentPROC) (Display *dpy, GLXDrawable drawable, GLXContext ctx);
+typedef Bool (APIENTRY * glXQueryExtensionPROC) (Display *dpy, int *errorBase, int *eventBase);
+typedef Bool (APIENTRY * glXQueryVersionPROC) (Display *dpy, int *major, int *minor);
+typedef void (APIENTRY * glXSwapBuffersPROC) (Display *dpy, GLXDrawable drawable);
+typedef void (APIENTRY * glXUseXFontPROC) (Font font, int first, int count, int listBase);
+typedef void (APIENTRY * glXWaitGLPROC) (void);
+typedef void (APIENTRY * glXWaitXPROC) (void);
+typedef const char * (APIENTRY * glXGetClientStringPROC) (Display *dpy, int name );
+typedef const char * (APIENTRY * glXQueryServerStringPROC) (Display *dpy, int screen, int name );
+typedef const char * (APIENTRY * glXQueryExtensionsStringPROC) (Display *dpy, int screen );
+
+/* GLX_SGI_swap_control */
+typedef void (APIENTRY * glXSwapIntervalSGIPROC)(int interval);
+
+/* GLX_ARB_create_context */
+typedef GLXContext (APIENTRY * glXCreateContextAttribsARBPROC) (Display *dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list);
+
+typedef struct {
+ bool GLX12;
+ bool GLX13;
+ bool GLX14;
+/* bool GLX_EXT_visual_info;
+ bool GLX_EXT_visual_rating;*/
+ bool GLX_SGI_swap_control;
+ bool GLX_ARB_multisample;
+ bool GLX_ARB_fbconfig_float;
+ bool GLX_EXT_fbconfig_packed_float;
+ bool GLX_ARB_framebuffer_sRGB;
+ bool GLX_ARB_create_context;
+} GLXExtensions;
+
+/* Add _ to global symbols to avoid symbol clash with the OpenGL library */
+extern glXGetFBConfigsPROC lwjgl_glXGetFBConfigs;
+extern glXChooseFBConfigPROC lwjgl_glXChooseFBConfig;
+extern glXGetFBConfigAttribPROC lwjgl_glXGetFBConfigAttrib;
+extern glXGetVisualFromFBConfigPROC lwjgl_glXGetVisualFromFBConfig;
+extern glXCreateWindowPROC lwjgl_glXCreateWindow;
+extern glXDestroyWindowPROC lwjgl_glXDestroyWindow;
+extern glXCreatePixmapPROC lwjgl_glXCreatePixmap;
+extern glXDestroyPixmapPROC lwjgl_glXDestroyPixmap;
+extern glXCreatePbufferPROC lwjgl_glXCreatePbuffer;
+extern glXDestroyPbufferPROC lwjgl_glXDestroyPbuffer;
+extern glXQueryDrawablePROC lwjgl_glXQueryDrawable;
+extern glXCreateNewContextPROC lwjgl_glXCreateNewContext;
+extern glXMakeContextCurrentPROC lwjgl_glXMakeContextCurrent;
+extern glXGetCurrentReadDrawablePROC lwjgl_glXGetCurrentReadDrawable;
+extern glXGetCurrentDisplayPROC lwjgl_glXGetCurrentDisplay;
+extern glXQueryContextPROC lwjgl_glXQueryContext;
+extern glXSelectEventPROC lwjgl_glXSelectEvent;
+extern glXGetSelectedEventPROC lwjgl_glXGetSelectedEvent;
+
+extern glXChooseVisualPROC lwjgl_glXChooseVisual;
+extern glXCopyContextPROC lwjgl_glXCopyContext;
+extern glXCreateContextPROC lwjgl_glXCreateContext;
+extern glXCreateGLXPixmapPROC lwjgl_glXCreateGLXPixmap;
+extern glXDestroyContextPROC lwjgl_glXDestroyContext;
+extern glXDestroyGLXPixmapPROC lwjgl_glXDestroyGLXPixmap;
+extern glXGetConfigPROC lwjgl_glXGetConfig;
+extern glXGetCurrentContextPROC lwjgl_glXGetCurrentContext;
+extern glXGetCurrentDrawablePROC lwjgl_glXGetCurrentDrawable;
+extern glXIsDirectPROC lwjgl_glXIsDirect;
+extern glXMakeCurrentPROC lwjgl_glXMakeCurrent;
+extern glXQueryExtensionPROC lwjgl_glXQueryExtension;
+extern glXQueryVersionPROC lwjgl_glXQueryVersion;
+extern glXSwapBuffersPROC lwjgl_glXSwapBuffers;
+extern glXUseXFontPROC lwjgl_glXUseXFont;
+extern glXWaitGLPROC lwjgl_glXWaitGL;
+extern glXWaitXPROC lwjgl_glXWaitX;
+extern glXGetClientStringPROC lwjgl_glXGetClientString;
+extern glXQueryServerStringPROC lwjgl_glXQueryServerString;
+extern glXQueryExtensionsStringPROC lwjgl_glXQueryExtensionsString;
+
+extern glXSwapIntervalSGIPROC lwjgl_glXSwapIntervalSGI;
+
+extern glXCreateContextAttribsARBPROC lwjgl_glXCreateContextAttribsARB;
+
+extern bool extgl_InitGLX(Display *disp, int screen, GLXExtensions *extension_flags);
+
+#endif
diff --git a/src/native/linux/linux_al.c b/src/native/linux/linux_al.c
index 207dea2..1cc932c 100644
--- a/src/native/linux/linux_al.c
+++ b/src/native/linux/linux_al.c
@@ -1,65 +1,65 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "org_lwjgl_openal_AL.h"
-#include "extal.h"
-#include "common_tools.h"
-
-#include <dlfcn.h>
-
-static void* handleOAL;
-
-void *NativeGetFunctionPointer(const char *function) {
- return dlsym(handleOAL, function);
-}
-
-void tryLoadLibrary(JNIEnv *env, jstring path) {
- char *path_str = GetStringNativeChars(env, path);
- printfDebugJava(env, "Testing '%s'", path_str);
- handleOAL = dlopen(path_str, RTLD_LAZY);
- if (handleOAL != NULL) {
- printfDebugJava(env, "Found OpenAL at '%s'", path_str);
- } else {
- throwException(env, "Could not load OpenAL library");
- }
- free(path_str);
-}
-
-void UnLoadOpenAL() {
- if (handleOAL != NULL) {
- dlclose(handleOAL);
- handleOAL = NULL;
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "org_lwjgl_openal_AL.h"
+#include "extal.h"
+#include "common_tools.h"
+
+#include <dlfcn.h>
+
+static void* handleOAL;
+
+void *NativeGetFunctionPointer(const char *function) {
+ return dlsym(handleOAL, function);
+}
+
+void tryLoadLibrary(JNIEnv *env, jstring path) {
+ char *path_str = GetStringNativeChars(env, path);
+ printfDebugJava(env, "Testing '%s'", path_str);
+ handleOAL = dlopen(path_str, RTLD_LAZY);
+ if (handleOAL != NULL) {
+ printfDebugJava(env, "Found OpenAL at '%s'", path_str);
+ } else {
+ throwException(env, "Could not load OpenAL library");
+ }
+ free(path_str);
+}
+
+void UnLoadOpenAL() {
+ if (handleOAL != NULL) {
+ dlclose(handleOAL);
+ handleOAL = NULL;
+ }
+}
diff --git a/src/native/linux/lwjgl.map b/src/native/linux/lwjgl.map
index 939db7b..a7111e3 100644
--- a/src/native/linux/lwjgl.map
+++ b/src/native/linux/lwjgl.map
@@ -1,7 +1,7 @@
-{
- global:
- Java_*;
- JNI_OnLoad;
- JNI_OnUnload;
- local: *;
-};
+{
+ global:
+ Java_*;
+ JNI_OnLoad;
+ JNI_OnUnload;
+ local: *;
+};
diff --git a/src/native/linux/org_lwjgl_input_Cursor.c b/src/native/linux/org_lwjgl_input_Cursor.c
index a974d8d..78d2d1c 100644
--- a/src/native/linux/org_lwjgl_input_Cursor.c
+++ b/src/native/linux/org_lwjgl_input_Cursor.c
@@ -1,120 +1,120 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: org_lwjgl_input_Cursor.c 2985 2008-04-07 18:42:36Z matzon $
- *
- * Linux cursor handling.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2985 $
- */
-
-#include <X11/X.h>
-#include <X11/Xlib.h>
-#include <X11/Xcursor/Xcursor.h>
-#include "org_lwjgl_input_Cursor.h"
-#include "org_lwjgl_opengl_LinuxDisplay.h"
-#include "common_tools.h"
-
-JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetNativeCursorCapabilities
- (JNIEnv *env, jclass clazz, jlong display) {
- Display *disp = (Display *)(intptr_t)display;
- int caps = 0;
- XcursorBool argb_supported = XcursorSupportsARGB(disp);
- XcursorBool anim_supported = XcursorSupportsAnim(disp);
- if (argb_supported)
- caps |= org_lwjgl_input_Cursor_CURSOR_8_BIT_ALPHA | org_lwjgl_input_Cursor_CURSOR_ONE_BIT_TRANSPARENCY;
- if (anim_supported)
- caps |= org_lwjgl_input_Cursor_CURSOR_ANIMATION;
- return caps;
-}
-
-JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetMinCursorSize
- (JNIEnv *env, jclass clazz, jlong display, jlong window_ptr)
-{
- Display *disp = (Display *)(intptr_t)display;
- Window window = (Window)window_ptr;
- unsigned int width_return = 0;
- unsigned int height_return = 0;
- XQueryBestCursor(disp, window, 1, 1, &width_return, &height_return);
- return width_return > height_return ? width_return : height_return;
-}
-
-JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetMaxCursorSize
- (JNIEnv *env, jclass clazz, jlong display, jlong window_ptr)
-{
- Display *disp = (Display *)(intptr_t)display;
- Window window = (Window)window_ptr;
- unsigned int width_return = 0;
- unsigned int height_return = 0;
- XQueryBestCursor(disp, window, 0xffffffff, 0xffffffff, &width_return, &height_return);
- return width_return > height_return ? height_return : width_return;
-}
-
-JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nCreateCursor
- (JNIEnv *env, jclass clazz, jlong display, jint width, jint height, jint x_hotspot, jint y_hotspot, jint num_images, jobject image_buffer, jint images_offset, jobject delay_buffer, jint delays_offset)
-{
- Display *disp = (Display *)(intptr_t)display;
- const int *delays = NULL;
- if (delay_buffer != NULL)
- delays = (const int *)(*env)->GetDirectBufferAddress(env, delay_buffer) + delays_offset;
- XcursorPixel *pixels = (XcursorPixel *)(*env)->GetDirectBufferAddress(env, image_buffer) + images_offset;
- int stride = width*height;
- XcursorImages *cursor_images = XcursorImagesCreate(num_images);
- if (cursor_images == NULL) {
- throwException(env, "Could not allocate cursor.");
- return None;
- }
- cursor_images->nimage = num_images;
- int i;
- for (i = 0; i < num_images; i++) {
- XcursorImage *cursor_image = XcursorImageCreate(width, height);
- cursor_image->xhot = x_hotspot;
- cursor_image->yhot = y_hotspot;
- cursor_image->pixels = &(pixels[stride*i]);
- if (num_images > 1)
- cursor_image->delay = delays[i];
- cursor_images->images[i] = cursor_image;
- }
- Cursor cursor = XcursorImagesLoadCursor(disp, cursor_images);
- XcursorImagesDestroy(cursor_images);
- return cursor;
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nDestroyCursor
- (JNIEnv *env, jclass clazz, jlong display, jlong cursor_ptr)
-{
- Display *disp = (Display *)(intptr_t)display;
- Cursor cursor = (Cursor)cursor_ptr;
- XFreeCursor(disp, cursor);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: org_lwjgl_input_Cursor.c 2985 2008-04-07 18:42:36Z matzon $
+ *
+ * Linux cursor handling.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2985 $
+ */
+
+#include <X11/X.h>
+#include <X11/Xlib.h>
+#include <X11/Xcursor/Xcursor.h>
+#include "org_lwjgl_input_Cursor.h"
+#include "org_lwjgl_opengl_LinuxDisplay.h"
+#include "common_tools.h"
+
+JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetNativeCursorCapabilities
+ (JNIEnv *env, jclass clazz, jlong display) {
+ Display *disp = (Display *)(intptr_t)display;
+ int caps = 0;
+ XcursorBool argb_supported = XcursorSupportsARGB(disp);
+ XcursorBool anim_supported = XcursorSupportsAnim(disp);
+ if (argb_supported)
+ caps |= org_lwjgl_input_Cursor_CURSOR_8_BIT_ALPHA | org_lwjgl_input_Cursor_CURSOR_ONE_BIT_TRANSPARENCY;
+ if (anim_supported)
+ caps |= org_lwjgl_input_Cursor_CURSOR_ANIMATION;
+ return caps;
+}
+
+JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetMinCursorSize
+ (JNIEnv *env, jclass clazz, jlong display, jlong window_ptr)
+{
+ Display *disp = (Display *)(intptr_t)display;
+ Window window = (Window)window_ptr;
+ unsigned int width_return = 0;
+ unsigned int height_return = 0;
+ XQueryBestCursor(disp, window, 1, 1, &width_return, &height_return);
+ return width_return > height_return ? width_return : height_return;
+}
+
+JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetMaxCursorSize
+ (JNIEnv *env, jclass clazz, jlong display, jlong window_ptr)
+{
+ Display *disp = (Display *)(intptr_t)display;
+ Window window = (Window)window_ptr;
+ unsigned int width_return = 0;
+ unsigned int height_return = 0;
+ XQueryBestCursor(disp, window, 0xffffffff, 0xffffffff, &width_return, &height_return);
+ return width_return > height_return ? height_return : width_return;
+}
+
+JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nCreateCursor
+ (JNIEnv *env, jclass clazz, jlong display, jint width, jint height, jint x_hotspot, jint y_hotspot, jint num_images, jobject image_buffer, jint images_offset, jobject delay_buffer, jint delays_offset)
+{
+ Display *disp = (Display *)(intptr_t)display;
+ const int *delays = NULL;
+ if (delay_buffer != NULL)
+ delays = (const int *)(*env)->GetDirectBufferAddress(env, delay_buffer) + delays_offset;
+ XcursorPixel *pixels = (XcursorPixel *)(*env)->GetDirectBufferAddress(env, image_buffer) + images_offset;
+ int stride = width*height;
+ XcursorImages *cursor_images = XcursorImagesCreate(num_images);
+ if (cursor_images == NULL) {
+ throwException(env, "Could not allocate cursor.");
+ return None;
+ }
+ cursor_images->nimage = num_images;
+ int i;
+ for (i = 0; i < num_images; i++) {
+ XcursorImage *cursor_image = XcursorImageCreate(width, height);
+ cursor_image->xhot = x_hotspot;
+ cursor_image->yhot = y_hotspot;
+ cursor_image->pixels = &(pixels[stride*i]);
+ if (num_images > 1)
+ cursor_image->delay = delays[i];
+ cursor_images->images[i] = cursor_image;
+ }
+ Cursor cursor = XcursorImagesLoadCursor(disp, cursor_images);
+ XcursorImagesDestroy(cursor_images);
+ return cursor;
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nDestroyCursor
+ (JNIEnv *env, jclass clazz, jlong display, jlong cursor_ptr)
+{
+ Display *disp = (Display *)(intptr_t)display;
+ Cursor cursor = (Cursor)cursor_ptr;
+ XFreeCursor(disp, cursor);
+}
diff --git a/src/native/linux/org_lwjgl_opengl_Display.c b/src/native/linux/org_lwjgl_opengl_Display.c
index 3e5d565..fee0294 100644
--- a/src/native/linux/org_lwjgl_opengl_Display.c
+++ b/src/native/linux/org_lwjgl_opengl_Display.c
@@ -1,589 +1,589 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: org_lwjgl_opengl_Display.c 3188 2009-03-19 21:50:30Z elias_naur $
- *
- * Linux specific display functions.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3188 $
- */
-
-#include <X11/X.h>
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <X11/extensions/xf86vmode.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <jni.h>
-#include <jawt_md.h>
-#include "common_tools.h"
-#include "extgl.h"
-#include "extgl_glx.h"
-#include "context.h"
-#include "org_lwjgl_opengl_LinuxDisplay.h"
-#include "org_lwjgl_opengl_LinuxDisplayPeerInfo.h"
-#include "org_lwjgl_LinuxSysImplementation.h"
-
-#define ERR_MSG_SIZE 1024
-
-typedef struct {
- unsigned long flags;
- unsigned long functions;
- unsigned long decorations;
- long input_mode;
- unsigned long status;
-} MotifWmHints;
-
-#define MWM_HINTS_DECORATIONS (1L << 1)
-
-static GLXWindow glx_window = None;
-
-static Colormap cmap;
-static int current_depth;
-static Pixmap current_icon_pixmap;
-static Pixmap current_icon_mask_pixmap;
-
-static Visual *current_visual;
-
-static bool checkXError(JNIEnv *env, Display *disp) {
- XSync(disp, False);
- return (*env)->ExceptionCheck(env) == JNI_FALSE;
-}
-
-static int global_error_handler(Display *disp, XErrorEvent *error) {
- JNIEnv *env = getThreadEnv();
- if (env != NULL) {
- jclass org_lwjgl_LinuxDisplay_class = (*env)->FindClass(env, "org/lwjgl/opengl/LinuxDisplay");
- if (org_lwjgl_LinuxDisplay_class == NULL) {
- // Don't propagate error
- (*env)->ExceptionClear(env);
- return 0;
- }
- jmethodID handler_method = (*env)->GetStaticMethodID(env, org_lwjgl_LinuxDisplay_class, "globalErrorHandler", "(JJJJJJJ)I");
- if (handler_method == NULL)
- return 0;
- return (*env)->CallStaticIntMethod(env, org_lwjgl_LinuxDisplay_class, handler_method, (jlong)(intptr_t)disp, (jlong)(intptr_t)error,
- (jlong)(intptr_t)error->display, (jlong)error->serial, (jlong)error->error_code, (jlong)error->request_code, (jlong)error->minor_code);
- } else
- return 0;
-}
-
-static jlong openDisplay(JNIEnv *env) {
- Display *display_connection = XOpenDisplay(NULL);
- if (display_connection == NULL) {
- throwException(env, "Could not open X display connection");
- return (intptr_t)NULL;
- }
- return (intptr_t)display_connection;
-}
-
-JNIEXPORT jint JNICALL Java_org_lwjgl_DefaultSysImplementation_getJNIVersion
- (JNIEnv *env, jobject ignored) {
- return org_lwjgl_LinuxSysImplementation_JNI_VERSION;
-}
-
-JNIEXPORT jstring JNICALL Java_org_lwjgl_opengl_LinuxDisplay_getErrorText(JNIEnv *env, jclass unused, jlong display_ptr, jlong error_code) {
- Display *disp = (Display *)(intptr_t)display_ptr;
- char err_msg_buffer[ERR_MSG_SIZE];
- XGetErrorText(disp, error_code, err_msg_buffer, ERR_MSG_SIZE);
- err_msg_buffer[ERR_MSG_SIZE - 1] = '\0';
- return NewStringNativeWithLength(env, err_msg_buffer, strlen(err_msg_buffer));
-}
-
-JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_callErrorHandler(JNIEnv *env, jclass unused, jlong handler_ptr, jlong display_ptr, jlong event_ptr) {
- XErrorHandler handler = (XErrorHandler)(intptr_t)handler_ptr;
- Display *disp = (Display *)(intptr_t)display_ptr;
- XErrorEvent *event = (XErrorEvent *)(intptr_t)event_ptr;
- return (jint)handler(disp, event);
-}
-
-JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_setErrorHandler(JNIEnv *env, jclass unused) {
- return (intptr_t)XSetErrorHandler(global_error_handler);
-}
-
-JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_resetErrorHandler(JNIEnv *env, jclass unused, jlong handler_ptr) {
- XErrorHandler handler = (XErrorHandler)(intptr_t)handler_ptr;
- return (intptr_t)XSetErrorHandler(handler);
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_sync(JNIEnv *env, jclass unused, jlong display_ptr, jboolean throw_away_events) {
- Display *disp = (Display *)(intptr_t)display_ptr;
- XSync(disp, throw_away_events ? True : False);
-}
-
-JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetDefaultScreen(JNIEnv *env, jclass unused, jlong display_ptr) {
- Display *disp = (Display *)(intptr_t)display_ptr;
- return XDefaultScreen(disp);
-}
-
-JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nInternAtom(JNIEnv *env, jclass unused, jlong display_ptr, jstring atom_name_obj, jboolean only_if_exists) {
- Display *disp = (Display *)(intptr_t)display_ptr;
- char *atom_name = GetStringNativeChars(env, atom_name_obj);
- if (atom_name == NULL)
- return 0;
- Atom atom = XInternAtom(disp, atom_name, only_if_exists ? True : False);
- free(atom_name);
- return atom;
-}
-
-static void setDecorations(Display *disp, Window window, int dec) {
- Atom motif_hints_atom = XInternAtom(disp, "_MOTIF_WM_HINTS", False);
- MotifWmHints motif_hints;
- motif_hints.flags = MWM_HINTS_DECORATIONS;
- motif_hints.decorations = dec;
- XChangeProperty(disp, window, motif_hints_atom, motif_hints_atom, 32, PropModeReplace, (unsigned char *)&motif_hints, sizeof(MotifWmHints)/sizeof(long));
-}
-
-static bool isLegacyFullscreen(jint window_mode) {
- return window_mode == org_lwjgl_opengl_LinuxDisplay_FULLSCREEN_LEGACY;
-}
-
-static void setWindowTitle(Display *disp, Window window, const char *title) {
- XStoreName(disp, window, title);
-}
-
-JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_openDisplay(JNIEnv *env, jclass clazz) {
- return openDisplay(env);
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_closeDisplay(JNIEnv *env, jclass clazz, jlong display) {
- Display *disp = (Display *)(intptr_t)display;
- XCloseDisplay(disp);
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplayPeerInfo_initDrawable(JNIEnv *env, jclass clazz, jlong window, jobject peer_info_handle) {
- X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle);
- if (peer_info->glx13)
- peer_info->drawable = glx_window;
- else
- peer_info->drawable = window;
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplayPeerInfo_initDefaultPeerInfo(JNIEnv *env, jclass clazz, jlong display, jint screen, jobject peer_info_handle, jobject pixel_format) {
- Display *disp = (Display *)(intptr_t)display;
- initPeerInfo(env, peer_info_handle, disp, screen, pixel_format, true, GLX_WINDOW_BIT, true, false);
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSetTitle(JNIEnv * env, jclass clazz, jlong display, jlong window_ptr, jstring title_obj) {
- Display *disp = (Display *)(intptr_t)display;
- Window window = (Window)window_ptr;
- char * title = GetStringNativeChars(env, title_obj);
- setWindowTitle(disp, window, title);
- free(title);
-}
-
-static void freeIconPixmap(Display *disp) {
- if (current_icon_mask_pixmap != 0) {
- XFreePixmap(disp, current_icon_mask_pixmap);
- current_icon_mask_pixmap = 0;
- }
- if (current_icon_pixmap != 0) {
- XFreePixmap(disp, current_icon_pixmap);
- current_icon_pixmap = 0;
- }
-}
-
-static void destroyWindow(JNIEnv *env, Display *disp, Window window) {
- if (glx_window != None) {
- lwjgl_glXDestroyWindow(disp, glx_window);
- glx_window = None;
- }
- XDestroyWindow(disp, window);
- XFreeColormap(disp, cmap);
- freeIconPixmap(disp);
-}
-
-static bool isNetWMFullscreenSupported(JNIEnv *env, Display *disp, int screen) {
- unsigned long nitems;
- Atom actual_type;
- int actual_format;
- unsigned long bytes_after;
- Atom *supported_list;
- Atom netwm_supported_atom = XInternAtom(disp, "_NET_SUPPORTED", False);
- int result = XGetWindowProperty(disp, RootWindow(disp, screen), netwm_supported_atom, 0, 10000, False, AnyPropertyType, &actual_type, &actual_format, &nitems, &bytes_after, (void *)&supported_list);
- if (result != Success) {
- throwException(env, "Unable to query _NET_SUPPORTED window property");
- return false;
- }
- Atom fullscreen_atom = XInternAtom(disp, "_NET_WM_STATE_FULLSCREEN", False);
- bool supported = false;
- unsigned long i;
- for (i = 0; i < nitems; i++) {
- if (fullscreen_atom == supported_list[i]) {
- supported = true;
- break;
- }
- }
- XFree(supported_list);
- return supported;
-}
-
-JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nIsNetWMFullscreenSupported(JNIEnv *env, jclass unused, jlong display, jint screen) {
- Display *disp = (Display *)(intptr_t)display;
- return isNetWMFullscreenSupported(env, disp, screen) ? JNI_TRUE : JNI_FALSE;
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nReshape(JNIEnv *env, jclass clazz, jlong display, jlong window_ptr, jint x, jint y, jint width, jint height) {
- Display *disp = (Display *)(intptr_t)display;
- Window window = (Window)window_ptr;
- XMoveWindow(disp, window, x, y);
- XResizeWindow(disp, window, width, height);
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_synchronize(JNIEnv *env, jclass clazz, jlong display, jboolean synchronize) {
- Display *disp = (Display *)(intptr_t)display;
- XSynchronize(disp, synchronize ? True : False);
-}
-
-JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_getRootWindow(JNIEnv *env, jclass clazz, jlong display, jint screen) {
- Display *disp = (Display *)(intptr_t)display;
- return RootWindow(disp, screen);
-}
-
-static void updateWindowHints(JNIEnv *env, Display *disp, Window window) {
- XWMHints* win_hints = XAllocWMHints();
- if (win_hints == NULL) {
- throwException(env, "XAllocWMHints failed");
- return;
- }
-
- win_hints->flags = InputHint;
- win_hints->input = True;
- if (current_icon_pixmap != 0) {
- win_hints->flags |= IconPixmapHint;
- win_hints->icon_pixmap = current_icon_pixmap;
- }
- if (current_icon_mask_pixmap != 0) {
- win_hints->flags |= IconMaskHint;
- win_hints->icon_mask = current_icon_mask_pixmap;
- }
-
- XSetWMHints(disp, window, win_hints);
- XFree(win_hints);
- XFlush(disp);
-}
-
-static Window createWindow(JNIEnv* env, Display *disp, int screen, jint window_mode, X11PeerInfo *peer_info, int x, int y, int width, int height, jboolean undecorated, long parent_handle) {
- Window parent = (Window)parent_handle;
- Window win;
- XSetWindowAttributes attribs;
- int attribmask;
-
- XVisualInfo *vis_info = getVisualInfoFromPeerInfo(env, peer_info);
- if (vis_info == NULL)
- return false;
- cmap = XCreateColormap(disp, parent, vis_info->visual, AllocNone);
- attribs.colormap = cmap;
- attribs.border_pixel = 0;
- attribs.event_mask = ExposureMask | FocusChangeMask | VisibilityChangeMask | StructureNotifyMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask;
- attribmask = CWColormap | CWEventMask | CWBorderPixel;
- if (isLegacyFullscreen(window_mode)) {
- attribmask |= CWOverrideRedirect;
- attribs.override_redirect = True;
- }
- win = XCreateWindow(disp, parent, x, y, width, height, 0, vis_info->depth, InputOutput, vis_info->visual, attribmask, &attribs);
-
- current_depth = vis_info->depth;
- current_visual = vis_info->visual;
-
- XFree(vis_info);
- if (!checkXError(env, disp)) {
- XFreeColormap(disp, cmap);
- return false;
- }
-// printfDebugJava(env, "Created window");
- if (undecorated) {
- // Use Motif decoration hint property and hope the window manager respects them
- setDecorations(disp, win, 0);
- }
- XSizeHints * size_hints = XAllocSizeHints();
- size_hints->flags = PMinSize | PMaxSize;
- size_hints->min_width = width;
- size_hints->max_width = width;
- size_hints->min_height = height;
- size_hints->max_height = height;
- XSetWMNormalHints(disp, win, size_hints);
- updateWindowHints(env, disp, win);
- XFree(size_hints);
-#define NUM_ATOMS 1
- Atom protocol_atoms[NUM_ATOMS] = {XInternAtom(disp, "WM_DELETE_WINDOW", False)/*, XInternAtom(disp, "WM_TAKE_FOCUS", False)*/};
- XSetWMProtocols(disp, win, protocol_atoms, NUM_ATOMS);
- if (window_mode == org_lwjgl_opengl_LinuxDisplay_FULLSCREEN_NETWM) {
- Atom fullscreen_atom = XInternAtom(disp, "_NET_WM_STATE_FULLSCREEN", False);
- XChangeProperty(disp, win, XInternAtom(disp, "_NET_WM_STATE", False),
- XInternAtom(disp, "ATOM", False), 32, PropModeReplace, (const unsigned char*)&fullscreen_atom, 1);
- }
- if (!checkXError(env, disp)) {
- destroyWindow(env, disp, win);
- return 0;
- }
- return win;
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_reparentWindow(JNIEnv *env, jclass unused, jlong display, jlong window_ptr, jlong parent_ptr, jint x, jint y) {
- Display *disp = (Display *)(intptr_t)display;
- Window window = (Window)window_ptr;
- Window parent = (Window)parent_ptr;
- XReparentWindow(disp, window, parent, x, y);
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_mapRaised(JNIEnv *env, jclass unused, jlong display, jlong window_ptr) {
- Display *disp = (Display *)(intptr_t)display;
- Window window = (Window)window_ptr;
- XMapRaised(disp, window);
-}
-
-JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_getParentWindow(JNIEnv *env, jclass unused, jlong display, jlong window_ptr) {
- Display *disp = (Display *)(intptr_t)display;
- Window window = (Window)window_ptr;
- Window root, parent;
- Window *children;
- unsigned int nchildren;
- if (XQueryTree(disp, window, &root, &parent, &children, &nchildren) == 0) {
- throwException(env, "XQueryTree failed");
- return None;
- }
- if (children != NULL)
- XFree(children);
- return parent;
-}
-
-JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxDisplay_hasProperty(JNIEnv *env, jclass unusued, jlong display, jlong window_ptr, jlong property_ptr) {
- Display *disp = (Display *)(intptr_t)display;
- Window window = (Window)window_ptr;
- Atom property = (Atom)property_ptr;
- int num_props;
- Atom *properties = XListProperties(disp, window, &num_props);
- if (properties == NULL)
- return JNI_FALSE;
- jboolean result = JNI_FALSE;
- for (int i = 0; i < num_props; i++) {
- if (properties[i] == property) {
- result = JNI_TRUE;
- break;
- }
- }
- XFree(properties);
- return result;
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_setInputFocus(JNIEnv *env, jclass clazz, jlong display, jlong window_ptr, jlong time) {
- Display *disp = (Display *)(intptr_t)display;
- Window window = (Window)window_ptr;
- XSetInputFocus(disp, window, RevertToParent, time);
-}
-
-JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nCreateWindow(JNIEnv *env, jclass clazz, jlong display, jint screen, jobject peer_info_handle, jobject mode, jint window_mode, jint x, jint y, jboolean undecorated, jlong parent_handle) {
- Display *disp = (Display *)(intptr_t)display;
- X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle);
- GLXFBConfig *fb_config = NULL;
- if (peer_info->glx13) {
- fb_config = getFBConfigFromPeerInfo(env, peer_info);
- if (fb_config == NULL)
- return 0;
- }
- jclass cls_displayMode = (*env)->GetObjectClass(env, mode);
- jfieldID fid_width = (*env)->GetFieldID(env, cls_displayMode, "width", "I");
- jfieldID fid_height = (*env)->GetFieldID(env, cls_displayMode, "height", "I");
- int width = (*env)->GetIntField(env, mode, fid_width);
- int height = (*env)->GetIntField(env, mode, fid_height);
- Window win = createWindow(env, disp, screen, window_mode, peer_info, x, y, width, height, undecorated, parent_handle);
- if ((*env)->ExceptionOccurred(env)) {
- return 0;
- }
- if (peer_info->glx13) {
- glx_window = lwjgl_glXCreateWindow(disp, *fb_config, win, NULL);
- XFree(fb_config);
- }
- if (!checkXError(env, disp)) {
- lwjgl_glXDestroyWindow(disp, glx_window);
- destroyWindow(env, disp, win);
- }
- return win;
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nDestroyWindow(JNIEnv *env, jclass clazz, jlong display, jlong window_ptr) {
- Display *disp = (Display *)(intptr_t)display;
- Window window = (Window)window_ptr;
- destroyWindow(env, disp, window);
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nLockAWT(JNIEnv *env, jclass clazz) {
- JAWT jawt;
- jawt.version = JAWT_VERSION_1_4;
- if (JAWT_GetAWT(env, &jawt) != JNI_TRUE) {
- throwException(env, "GetAWT failed");
- return;
- }
- jawt.Lock(env);
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nUnlockAWT(JNIEnv *env, jclass clazz) {
- JAWT jawt;
- jawt.version = JAWT_VERSION_1_4;
- if (JAWT_GetAWT(env, &jawt) != JNI_TRUE) {
- throwException(env, "GetAWT failed");
- return;
- }
- jawt.Unlock(env);
-}
-
-static Pixmap createPixmapFromBuffer(JNIEnv *env, Display *disp, Window window, char *data, int data_size, int width, int height, int format, int depth) {
- Pixmap pixmap = XCreatePixmap(disp, window, width, height, depth);
- /* We need to copy the image data since XDestroyImage will also free its data buffer, which can't be allowed
- * since the data buffer is managed by the jvm (it's the storage for the direct ByteBuffer)
- */
- char *icon_copy = (char *)malloc(sizeof(*icon_copy)*data_size);
-
- if (icon_copy == NULL) {
- XFreePixmap(disp, pixmap);
- throwException(env, "malloc failed");
- return None;
- }
- memcpy(icon_copy, data, data_size);
- XImage *image = XCreateImage(disp, current_visual, depth, format, 0, icon_copy, width, height, 32, 0);
- if (image == NULL) {
- XFreePixmap(disp, pixmap);
- free(icon_copy);
- throwException(env, "XCreateImage failed");
- return None;
- }
-
- GC gc = XCreateGC(disp, pixmap, 0, NULL);
- XPutImage(disp, pixmap, gc, image, 0, 0, 0, 0, width, height);
- XFreeGC(disp, gc);
- XDestroyImage(image);
- // We won't free icon_copy because it is freed by XDestroyImage
- return pixmap;
-}
-
-static void setIcon(JNIEnv *env, Display *disp, Window window, char *rgb_data, int rgb_size, char *mask_data, int mask_size, int width, int height) {
- freeIconPixmap(disp);
- current_icon_pixmap = createPixmapFromBuffer(env, disp, window, rgb_data, rgb_size, width, height, ZPixmap, current_depth);
- if ((*env)->ExceptionCheck(env))
- return;
- current_icon_mask_pixmap = createPixmapFromBuffer(env, disp, window, mask_data, mask_size, width, height, XYPixmap, 1);
- if ((*env)->ExceptionCheck(env)) {
- freeIconPixmap(disp);
- return;
- }
-
- updateWindowHints(env, disp, window);
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSetWindowIcon
- (JNIEnv *env, jclass clazz, jlong display, jlong window_ptr, jobject icon_rgb_buffer, jint rgb_size, jobject icon_mask_buffer, jint mask_size, jint width, jint height)
-{
- Display *disp = (Display *)(intptr_t)display;
- Window window = (Window)window_ptr;
- char *rgb_data= (char *)(*env)->GetDirectBufferAddress(env, icon_rgb_buffer);
- char *mask_data= (char *)(*env)->GetDirectBufferAddress(env, icon_mask_buffer);
-
- setIcon(env, disp, window, rgb_data, rgb_size, mask_data, mask_size, width, height);
-}
-
-JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nUngrabKeyboard(JNIEnv *env, jclass unused, jlong display_ptr) {
- Display *disp = (Display *)(intptr_t)display_ptr;
- return XUngrabKeyboard(disp, CurrentTime);
-}
-
-JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGrabKeyboard(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr) {
- Display *disp = (Display *)(intptr_t)display_ptr;
- Window win = (Window)window_ptr;
- return XGrabKeyboard(disp, win, False, GrabModeAsync, GrabModeAsync, CurrentTime);
-}
-
-JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGrabPointer(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr, jlong cursor_ptr) {
- Display *disp = (Display *)(intptr_t)display_ptr;
- Window win = (Window)window_ptr;
- Cursor cursor = (Cursor)cursor_ptr;
- int grab_mask = PointerMotionMask | ButtonPressMask | ButtonReleaseMask;
- return XGrabPointer(disp, win, False, grab_mask, GrabModeAsync, GrabModeAsync, win, cursor, CurrentTime);
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSetViewPort(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr, jint screen) {
- Display *disp = (Display *)(intptr_t)display_ptr;
- Window win = (Window)window_ptr;
- XWindowAttributes win_attribs;
-
- XGetWindowAttributes(disp, win, &win_attribs);
- XF86VidModeSetViewPort(disp, screen, win_attribs.x, win_attribs.y);
-}
-
-JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nUngrabPointer(JNIEnv *env, jclass unused, jlong display_ptr) {
- Display *disp = (Display *)(intptr_t)display_ptr;
- return XUngrabPointer(disp, CurrentTime);
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nDefineCursor(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr, jlong cursor_ptr) {
- Display *disp = (Display *)(intptr_t)display_ptr;
- Window win = (Window)window_ptr;
- Cursor cursor = (Cursor)cursor_ptr;
- XDefineCursor(disp, win, cursor);
-}
-
-JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nCreateBlankCursor(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr) {
- Display *disp = (Display *)(intptr_t)display_ptr;
- Window win = (Window)window_ptr;
- unsigned int best_width, best_height;
- if (XQueryBestCursor(disp, win, 1, 1, &best_width, &best_height) == 0) {
- throwException(env, "Could not query best cursor size");
- return false;
- }
- Pixmap mask = XCreatePixmap(disp, win, best_width, best_height, 1);
- XGCValues gc_values;
- gc_values.foreground = 0;
- GC gc = XCreateGC(disp, mask, GCForeground, &gc_values);
- XFillRectangle(disp, mask, gc, 0, 0, best_width, best_height);
- XFreeGC(disp, gc);
- XColor dummy_color;
- Cursor cursor = XCreatePixmapCursor(disp, mask, mask, &dummy_color, &dummy_color, 0, 0);
- XFreePixmap(disp, mask);
- return cursor;
-}
-
-JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetInputFocus(JNIEnv *env, jclass unused, jlong display_ptr) {
- Display *disp = (Display *)(intptr_t)display_ptr;
- int revert_mode;
- Window win;
- XGetInputFocus(disp, &win, &revert_mode);
- return win;
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nIconifyWindow(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr, jint screen) {
- Display *disp = (Display *)(intptr_t)display_ptr;
- Window win = (Window)window_ptr;
- XIconifyWindow(disp, win, screen);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: org_lwjgl_opengl_Display.c 3188 2009-03-19 21:50:30Z elias_naur $
+ *
+ * Linux specific display functions.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3188 $
+ */
+
+#include <X11/X.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/extensions/xf86vmode.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <jni.h>
+#include <jawt_md.h>
+#include "common_tools.h"
+#include "extgl.h"
+#include "extgl_glx.h"
+#include "context.h"
+#include "org_lwjgl_opengl_LinuxDisplay.h"
+#include "org_lwjgl_opengl_LinuxDisplayPeerInfo.h"
+#include "org_lwjgl_LinuxSysImplementation.h"
+
+#define ERR_MSG_SIZE 1024
+
+typedef struct {
+ unsigned long flags;
+ unsigned long functions;
+ unsigned long decorations;
+ long input_mode;
+ unsigned long status;
+} MotifWmHints;
+
+#define MWM_HINTS_DECORATIONS (1L << 1)
+
+static GLXWindow glx_window = None;
+
+static Colormap cmap;
+static int current_depth;
+static Pixmap current_icon_pixmap;
+static Pixmap current_icon_mask_pixmap;
+
+static Visual *current_visual;
+
+static bool checkXError(JNIEnv *env, Display *disp) {
+ XSync(disp, False);
+ return (*env)->ExceptionCheck(env) == JNI_FALSE;
+}
+
+static int global_error_handler(Display *disp, XErrorEvent *error) {
+ JNIEnv *env = getThreadEnv();
+ if (env != NULL) {
+ jclass org_lwjgl_LinuxDisplay_class = (*env)->FindClass(env, "org/lwjgl/opengl/LinuxDisplay");
+ if (org_lwjgl_LinuxDisplay_class == NULL) {
+ // Don't propagate error
+ (*env)->ExceptionClear(env);
+ return 0;
+ }
+ jmethodID handler_method = (*env)->GetStaticMethodID(env, org_lwjgl_LinuxDisplay_class, "globalErrorHandler", "(JJJJJJJ)I");
+ if (handler_method == NULL)
+ return 0;
+ return (*env)->CallStaticIntMethod(env, org_lwjgl_LinuxDisplay_class, handler_method, (jlong)(intptr_t)disp, (jlong)(intptr_t)error,
+ (jlong)(intptr_t)error->display, (jlong)error->serial, (jlong)error->error_code, (jlong)error->request_code, (jlong)error->minor_code);
+ } else
+ return 0;
+}
+
+static jlong openDisplay(JNIEnv *env) {
+ Display *display_connection = XOpenDisplay(NULL);
+ if (display_connection == NULL) {
+ throwException(env, "Could not open X display connection");
+ return (intptr_t)NULL;
+ }
+ return (intptr_t)display_connection;
+}
+
+JNIEXPORT jint JNICALL Java_org_lwjgl_DefaultSysImplementation_getJNIVersion
+ (JNIEnv *env, jobject ignored) {
+ return org_lwjgl_LinuxSysImplementation_JNI_VERSION;
+}
+
+JNIEXPORT jstring JNICALL Java_org_lwjgl_opengl_LinuxDisplay_getErrorText(JNIEnv *env, jclass unused, jlong display_ptr, jlong error_code) {
+ Display *disp = (Display *)(intptr_t)display_ptr;
+ char err_msg_buffer[ERR_MSG_SIZE];
+ XGetErrorText(disp, error_code, err_msg_buffer, ERR_MSG_SIZE);
+ err_msg_buffer[ERR_MSG_SIZE - 1] = '\0';
+ return NewStringNativeWithLength(env, err_msg_buffer, strlen(err_msg_buffer));
+}
+
+JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_callErrorHandler(JNIEnv *env, jclass unused, jlong handler_ptr, jlong display_ptr, jlong event_ptr) {
+ XErrorHandler handler = (XErrorHandler)(intptr_t)handler_ptr;
+ Display *disp = (Display *)(intptr_t)display_ptr;
+ XErrorEvent *event = (XErrorEvent *)(intptr_t)event_ptr;
+ return (jint)handler(disp, event);
+}
+
+JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_setErrorHandler(JNIEnv *env, jclass unused) {
+ return (intptr_t)XSetErrorHandler(global_error_handler);
+}
+
+JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_resetErrorHandler(JNIEnv *env, jclass unused, jlong handler_ptr) {
+ XErrorHandler handler = (XErrorHandler)(intptr_t)handler_ptr;
+ return (intptr_t)XSetErrorHandler(handler);
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_sync(JNIEnv *env, jclass unused, jlong display_ptr, jboolean throw_away_events) {
+ Display *disp = (Display *)(intptr_t)display_ptr;
+ XSync(disp, throw_away_events ? True : False);
+}
+
+JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetDefaultScreen(JNIEnv *env, jclass unused, jlong display_ptr) {
+ Display *disp = (Display *)(intptr_t)display_ptr;
+ return XDefaultScreen(disp);
+}
+
+JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nInternAtom(JNIEnv *env, jclass unused, jlong display_ptr, jstring atom_name_obj, jboolean only_if_exists) {
+ Display *disp = (Display *)(intptr_t)display_ptr;
+ char *atom_name = GetStringNativeChars(env, atom_name_obj);
+ if (atom_name == NULL)
+ return 0;
+ Atom atom = XInternAtom(disp, atom_name, only_if_exists ? True : False);
+ free(atom_name);
+ return atom;
+}
+
+static void setDecorations(Display *disp, Window window, int dec) {
+ Atom motif_hints_atom = XInternAtom(disp, "_MOTIF_WM_HINTS", False);
+ MotifWmHints motif_hints;
+ motif_hints.flags = MWM_HINTS_DECORATIONS;
+ motif_hints.decorations = dec;
+ XChangeProperty(disp, window, motif_hints_atom, motif_hints_atom, 32, PropModeReplace, (unsigned char *)&motif_hints, sizeof(MotifWmHints)/sizeof(long));
+}
+
+static bool isLegacyFullscreen(jint window_mode) {
+ return window_mode == org_lwjgl_opengl_LinuxDisplay_FULLSCREEN_LEGACY;
+}
+
+static void setWindowTitle(Display *disp, Window window, const char *title) {
+ XStoreName(disp, window, title);
+}
+
+JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_openDisplay(JNIEnv *env, jclass clazz) {
+ return openDisplay(env);
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_closeDisplay(JNIEnv *env, jclass clazz, jlong display) {
+ Display *disp = (Display *)(intptr_t)display;
+ XCloseDisplay(disp);
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplayPeerInfo_initDrawable(JNIEnv *env, jclass clazz, jlong window, jobject peer_info_handle) {
+ X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle);
+ if (peer_info->glx13)
+ peer_info->drawable = glx_window;
+ else
+ peer_info->drawable = window;
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplayPeerInfo_initDefaultPeerInfo(JNIEnv *env, jclass clazz, jlong display, jint screen, jobject peer_info_handle, jobject pixel_format) {
+ Display *disp = (Display *)(intptr_t)display;
+ initPeerInfo(env, peer_info_handle, disp, screen, pixel_format, true, GLX_WINDOW_BIT, true, false);
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSetTitle(JNIEnv * env, jclass clazz, jlong display, jlong window_ptr, jstring title_obj) {
+ Display *disp = (Display *)(intptr_t)display;
+ Window window = (Window)window_ptr;
+ char * title = GetStringNativeChars(env, title_obj);
+ setWindowTitle(disp, window, title);
+ free(title);
+}
+
+static void freeIconPixmap(Display *disp) {
+ if (current_icon_mask_pixmap != 0) {
+ XFreePixmap(disp, current_icon_mask_pixmap);
+ current_icon_mask_pixmap = 0;
+ }
+ if (current_icon_pixmap != 0) {
+ XFreePixmap(disp, current_icon_pixmap);
+ current_icon_pixmap = 0;
+ }
+}
+
+static void destroyWindow(JNIEnv *env, Display *disp, Window window) {
+ if (glx_window != None) {
+ lwjgl_glXDestroyWindow(disp, glx_window);
+ glx_window = None;
+ }
+ XDestroyWindow(disp, window);
+ XFreeColormap(disp, cmap);
+ freeIconPixmap(disp);
+}
+
+static bool isNetWMFullscreenSupported(JNIEnv *env, Display *disp, int screen) {
+ unsigned long nitems;
+ Atom actual_type;
+ int actual_format;
+ unsigned long bytes_after;
+ Atom *supported_list;
+ Atom netwm_supported_atom = XInternAtom(disp, "_NET_SUPPORTED", False);
+ int result = XGetWindowProperty(disp, RootWindow(disp, screen), netwm_supported_atom, 0, 10000, False, AnyPropertyType, &actual_type, &actual_format, &nitems, &bytes_after, (void *)&supported_list);
+ if (result != Success) {
+ throwException(env, "Unable to query _NET_SUPPORTED window property");
+ return false;
+ }
+ Atom fullscreen_atom = XInternAtom(disp, "_NET_WM_STATE_FULLSCREEN", False);
+ bool supported = false;
+ unsigned long i;
+ for (i = 0; i < nitems; i++) {
+ if (fullscreen_atom == supported_list[i]) {
+ supported = true;
+ break;
+ }
+ }
+ XFree(supported_list);
+ return supported;
+}
+
+JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nIsNetWMFullscreenSupported(JNIEnv *env, jclass unused, jlong display, jint screen) {
+ Display *disp = (Display *)(intptr_t)display;
+ return isNetWMFullscreenSupported(env, disp, screen) ? JNI_TRUE : JNI_FALSE;
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nReshape(JNIEnv *env, jclass clazz, jlong display, jlong window_ptr, jint x, jint y, jint width, jint height) {
+ Display *disp = (Display *)(intptr_t)display;
+ Window window = (Window)window_ptr;
+ XMoveWindow(disp, window, x, y);
+ XResizeWindow(disp, window, width, height);
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_synchronize(JNIEnv *env, jclass clazz, jlong display, jboolean synchronize) {
+ Display *disp = (Display *)(intptr_t)display;
+ XSynchronize(disp, synchronize ? True : False);
+}
+
+JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_getRootWindow(JNIEnv *env, jclass clazz, jlong display, jint screen) {
+ Display *disp = (Display *)(intptr_t)display;
+ return RootWindow(disp, screen);
+}
+
+static void updateWindowHints(JNIEnv *env, Display *disp, Window window) {
+ XWMHints* win_hints = XAllocWMHints();
+ if (win_hints == NULL) {
+ throwException(env, "XAllocWMHints failed");
+ return;
+ }
+
+ win_hints->flags = InputHint;
+ win_hints->input = True;
+ if (current_icon_pixmap != 0) {
+ win_hints->flags |= IconPixmapHint;
+ win_hints->icon_pixmap = current_icon_pixmap;
+ }
+ if (current_icon_mask_pixmap != 0) {
+ win_hints->flags |= IconMaskHint;
+ win_hints->icon_mask = current_icon_mask_pixmap;
+ }
+
+ XSetWMHints(disp, window, win_hints);
+ XFree(win_hints);
+ XFlush(disp);
+}
+
+static Window createWindow(JNIEnv* env, Display *disp, int screen, jint window_mode, X11PeerInfo *peer_info, int x, int y, int width, int height, jboolean undecorated, long parent_handle) {
+ Window parent = (Window)parent_handle;
+ Window win;
+ XSetWindowAttributes attribs;
+ int attribmask;
+
+ XVisualInfo *vis_info = getVisualInfoFromPeerInfo(env, peer_info);
+ if (vis_info == NULL)
+ return false;
+ cmap = XCreateColormap(disp, parent, vis_info->visual, AllocNone);
+ attribs.colormap = cmap;
+ attribs.border_pixel = 0;
+ attribs.event_mask = ExposureMask | FocusChangeMask | VisibilityChangeMask | StructureNotifyMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask;
+ attribmask = CWColormap | CWEventMask | CWBorderPixel;
+ if (isLegacyFullscreen(window_mode)) {
+ attribmask |= CWOverrideRedirect;
+ attribs.override_redirect = True;
+ }
+ win = XCreateWindow(disp, parent, x, y, width, height, 0, vis_info->depth, InputOutput, vis_info->visual, attribmask, &attribs);
+
+ current_depth = vis_info->depth;
+ current_visual = vis_info->visual;
+
+ XFree(vis_info);
+ if (!checkXError(env, disp)) {
+ XFreeColormap(disp, cmap);
+ return false;
+ }
+// printfDebugJava(env, "Created window");
+ if (undecorated) {
+ // Use Motif decoration hint property and hope the window manager respects them
+ setDecorations(disp, win, 0);
+ }
+ XSizeHints * size_hints = XAllocSizeHints();
+ size_hints->flags = PMinSize | PMaxSize;
+ size_hints->min_width = width;
+ size_hints->max_width = width;
+ size_hints->min_height = height;
+ size_hints->max_height = height;
+ XSetWMNormalHints(disp, win, size_hints);
+ updateWindowHints(env, disp, win);
+ XFree(size_hints);
+#define NUM_ATOMS 1
+ Atom protocol_atoms[NUM_ATOMS] = {XInternAtom(disp, "WM_DELETE_WINDOW", False)/*, XInternAtom(disp, "WM_TAKE_FOCUS", False)*/};
+ XSetWMProtocols(disp, win, protocol_atoms, NUM_ATOMS);
+ if (window_mode == org_lwjgl_opengl_LinuxDisplay_FULLSCREEN_NETWM) {
+ Atom fullscreen_atom = XInternAtom(disp, "_NET_WM_STATE_FULLSCREEN", False);
+ XChangeProperty(disp, win, XInternAtom(disp, "_NET_WM_STATE", False),
+ XInternAtom(disp, "ATOM", False), 32, PropModeReplace, (const unsigned char*)&fullscreen_atom, 1);
+ }
+ if (!checkXError(env, disp)) {
+ destroyWindow(env, disp, win);
+ return 0;
+ }
+ return win;
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_reparentWindow(JNIEnv *env, jclass unused, jlong display, jlong window_ptr, jlong parent_ptr, jint x, jint y) {
+ Display *disp = (Display *)(intptr_t)display;
+ Window window = (Window)window_ptr;
+ Window parent = (Window)parent_ptr;
+ XReparentWindow(disp, window, parent, x, y);
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_mapRaised(JNIEnv *env, jclass unused, jlong display, jlong window_ptr) {
+ Display *disp = (Display *)(intptr_t)display;
+ Window window = (Window)window_ptr;
+ XMapRaised(disp, window);
+}
+
+JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_getParentWindow(JNIEnv *env, jclass unused, jlong display, jlong window_ptr) {
+ Display *disp = (Display *)(intptr_t)display;
+ Window window = (Window)window_ptr;
+ Window root, parent;
+ Window *children;
+ unsigned int nchildren;
+ if (XQueryTree(disp, window, &root, &parent, &children, &nchildren) == 0) {
+ throwException(env, "XQueryTree failed");
+ return None;
+ }
+ if (children != NULL)
+ XFree(children);
+ return parent;
+}
+
+JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxDisplay_hasProperty(JNIEnv *env, jclass unusued, jlong display, jlong window_ptr, jlong property_ptr) {
+ Display *disp = (Display *)(intptr_t)display;
+ Window window = (Window)window_ptr;
+ Atom property = (Atom)property_ptr;
+ int num_props;
+ Atom *properties = XListProperties(disp, window, &num_props);
+ if (properties == NULL)
+ return JNI_FALSE;
+ jboolean result = JNI_FALSE;
+ for (int i = 0; i < num_props; i++) {
+ if (properties[i] == property) {
+ result = JNI_TRUE;
+ break;
+ }
+ }
+ XFree(properties);
+ return result;
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_setInputFocus(JNIEnv *env, jclass clazz, jlong display, jlong window_ptr, jlong time) {
+ Display *disp = (Display *)(intptr_t)display;
+ Window window = (Window)window_ptr;
+ XSetInputFocus(disp, window, RevertToParent, time);
+}
+
+JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nCreateWindow(JNIEnv *env, jclass clazz, jlong display, jint screen, jobject peer_info_handle, jobject mode, jint window_mode, jint x, jint y, jboolean undecorated, jlong parent_handle) {
+ Display *disp = (Display *)(intptr_t)display;
+ X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle);
+ GLXFBConfig *fb_config = NULL;
+ if (peer_info->glx13) {
+ fb_config = getFBConfigFromPeerInfo(env, peer_info);
+ if (fb_config == NULL)
+ return 0;
+ }
+ jclass cls_displayMode = (*env)->GetObjectClass(env, mode);
+ jfieldID fid_width = (*env)->GetFieldID(env, cls_displayMode, "width", "I");
+ jfieldID fid_height = (*env)->GetFieldID(env, cls_displayMode, "height", "I");
+ int width = (*env)->GetIntField(env, mode, fid_width);
+ int height = (*env)->GetIntField(env, mode, fid_height);
+ Window win = createWindow(env, disp, screen, window_mode, peer_info, x, y, width, height, undecorated, parent_handle);
+ if ((*env)->ExceptionOccurred(env)) {
+ return 0;
+ }
+ if (peer_info->glx13) {
+ glx_window = lwjgl_glXCreateWindow(disp, *fb_config, win, NULL);
+ XFree(fb_config);
+ }
+ if (!checkXError(env, disp)) {
+ lwjgl_glXDestroyWindow(disp, glx_window);
+ destroyWindow(env, disp, win);
+ }
+ return win;
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nDestroyWindow(JNIEnv *env, jclass clazz, jlong display, jlong window_ptr) {
+ Display *disp = (Display *)(intptr_t)display;
+ Window window = (Window)window_ptr;
+ destroyWindow(env, disp, window);
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nLockAWT(JNIEnv *env, jclass clazz) {
+ JAWT jawt;
+ jawt.version = JAWT_VERSION_1_4;
+ if (JAWT_GetAWT(env, &jawt) != JNI_TRUE) {
+ throwException(env, "GetAWT failed");
+ return;
+ }
+ jawt.Lock(env);
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nUnlockAWT(JNIEnv *env, jclass clazz) {
+ JAWT jawt;
+ jawt.version = JAWT_VERSION_1_4;
+ if (JAWT_GetAWT(env, &jawt) != JNI_TRUE) {
+ throwException(env, "GetAWT failed");
+ return;
+ }
+ jawt.Unlock(env);
+}
+
+static Pixmap createPixmapFromBuffer(JNIEnv *env, Display *disp, Window window, char *data, int data_size, int width, int height, int format, int depth) {
+ Pixmap pixmap = XCreatePixmap(disp, window, width, height, depth);
+ /* We need to copy the image data since XDestroyImage will also free its data buffer, which can't be allowed
+ * since the data buffer is managed by the jvm (it's the storage for the direct ByteBuffer)
+ */
+ char *icon_copy = (char *)malloc(sizeof(*icon_copy)*data_size);
+
+ if (icon_copy == NULL) {
+ XFreePixmap(disp, pixmap);
+ throwException(env, "malloc failed");
+ return None;
+ }
+ memcpy(icon_copy, data, data_size);
+ XImage *image = XCreateImage(disp, current_visual, depth, format, 0, icon_copy, width, height, 32, 0);
+ if (image == NULL) {
+ XFreePixmap(disp, pixmap);
+ free(icon_copy);
+ throwException(env, "XCreateImage failed");
+ return None;
+ }
+
+ GC gc = XCreateGC(disp, pixmap, 0, NULL);
+ XPutImage(disp, pixmap, gc, image, 0, 0, 0, 0, width, height);
+ XFreeGC(disp, gc);
+ XDestroyImage(image);
+ // We won't free icon_copy because it is freed by XDestroyImage
+ return pixmap;
+}
+
+static void setIcon(JNIEnv *env, Display *disp, Window window, char *rgb_data, int rgb_size, char *mask_data, int mask_size, int width, int height) {
+ freeIconPixmap(disp);
+ current_icon_pixmap = createPixmapFromBuffer(env, disp, window, rgb_data, rgb_size, width, height, ZPixmap, current_depth);
+ if ((*env)->ExceptionCheck(env))
+ return;
+ current_icon_mask_pixmap = createPixmapFromBuffer(env, disp, window, mask_data, mask_size, width, height, XYPixmap, 1);
+ if ((*env)->ExceptionCheck(env)) {
+ freeIconPixmap(disp);
+ return;
+ }
+
+ updateWindowHints(env, disp, window);
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSetWindowIcon
+ (JNIEnv *env, jclass clazz, jlong display, jlong window_ptr, jobject icon_rgb_buffer, jint rgb_size, jobject icon_mask_buffer, jint mask_size, jint width, jint height)
+{
+ Display *disp = (Display *)(intptr_t)display;
+ Window window = (Window)window_ptr;
+ char *rgb_data= (char *)(*env)->GetDirectBufferAddress(env, icon_rgb_buffer);
+ char *mask_data= (char *)(*env)->GetDirectBufferAddress(env, icon_mask_buffer);
+
+ setIcon(env, disp, window, rgb_data, rgb_size, mask_data, mask_size, width, height);
+}
+
+JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nUngrabKeyboard(JNIEnv *env, jclass unused, jlong display_ptr) {
+ Display *disp = (Display *)(intptr_t)display_ptr;
+ return XUngrabKeyboard(disp, CurrentTime);
+}
+
+JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGrabKeyboard(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr) {
+ Display *disp = (Display *)(intptr_t)display_ptr;
+ Window win = (Window)window_ptr;
+ return XGrabKeyboard(disp, win, False, GrabModeAsync, GrabModeAsync, CurrentTime);
+}
+
+JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGrabPointer(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr, jlong cursor_ptr) {
+ Display *disp = (Display *)(intptr_t)display_ptr;
+ Window win = (Window)window_ptr;
+ Cursor cursor = (Cursor)cursor_ptr;
+ int grab_mask = PointerMotionMask | ButtonPressMask | ButtonReleaseMask;
+ return XGrabPointer(disp, win, False, grab_mask, GrabModeAsync, GrabModeAsync, win, cursor, CurrentTime);
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSetViewPort(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr, jint screen) {
+ Display *disp = (Display *)(intptr_t)display_ptr;
+ Window win = (Window)window_ptr;
+ XWindowAttributes win_attribs;
+
+ XGetWindowAttributes(disp, win, &win_attribs);
+ XF86VidModeSetViewPort(disp, screen, win_attribs.x, win_attribs.y);
+}
+
+JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nUngrabPointer(JNIEnv *env, jclass unused, jlong display_ptr) {
+ Display *disp = (Display *)(intptr_t)display_ptr;
+ return XUngrabPointer(disp, CurrentTime);
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nDefineCursor(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr, jlong cursor_ptr) {
+ Display *disp = (Display *)(intptr_t)display_ptr;
+ Window win = (Window)window_ptr;
+ Cursor cursor = (Cursor)cursor_ptr;
+ XDefineCursor(disp, win, cursor);
+}
+
+JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nCreateBlankCursor(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr) {
+ Display *disp = (Display *)(intptr_t)display_ptr;
+ Window win = (Window)window_ptr;
+ unsigned int best_width, best_height;
+ if (XQueryBestCursor(disp, win, 1, 1, &best_width, &best_height) == 0) {
+ throwException(env, "Could not query best cursor size");
+ return false;
+ }
+ Pixmap mask = XCreatePixmap(disp, win, best_width, best_height, 1);
+ XGCValues gc_values;
+ gc_values.foreground = 0;
+ GC gc = XCreateGC(disp, mask, GCForeground, &gc_values);
+ XFillRectangle(disp, mask, gc, 0, 0, best_width, best_height);
+ XFreeGC(disp, gc);
+ XColor dummy_color;
+ Cursor cursor = XCreatePixmapCursor(disp, mask, mask, &dummy_color, &dummy_color, 0, 0);
+ XFreePixmap(disp, mask);
+ return cursor;
+}
+
+JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetInputFocus(JNIEnv *env, jclass unused, jlong display_ptr) {
+ Display *disp = (Display *)(intptr_t)display_ptr;
+ int revert_mode;
+ Window win;
+ XGetInputFocus(disp, &win, &revert_mode);
+ return win;
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nIconifyWindow(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr, jint screen) {
+ Display *disp = (Display *)(intptr_t)display_ptr;
+ Window win = (Window)window_ptr;
+ XIconifyWindow(disp, win, screen);
+}
diff --git a/src/native/linux/org_lwjgl_opengl_LinuxAWTGLCanvasPeerInfo.c b/src/native/linux/org_lwjgl_opengl_LinuxAWTGLCanvasPeerInfo.c
index 84797ee..b3ddf0d 100644
--- a/src/native/linux/org_lwjgl_opengl_LinuxAWTGLCanvasPeerInfo.c
+++ b/src/native/linux/org_lwjgl_opengl_LinuxAWTGLCanvasPeerInfo.c
@@ -1,82 +1,82 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: org_lwjgl_opengl_LinuxAWTGLCanvasPeerInfo.c 2985 2008-04-07 18:42:36Z matzon $
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2985 $
- */
-
-#include <jni.h>
-#include <jawt_md.h>
-#include <X11/X.h>
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include "awt_tools.h"
-#include "org_lwjgl_opengl_LinuxAWTGLCanvasPeerInfo.h"
-#include "context.h"
-
-JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxAWTGLCanvasPeerInfo_getScreenFromSurfaceInfo
- (JNIEnv *env, jclass clazz, jobject lock_buffer_handle) {
- const AWTSurfaceLock *awt_lock = (AWTSurfaceLock *)(*env)->GetDirectBufferAddress(env, lock_buffer_handle);
- // Get the platform-specific drawing info
- JAWT_X11DrawingSurfaceInfo *dsi_x11 = (JAWT_X11DrawingSurfaceInfo*)awt_lock->dsi->platformInfo;
-
- XVisualInfo template;
- int num_infos;
- template.visualid = dsi_x11->visualID;
- template.depth = dsi_x11->depth;
- XVisualInfo *vis_info = XGetVisualInfo(dsi_x11->display, VisualIDMask | VisualDepthMask, &template, &num_infos);
- if (vis_info == NULL) {
- throwException(env, "Could not determine screen");
- return -1;
- }
- int screen = vis_info[0].screen;
- XFree(vis_info);
- return screen;
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxAWTGLCanvasPeerInfo_nInitHandle
- (JNIEnv *env, jclass clazz, int screen, jobject lock_buffer_handle, jobject peer_info_handle) {
- const AWTSurfaceLock *awt_lock = (AWTSurfaceLock *)(*env)->GetDirectBufferAddress(env, lock_buffer_handle);
- X11PeerInfo *peer_info = (X11PeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
- // Get the platform-specific drawing info
- JAWT_X11DrawingSurfaceInfo *dsi_x11 = (JAWT_X11DrawingSurfaceInfo*)awt_lock->dsi->platformInfo;
-
- peer_info->display = dsi_x11->display;
- peer_info->screen = screen;
- peer_info->drawable = dsi_x11->drawable;
- peer_info->glx13 = false;
- peer_info->config.glx_config.visualid = dsi_x11->visualID;
- peer_info->config.glx_config.depth = dsi_x11->depth;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: org_lwjgl_opengl_LinuxAWTGLCanvasPeerInfo.c 2985 2008-04-07 18:42:36Z matzon $
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2985 $
+ */
+
+#include <jni.h>
+#include <jawt_md.h>
+#include <X11/X.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include "awt_tools.h"
+#include "org_lwjgl_opengl_LinuxAWTGLCanvasPeerInfo.h"
+#include "context.h"
+
+JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxAWTGLCanvasPeerInfo_getScreenFromSurfaceInfo
+ (JNIEnv *env, jclass clazz, jobject lock_buffer_handle) {
+ const AWTSurfaceLock *awt_lock = (AWTSurfaceLock *)(*env)->GetDirectBufferAddress(env, lock_buffer_handle);
+ // Get the platform-specific drawing info
+ JAWT_X11DrawingSurfaceInfo *dsi_x11 = (JAWT_X11DrawingSurfaceInfo*)awt_lock->dsi->platformInfo;
+
+ XVisualInfo template;
+ int num_infos;
+ template.visualid = dsi_x11->visualID;
+ template.depth = dsi_x11->depth;
+ XVisualInfo *vis_info = XGetVisualInfo(dsi_x11->display, VisualIDMask | VisualDepthMask, &template, &num_infos);
+ if (vis_info == NULL) {
+ throwException(env, "Could not determine screen");
+ return -1;
+ }
+ int screen = vis_info[0].screen;
+ XFree(vis_info);
+ return screen;
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxAWTGLCanvasPeerInfo_nInitHandle
+ (JNIEnv *env, jclass clazz, int screen, jobject lock_buffer_handle, jobject peer_info_handle) {
+ const AWTSurfaceLock *awt_lock = (AWTSurfaceLock *)(*env)->GetDirectBufferAddress(env, lock_buffer_handle);
+ X11PeerInfo *peer_info = (X11PeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
+ // Get the platform-specific drawing info
+ JAWT_X11DrawingSurfaceInfo *dsi_x11 = (JAWT_X11DrawingSurfaceInfo*)awt_lock->dsi->platformInfo;
+
+ peer_info->display = dsi_x11->display;
+ peer_info->screen = screen;
+ peer_info->drawable = dsi_x11->drawable;
+ peer_info->glx13 = false;
+ peer_info->config.glx_config.visualid = dsi_x11->visualID;
+ peer_info->config.glx_config.depth = dsi_x11->depth;
+}
diff --git a/src/native/linux/org_lwjgl_opengl_LinuxCanvasImplementation.c b/src/native/linux/org_lwjgl_opengl_LinuxCanvasImplementation.c
index a27efea..6ab1cf1 100644
--- a/src/native/linux/org_lwjgl_opengl_LinuxCanvasImplementation.c
+++ b/src/native/linux/org_lwjgl_opengl_LinuxCanvasImplementation.c
@@ -1,65 +1,65 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: org_lwjgl_opengl_LinuxCanvasImplementation.c 2985 2008-04-07 18:42:36Z matzon $
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2985 $
- */
-
-#include <jni.h>
-#include <X11/X.h>
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include "org_lwjgl_opengl_LinuxCanvasImplementation.h"
-#include "extgl_glx.h"
-#include "context.h"
-
-JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxCanvasImplementation_nFindVisualIDFromFormat
- (JNIEnv *env, jclass clazz, jlong display, jint screen, jobject pixel_format) {
- Display *disp = (Display *)(intptr_t)display;
- GLXExtensions extension_flags;
- if (!extgl_InitGLX(disp, screen, &extension_flags)) {
- throwException(env, "Could not initialize GLX");
- return -1;
- }
- XVisualInfo *vis_info = chooseVisualGLX(env, disp, screen, pixel_format, true, true);
- if (vis_info == NULL) {
- throwException(env, "Could not choose a VisualInfo");
- return -1;
- }
-
- VisualID vis_id = vis_info->visualid;
- XFree(vis_info);
- return vis_id;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: org_lwjgl_opengl_LinuxCanvasImplementation.c 2985 2008-04-07 18:42:36Z matzon $
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2985 $
+ */
+
+#include <jni.h>
+#include <X11/X.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include "org_lwjgl_opengl_LinuxCanvasImplementation.h"
+#include "extgl_glx.h"
+#include "context.h"
+
+JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxCanvasImplementation_nFindVisualIDFromFormat
+ (JNIEnv *env, jclass clazz, jlong display, jint screen, jobject pixel_format) {
+ Display *disp = (Display *)(intptr_t)display;
+ GLXExtensions extension_flags;
+ if (!extgl_InitGLX(disp, screen, &extension_flags)) {
+ throwException(env, "Could not initialize GLX");
+ return -1;
+ }
+ XVisualInfo *vis_info = chooseVisualGLX(env, disp, screen, pixel_format, true, true);
+ if (vis_info == NULL) {
+ throwException(env, "Could not choose a VisualInfo");
+ return -1;
+ }
+
+ VisualID vis_id = vis_info->visualid;
+ XFree(vis_info);
+ return vis_id;
+}
diff --git a/src/native/linux/org_lwjgl_opengl_LinuxContextImplementation.c b/src/native/linux/org_lwjgl_opengl_LinuxContextImplementation.c
index f810b70..df0e2eb 100644
--- a/src/native/linux/org_lwjgl_opengl_LinuxContextImplementation.c
+++ b/src/native/linux/org_lwjgl_opengl_LinuxContextImplementation.c
@@ -1,190 +1,190 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: org_lwjgl_opengl_LinuxContextImplementation.c 3203 2009-04-24 20:35:33Z elias_naur $
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3203 $
- */
-
-#include <jni.h>
-#include <X11/X.h>
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include "org_lwjgl_opengl_LinuxContextImplementation.h"
-#include "extgl_glx.h"
-#include "context.h"
-#include "common_tools.h"
-
-typedef struct {
- GLXExtensions extension_flags;
- GLXContext context;
-} X11Context;
-
-static bool checkContext(JNIEnv *env, Display *display, GLXContext context) {
- if (context == NULL) {
- throwException(env, "Could not create GLX context");
- return false;
- }
- /*
- * Ditched the requirement that contexts have to be direct. It was
- * never true that all accelerated contexts are direct, but it
- * was a reasonable test until the appearance of Xgl and AIGLX.
- * Now the test is at best useless, and at worst wrong,
- * in case the current X server accelerates indirect rendering.
- */
-/* jboolean allow_software_acceleration = getBooleanProperty(env, "org.lwjgl.opengl.Display.allowSoftwareOpenGL");
- if (!allow_software_acceleration && lwjgl_glXIsDirect(display, context) == False) {
- lwjgl_glXDestroyContext(display, context);
- throwException(env, "Could not create a direct GLX context");
- return false;
- }*/
- return true;
-}
-
-static void createContextGLX13(JNIEnv *env, X11PeerInfo *peer_info, X11Context *context_info, jobject attribs, GLXContext shared_context) {
- GLXFBConfig *config = getFBConfigFromPeerInfo(env, peer_info);
- if (config == NULL)
- return;
- GLXContext context;
- if (attribs) {
- const int *attrib_list = (const int *)(*env)->GetDirectBufferAddress(env, attribs);
- context = lwjgl_glXCreateContextAttribsARB(peer_info->display, *config, shared_context, True, attrib_list);
- } else {
- int render_type;
- if (lwjgl_glXGetFBConfigAttrib(peer_info->display, *config, GLX_RENDER_TYPE, &render_type) != 0) {
- throwException(env, "Could not get GLX_RENDER_TYPE attribute");
- return;
- }
- int context_render_type = (render_type & GLX_RGBA_FLOAT_BIT) != 0 ? GLX_RGBA_FLOAT_TYPE : GLX_RGBA_TYPE;
- context = lwjgl_glXCreateNewContext(peer_info->display, *config, context_render_type, shared_context, True);
- }
- XFree(config);
- if (!checkContext(env, peer_info->display, context))
- return;
- context_info->context = context;
-}
-
-static void createContextGLX(JNIEnv *env, X11PeerInfo *peer_info, X11Context *context_info, GLXContext shared_context) {
- XVisualInfo *vis_info = getVisualInfoFromPeerInfo(env, peer_info);
- if (vis_info == NULL)
- return;
- GLXContext context = lwjgl_glXCreateContext(peer_info->display, vis_info, shared_context, True);
- XFree(vis_info);
- if (!checkContext(env, peer_info->display, context))
- return;
- context_info->context = context;
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxContextImplementation_nSetSwapInterval
- (JNIEnv *env, jclass clazz, jobject context_handle, jint value)
-{
- X11Context *context_info = (*env)->GetDirectBufferAddress(env, context_handle);
- if (context_info->extension_flags.GLX_SGI_swap_control) {
- lwjgl_glXSwapIntervalSGI(value);
- }
-}
-
-JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_LinuxContextImplementation_nCreate
- (JNIEnv *env , jclass clazz, jobject peer_handle, jobject attribs, jobject shared_context_handle) {
- jobject context_handle = newJavaManagedByteBuffer(env, sizeof(X11Context));
- if (context_handle == NULL) {
- throwException(env, "Could not allocate handle buffer");
- return NULL;
- }
- X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_handle);
- X11Context *context_info = (*env)->GetDirectBufferAddress(env, context_handle);
- GLXExtensions extension_flags;
- if (!extgl_InitGLX(peer_info->display, peer_info->screen, &extension_flags)) {
- throwException(env, "Could not initialize GLX");
- return NULL;
- }
- GLXContext shared_context = NULL;
- if (shared_context_handle != NULL) {
- X11Context *shared_context_info = (*env)->GetDirectBufferAddress(env, shared_context_handle);
- shared_context = shared_context_info->context;
- }
- if (peer_info->glx13) {
- createContextGLX13(env, peer_info, context_info, extension_flags.GLX_ARB_create_context ? attribs : NULL, shared_context);
- } else {
- createContextGLX(env, peer_info, context_info, shared_context);
- }
- context_info->extension_flags = extension_flags;
- return context_handle;
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxContextImplementation_nDestroy
- (JNIEnv *env, jclass clazz, jobject peer_handle, jobject context_handle) {
- X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_handle);
- X11Context *context_info = (*env)->GetDirectBufferAddress(env, context_handle);
- lwjgl_glXDestroyContext(peer_info->display, context_info->context);
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxContextImplementation_nReleaseCurrentContext
- (JNIEnv *env , jclass clazz, jobject peer_info_handle) {
- X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle);
- Bool result;
- if (peer_info->glx13) {
- result = lwjgl_glXMakeContextCurrent(peer_info->display, None, None, NULL);
- } else {
- result = lwjgl_glXMakeCurrent(peer_info->display, None, NULL);
- }
- if (!result)
- throwException(env, "Could not release current context");
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxContextImplementation_nMakeCurrent
- (JNIEnv *env, jclass clazz, jobject peer_info_handle, jobject context_handle) {
- X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle);
- X11Context *context_info = (*env)->GetDirectBufferAddress(env, context_handle);
- Bool result;
- if (peer_info->glx13) {
- result = lwjgl_glXMakeContextCurrent(peer_info->display, peer_info->drawable, peer_info->drawable, context_info->context);
- } else {
- result = lwjgl_glXMakeCurrent(peer_info->display, peer_info->drawable, context_info->context);
- }
- if (!result)
- throwException(env, "Could not make context current");
-}
-
-JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxContextImplementation_nIsCurrent
- (JNIEnv *env, jclass clazz, jobject context_handle) {
- X11Context *context_info = (*env)->GetDirectBufferAddress(env, context_handle);
- return context_info->context == lwjgl_glXGetCurrentContext();
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxContextImplementation_nSwapBuffers
- (JNIEnv *env, jclass clazz, jobject peer_info_handle) {
- X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle);
- lwjgl_glXSwapBuffers(peer_info->display, peer_info->drawable);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: org_lwjgl_opengl_LinuxContextImplementation.c 3203 2009-04-24 20:35:33Z elias_naur $
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3203 $
+ */
+
+#include <jni.h>
+#include <X11/X.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include "org_lwjgl_opengl_LinuxContextImplementation.h"
+#include "extgl_glx.h"
+#include "context.h"
+#include "common_tools.h"
+
+typedef struct {
+ GLXExtensions extension_flags;
+ GLXContext context;
+} X11Context;
+
+static bool checkContext(JNIEnv *env, Display *display, GLXContext context) {
+ if (context == NULL) {
+ throwException(env, "Could not create GLX context");
+ return false;
+ }
+ /*
+ * Ditched the requirement that contexts have to be direct. It was
+ * never true that all accelerated contexts are direct, but it
+ * was a reasonable test until the appearance of Xgl and AIGLX.
+ * Now the test is at best useless, and at worst wrong,
+ * in case the current X server accelerates indirect rendering.
+ */
+/* jboolean allow_software_acceleration = getBooleanProperty(env, "org.lwjgl.opengl.Display.allowSoftwareOpenGL");
+ if (!allow_software_acceleration && lwjgl_glXIsDirect(display, context) == False) {
+ lwjgl_glXDestroyContext(display, context);
+ throwException(env, "Could not create a direct GLX context");
+ return false;
+ }*/
+ return true;
+}
+
+static void createContextGLX13(JNIEnv *env, X11PeerInfo *peer_info, X11Context *context_info, jobject attribs, GLXContext shared_context) {
+ GLXFBConfig *config = getFBConfigFromPeerInfo(env, peer_info);
+ if (config == NULL)
+ return;
+ GLXContext context;
+ if (attribs) {
+ const int *attrib_list = (const int *)(*env)->GetDirectBufferAddress(env, attribs);
+ context = lwjgl_glXCreateContextAttribsARB(peer_info->display, *config, shared_context, True, attrib_list);
+ } else {
+ int render_type;
+ if (lwjgl_glXGetFBConfigAttrib(peer_info->display, *config, GLX_RENDER_TYPE, &render_type) != 0) {
+ throwException(env, "Could not get GLX_RENDER_TYPE attribute");
+ return;
+ }
+ int context_render_type = (render_type & GLX_RGBA_FLOAT_BIT) != 0 ? GLX_RGBA_FLOAT_TYPE : GLX_RGBA_TYPE;
+ context = lwjgl_glXCreateNewContext(peer_info->display, *config, context_render_type, shared_context, True);
+ }
+ XFree(config);
+ if (!checkContext(env, peer_info->display, context))
+ return;
+ context_info->context = context;
+}
+
+static void createContextGLX(JNIEnv *env, X11PeerInfo *peer_info, X11Context *context_info, GLXContext shared_context) {
+ XVisualInfo *vis_info = getVisualInfoFromPeerInfo(env, peer_info);
+ if (vis_info == NULL)
+ return;
+ GLXContext context = lwjgl_glXCreateContext(peer_info->display, vis_info, shared_context, True);
+ XFree(vis_info);
+ if (!checkContext(env, peer_info->display, context))
+ return;
+ context_info->context = context;
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxContextImplementation_nSetSwapInterval
+ (JNIEnv *env, jclass clazz, jobject context_handle, jint value)
+{
+ X11Context *context_info = (*env)->GetDirectBufferAddress(env, context_handle);
+ if (context_info->extension_flags.GLX_SGI_swap_control) {
+ lwjgl_glXSwapIntervalSGI(value);
+ }
+}
+
+JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_LinuxContextImplementation_nCreate
+ (JNIEnv *env , jclass clazz, jobject peer_handle, jobject attribs, jobject shared_context_handle) {
+ jobject context_handle = newJavaManagedByteBuffer(env, sizeof(X11Context));
+ if (context_handle == NULL) {
+ throwException(env, "Could not allocate handle buffer");
+ return NULL;
+ }
+ X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_handle);
+ X11Context *context_info = (*env)->GetDirectBufferAddress(env, context_handle);
+ GLXExtensions extension_flags;
+ if (!extgl_InitGLX(peer_info->display, peer_info->screen, &extension_flags)) {
+ throwException(env, "Could not initialize GLX");
+ return NULL;
+ }
+ GLXContext shared_context = NULL;
+ if (shared_context_handle != NULL) {
+ X11Context *shared_context_info = (*env)->GetDirectBufferAddress(env, shared_context_handle);
+ shared_context = shared_context_info->context;
+ }
+ if (peer_info->glx13) {
+ createContextGLX13(env, peer_info, context_info, extension_flags.GLX_ARB_create_context ? attribs : NULL, shared_context);
+ } else {
+ createContextGLX(env, peer_info, context_info, shared_context);
+ }
+ context_info->extension_flags = extension_flags;
+ return context_handle;
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxContextImplementation_nDestroy
+ (JNIEnv *env, jclass clazz, jobject peer_handle, jobject context_handle) {
+ X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_handle);
+ X11Context *context_info = (*env)->GetDirectBufferAddress(env, context_handle);
+ lwjgl_glXDestroyContext(peer_info->display, context_info->context);
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxContextImplementation_nReleaseCurrentContext
+ (JNIEnv *env , jclass clazz, jobject peer_info_handle) {
+ X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle);
+ Bool result;
+ if (peer_info->glx13) {
+ result = lwjgl_glXMakeContextCurrent(peer_info->display, None, None, NULL);
+ } else {
+ result = lwjgl_glXMakeCurrent(peer_info->display, None, NULL);
+ }
+ if (!result)
+ throwException(env, "Could not release current context");
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxContextImplementation_nMakeCurrent
+ (JNIEnv *env, jclass clazz, jobject peer_info_handle, jobject context_handle) {
+ X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle);
+ X11Context *context_info = (*env)->GetDirectBufferAddress(env, context_handle);
+ Bool result;
+ if (peer_info->glx13) {
+ result = lwjgl_glXMakeContextCurrent(peer_info->display, peer_info->drawable, peer_info->drawable, context_info->context);
+ } else {
+ result = lwjgl_glXMakeCurrent(peer_info->display, peer_info->drawable, context_info->context);
+ }
+ if (!result)
+ throwException(env, "Could not make context current");
+}
+
+JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxContextImplementation_nIsCurrent
+ (JNIEnv *env, jclass clazz, jobject context_handle) {
+ X11Context *context_info = (*env)->GetDirectBufferAddress(env, context_handle);
+ return context_info->context == lwjgl_glXGetCurrentContext();
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxContextImplementation_nSwapBuffers
+ (JNIEnv *env, jclass clazz, jobject peer_info_handle) {
+ X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle);
+ lwjgl_glXSwapBuffers(peer_info->display, peer_info->drawable);
+}
diff --git a/src/native/linux/org_lwjgl_opengl_LinuxPeerInfo.c b/src/native/linux/org_lwjgl_opengl_LinuxPeerInfo.c
index db6323c..0e9636f 100644
--- a/src/native/linux/org_lwjgl_opengl_LinuxPeerInfo.c
+++ b/src/native/linux/org_lwjgl_opengl_LinuxPeerInfo.c
@@ -1,58 +1,58 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: org_lwjgl_opengl_LinuxPeerInfo.c 2985 2008-04-07 18:42:36Z matzon $
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2985 $
- */
-
-#include <jni.h>
-#include "org_lwjgl_opengl_LinuxPeerInfo.h"
-#include "context.h"
-#include "common_tools.h"
-
-JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_LinuxPeerInfo_createHandle
- (JNIEnv *env, jclass clazz) {
- return newJavaManagedByteBuffer(env, sizeof(X11PeerInfo));
-}
-
-JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxPeerInfo_nGetDisplay(JNIEnv *env, jclass unused, jobject handle) {
- X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, handle);
- return (jlong)(intptr_t)peer_info->display;
-}
-
-JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxPeerInfo_nGetDrawable(JNIEnv *env, jclass unused, jobject handle) {
- X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, handle);
- return peer_info->drawable;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: org_lwjgl_opengl_LinuxPeerInfo.c 2985 2008-04-07 18:42:36Z matzon $
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2985 $
+ */
+
+#include <jni.h>
+#include "org_lwjgl_opengl_LinuxPeerInfo.h"
+#include "context.h"
+#include "common_tools.h"
+
+JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_LinuxPeerInfo_createHandle
+ (JNIEnv *env, jclass clazz) {
+ return newJavaManagedByteBuffer(env, sizeof(X11PeerInfo));
+}
+
+JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxPeerInfo_nGetDisplay(JNIEnv *env, jclass unused, jobject handle) {
+ X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, handle);
+ return (jlong)(intptr_t)peer_info->display;
+}
+
+JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxPeerInfo_nGetDrawable(JNIEnv *env, jclass unused, jobject handle) {
+ X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, handle);
+ return peer_info->drawable;
+}
diff --git a/src/native/linux/org_lwjgl_opengl_Pbuffer.c b/src/native/linux/org_lwjgl_opengl_Pbuffer.c
index a0eac74..63a4f61 100644
--- a/src/native/linux/org_lwjgl_opengl_Pbuffer.c
+++ b/src/native/linux/org_lwjgl_opengl_Pbuffer.c
@@ -1,90 +1,90 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: org_lwjgl_opengl_Pbuffer.c 2985 2008-04-07 18:42:36Z matzon $
- *
- * Linux Pbuffer.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2985 $
- */
-
-#include <stdlib.h>
-#include "org_lwjgl_opengl_LinuxPbufferPeerInfo.h"
-#include "org_lwjgl_opengl_Pbuffer.h"
-#include "extgl.h"
-#include "context.h"
-#include "common_tools.h"
-
-JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetPbufferCapabilities
- (JNIEnv *env, jclass clazz, jlong display, jint screen)
-{
- Display *disp = (Display *)(intptr_t)display;
- GLXExtensions extension_flags;
- if (!extgl_InitGLX(disp, screen, &extension_flags))
- return 0;
- // Only support the GLX 1.3 Pbuffers and ignore the GLX_SGIX_pbuffer extension
- return extension_flags.GLX13 ? org_lwjgl_opengl_Pbuffer_PBUFFER_SUPPORTED : 0;
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxPbufferPeerInfo_nInitHandle
- (JNIEnv *env, jclass clazz, jlong display, jint screen, jobject peer_info_handle, jint width, jint height, jobject pixel_format) {
- Display *disp = (Display *)(intptr_t)display;
- GLXExtensions extension_flags;
- if (!extgl_InitGLX(disp, screen, &extension_flags) || !extension_flags.GLX13) {
- throwException(env, "No Pbuffer support");
- return;
- }
- bool result = initPeerInfo(env, peer_info_handle, disp, screen, pixel_format, false, GLX_PBUFFER_BIT, false, true);
- if (!result)
- return;
- const int buffer_attribs[] = {GLX_PBUFFER_WIDTH, width,
- GLX_PBUFFER_HEIGHT, height,
- GLX_PRESERVED_CONTENTS, True,
- GLX_LARGEST_PBUFFER, False,
- None, None};
-
- X11PeerInfo *peer_info = (X11PeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
- GLXFBConfig *config = getFBConfigFromPeerInfo(env, peer_info);
- if (config != NULL) {
- GLXPbuffer buffer = lwjgl_glXCreatePbuffer(peer_info->display, *config, buffer_attribs);
- XFree(config);
- peer_info->drawable = buffer;
- }
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxPbufferPeerInfo_nDestroy
- (JNIEnv *env, jclass clazz, jobject peer_info_handle) {
- X11PeerInfo *peer_info = (X11PeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
- lwjgl_glXDestroyPbuffer(peer_info->display, peer_info->drawable);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: org_lwjgl_opengl_Pbuffer.c 2985 2008-04-07 18:42:36Z matzon $
+ *
+ * Linux Pbuffer.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2985 $
+ */
+
+#include <stdlib.h>
+#include "org_lwjgl_opengl_LinuxPbufferPeerInfo.h"
+#include "org_lwjgl_opengl_Pbuffer.h"
+#include "extgl.h"
+#include "context.h"
+#include "common_tools.h"
+
+JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetPbufferCapabilities
+ (JNIEnv *env, jclass clazz, jlong display, jint screen)
+{
+ Display *disp = (Display *)(intptr_t)display;
+ GLXExtensions extension_flags;
+ if (!extgl_InitGLX(disp, screen, &extension_flags))
+ return 0;
+ // Only support the GLX 1.3 Pbuffers and ignore the GLX_SGIX_pbuffer extension
+ return extension_flags.GLX13 ? org_lwjgl_opengl_Pbuffer_PBUFFER_SUPPORTED : 0;
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxPbufferPeerInfo_nInitHandle
+ (JNIEnv *env, jclass clazz, jlong display, jint screen, jobject peer_info_handle, jint width, jint height, jobject pixel_format) {
+ Display *disp = (Display *)(intptr_t)display;
+ GLXExtensions extension_flags;
+ if (!extgl_InitGLX(disp, screen, &extension_flags) || !extension_flags.GLX13) {
+ throwException(env, "No Pbuffer support");
+ return;
+ }
+ bool result = initPeerInfo(env, peer_info_handle, disp, screen, pixel_format, false, GLX_PBUFFER_BIT, false, true);
+ if (!result)
+ return;
+ const int buffer_attribs[] = {GLX_PBUFFER_WIDTH, width,
+ GLX_PBUFFER_HEIGHT, height,
+ GLX_PRESERVED_CONTENTS, True,
+ GLX_LARGEST_PBUFFER, False,
+ None, None};
+
+ X11PeerInfo *peer_info = (X11PeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
+ GLXFBConfig *config = getFBConfigFromPeerInfo(env, peer_info);
+ if (config != NULL) {
+ GLXPbuffer buffer = lwjgl_glXCreatePbuffer(peer_info->display, *config, buffer_attribs);
+ XFree(config);
+ peer_info->drawable = buffer;
+ }
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxPbufferPeerInfo_nDestroy
+ (JNIEnv *env, jclass clazz, jobject peer_info_handle) {
+ X11PeerInfo *peer_info = (X11PeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
+ lwjgl_glXDestroyPbuffer(peer_info->display, peer_info->drawable);
+}
diff --git a/src/native/macosx/context.h b/src/native/macosx/context.h
index 4c5b4f6..b3350f0 100644
--- a/src/native/macosx/context.h
+++ b/src/native/macosx/context.h
@@ -1,60 +1,60 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: context.h 2985 2008-04-07 18:42:36Z matzon $
- *
- * Base Win32 display
- *
- * @author cix_foo <cix_foo at users.sourceforge.net>
- * @version $Revision: 2985 $
- */
-
-#ifndef __LWJGL_CONTEXT_H
-#define __LWJGL_CONTEXT_H
-
-#include <Cocoa/Cocoa.h>
-#include <OpenGL/gl.h>
-#include <OpenGL/glext.h>
-#include "common_tools.h"
-
-typedef struct {
- NSOpenGLPixelFormat *pixel_format;
- bool window;
- union {
- NSView *nsview;
- NSOpenGLPixelBuffer *pbuffer;
- };
-} MacOSXPeerInfo;
-
-NSOpenGLPixelFormat *choosePixelFormat(JNIEnv *env, jobject pixel_format, bool use_display_bpp, bool support_window, bool support_pbuffer, bool double_buffered);
-#endif
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: context.h 2985 2008-04-07 18:42:36Z matzon $
+ *
+ * Base Win32 display
+ *
+ * @author cix_foo <cix_foo at users.sourceforge.net>
+ * @version $Revision: 2985 $
+ */
+
+#ifndef __LWJGL_CONTEXT_H
+#define __LWJGL_CONTEXT_H
+
+#include <Cocoa/Cocoa.h>
+#include <OpenGL/gl.h>
+#include <OpenGL/glext.h>
+#include "common_tools.h"
+
+typedef struct {
+ NSOpenGLPixelFormat *pixel_format;
+ bool window;
+ union {
+ NSView *nsview;
+ NSOpenGLPixelBuffer *pbuffer;
+ };
+} MacOSXPeerInfo;
+
+NSOpenGLPixelFormat *choosePixelFormat(JNIEnv *env, jobject pixel_format, bool use_display_bpp, bool support_window, bool support_pbuffer, bool double_buffered);
+#endif
diff --git a/src/native/macosx/context.m b/src/native/macosx/context.m
index a5dc84b..e5eace1 100644
--- a/src/native/macosx/context.m
+++ b/src/native/macosx/context.m
@@ -1,144 +1,144 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: context.m 3116 2008-08-19 16:46:03Z spasi $
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3116 $
- */
-
-#import <CoreFoundation/CoreFoundation.h>
-#import "context.h"
-
-static CFBundleRef opengl_bundle = NULL;
-
-void *extgl_GetProcAddress(const char *name) {
- CFStringRef cf_name = CFStringCreateWithCString(NULL, name, kCFStringEncodingUTF8);
- void *address = CFBundleGetFunctionPointerForName(opengl_bundle, cf_name);
- CFRelease(cf_name);
- if (address == NULL)
- printfDebug("Could not locate symbol %s\n", name);
- return address;
-}
-
-static CFBundleRef loadFramework(JNIEnv *env) {
- CFStringRef framework_path = CFSTR("/System/Library/Frameworks/OpenGL.framework");
- if (framework_path == NULL) {
- printfDebugJava(env, "Failed to allocate string");
- return NULL;
- }
- CFURLRef url = CFURLCreateWithFileSystemPath(NULL, framework_path, kCFURLPOSIXPathStyle, TRUE);
- if (url == NULL) {
- printfDebugJava(env, "Failed to allocate URL");
- return NULL;
- }
- CFBundleRef opengl_bundle = CFBundleCreate(NULL, url);
- CFRelease(url);
- return opengl_bundle;
-}
-
-bool extgl_Open(JNIEnv *env) {
- if (opengl_bundle != NULL)
- return true;
- opengl_bundle = loadFramework(env);
- if (opengl_bundle != NULL) {
- return true;
- } else {
- throwException(env, "Could not load OpenGL library");
- return false;
- }
-}
-
-void extgl_Close(void)
-{
- if (opengl_bundle != NULL) {
- CFRelease(opengl_bundle);
- opengl_bundle = NULL;
- }
-}
-
-NSOpenGLPixelFormat *choosePixelFormat(JNIEnv *env, jobject pixel_format, bool use_display_bpp, bool support_window, bool support_pbuffer, bool double_buffered) {
- int bpp;
- jclass cls_pixel_format = (*env)->GetObjectClass(env, pixel_format);
- if (use_display_bpp)
- bpp = CGDisplayBitsPerPixel(kCGDirectMainDisplay);
- else
- bpp = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "bpp", "I"));
-
- int alpha = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "alpha", "I"));
- int depth = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "depth", "I"));
- int stencil = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "stencil", "I"));
- int samples = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "samples", "I"));
- int num_aux_buffers = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "num_aux_buffers", "I"));
- int accum_bpp = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "accum_bpp", "I"));
- int accum_alpha = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "accum_alpha", "I"));
- bool stereo = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "stereo", "Z"));
- bool floating_point = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "floating_point", "Z"));
- // TODO: Add floating_point_packed attribute below
- bool floating_point_packed = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "floating_point_packed", "Z"));
- // TODO: Add sRGB attribute below
- bool sRGB = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "sRGB", "Z"));
-
- attrib_list_t attribs;
- jboolean allow_software_acceleration = getBooleanProperty(env, "org.lwjgl.opengl.Display.allowSoftwareOpenGL");
- initAttribList(&attribs);
- if (!allow_software_acceleration)
- putAttrib(&attribs, NSOpenGLPFAAccelerated);
- if (double_buffered)
- putAttrib(&attribs, NSOpenGLPFADoubleBuffer);
- putAttrib(&attribs, NSOpenGLPFAMinimumPolicy);
- putAttrib(&attribs, NSOpenGLPFAColorSize); putAttrib(&attribs, bpp);
- putAttrib(&attribs, NSOpenGLPFAAlphaSize); putAttrib(&attribs, alpha);
- putAttrib(&attribs, NSOpenGLPFADepthSize); putAttrib(&attribs, depth);
- putAttrib(&attribs, NSOpenGLPFAStencilSize); putAttrib(&attribs, stencil);
- putAttrib(&attribs, NSOpenGLPFAAccumSize); putAttrib(&attribs, accum_bpp + accum_alpha);
- putAttrib(&attribs, NSOpenGLPFASampleBuffers); putAttrib(&attribs, samples > 0 ? 1 : 0);
- putAttrib(&attribs, NSOpenGLPFASamples); putAttrib(&attribs, samples);
- putAttrib(&attribs, NSOpenGLPFAAuxBuffers); putAttrib(&attribs, num_aux_buffers);
- if (support_window)
- putAttrib(&attribs, NSOpenGLPFAWindow);
- if (support_pbuffer)
- putAttrib(&attribs, NSOpenGLPFAPixelBuffer);
- if (stereo)
- putAttrib(&attribs, NSOpenGLPFAStereo);
- if (floating_point)
- putAttrib(&attribs, NSOpenGLPFAColorFloat);
- putAttrib(&attribs, 0);
- NSOpenGLPixelFormat* fmt = [[NSOpenGLPixelFormat alloc] initWithAttributes:(NSOpenGLPixelFormatAttribute *)attribs.attribs];
-
- if (fmt == nil) {
- throwException(env, "Could not create pixel format");
- return NULL;
- }
- return fmt;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: context.m 3116 2008-08-19 16:46:03Z spasi $
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3116 $
+ */
+
+#import <CoreFoundation/CoreFoundation.h>
+#import "context.h"
+
+static CFBundleRef opengl_bundle = NULL;
+
+void *extgl_GetProcAddress(const char *name) {
+ CFStringRef cf_name = CFStringCreateWithCString(NULL, name, kCFStringEncodingUTF8);
+ void *address = CFBundleGetFunctionPointerForName(opengl_bundle, cf_name);
+ CFRelease(cf_name);
+ if (address == NULL)
+ printfDebug("Could not locate symbol %s\n", name);
+ return address;
+}
+
+static CFBundleRef loadFramework(JNIEnv *env) {
+ CFStringRef framework_path = CFSTR("/System/Library/Frameworks/OpenGL.framework");
+ if (framework_path == NULL) {
+ printfDebugJava(env, "Failed to allocate string");
+ return NULL;
+ }
+ CFURLRef url = CFURLCreateWithFileSystemPath(NULL, framework_path, kCFURLPOSIXPathStyle, TRUE);
+ if (url == NULL) {
+ printfDebugJava(env, "Failed to allocate URL");
+ return NULL;
+ }
+ CFBundleRef opengl_bundle = CFBundleCreate(NULL, url);
+ CFRelease(url);
+ return opengl_bundle;
+}
+
+bool extgl_Open(JNIEnv *env) {
+ if (opengl_bundle != NULL)
+ return true;
+ opengl_bundle = loadFramework(env);
+ if (opengl_bundle != NULL) {
+ return true;
+ } else {
+ throwException(env, "Could not load OpenGL library");
+ return false;
+ }
+}
+
+void extgl_Close(void)
+{
+ if (opengl_bundle != NULL) {
+ CFRelease(opengl_bundle);
+ opengl_bundle = NULL;
+ }
+}
+
+NSOpenGLPixelFormat *choosePixelFormat(JNIEnv *env, jobject pixel_format, bool use_display_bpp, bool support_window, bool support_pbuffer, bool double_buffered) {
+ int bpp;
+ jclass cls_pixel_format = (*env)->GetObjectClass(env, pixel_format);
+ if (use_display_bpp)
+ bpp = CGDisplayBitsPerPixel(kCGDirectMainDisplay);
+ else
+ bpp = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "bpp", "I"));
+
+ int alpha = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "alpha", "I"));
+ int depth = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "depth", "I"));
+ int stencil = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "stencil", "I"));
+ int samples = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "samples", "I"));
+ int num_aux_buffers = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "num_aux_buffers", "I"));
+ int accum_bpp = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "accum_bpp", "I"));
+ int accum_alpha = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "accum_alpha", "I"));
+ bool stereo = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "stereo", "Z"));
+ bool floating_point = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "floating_point", "Z"));
+ // TODO: Add floating_point_packed attribute below
+ bool floating_point_packed = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "floating_point_packed", "Z"));
+ // TODO: Add sRGB attribute below
+ bool sRGB = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "sRGB", "Z"));
+
+ attrib_list_t attribs;
+ jboolean allow_software_acceleration = getBooleanProperty(env, "org.lwjgl.opengl.Display.allowSoftwareOpenGL");
+ initAttribList(&attribs);
+ if (!allow_software_acceleration)
+ putAttrib(&attribs, NSOpenGLPFAAccelerated);
+ if (double_buffered)
+ putAttrib(&attribs, NSOpenGLPFADoubleBuffer);
+ putAttrib(&attribs, NSOpenGLPFAMinimumPolicy);
+ putAttrib(&attribs, NSOpenGLPFAColorSize); putAttrib(&attribs, bpp);
+ putAttrib(&attribs, NSOpenGLPFAAlphaSize); putAttrib(&attribs, alpha);
+ putAttrib(&attribs, NSOpenGLPFADepthSize); putAttrib(&attribs, depth);
+ putAttrib(&attribs, NSOpenGLPFAStencilSize); putAttrib(&attribs, stencil);
+ putAttrib(&attribs, NSOpenGLPFAAccumSize); putAttrib(&attribs, accum_bpp + accum_alpha);
+ putAttrib(&attribs, NSOpenGLPFASampleBuffers); putAttrib(&attribs, samples > 0 ? 1 : 0);
+ putAttrib(&attribs, NSOpenGLPFASamples); putAttrib(&attribs, samples);
+ putAttrib(&attribs, NSOpenGLPFAAuxBuffers); putAttrib(&attribs, num_aux_buffers);
+ if (support_window)
+ putAttrib(&attribs, NSOpenGLPFAWindow);
+ if (support_pbuffer)
+ putAttrib(&attribs, NSOpenGLPFAPixelBuffer);
+ if (stereo)
+ putAttrib(&attribs, NSOpenGLPFAStereo);
+ if (floating_point)
+ putAttrib(&attribs, NSOpenGLPFAColorFloat);
+ putAttrib(&attribs, 0);
+ NSOpenGLPixelFormat* fmt = [[NSOpenGLPixelFormat alloc] initWithAttributes:(NSOpenGLPixelFormatAttribute *)attribs.attribs];
+
+ if (fmt == nil) {
+ throwException(env, "Could not create pixel format");
+ return NULL;
+ }
+ return fmt;
+}
diff --git a/src/native/macosx/macosx_al.c b/src/native/macosx/macosx_al.c
index 1e2e9a0..14465b7 100644
--- a/src/native/macosx/macosx_al.c
+++ b/src/native/macosx/macosx_al.c
@@ -1,120 +1,120 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <mach-o/dyld.h>
-#include <stdlib.h>
-#include <string.h>
-#include <CoreFoundation/CoreFoundation.h>
-#include "extal.h"
-#include "common_tools.h"
-
-/**
- * $Id: macosx_al.c 2985 2008-04-07 18:42:36Z matzon $
- *
- * This file contains the AL extension assigning mechanism
- *
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 2985 $
- */
-
-static const struct mach_header* handleOAL = NULL;
-static CFBundleRef openal_bundle = NULL;
-
-void *NativeGetFunctionPointer(const char *function) {
- void *address = NULL;
- if (handleOAL != NULL) {
- char *mac_symbol_name = (char *)malloc((strlen(function) + 2)*sizeof(char));
- if (mac_symbol_name == NULL)
- return NULL;
- mac_symbol_name[0] = '_';
- strcpy(&(mac_symbol_name[1]), function);
- NSSymbol symbol = NSLookupSymbolInImage(handleOAL, mac_symbol_name, NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR);
- free(mac_symbol_name);
- if (symbol != NULL) {
- address = NSAddressOfSymbol(symbol);
- }
- } else if (openal_bundle != NULL) {
- CFStringRef cf_function = CFStringCreateWithCString(NULL, function, kCFStringEncodingUTF8);
- address = CFBundleGetFunctionPointerForName(openal_bundle, cf_function);
- CFRelease(cf_function);
- }
- return address;
-}
-
-static CFBundleRef tryLoadFramework(JNIEnv *env) {
- CFStringRef framework_path = CFSTR("/System/Library/Frameworks/OpenAL.framework");
- if (framework_path == NULL) {
- printfDebugJava(env, "Failed to allocate string");
- return NULL;
- }
- CFURLRef url = CFURLCreateWithFileSystemPath(NULL, framework_path, kCFURLPOSIXPathStyle, TRUE);
- if (url == NULL) {
- printfDebugJava(env, "Failed to allocate URL");
- return NULL;
- }
- CFBundleRef openal_bundle = CFBundleCreate(NULL, url);
- CFRelease(url);
- return openal_bundle;
-}
-
-void tryLoadLibrary(JNIEnv *env, jstring path) {
- const char *path_str = (*env)->GetStringUTFChars(env, path, NULL);
- printfDebugJava(env, "Testing '%s'", path_str);
- handleOAL = NSAddImage(path_str, NSADDIMAGE_OPTION_RETURN_ON_ERROR);
- if (handleOAL != NULL) {
- printfDebugJava(env, "Found OpenAL at '%s'", path_str);
- } else {
- throwException(env, "Could not load OpenAL library");
- }
- (*env)->ReleaseStringUTFChars(env, path, path_str);
-}
-
-/**
- * Unloads the OpenAL Library
- */
-void UnLoadOpenAL() {
- if (openal_bundle != NULL) {
- CFRelease(openal_bundle);
- openal_bundle = NULL;
- }
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_openal_AL_nCreateDefault(JNIEnv *env, jclass clazz) {
- openal_bundle = tryLoadFramework(env);
- if (openal_bundle != NULL)
- printfDebugJava(env, "Found OpenAL Bundle");
- else
- throwException(env, "Could not load OpenAL framework");
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <mach-o/dyld.h>
+#include <stdlib.h>
+#include <string.h>
+#include <CoreFoundation/CoreFoundation.h>
+#include "extal.h"
+#include "common_tools.h"
+
+/**
+ * $Id: macosx_al.c 2985 2008-04-07 18:42:36Z matzon $
+ *
+ * This file contains the AL extension assigning mechanism
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 2985 $
+ */
+
+static const struct mach_header* handleOAL = NULL;
+static CFBundleRef openal_bundle = NULL;
+
+void *NativeGetFunctionPointer(const char *function) {
+ void *address = NULL;
+ if (handleOAL != NULL) {
+ char *mac_symbol_name = (char *)malloc((strlen(function) + 2)*sizeof(char));
+ if (mac_symbol_name == NULL)
+ return NULL;
+ mac_symbol_name[0] = '_';
+ strcpy(&(mac_symbol_name[1]), function);
+ NSSymbol symbol = NSLookupSymbolInImage(handleOAL, mac_symbol_name, NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR);
+ free(mac_symbol_name);
+ if (symbol != NULL) {
+ address = NSAddressOfSymbol(symbol);
+ }
+ } else if (openal_bundle != NULL) {
+ CFStringRef cf_function = CFStringCreateWithCString(NULL, function, kCFStringEncodingUTF8);
+ address = CFBundleGetFunctionPointerForName(openal_bundle, cf_function);
+ CFRelease(cf_function);
+ }
+ return address;
+}
+
+static CFBundleRef tryLoadFramework(JNIEnv *env) {
+ CFStringRef framework_path = CFSTR("/System/Library/Frameworks/OpenAL.framework");
+ if (framework_path == NULL) {
+ printfDebugJava(env, "Failed to allocate string");
+ return NULL;
+ }
+ CFURLRef url = CFURLCreateWithFileSystemPath(NULL, framework_path, kCFURLPOSIXPathStyle, TRUE);
+ if (url == NULL) {
+ printfDebugJava(env, "Failed to allocate URL");
+ return NULL;
+ }
+ CFBundleRef openal_bundle = CFBundleCreate(NULL, url);
+ CFRelease(url);
+ return openal_bundle;
+}
+
+void tryLoadLibrary(JNIEnv *env, jstring path) {
+ const char *path_str = (*env)->GetStringUTFChars(env, path, NULL);
+ printfDebugJava(env, "Testing '%s'", path_str);
+ handleOAL = NSAddImage(path_str, NSADDIMAGE_OPTION_RETURN_ON_ERROR);
+ if (handleOAL != NULL) {
+ printfDebugJava(env, "Found OpenAL at '%s'", path_str);
+ } else {
+ throwException(env, "Could not load OpenAL library");
+ }
+ (*env)->ReleaseStringUTFChars(env, path, path_str);
+}
+
+/**
+ * Unloads the OpenAL Library
+ */
+void UnLoadOpenAL() {
+ if (openal_bundle != NULL) {
+ CFRelease(openal_bundle);
+ openal_bundle = NULL;
+ }
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_openal_AL_nCreateDefault(JNIEnv *env, jclass clazz) {
+ openal_bundle = tryLoadFramework(env);
+ if (openal_bundle != NULL)
+ printfDebugJava(env, "Found OpenAL Bundle");
+ else
+ throwException(env, "Could not load OpenAL framework");
+}
diff --git a/src/native/macosx/org_lwjgl_input_Mouse.c b/src/native/macosx/org_lwjgl_input_Mouse.c
index 21eea37..5b04a48 100644
--- a/src/native/macosx/org_lwjgl_input_Mouse.c
+++ b/src/native/macosx/org_lwjgl_input_Mouse.c
@@ -1,73 +1,73 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: org_lwjgl_input_Mouse.c 2985 2008-04-07 18:42:36Z matzon $
- *
- * Mac OS X mouse handling.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2985 $
- */
-
-#include <jni.h>
-#include <ApplicationServices/ApplicationServices.h>
-#include "org_lwjgl_opengl_MacOSXMouseEventQueue.h"
-#include "common_tools.h"
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXMouseEventQueue_nGrabMouse(JNIEnv *env, jclass unused, jboolean grab) {
- CGAssociateMouseAndMouseCursorPosition(grab == JNI_TRUE ? FALSE : TRUE);
- if (grab)
- CGDisplayHideCursor(kCGDirectMainDisplay);
- else
- CGDisplayShowCursor(kCGDirectMainDisplay);
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXMouseEventQueue_nWarpCursor(JNIEnv *env, jclass unused, jint x, jint y) {
- CGPoint p;
- p.x = x;
- p.y = y;
- CGWarpMouseCursorPosition(p);
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXMouseEventQueue_getMouseDeltas(JNIEnv *env, jclass unused, jobject delta_buffer) {
- CGMouseDelta dx, dy;
- CGGetLastMouseDelta(&dx, &dy);
- int buffer_length = (*env)->GetDirectBufferCapacity(env, delta_buffer);
- if (buffer_length != 2) {
- printfDebugJava(env, "Delta buffer not large enough!");
- return;
- }
- jint *buffer = (*env)->GetDirectBufferAddress(env, delta_buffer);
- buffer[0] = dx;
- buffer[1] = dy;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: org_lwjgl_input_Mouse.c 2985 2008-04-07 18:42:36Z matzon $
+ *
+ * Mac OS X mouse handling.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2985 $
+ */
+
+#include <jni.h>
+#include <ApplicationServices/ApplicationServices.h>
+#include "org_lwjgl_opengl_MacOSXMouseEventQueue.h"
+#include "common_tools.h"
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXMouseEventQueue_nGrabMouse(JNIEnv *env, jclass unused, jboolean grab) {
+ CGAssociateMouseAndMouseCursorPosition(grab == JNI_TRUE ? FALSE : TRUE);
+ if (grab)
+ CGDisplayHideCursor(kCGDirectMainDisplay);
+ else
+ CGDisplayShowCursor(kCGDirectMainDisplay);
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXMouseEventQueue_nWarpCursor(JNIEnv *env, jclass unused, jint x, jint y) {
+ CGPoint p;
+ p.x = x;
+ p.y = y;
+ CGWarpMouseCursorPosition(p);
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXMouseEventQueue_getMouseDeltas(JNIEnv *env, jclass unused, jobject delta_buffer) {
+ CGMouseDelta dx, dy;
+ CGGetLastMouseDelta(&dx, &dy);
+ int buffer_length = (*env)->GetDirectBufferCapacity(env, delta_buffer);
+ if (buffer_length != 2) {
+ printfDebugJava(env, "Delta buffer not large enough!");
+ return;
+ }
+ jint *buffer = (*env)->GetDirectBufferAddress(env, delta_buffer);
+ buffer[0] = dx;
+ buffer[1] = dy;
+}
diff --git a/src/native/macosx/org_lwjgl_opengl_Display.m b/src/native/macosx/org_lwjgl_opengl_Display.m
index cfd9e2f..ee836c5 100644
--- a/src/native/macosx/org_lwjgl_opengl_Display.m
+++ b/src/native/macosx/org_lwjgl_opengl_Display.m
@@ -1,78 +1,78 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: org_lwjgl_opengl_Display.m 3055 2008-04-30 14:58:47Z elias_naur $
- *
- * Mac OS X specific display functions.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3055 $
- */
-
-#import <Cocoa/Cocoa.h>
-#import <Carbon/Carbon.h>
-#import <jawt_md.h>
-#import <jni.h>
-#import <unistd.h>
-//#import "display.h"
-#import "common_tools.h"
-#import "org_lwjgl_opengl_MacOSXDisplay.h"
-#import "org_lwjgl_MacOSXSysImplementation.h"
-
-#define WAIT_DELAY 100
-
-JNIEXPORT jint JNICALL Java_org_lwjgl_DefaultSysImplementation_getJNIVersion
- (JNIEnv *env, jobject ignored) {
- return org_lwjgl_MacOSXSysImplementation_JNI_VERSION;
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_restoreGamma(JNIEnv *env, jobject this) {
- CGDisplayRestoreColorSyncSettings();
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_setGammaRamp(JNIEnv *env, jobject this, jobject gamma_buffer) {
- const CGGammaValue *values = (*env)->GetDirectBufferAddress(env, gamma_buffer);
- CGTableCount table_size = (*env)->GetDirectBufferCapacity(env, gamma_buffer);
- CGDisplayErr err = CGSetDisplayTransferByTable(kCGDirectMainDisplay, table_size, values, values, values);
- if (err != CGDisplayNoErr) {
- throwException(env, "Could not set display gamma");
- }
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_nHideUI(JNIEnv *env, jobject this, jboolean hide) {
- if (hide == JNI_TRUE) {
- SetSystemUIMode(kUIModeContentSuppressed, 0);
- } else {
- SetSystemUIMode(kUIModeNormal, 0);
- }
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: org_lwjgl_opengl_Display.m 3055 2008-04-30 14:58:47Z elias_naur $
+ *
+ * Mac OS X specific display functions.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3055 $
+ */
+
+#import <Cocoa/Cocoa.h>
+#import <Carbon/Carbon.h>
+#import <jawt_md.h>
+#import <jni.h>
+#import <unistd.h>
+//#import "display.h"
+#import "common_tools.h"
+#import "org_lwjgl_opengl_MacOSXDisplay.h"
+#import "org_lwjgl_MacOSXSysImplementation.h"
+
+#define WAIT_DELAY 100
+
+JNIEXPORT jint JNICALL Java_org_lwjgl_DefaultSysImplementation_getJNIVersion
+ (JNIEnv *env, jobject ignored) {
+ return org_lwjgl_MacOSXSysImplementation_JNI_VERSION;
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_restoreGamma(JNIEnv *env, jobject this) {
+ CGDisplayRestoreColorSyncSettings();
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_setGammaRamp(JNIEnv *env, jobject this, jobject gamma_buffer) {
+ const CGGammaValue *values = (*env)->GetDirectBufferAddress(env, gamma_buffer);
+ CGTableCount table_size = (*env)->GetDirectBufferCapacity(env, gamma_buffer);
+ CGDisplayErr err = CGSetDisplayTransferByTable(kCGDirectMainDisplay, table_size, values, values, values);
+ if (err != CGDisplayNoErr) {
+ throwException(env, "Could not set display gamma");
+ }
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_nHideUI(JNIEnv *env, jobject this, jboolean hide) {
+ if (hide == JNI_TRUE) {
+ SetSystemUIMode(kUIModeContentSuppressed, 0);
+ } else {
+ SetSystemUIMode(kUIModeNormal, 0);
+ }
+}
diff --git a/src/native/macosx/org_lwjgl_opengl_MacOSXCanvasPeerInfo.m b/src/native/macosx/org_lwjgl_opengl_MacOSXCanvasPeerInfo.m
index 4903124..d1214bd 100644
--- a/src/native/macosx/org_lwjgl_opengl_MacOSXCanvasPeerInfo.m
+++ b/src/native/macosx/org_lwjgl_opengl_MacOSXCanvasPeerInfo.m
@@ -1,56 +1,56 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: org_lwjgl_opengl_MacOSXCanvasPeerInfo.m 2985 2008-04-07 18:42:36Z matzon $
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2985 $
- */
-
-#include <jni.h>
-#include <jawt_md.h>
-#include "awt_tools.h"
-#include "org_lwjgl_opengl_MacOSXCanvasPeerInfo.h"
-#include "context.h"
-#include "common_tools.h"
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXCanvasPeerInfo_nInitHandle
- (JNIEnv *env, jclass clazz, jobject lock_buffer_handle, jobject peer_info_handle) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- MacOSXPeerInfo *peer_info = (MacOSXPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
- AWTSurfaceLock *surface = (AWTSurfaceLock *)(*env)->GetDirectBufferAddress(env, lock_buffer_handle);
- JAWT_MacOSXDrawingSurfaceInfo *macosx_dsi = (JAWT_MacOSXDrawingSurfaceInfo *)surface->dsi->platformInfo;
- peer_info->nsview = macosx_dsi->cocoaViewRef;
- peer_info->window = true;
- [pool release];
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: org_lwjgl_opengl_MacOSXCanvasPeerInfo.m 2985 2008-04-07 18:42:36Z matzon $
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2985 $
+ */
+
+#include <jni.h>
+#include <jawt_md.h>
+#include "awt_tools.h"
+#include "org_lwjgl_opengl_MacOSXCanvasPeerInfo.h"
+#include "context.h"
+#include "common_tools.h"
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXCanvasPeerInfo_nInitHandle
+ (JNIEnv *env, jclass clazz, jobject lock_buffer_handle, jobject peer_info_handle) {
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ MacOSXPeerInfo *peer_info = (MacOSXPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
+ AWTSurfaceLock *surface = (AWTSurfaceLock *)(*env)->GetDirectBufferAddress(env, lock_buffer_handle);
+ JAWT_MacOSXDrawingSurfaceInfo *macosx_dsi = (JAWT_MacOSXDrawingSurfaceInfo *)surface->dsi->platformInfo;
+ peer_info->nsview = macosx_dsi->cocoaViewRef;
+ peer_info->window = true;
+ [pool release];
+}
diff --git a/src/native/macosx/org_lwjgl_opengl_MacOSXContextImplementation.m b/src/native/macosx/org_lwjgl_opengl_MacOSXContextImplementation.m
index 7f13e1c..662d615 100644
--- a/src/native/macosx/org_lwjgl_opengl_MacOSXContextImplementation.m
+++ b/src/native/macosx/org_lwjgl_opengl_MacOSXContextImplementation.m
@@ -1,157 +1,157 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: org_lwjgl_opengl_MacOSXContextImplementation.m 3116 2008-08-19 16:46:03Z spasi $
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3116 $
- */
-
-#import <jni.h>
-#import <Cocoa/Cocoa.h>
-#import "org_lwjgl_opengl_MacOSXContextImplementation.h"
-#import "context.h"
-#import "common_tools.h"
-
-typedef struct {
- NSOpenGLContext *context;
-} MacOSXContext;
-
-JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_nCreate
- (JNIEnv *env, jclass clazz, jobject peer_info_handle, jobject attribs, jobject shared_context_handle) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- MacOSXPeerInfo *peer_info;
- MacOSXContext *shared_context_info;
- MacOSXContext *context_info;
- NSOpenGLContext *context;
- NSOpenGLContext *shared_context = NULL;
- jobject context_handle = newJavaManagedByteBuffer(env, sizeof(MacOSXContext));
- if (context_handle == NULL) {
- throwException(env, "Could not create handle buffer");
- return NULL;
- }
- peer_info = (MacOSXPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
- if (shared_context_handle != NULL) {
- shared_context_info = (MacOSXContext *)(*env)->GetDirectBufferAddress(env, shared_context_handle);
- shared_context = shared_context_info->context;
- }
- context = [[NSOpenGLContext alloc] initWithFormat:peer_info->pixel_format shareContext:shared_context];
- if (context == NULL) {
- throwException(env, "Could not create context");
- return NULL;
- }
- context_info = (MacOSXContext *)(*env)->GetDirectBufferAddress(env, context_handle);
- context_info->context = context;
- [pool release];
- return context_handle;
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_nSwapBuffers
- (JNIEnv *env, jclass clazz, jobject context_handle) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- MacOSXContext *peer_info = (MacOSXContext *)(*env)->GetDirectBufferAddress(env, context_handle);
- [peer_info->context flushBuffer];
- [pool release];
-}
-
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_nUpdate
- (JNIEnv *env, jclass clazz, jobject context_handle) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- MacOSXContext *context_info = (MacOSXContext *)(*env)->GetDirectBufferAddress(env, context_handle);
- [context_info->context update];
- [pool release];
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_clearDrawable
- (JNIEnv *env, jclass clazz, jobject context_handle) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- MacOSXContext *context_info = (MacOSXContext *)(*env)->GetDirectBufferAddress(env, context_handle);
- [context_info->context clearDrawable];
- [pool release];
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_nReleaseCurrentContext
- (JNIEnv *env, jclass clazz) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- [NSOpenGLContext clearCurrentContext];
- [pool release];
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_setView
- (JNIEnv *env, jclass clazz, jobject peer_info_handle, jobject context_handle) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- MacOSXContext *context_info = (MacOSXContext *)(*env)->GetDirectBufferAddress(env, context_handle);
- MacOSXPeerInfo *peer_info = (MacOSXPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
- if (peer_info->window) {
- [context_info->context setView: peer_info->nsview];
- } else {
- [context_info->context setPixelBuffer:peer_info->pbuffer cubeMapFace:0 mipMapLevel:0 currentVirtualScreen:0];
- }
- [pool release];
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_nMakeCurrent
- (JNIEnv *env, jclass clazz, jobject context_handle) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- MacOSXContext *context_info = (MacOSXContext *)(*env)->GetDirectBufferAddress(env, context_handle);
- [context_info->context makeCurrentContext];
- [pool release];
-}
-
-JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_nIsCurrent
- (JNIEnv *env, jclass clazz, jobject context_handle) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- MacOSXContext *context_info = (MacOSXContext *)(*env)->GetDirectBufferAddress(env, context_handle);
- bool result = context_info->context == [NSOpenGLContext currentContext];
- [pool release];
- return result ? JNI_TRUE : JNI_FALSE;
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_nSetSwapInterval
- (JNIEnv *env, jclass clazz, jobject context_handle, jint int_value) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- MacOSXContext *context_info = (MacOSXContext *)(*env)->GetDirectBufferAddress(env, context_handle);
- GLint value = int_value;
- [context_info->context setValues:&value forParameter:NSOpenGLCPSwapInterval];
- [pool release];
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_nDestroy
- (JNIEnv *env, jclass clazz, jobject context_handle) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- MacOSXContext *context_info = (MacOSXContext *)(*env)->GetDirectBufferAddress(env, context_handle);
- [context_info->context clearDrawable];
- [context_info->context release];
- [pool release];
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: org_lwjgl_opengl_MacOSXContextImplementation.m 3116 2008-08-19 16:46:03Z spasi $
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3116 $
+ */
+
+#import <jni.h>
+#import <Cocoa/Cocoa.h>
+#import "org_lwjgl_opengl_MacOSXContextImplementation.h"
+#import "context.h"
+#import "common_tools.h"
+
+typedef struct {
+ NSOpenGLContext *context;
+} MacOSXContext;
+
+JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_nCreate
+ (JNIEnv *env, jclass clazz, jobject peer_info_handle, jobject attribs, jobject shared_context_handle) {
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ MacOSXPeerInfo *peer_info;
+ MacOSXContext *shared_context_info;
+ MacOSXContext *context_info;
+ NSOpenGLContext *context;
+ NSOpenGLContext *shared_context = NULL;
+ jobject context_handle = newJavaManagedByteBuffer(env, sizeof(MacOSXContext));
+ if (context_handle == NULL) {
+ throwException(env, "Could not create handle buffer");
+ return NULL;
+ }
+ peer_info = (MacOSXPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
+ if (shared_context_handle != NULL) {
+ shared_context_info = (MacOSXContext *)(*env)->GetDirectBufferAddress(env, shared_context_handle);
+ shared_context = shared_context_info->context;
+ }
+ context = [[NSOpenGLContext alloc] initWithFormat:peer_info->pixel_format shareContext:shared_context];
+ if (context == NULL) {
+ throwException(env, "Could not create context");
+ return NULL;
+ }
+ context_info = (MacOSXContext *)(*env)->GetDirectBufferAddress(env, context_handle);
+ context_info->context = context;
+ [pool release];
+ return context_handle;
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_nSwapBuffers
+ (JNIEnv *env, jclass clazz, jobject context_handle) {
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ MacOSXContext *peer_info = (MacOSXContext *)(*env)->GetDirectBufferAddress(env, context_handle);
+ [peer_info->context flushBuffer];
+ [pool release];
+}
+
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_nUpdate
+ (JNIEnv *env, jclass clazz, jobject context_handle) {
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ MacOSXContext *context_info = (MacOSXContext *)(*env)->GetDirectBufferAddress(env, context_handle);
+ [context_info->context update];
+ [pool release];
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_clearDrawable
+ (JNIEnv *env, jclass clazz, jobject context_handle) {
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ MacOSXContext *context_info = (MacOSXContext *)(*env)->GetDirectBufferAddress(env, context_handle);
+ [context_info->context clearDrawable];
+ [pool release];
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_nReleaseCurrentContext
+ (JNIEnv *env, jclass clazz) {
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ [NSOpenGLContext clearCurrentContext];
+ [pool release];
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_setView
+ (JNIEnv *env, jclass clazz, jobject peer_info_handle, jobject context_handle) {
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ MacOSXContext *context_info = (MacOSXContext *)(*env)->GetDirectBufferAddress(env, context_handle);
+ MacOSXPeerInfo *peer_info = (MacOSXPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
+ if (peer_info->window) {
+ [context_info->context setView: peer_info->nsview];
+ } else {
+ [context_info->context setPixelBuffer:peer_info->pbuffer cubeMapFace:0 mipMapLevel:0 currentVirtualScreen:0];
+ }
+ [pool release];
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_nMakeCurrent
+ (JNIEnv *env, jclass clazz, jobject context_handle) {
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ MacOSXContext *context_info = (MacOSXContext *)(*env)->GetDirectBufferAddress(env, context_handle);
+ [context_info->context makeCurrentContext];
+ [pool release];
+}
+
+JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_nIsCurrent
+ (JNIEnv *env, jclass clazz, jobject context_handle) {
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ MacOSXContext *context_info = (MacOSXContext *)(*env)->GetDirectBufferAddress(env, context_handle);
+ bool result = context_info->context == [NSOpenGLContext currentContext];
+ [pool release];
+ return result ? JNI_TRUE : JNI_FALSE;
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_nSetSwapInterval
+ (JNIEnv *env, jclass clazz, jobject context_handle, jint int_value) {
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ MacOSXContext *context_info = (MacOSXContext *)(*env)->GetDirectBufferAddress(env, context_handle);
+ GLint value = int_value;
+ [context_info->context setValues:&value forParameter:NSOpenGLCPSwapInterval];
+ [pool release];
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_nDestroy
+ (JNIEnv *env, jclass clazz, jobject context_handle) {
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ MacOSXContext *context_info = (MacOSXContext *)(*env)->GetDirectBufferAddress(env, context_handle);
+ [context_info->context clearDrawable];
+ [context_info->context release];
+ [pool release];
+}
diff --git a/src/native/macosx/org_lwjgl_opengl_MacOSXPbufferPeerInfo.m b/src/native/macosx/org_lwjgl_opengl_MacOSXPbufferPeerInfo.m
index affd641..cfc1302 100644
--- a/src/native/macosx/org_lwjgl_opengl_MacOSXPbufferPeerInfo.m
+++ b/src/native/macosx/org_lwjgl_opengl_MacOSXPbufferPeerInfo.m
@@ -1,78 +1,78 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: org_lwjgl_opengl_MacOSXPbufferPeerInfo.m 2985 2008-04-07 18:42:36Z matzon $
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2985 $
- */
-
-#import <jni.h>
-#import <Cocoa/Cocoa.h>
-#import "org_lwjgl_opengl_MacOSXPbufferPeerInfo.h"
-#import "context.h"
-#import "common_tools.h"
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXPbufferPeerInfo_nCreate(JNIEnv *env, jclass clazz, jobject peer_info_handle, jint width, jint height) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- NSOpenGLPixelBuffer *pbuffer = nil;
- // check if the texture is power of 2
- if ( (( width > 0 ) && ( width & ( width-1)) == 0) || (( height > 0 ) && ( height & ( height-1)) == 0) )
- {
- pbuffer = [[NSOpenGLPixelBuffer alloc] initWithTextureTarget:GL_TEXTURE_2D
- textureInternalFormat:GL_RGBA
- textureMaxMipMapLevel:0
- pixelsWide:width
- pixelsHigh:height];
- }
- else
- {
- pbuffer = [[NSOpenGLPixelBuffer alloc] initWithTextureTarget:GL_TEXTURE_RECTANGLE_EXT
- textureInternalFormat:GL_RGBA
- textureMaxMipMapLevel:0
- pixelsWide:width
- pixelsHigh:height];
- }
- MacOSXPeerInfo *peer_info = (MacOSXPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
- peer_info->pbuffer = pbuffer;
- peer_info->window = false;
- [pool release];
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXPbufferPeerInfo_nDestroy
- (JNIEnv *env, jclass clazz, jobject peer_info_handle) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- MacOSXPeerInfo *peer_info = (MacOSXPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
- [peer_info->pbuffer release];
- [pool release];
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: org_lwjgl_opengl_MacOSXPbufferPeerInfo.m 2985 2008-04-07 18:42:36Z matzon $
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2985 $
+ */
+
+#import <jni.h>
+#import <Cocoa/Cocoa.h>
+#import "org_lwjgl_opengl_MacOSXPbufferPeerInfo.h"
+#import "context.h"
+#import "common_tools.h"
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXPbufferPeerInfo_nCreate(JNIEnv *env, jclass clazz, jobject peer_info_handle, jint width, jint height) {
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ NSOpenGLPixelBuffer *pbuffer = nil;
+ // check if the texture is power of 2
+ if ( (( width > 0 ) && ( width & ( width-1)) == 0) || (( height > 0 ) && ( height & ( height-1)) == 0) )
+ {
+ pbuffer = [[NSOpenGLPixelBuffer alloc] initWithTextureTarget:GL_TEXTURE_2D
+ textureInternalFormat:GL_RGBA
+ textureMaxMipMapLevel:0
+ pixelsWide:width
+ pixelsHigh:height];
+ }
+ else
+ {
+ pbuffer = [[NSOpenGLPixelBuffer alloc] initWithTextureTarget:GL_TEXTURE_RECTANGLE_EXT
+ textureInternalFormat:GL_RGBA
+ textureMaxMipMapLevel:0
+ pixelsWide:width
+ pixelsHigh:height];
+ }
+ MacOSXPeerInfo *peer_info = (MacOSXPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
+ peer_info->pbuffer = pbuffer;
+ peer_info->window = false;
+ [pool release];
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXPbufferPeerInfo_nDestroy
+ (JNIEnv *env, jclass clazz, jobject peer_info_handle) {
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ MacOSXPeerInfo *peer_info = (MacOSXPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
+ [peer_info->pbuffer release];
+ [pool release];
+}
diff --git a/src/native/macosx/org_lwjgl_opengl_MacOSXPeerInfo.m b/src/native/macosx/org_lwjgl_opengl_MacOSXPeerInfo.m
index 6ccd2c9..0acc731 100644
--- a/src/native/macosx/org_lwjgl_opengl_MacOSXPeerInfo.m
+++ b/src/native/macosx/org_lwjgl_opengl_MacOSXPeerInfo.m
@@ -1,73 +1,73 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: org_lwjgl_opengl_MacOSXPeerInfo.m 2985 2008-04-07 18:42:36Z matzon $
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2985 $
- */
-
-#import <jni.h>
-#import <Cocoa/Cocoa.h>
-#import "org_lwjgl_opengl_MacOSXPeerInfo.h"
-#import "context.h"
-#import "common_tools.h"
-
-JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_MacOSXPeerInfo_createHandle
- (JNIEnv *env, jclass clazz) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- jobject handle = newJavaManagedByteBuffer(env, sizeof(MacOSXPeerInfo));
- [pool release];
- return handle;
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXPeerInfo_nChoosePixelFormat
- (JNIEnv *env, jclass clazz, jobject peer_info_handle, jobject pixel_format, jboolean use_display_bpp, jboolean support_window, jboolean support_pbuffer, jboolean double_buffered) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- MacOSXPeerInfo *peer_info = (MacOSXPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
- NSOpenGLPixelFormat *macosx_pixel_format = choosePixelFormat(env, pixel_format, use_display_bpp, support_window, support_pbuffer, double_buffered);
- if (pixel_format == nil) {
- throwException(env, "Could not find pixel format");
- return;
- }
- peer_info->pixel_format = macosx_pixel_format;
- [pool release];
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXPeerInfo_nDestroy
- (JNIEnv *env, jclass clazz, jobject peer_info_handle) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- MacOSXPeerInfo *peer_info = (MacOSXPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
- [peer_info->pixel_format release];
- [pool release];
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: org_lwjgl_opengl_MacOSXPeerInfo.m 2985 2008-04-07 18:42:36Z matzon $
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2985 $
+ */
+
+#import <jni.h>
+#import <Cocoa/Cocoa.h>
+#import "org_lwjgl_opengl_MacOSXPeerInfo.h"
+#import "context.h"
+#import "common_tools.h"
+
+JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_MacOSXPeerInfo_createHandle
+ (JNIEnv *env, jclass clazz) {
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ jobject handle = newJavaManagedByteBuffer(env, sizeof(MacOSXPeerInfo));
+ [pool release];
+ return handle;
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXPeerInfo_nChoosePixelFormat
+ (JNIEnv *env, jclass clazz, jobject peer_info_handle, jobject pixel_format, jboolean use_display_bpp, jboolean support_window, jboolean support_pbuffer, jboolean double_buffered) {
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ MacOSXPeerInfo *peer_info = (MacOSXPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
+ NSOpenGLPixelFormat *macosx_pixel_format = choosePixelFormat(env, pixel_format, use_display_bpp, support_window, support_pbuffer, double_buffered);
+ if (pixel_format == nil) {
+ throwException(env, "Could not find pixel format");
+ return;
+ }
+ peer_info->pixel_format = macosx_pixel_format;
+ [pool release];
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXPeerInfo_nDestroy
+ (JNIEnv *env, jclass clazz, jobject peer_info_handle) {
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ MacOSXPeerInfo *peer_info = (MacOSXPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
+ [peer_info->pixel_format release];
+ [pool release];
+}
diff --git a/src/native/windows/LWJGL.c b/src/native/windows/LWJGL.c
index 9999f1b..6960bef 100644
--- a/src/native/windows/LWJGL.c
+++ b/src/native/windows/LWJGL.c
@@ -1,65 +1,65 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: LWJGL.c 2985 2008-04-07 18:42:36Z matzon $
- *
- * Basic DLL stub.
- *
- * @author cix_foo <cix_foo at users.sourceforge.net>
- * @version $Revision: 2985 $
- */
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <stdio.h>
-#include <jni.h>
-#include "org_lwjgl_opengl_WindowsDisplay.h"
-
-HINSTANCE dll_handle;
-
-/*
- * DLL entry point for Windows. Called when Java loads the .dll
- */
-BOOL WINAPI DllMain(
- HINSTANCE hinstDLL, // handle to DLL module
- DWORD fdwReason, // reason for calling function
- LPVOID lpvReserved // reserved
- )
-{
- dll_handle = hinstDLL;
- return TRUE; // Success
-}
-
-JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_getDllInstance(JNIEnv *env, jclass unused) {
- return (LONG_PTR)dll_handle;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: LWJGL.c 2985 2008-04-07 18:42:36Z matzon $
+ *
+ * Basic DLL stub.
+ *
+ * @author cix_foo <cix_foo at users.sourceforge.net>
+ * @version $Revision: 2985 $
+ */
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <stdio.h>
+#include <jni.h>
+#include "org_lwjgl_opengl_WindowsDisplay.h"
+
+HINSTANCE dll_handle;
+
+/*
+ * DLL entry point for Windows. Called when Java loads the .dll
+ */
+BOOL WINAPI DllMain(
+ HINSTANCE hinstDLL, // handle to DLL module
+ DWORD fdwReason, // reason for calling function
+ LPVOID lpvReserved // reserved
+ )
+{
+ dll_handle = hinstDLL;
+ return TRUE; // Success
+}
+
+JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_getDllInstance(JNIEnv *env, jclass unused) {
+ return (LONG_PTR)dll_handle;
+}
diff --git a/src/native/windows/Window.h b/src/native/windows/Window.h
index cdcabc5..7164698 100644
--- a/src/native/windows/Window.h
+++ b/src/native/windows/Window.h
@@ -1,65 +1,65 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: Window.h 3227 2009-07-07 19:47:55Z matzon $
- *
- * Include file to access public window features
- *
- * @author cix_foo <cix_foo at users.sourceforge.net>
- * @version $Revision: 3227 $
- */
-#ifndef _LWJGL_WINDOW_H_INCLUDED_
- #define _LWJGL_WINDOW_H_INCLUDED_
-
- #define WIN32_LEAN_AND_MEAN
- #ifndef _WIN32_WINDOWS
- #define _WIN32_WINDOWS 0x0500
- #endif
- #ifndef WINVER
- #define WINVER 0x0500
- #endif
- #ifndef _WIN32_WINNT
- #define _WIN32_WINNT 0x0400
- #endif
-
- #include <windows.h>
- #include <jni.h>
- #include "common_tools.h"
-
- #ifdef _PRIVATE_WINDOW_H_
- #define WINDOW_H_API
- #else
- #define WINDOW_H_API extern
- #endif /* _PRIVATE_WINDOW_H_ */
-
-#endif /* _LWJGL_WINDOW_H_INCLUDED_ */
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: Window.h 3227 2009-07-07 19:47:55Z matzon $
+ *
+ * Include file to access public window features
+ *
+ * @author cix_foo <cix_foo at users.sourceforge.net>
+ * @version $Revision: 3227 $
+ */
+#ifndef _LWJGL_WINDOW_H_INCLUDED_
+ #define _LWJGL_WINDOW_H_INCLUDED_
+
+ #define WIN32_LEAN_AND_MEAN
+ #ifndef _WIN32_WINDOWS
+ #define _WIN32_WINDOWS 0x0500
+ #endif
+ #ifndef WINVER
+ #define WINVER 0x0500
+ #endif
+ #ifndef _WIN32_WINNT
+ #define _WIN32_WINNT 0x0400
+ #endif
+
+ #include <windows.h>
+ #include <jni.h>
+ #include "common_tools.h"
+
+ #ifdef _PRIVATE_WINDOW_H_
+ #define WINDOW_H_API
+ #else
+ #define WINDOW_H_API extern
+ #endif /* _PRIVATE_WINDOW_H_ */
+
+#endif /* _LWJGL_WINDOW_H_INCLUDED_ */
diff --git a/src/native/windows/context.c b/src/native/windows/context.c
index e7c65c7..e658f91 100644
--- a/src/native/windows/context.c
+++ b/src/native/windows/context.c
@@ -1,489 +1,489 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: context.c 3139 2008-10-28 09:53:16Z elias_naur $
- *
- * @author elias_naue <elias_naur at users.sourceforge.net>
- * @version $Revision: 3139 $
- */
-
-#include <malloc.h>
-#include <jni.h>
-#include "common_tools.h"
-#include "extgl.h"
-#include "extgl_wgl.h"
-#include "context.h"
-
-extern HINSTANCE dll_handle; // Handle to the LWJGL dll
-
-#define _CONTEXT_PRIVATE_CLASS_NAME "__lwjgl_context_class_name"
-
-/*
- * Register the LWJGL window class.
- * Returns true for success, or false for failure
- */
-bool registerWindow(WNDPROC win_proc, LPCTSTR class_name)
-{
- WNDCLASS windowClass;
- memset(&windowClass, 0, sizeof(windowClass));
- windowClass.style = CS_OWNDC;
- windowClass.lpfnWndProc = win_proc;
- windowClass.cbClsExtra = 0;
- windowClass.cbWndExtra = 0;
- windowClass.hInstance = dll_handle;
- windowClass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
- windowClass.hCursor = LoadCursor(NULL, IDC_ARROW);
- windowClass.hbrBackground = NULL;
- windowClass.lpszMenuName = NULL;
- windowClass.lpszClassName = class_name;
-
- if (RegisterClass(&windowClass) == 0) {
- printfDebug("Failed to register window class\n");
- return false;
- }
- return true;
-}
-
-static LRESULT CALLBACK dummyWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
- return DefWindowProc(hwnd, msg, wParam, lParam);
-}
-
-bool applyPixelFormat(JNIEnv *env, HDC hdc, int iPixelFormat) {
- PIXELFORMATDESCRIPTOR desc;
- if (DescribePixelFormat(hdc, iPixelFormat, sizeof(PIXELFORMATDESCRIPTOR), &desc) == 0) {
- throwFormattedException(env, "DescribePixelFormat failed (%d)", GetLastError());
- return false;
- }
-
- // make that the pixel format of the device context
- if (SetPixelFormat(hdc, iPixelFormat, &desc) == FALSE) {
- throwFormattedException(env, "SetPixelFormat failed (%d)", GetLastError());
- return false;
- }
- return true;
-}
-
-/*
- * Close the window
- */
-void closeWindow(HWND *hwnd, HDC *hdc)
-{
- // Release device context
- if (*hdc != NULL && *hwnd != NULL) {
- ReleaseDC(*hwnd, *hdc);
- *hdc = NULL;
- }
-
- // Close the window
- if (*hwnd != NULL) {
- ShowWindow(*hwnd, SW_HIDE);
- DestroyWindow(*hwnd);
- *hwnd = NULL;
- }
-}
-
-void getWindowFlags(DWORD *windowflags_return, DWORD *exstyle_return, bool undecorated, bool child_window) {
- DWORD exstyle, windowflags;
- if (undecorated) {
- exstyle = WS_EX_APPWINDOW;
- windowflags = WS_POPUP;
- } else if (child_window) {
- exstyle = 0;
- windowflags = WS_CHILDWINDOW;
- } else {
- exstyle = WS_EX_APPWINDOW;
- windowflags = WS_OVERLAPPED | WS_BORDER | WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU;
- }
- windowflags = windowflags | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
- *windowflags_return = windowflags;
- *exstyle_return = exstyle;
-}
-
-HWND createWindow(LPCTSTR window_class_name, int x, int y, int width, int height, bool undecorated, bool child_window, HWND parent)
-{
- RECT clientSize;
- DWORD exstyle, windowflags;
- HWND new_hwnd;
-
- getWindowFlags(&windowflags, &exstyle, undecorated, child_window);
-
- clientSize.bottom = height;
- clientSize.left = 0;
- clientSize.right = width;
- clientSize.top = 0;
-
- AdjustWindowRectEx(
- &clientSize, // client-rectangle structure
- windowflags, // window styles
- FALSE, // menu-present option
- exstyle // extended window style
- );
- // Create the window now, using that class:
- new_hwnd = CreateWindowEx (
- exstyle,
- window_class_name,
- "",
- windowflags,
- x, y, clientSize.right - clientSize.left, clientSize.bottom - clientSize.top,
- parent,
- NULL,
- dll_handle,
- NULL);
-
- return new_hwnd;
-}
-
-static int convertToBPE(int bpp) {
- int bpe;
- switch (bpp) {
- case 0:
- bpe = 0;
- break;
- case 32:
- case 24:
- bpe = 8;
- break;
- case 16: /* Fall through */
- default:
- bpe = 4;
- break;
- }
- return bpe;
-}
-
-static int findPixelFormatARBFromBPP(JNIEnv *env, HDC hdc, WGLExtensions *extensions, jobject pixel_format, jobject pixelFormatCaps, int bpp, bool window, bool pbuffer, bool double_buffer) {
- jclass cls_pixel_format = (*env)->GetObjectClass(env, pixel_format);
- int alpha = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "alpha", "I"));
- int depth = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "depth", "I"));
- int stencil = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "stencil", "I"));
- int samples = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "samples", "I"));
- int num_aux_buffers = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "num_aux_buffers", "I"));
- int accum_bpp = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "accum_bpp", "I"));
- int accum_alpha = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "accum_alpha", "I"));
-
- jboolean stereo = (*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "stereo", "Z"));
- jboolean floating_point = (*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "floating_point", "Z"));
- jboolean floating_point_packed = (*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "floating_point_packed", "Z"));
- jboolean sRGB = (*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "sRGB", "Z"));
-
- int pixel_type;
- int iPixelFormat;
- unsigned int num_formats_returned;
- attrib_list_t attrib_list;
- GLuint *pixelFormatCaps_ptr;
- jlong pixelFormatCapsSize;
- BOOL result;
- jlong i;
- int bpe = convertToBPE(bpp);
-
- if ( floating_point )
- pixel_type = WGL_TYPE_RGBA_FLOAT_ARB;
- else if ( floating_point_packed )
- pixel_type = WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT;
- else
- pixel_type = WGL_TYPE_RGBA_ARB;
-
- initAttribList(&attrib_list);
- if (window) {
- putAttrib(&attrib_list, WGL_DRAW_TO_WINDOW_ARB); putAttrib(&attrib_list, TRUE);
- }
- if (pbuffer) {
- putAttrib(&attrib_list, WGL_DRAW_TO_PBUFFER_ARB); putAttrib(&attrib_list, TRUE);
- }
- if (!getBooleanProperty(env, "org.lwjgl.opengl.Display.allowSoftwareOpenGL"))
- putAttrib(&attrib_list, WGL_ACCELERATION_ARB); putAttrib(&attrib_list, WGL_FULL_ACCELERATION_ARB);
- putAttrib(&attrib_list, WGL_PIXEL_TYPE_ARB); putAttrib(&attrib_list, pixel_type);
- putAttrib(&attrib_list, WGL_DOUBLE_BUFFER_ARB); putAttrib(&attrib_list, double_buffer ? TRUE : FALSE);
- putAttrib(&attrib_list, WGL_SUPPORT_OPENGL_ARB); putAttrib(&attrib_list, TRUE);
- putAttrib(&attrib_list, WGL_RED_BITS_ARB); putAttrib(&attrib_list, bpe);
- putAttrib(&attrib_list, WGL_GREEN_BITS_ARB); putAttrib(&attrib_list, bpe);
- putAttrib(&attrib_list, WGL_BLUE_BITS_ARB); putAttrib(&attrib_list, bpe);
- putAttrib(&attrib_list, WGL_ALPHA_BITS_ARB); putAttrib(&attrib_list, alpha);
- putAttrib(&attrib_list, WGL_DEPTH_BITS_ARB); putAttrib(&attrib_list, depth);
- putAttrib(&attrib_list, WGL_STENCIL_BITS_ARB); putAttrib(&attrib_list, stencil);
- // Assume caller checked extension availability
- if (samples > 0) {
- putAttrib(&attrib_list, WGL_SAMPLE_BUFFERS_ARB); putAttrib(&attrib_list, 1);
- putAttrib(&attrib_list, WGL_SAMPLES_ARB); putAttrib(&attrib_list, samples);
- }
- putAttrib(&attrib_list, WGL_ACCUM_BITS_ARB); putAttrib(&attrib_list, accum_bpp);
- putAttrib(&attrib_list, WGL_ACCUM_ALPHA_BITS_ARB); putAttrib(&attrib_list, accum_alpha);
- putAttrib(&attrib_list, WGL_STEREO_ARB); putAttrib(&attrib_list, stereo ? TRUE : FALSE);
- putAttrib(&attrib_list, WGL_AUX_BUFFERS_ARB); putAttrib(&attrib_list, num_aux_buffers);
- if (sRGB) {
- putAttrib(&attrib_list, WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB); putAttrib(&attrib_list, TRUE);
- }
-
- // Assume caller checked extension availability
- if (pixelFormatCaps != NULL) {
- pixelFormatCaps_ptr = (GLuint *)(*env)->GetDirectBufferAddress(env, pixelFormatCaps);
- pixelFormatCapsSize = (*env)->GetDirectBufferCapacity(env, pixelFormatCaps);
-
- for (i = 0; i < pixelFormatCapsSize; i++)
- putAttrib(&attrib_list, pixelFormatCaps_ptr[i]);
- }
- putAttrib(&attrib_list, 0); putAttrib(&attrib_list, 0);
- result = extensions->wglChoosePixelFormatARB(hdc, attrib_list.attribs, NULL, 1, &iPixelFormat, &num_formats_returned);
-
- if (result == FALSE || num_formats_returned < 1) {
- throwFormattedException(env, "Failed to find ARB pixel format %d %d\n", result, num_formats_returned);
- return -1;
- }
- return iPixelFormat;
-}
-
-static int findPixelFormatARB(JNIEnv *env, HDC hdc, WGLExtensions *extensions, jobject pixel_format, jobject pixelFormatCaps, bool use_hdc_bpp, bool window, bool pbuffer, bool double_buffer) {
- int bpp;
- int iPixelFormat;
- int fallback_bpp = 16;
- jclass cls_pixel_format = (*env)->GetObjectClass(env, pixel_format);
- if (use_hdc_bpp) {
- bpp = GetDeviceCaps(hdc, BITSPIXEL);
- iPixelFormat = findPixelFormatARBFromBPP(env, hdc, extensions, pixel_format, pixelFormatCaps, bpp, window, pbuffer, double_buffer);
- if ((*env)->ExceptionOccurred(env)) {
- (*env)->ExceptionClear(env);
- printfDebugJava(env, "Failed to find ARB pixel format with HDC depth %d, falling back to %d\n", bpp, fallback_bpp);
- bpp = fallback_bpp;
- } else
- return iPixelFormat;
- } else
- bpp = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "bpp", "I"));
- return findPixelFormatARBFromBPP(env, hdc, extensions, pixel_format, pixelFormatCaps, bpp, window, pbuffer, double_buffer);
-}
-
-/*
- * Find an appropriate pixel format
- */
-static int findPixelFormatFromBPP(JNIEnv *env, HDC hdc, jobject pixel_format, int bpp, bool double_buffer)
-{
- jclass cls_pixel_format = (*env)->GetObjectClass(env, pixel_format);
- int alpha = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "alpha", "I"));
- int depth = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "depth", "I"));
- int stencil = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "stencil", "I"));
- int num_aux_buffers = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "num_aux_buffers", "I"));
- int accum_bpp = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "accum_bpp", "I"));
- int accum_alpha = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "accum_alpha", "I"));
- jboolean stereo = (*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "stereo", "Z"));
- unsigned int flags = PFD_DRAW_TO_WINDOW | // support window
- PFD_SUPPORT_OPENGL |
- (double_buffer ? PFD_DOUBLEBUFFER : 0) |
- (stereo ? PFD_STEREO : 0);
- PIXELFORMATDESCRIPTOR desc;
- int iPixelFormat;
- PIXELFORMATDESCRIPTOR pfd = {
- sizeof(PIXELFORMATDESCRIPTOR), // size of this pfd
- 1, // version number
- flags, // RGBA type
- PFD_TYPE_RGBA,
- (BYTE)bpp,
- 0, 0, 0, 0, 0, 0, // color bits ignored
- (BYTE)alpha,
- 0, // shift bit ignored
- accum_bpp + accum_alpha, // no accumulation buffer
- 0, 0, 0, 0, // accum bits ignored
- (BYTE)depth,
- (BYTE)stencil,
- num_aux_buffers,
- PFD_MAIN_PLANE, // main layer
- 0, // reserved
- 0, 0, 0 // layer masks ignored
- };
- // get the best available match of pixel format for the device context
- iPixelFormat = ChoosePixelFormat(hdc, &pfd);
- if (iPixelFormat == 0) {
- throwException(env, "Failed to choose pixel format");
- return -1;
- }
-
- if (DescribePixelFormat(hdc, iPixelFormat, sizeof(PIXELFORMATDESCRIPTOR), &desc) == 0) {
- throwException(env, "Could not describe pixel format");
- return -1;
- }
-
- if (desc.cColorBits < bpp) {
- throwException(env, "Insufficient color precision");
- return -1;
- }
-
- if (desc.cAlphaBits < alpha) {
- throwException(env, "Insufficient alpha precision");
- return -1;
- }
-
- if (desc.cStencilBits < stencil) {
- throwException(env, "Insufficient stencil precision");
- return -1;
- }
-
- if (desc.cDepthBits < depth) {
- throwException(env, "Insufficient depth buffer precision");
- return -1;
- }
-
- if ((desc.dwFlags & PFD_GENERIC_FORMAT) != 0) {
- jboolean allowSoftwareOpenGL = getBooleanProperty(env, "org.lwjgl.opengl.Display.allowSoftwareOpenGL");
- // secondary check for software override
- if(!allowSoftwareOpenGL) {
- throwException(env, "Pixel format not accelerated");
- return -1;
- }
- }
-
- if ((desc.dwFlags & flags) != flags) {
- throwException(env, "Capabilities not supported");
- return -1;
- }
- return iPixelFormat;
-}
-
-static int findPixelFormatDefault(JNIEnv *env, HDC hdc, jobject pixel_format, bool use_hdc_bpp, bool double_buffer) {
- int bpp;
- int iPixelFormat;
- int fallback_bpp = 16;
- jclass cls_pixel_format = (*env)->GetObjectClass(env, pixel_format);
- if (use_hdc_bpp) {
- bpp = GetDeviceCaps(hdc, BITSPIXEL);
- iPixelFormat = findPixelFormatFromBPP(env, hdc, pixel_format, bpp, double_buffer);
- if ((*env)->ExceptionOccurred(env)) {
- (*env)->ExceptionClear(env);
- printfDebugJava(env, "Failed to find pixel format with HDC depth %d, falling back to %d\n", bpp, fallback_bpp);
- bpp = fallback_bpp;
- } else
- return iPixelFormat;
- } else
- bpp = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "bpp", "I"));
- return findPixelFormatFromBPP(env, hdc, pixel_format, bpp, double_buffer);
-}
-
-static bool validateAndGetExtensions(JNIEnv *env, WGLExtensions *extensions, HDC dummy_hdc, HGLRC dummy_hglrc, int samples, bool floating_point, bool floating_point_packed, bool sRGB, jobject pixelFormatCaps) {
- if (!wglMakeCurrent(dummy_hdc, dummy_hglrc)) {
- throwException(env, "Could not bind context to dummy window");
- return false;
- }
- extgl_InitWGL(extensions);
-
- if (!extensions->WGL_ARB_pixel_format) {
- throwException(env, "No support for WGL_ARB_pixel_format");
- return false;
- }
- if (samples > 0 && !extensions->WGL_ARB_multisample) {
- throwException(env, "No support for WGL_ARB_multisample");
- return false;
- }
- /*
- * Apparently, some drivers don't report WGL_ARB_pixel_format_float
- * even though GL_ARB_color_buffer_float and WGL_ATI_color_format_float
- * is supported.
- */
- if (floating_point && !(extensions->WGL_ARB_pixel_format_float || extensions->WGL_ATI_pixel_format_float)) {
- throwException(env, "No support for WGL_ARB_pixel_format_float nor WGL_ATI_pixel_format_float");
- return false;
- }
- if (floating_point_packed && !(extensions->WGL_EXT_pixel_format_packed_float)) {
- throwException(env, "No support for WGL_EXT_pixel_format_packed_float");
- return false;
- }
- if (sRGB && !(extensions->WGL_ARB_framebuffer_sRGB)) {
- throwException(env, "No support for WGL_ARB_framebuffer_sRGB");
- return false;
- }
- if (pixelFormatCaps != NULL && !extensions->WGL_ARB_render_texture) {
- throwException(env, "No support for WGL_ARB_render_texture");
- return false;
- }
- return true;
-}
-
-int findPixelFormatOnDC(JNIEnv *env, HDC hdc, int origin_x, int origin_y, jobject pixel_format, jobject pixelFormatCaps, bool use_hdc_bpp, bool window, bool pbuffer, bool double_buffer) {
- HGLRC dummy_hglrc;
- HDC saved_current_hdc;
- HGLRC saved_current_hglrc;
- WGLExtensions extensions;
- HWND dummy_hwnd;
- HDC dummy_hdc;
- int pixel_format_id;
- jclass cls_pixel_format = (*env)->GetObjectClass(env, pixel_format);
-
- int samples = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "samples", "I"));
- bool floating_point = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "floating_point", "Z"));
- bool floating_point_packed = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "floating_point_packed", "Z"));
- bool sRGB = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "sRGB", "Z"));
- bool use_arb_selection = samples > 0 || floating_point || floating_point_packed || sRGB || pbuffer || pixelFormatCaps != NULL;
-
- pixel_format_id = findPixelFormatDefault(env, hdc, pixel_format, use_hdc_bpp, double_buffer);
- if (!(*env)->ExceptionOccurred(env) && use_arb_selection) {
- dummy_hwnd = createDummyWindow(origin_x, origin_y);
- if (dummy_hwnd == NULL) {
- throwException(env, "Could not create dummy window");
- return -1;
- }
- dummy_hdc = GetDC(dummy_hwnd);
- if (!applyPixelFormat(env, dummy_hdc, pixel_format_id)) {
- closeWindow(&dummy_hwnd, &dummy_hdc);
- return -1;
- }
- dummy_hglrc = wglCreateContext(dummy_hdc);
- if (dummy_hglrc == NULL) {
- closeWindow(&dummy_hwnd, &dummy_hdc);
- throwException(env, "Failed to create OpenGL rendering context");
- return -1;
- }
- // Save the current HDC and HGLRC to avoid disruption
- saved_current_hdc = wglGetCurrentDC();
- saved_current_hglrc = wglGetCurrentContext();
- if (validateAndGetExtensions(env, &extensions, dummy_hdc, dummy_hglrc, samples, floating_point, floating_point_packed, sRGB, pixelFormatCaps)) {
- pixel_format_id = findPixelFormatARB(env, hdc, &extensions, pixel_format, pixelFormatCaps, use_hdc_bpp, window, pbuffer, double_buffer);
- }
- wglMakeCurrent(saved_current_hdc, saved_current_hglrc);
- wglDeleteContext(dummy_hglrc);
- closeWindow(&dummy_hwnd, &dummy_hdc);
- }
- return pixel_format_id;
-}
-
-static bool registerDummyWindow() {
- static bool window_registered = false;
- if (!window_registered) {
- if (!registerWindow(dummyWindowProc, _CONTEXT_PRIVATE_CLASS_NAME)) {
- return false;
- }
- window_registered = true;
- }
- return true;
-}
-
-HWND createDummyWindow(int origin_x, int origin_y) {
- if (!registerDummyWindow())
- return NULL;
- return createWindow(_CONTEXT_PRIVATE_CLASS_NAME, origin_x, origin_y, 1, 1, false, false, NULL);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: context.c 3139 2008-10-28 09:53:16Z elias_naur $
+ *
+ * @author elias_naue <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3139 $
+ */
+
+#include <malloc.h>
+#include <jni.h>
+#include "common_tools.h"
+#include "extgl.h"
+#include "extgl_wgl.h"
+#include "context.h"
+
+extern HINSTANCE dll_handle; // Handle to the LWJGL dll
+
+#define _CONTEXT_PRIVATE_CLASS_NAME "__lwjgl_context_class_name"
+
+/*
+ * Register the LWJGL window class.
+ * Returns true for success, or false for failure
+ */
+bool registerWindow(WNDPROC win_proc, LPCTSTR class_name)
+{
+ WNDCLASS windowClass;
+ memset(&windowClass, 0, sizeof(windowClass));
+ windowClass.style = CS_OWNDC;
+ windowClass.lpfnWndProc = win_proc;
+ windowClass.cbClsExtra = 0;
+ windowClass.cbWndExtra = 0;
+ windowClass.hInstance = dll_handle;
+ windowClass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
+ windowClass.hCursor = LoadCursor(NULL, IDC_ARROW);
+ windowClass.hbrBackground = NULL;
+ windowClass.lpszMenuName = NULL;
+ windowClass.lpszClassName = class_name;
+
+ if (RegisterClass(&windowClass) == 0) {
+ printfDebug("Failed to register window class\n");
+ return false;
+ }
+ return true;
+}
+
+static LRESULT CALLBACK dummyWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
+ return DefWindowProc(hwnd, msg, wParam, lParam);
+}
+
+bool applyPixelFormat(JNIEnv *env, HDC hdc, int iPixelFormat) {
+ PIXELFORMATDESCRIPTOR desc;
+ if (DescribePixelFormat(hdc, iPixelFormat, sizeof(PIXELFORMATDESCRIPTOR), &desc) == 0) {
+ throwFormattedException(env, "DescribePixelFormat failed (%d)", GetLastError());
+ return false;
+ }
+
+ // make that the pixel format of the device context
+ if (SetPixelFormat(hdc, iPixelFormat, &desc) == FALSE) {
+ throwFormattedException(env, "SetPixelFormat failed (%d)", GetLastError());
+ return false;
+ }
+ return true;
+}
+
+/*
+ * Close the window
+ */
+void closeWindow(HWND *hwnd, HDC *hdc)
+{
+ // Release device context
+ if (*hdc != NULL && *hwnd != NULL) {
+ ReleaseDC(*hwnd, *hdc);
+ *hdc = NULL;
+ }
+
+ // Close the window
+ if (*hwnd != NULL) {
+ ShowWindow(*hwnd, SW_HIDE);
+ DestroyWindow(*hwnd);
+ *hwnd = NULL;
+ }
+}
+
+void getWindowFlags(DWORD *windowflags_return, DWORD *exstyle_return, bool undecorated, bool child_window) {
+ DWORD exstyle, windowflags;
+ if (undecorated) {
+ exstyle = WS_EX_APPWINDOW;
+ windowflags = WS_POPUP;
+ } else if (child_window) {
+ exstyle = 0;
+ windowflags = WS_CHILDWINDOW;
+ } else {
+ exstyle = WS_EX_APPWINDOW;
+ windowflags = WS_OVERLAPPED | WS_BORDER | WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU;
+ }
+ windowflags = windowflags | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
+ *windowflags_return = windowflags;
+ *exstyle_return = exstyle;
+}
+
+HWND createWindow(LPCTSTR window_class_name, int x, int y, int width, int height, bool undecorated, bool child_window, HWND parent)
+{
+ RECT clientSize;
+ DWORD exstyle, windowflags;
+ HWND new_hwnd;
+
+ getWindowFlags(&windowflags, &exstyle, undecorated, child_window);
+
+ clientSize.bottom = height;
+ clientSize.left = 0;
+ clientSize.right = width;
+ clientSize.top = 0;
+
+ AdjustWindowRectEx(
+ &clientSize, // client-rectangle structure
+ windowflags, // window styles
+ FALSE, // menu-present option
+ exstyle // extended window style
+ );
+ // Create the window now, using that class:
+ new_hwnd = CreateWindowEx (
+ exstyle,
+ window_class_name,
+ "",
+ windowflags,
+ x, y, clientSize.right - clientSize.left, clientSize.bottom - clientSize.top,
+ parent,
+ NULL,
+ dll_handle,
+ NULL);
+
+ return new_hwnd;
+}
+
+static int convertToBPE(int bpp) {
+ int bpe;
+ switch (bpp) {
+ case 0:
+ bpe = 0;
+ break;
+ case 32:
+ case 24:
+ bpe = 8;
+ break;
+ case 16: /* Fall through */
+ default:
+ bpe = 4;
+ break;
+ }
+ return bpe;
+}
+
+static int findPixelFormatARBFromBPP(JNIEnv *env, HDC hdc, WGLExtensions *extensions, jobject pixel_format, jobject pixelFormatCaps, int bpp, bool window, bool pbuffer, bool double_buffer) {
+ jclass cls_pixel_format = (*env)->GetObjectClass(env, pixel_format);
+ int alpha = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "alpha", "I"));
+ int depth = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "depth", "I"));
+ int stencil = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "stencil", "I"));
+ int samples = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "samples", "I"));
+ int num_aux_buffers = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "num_aux_buffers", "I"));
+ int accum_bpp = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "accum_bpp", "I"));
+ int accum_alpha = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "accum_alpha", "I"));
+
+ jboolean stereo = (*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "stereo", "Z"));
+ jboolean floating_point = (*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "floating_point", "Z"));
+ jboolean floating_point_packed = (*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "floating_point_packed", "Z"));
+ jboolean sRGB = (*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "sRGB", "Z"));
+
+ int pixel_type;
+ int iPixelFormat;
+ unsigned int num_formats_returned;
+ attrib_list_t attrib_list;
+ GLuint *pixelFormatCaps_ptr;
+ jlong pixelFormatCapsSize;
+ BOOL result;
+ jlong i;
+ int bpe = convertToBPE(bpp);
+
+ if ( floating_point )
+ pixel_type = WGL_TYPE_RGBA_FLOAT_ARB;
+ else if ( floating_point_packed )
+ pixel_type = WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT;
+ else
+ pixel_type = WGL_TYPE_RGBA_ARB;
+
+ initAttribList(&attrib_list);
+ if (window) {
+ putAttrib(&attrib_list, WGL_DRAW_TO_WINDOW_ARB); putAttrib(&attrib_list, TRUE);
+ }
+ if (pbuffer) {
+ putAttrib(&attrib_list, WGL_DRAW_TO_PBUFFER_ARB); putAttrib(&attrib_list, TRUE);
+ }
+ if (!getBooleanProperty(env, "org.lwjgl.opengl.Display.allowSoftwareOpenGL"))
+ putAttrib(&attrib_list, WGL_ACCELERATION_ARB); putAttrib(&attrib_list, WGL_FULL_ACCELERATION_ARB);
+ putAttrib(&attrib_list, WGL_PIXEL_TYPE_ARB); putAttrib(&attrib_list, pixel_type);
+ putAttrib(&attrib_list, WGL_DOUBLE_BUFFER_ARB); putAttrib(&attrib_list, double_buffer ? TRUE : FALSE);
+ putAttrib(&attrib_list, WGL_SUPPORT_OPENGL_ARB); putAttrib(&attrib_list, TRUE);
+ putAttrib(&attrib_list, WGL_RED_BITS_ARB); putAttrib(&attrib_list, bpe);
+ putAttrib(&attrib_list, WGL_GREEN_BITS_ARB); putAttrib(&attrib_list, bpe);
+ putAttrib(&attrib_list, WGL_BLUE_BITS_ARB); putAttrib(&attrib_list, bpe);
+ putAttrib(&attrib_list, WGL_ALPHA_BITS_ARB); putAttrib(&attrib_list, alpha);
+ putAttrib(&attrib_list, WGL_DEPTH_BITS_ARB); putAttrib(&attrib_list, depth);
+ putAttrib(&attrib_list, WGL_STENCIL_BITS_ARB); putAttrib(&attrib_list, stencil);
+ // Assume caller checked extension availability
+ if (samples > 0) {
+ putAttrib(&attrib_list, WGL_SAMPLE_BUFFERS_ARB); putAttrib(&attrib_list, 1);
+ putAttrib(&attrib_list, WGL_SAMPLES_ARB); putAttrib(&attrib_list, samples);
+ }
+ putAttrib(&attrib_list, WGL_ACCUM_BITS_ARB); putAttrib(&attrib_list, accum_bpp);
+ putAttrib(&attrib_list, WGL_ACCUM_ALPHA_BITS_ARB); putAttrib(&attrib_list, accum_alpha);
+ putAttrib(&attrib_list, WGL_STEREO_ARB); putAttrib(&attrib_list, stereo ? TRUE : FALSE);
+ putAttrib(&attrib_list, WGL_AUX_BUFFERS_ARB); putAttrib(&attrib_list, num_aux_buffers);
+ if (sRGB) {
+ putAttrib(&attrib_list, WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB); putAttrib(&attrib_list, TRUE);
+ }
+
+ // Assume caller checked extension availability
+ if (pixelFormatCaps != NULL) {
+ pixelFormatCaps_ptr = (GLuint *)(*env)->GetDirectBufferAddress(env, pixelFormatCaps);
+ pixelFormatCapsSize = (*env)->GetDirectBufferCapacity(env, pixelFormatCaps);
+
+ for (i = 0; i < pixelFormatCapsSize; i++)
+ putAttrib(&attrib_list, pixelFormatCaps_ptr[i]);
+ }
+ putAttrib(&attrib_list, 0); putAttrib(&attrib_list, 0);
+ result = extensions->wglChoosePixelFormatARB(hdc, attrib_list.attribs, NULL, 1, &iPixelFormat, &num_formats_returned);
+
+ if (result == FALSE || num_formats_returned < 1) {
+ throwFormattedException(env, "Failed to find ARB pixel format %d %d\n", result, num_formats_returned);
+ return -1;
+ }
+ return iPixelFormat;
+}
+
+static int findPixelFormatARB(JNIEnv *env, HDC hdc, WGLExtensions *extensions, jobject pixel_format, jobject pixelFormatCaps, bool use_hdc_bpp, bool window, bool pbuffer, bool double_buffer) {
+ int bpp;
+ int iPixelFormat;
+ int fallback_bpp = 16;
+ jclass cls_pixel_format = (*env)->GetObjectClass(env, pixel_format);
+ if (use_hdc_bpp) {
+ bpp = GetDeviceCaps(hdc, BITSPIXEL);
+ iPixelFormat = findPixelFormatARBFromBPP(env, hdc, extensions, pixel_format, pixelFormatCaps, bpp, window, pbuffer, double_buffer);
+ if ((*env)->ExceptionOccurred(env)) {
+ (*env)->ExceptionClear(env);
+ printfDebugJava(env, "Failed to find ARB pixel format with HDC depth %d, falling back to %d\n", bpp, fallback_bpp);
+ bpp = fallback_bpp;
+ } else
+ return iPixelFormat;
+ } else
+ bpp = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "bpp", "I"));
+ return findPixelFormatARBFromBPP(env, hdc, extensions, pixel_format, pixelFormatCaps, bpp, window, pbuffer, double_buffer);
+}
+
+/*
+ * Find an appropriate pixel format
+ */
+static int findPixelFormatFromBPP(JNIEnv *env, HDC hdc, jobject pixel_format, int bpp, bool double_buffer)
+{
+ jclass cls_pixel_format = (*env)->GetObjectClass(env, pixel_format);
+ int alpha = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "alpha", "I"));
+ int depth = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "depth", "I"));
+ int stencil = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "stencil", "I"));
+ int num_aux_buffers = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "num_aux_buffers", "I"));
+ int accum_bpp = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "accum_bpp", "I"));
+ int accum_alpha = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "accum_alpha", "I"));
+ jboolean stereo = (*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "stereo", "Z"));
+ unsigned int flags = PFD_DRAW_TO_WINDOW | // support window
+ PFD_SUPPORT_OPENGL |
+ (double_buffer ? PFD_DOUBLEBUFFER : 0) |
+ (stereo ? PFD_STEREO : 0);
+ PIXELFORMATDESCRIPTOR desc;
+ int iPixelFormat;
+ PIXELFORMATDESCRIPTOR pfd = {
+ sizeof(PIXELFORMATDESCRIPTOR), // size of this pfd
+ 1, // version number
+ flags, // RGBA type
+ PFD_TYPE_RGBA,
+ (BYTE)bpp,
+ 0, 0, 0, 0, 0, 0, // color bits ignored
+ (BYTE)alpha,
+ 0, // shift bit ignored
+ accum_bpp + accum_alpha, // no accumulation buffer
+ 0, 0, 0, 0, // accum bits ignored
+ (BYTE)depth,
+ (BYTE)stencil,
+ num_aux_buffers,
+ PFD_MAIN_PLANE, // main layer
+ 0, // reserved
+ 0, 0, 0 // layer masks ignored
+ };
+ // get the best available match of pixel format for the device context
+ iPixelFormat = ChoosePixelFormat(hdc, &pfd);
+ if (iPixelFormat == 0) {
+ throwException(env, "Failed to choose pixel format");
+ return -1;
+ }
+
+ if (DescribePixelFormat(hdc, iPixelFormat, sizeof(PIXELFORMATDESCRIPTOR), &desc) == 0) {
+ throwException(env, "Could not describe pixel format");
+ return -1;
+ }
+
+ if (desc.cColorBits < bpp) {
+ throwException(env, "Insufficient color precision");
+ return -1;
+ }
+
+ if (desc.cAlphaBits < alpha) {
+ throwException(env, "Insufficient alpha precision");
+ return -1;
+ }
+
+ if (desc.cStencilBits < stencil) {
+ throwException(env, "Insufficient stencil precision");
+ return -1;
+ }
+
+ if (desc.cDepthBits < depth) {
+ throwException(env, "Insufficient depth buffer precision");
+ return -1;
+ }
+
+ if ((desc.dwFlags & PFD_GENERIC_FORMAT) != 0) {
+ jboolean allowSoftwareOpenGL = getBooleanProperty(env, "org.lwjgl.opengl.Display.allowSoftwareOpenGL");
+ // secondary check for software override
+ if(!allowSoftwareOpenGL) {
+ throwException(env, "Pixel format not accelerated");
+ return -1;
+ }
+ }
+
+ if ((desc.dwFlags & flags) != flags) {
+ throwException(env, "Capabilities not supported");
+ return -1;
+ }
+ return iPixelFormat;
+}
+
+static int findPixelFormatDefault(JNIEnv *env, HDC hdc, jobject pixel_format, bool use_hdc_bpp, bool double_buffer) {
+ int bpp;
+ int iPixelFormat;
+ int fallback_bpp = 16;
+ jclass cls_pixel_format = (*env)->GetObjectClass(env, pixel_format);
+ if (use_hdc_bpp) {
+ bpp = GetDeviceCaps(hdc, BITSPIXEL);
+ iPixelFormat = findPixelFormatFromBPP(env, hdc, pixel_format, bpp, double_buffer);
+ if ((*env)->ExceptionOccurred(env)) {
+ (*env)->ExceptionClear(env);
+ printfDebugJava(env, "Failed to find pixel format with HDC depth %d, falling back to %d\n", bpp, fallback_bpp);
+ bpp = fallback_bpp;
+ } else
+ return iPixelFormat;
+ } else
+ bpp = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "bpp", "I"));
+ return findPixelFormatFromBPP(env, hdc, pixel_format, bpp, double_buffer);
+}
+
+static bool validateAndGetExtensions(JNIEnv *env, WGLExtensions *extensions, HDC dummy_hdc, HGLRC dummy_hglrc, int samples, bool floating_point, bool floating_point_packed, bool sRGB, jobject pixelFormatCaps) {
+ if (!wglMakeCurrent(dummy_hdc, dummy_hglrc)) {
+ throwException(env, "Could not bind context to dummy window");
+ return false;
+ }
+ extgl_InitWGL(extensions);
+
+ if (!extensions->WGL_ARB_pixel_format) {
+ throwException(env, "No support for WGL_ARB_pixel_format");
+ return false;
+ }
+ if (samples > 0 && !extensions->WGL_ARB_multisample) {
+ throwException(env, "No support for WGL_ARB_multisample");
+ return false;
+ }
+ /*
+ * Apparently, some drivers don't report WGL_ARB_pixel_format_float
+ * even though GL_ARB_color_buffer_float and WGL_ATI_color_format_float
+ * is supported.
+ */
+ if (floating_point && !(extensions->WGL_ARB_pixel_format_float || extensions->WGL_ATI_pixel_format_float)) {
+ throwException(env, "No support for WGL_ARB_pixel_format_float nor WGL_ATI_pixel_format_float");
+ return false;
+ }
+ if (floating_point_packed && !(extensions->WGL_EXT_pixel_format_packed_float)) {
+ throwException(env, "No support for WGL_EXT_pixel_format_packed_float");
+ return false;
+ }
+ if (sRGB && !(extensions->WGL_ARB_framebuffer_sRGB)) {
+ throwException(env, "No support for WGL_ARB_framebuffer_sRGB");
+ return false;
+ }
+ if (pixelFormatCaps != NULL && !extensions->WGL_ARB_render_texture) {
+ throwException(env, "No support for WGL_ARB_render_texture");
+ return false;
+ }
+ return true;
+}
+
+int findPixelFormatOnDC(JNIEnv *env, HDC hdc, int origin_x, int origin_y, jobject pixel_format, jobject pixelFormatCaps, bool use_hdc_bpp, bool window, bool pbuffer, bool double_buffer) {
+ HGLRC dummy_hglrc;
+ HDC saved_current_hdc;
+ HGLRC saved_current_hglrc;
+ WGLExtensions extensions;
+ HWND dummy_hwnd;
+ HDC dummy_hdc;
+ int pixel_format_id;
+ jclass cls_pixel_format = (*env)->GetObjectClass(env, pixel_format);
+
+ int samples = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "samples", "I"));
+ bool floating_point = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "floating_point", "Z"));
+ bool floating_point_packed = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "floating_point_packed", "Z"));
+ bool sRGB = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "sRGB", "Z"));
+ bool use_arb_selection = samples > 0 || floating_point || floating_point_packed || sRGB || pbuffer || pixelFormatCaps != NULL;
+
+ pixel_format_id = findPixelFormatDefault(env, hdc, pixel_format, use_hdc_bpp, double_buffer);
+ if (!(*env)->ExceptionOccurred(env) && use_arb_selection) {
+ dummy_hwnd = createDummyWindow(origin_x, origin_y);
+ if (dummy_hwnd == NULL) {
+ throwException(env, "Could not create dummy window");
+ return -1;
+ }
+ dummy_hdc = GetDC(dummy_hwnd);
+ if (!applyPixelFormat(env, dummy_hdc, pixel_format_id)) {
+ closeWindow(&dummy_hwnd, &dummy_hdc);
+ return -1;
+ }
+ dummy_hglrc = wglCreateContext(dummy_hdc);
+ if (dummy_hglrc == NULL) {
+ closeWindow(&dummy_hwnd, &dummy_hdc);
+ throwException(env, "Failed to create OpenGL rendering context");
+ return -1;
+ }
+ // Save the current HDC and HGLRC to avoid disruption
+ saved_current_hdc = wglGetCurrentDC();
+ saved_current_hglrc = wglGetCurrentContext();
+ if (validateAndGetExtensions(env, &extensions, dummy_hdc, dummy_hglrc, samples, floating_point, floating_point_packed, sRGB, pixelFormatCaps)) {
+ pixel_format_id = findPixelFormatARB(env, hdc, &extensions, pixel_format, pixelFormatCaps, use_hdc_bpp, window, pbuffer, double_buffer);
+ }
+ wglMakeCurrent(saved_current_hdc, saved_current_hglrc);
+ wglDeleteContext(dummy_hglrc);
+ closeWindow(&dummy_hwnd, &dummy_hdc);
+ }
+ return pixel_format_id;
+}
+
+static bool registerDummyWindow() {
+ static bool window_registered = false;
+ if (!window_registered) {
+ if (!registerWindow(dummyWindowProc, _CONTEXT_PRIVATE_CLASS_NAME)) {
+ return false;
+ }
+ window_registered = true;
+ }
+ return true;
+}
+
+HWND createDummyWindow(int origin_x, int origin_y) {
+ if (!registerDummyWindow())
+ return NULL;
+ return createWindow(_CONTEXT_PRIVATE_CLASS_NAME, origin_x, origin_y, 1, 1, false, false, NULL);
+}
diff --git a/src/native/windows/context.h b/src/native/windows/context.h
index 8f513c1..fb1b4a2 100644
--- a/src/native/windows/context.h
+++ b/src/native/windows/context.h
@@ -1,96 +1,96 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: context.h 3139 2008-10-28 09:53:16Z elias_naur $
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3139 $
- */
-
-#ifndef __LWJGL_CONTEXT_H
-#define __LWJGL_CONTEXT_H
-
-#include <windows.h>
-#include <jni.h>
-#include "common_tools.h"
-#include "extgl.h"
-#include "extgl_wgl.h"
-
-typedef struct {
- union {
- HWND hwnd;
- struct {
- HPBUFFERARB pbuffer;
- // Contains the function pointers that
- // created the pbuffer
- WGLExtensions extensions;
- } pbuffer;
- } u;
- HDC drawable_hdc;
-} WindowsPeerInfo;
-
-/*
- * Register the LWJGL window class.
- * Returns true for success, or false for failure
- */
-extern bool registerWindow();
-
-extern bool applyPixelFormat(JNIEnv *env, HDC hdc, int iPixelFormat);
-
-/*
- * Close the window
- */
-extern void closeWindow(HWND *hwnd, HDC *hdc);
-
-/**
- * Create a dummy window suitable to create contexts from
- */
-extern HWND createDummyWindow(int x, int y);
-
-/**
- * Return appropriate window and extended style flags from the given fullscreen and undecorated property
- */
-extern void getWindowFlags(DWORD *windowflags_return, DWORD *exstyle_return, bool undecorated, bool child_window);
-
-/*
- * Create a window with the specified position, size, and
- * fullscreen attribute. The window will have DirectInput associated
- * with it.
- *
- * Returns true for success, or false for failure
- */
-extern HWND createWindow(LPCTSTR window_class_name, int x, int y, int width, int height, bool undecorated, bool child_window, HWND parent);
-
-extern int findPixelFormatOnDC(JNIEnv *env, HDC hdc, int origin_x, int origin_y, jobject pixel_format, jobject pixelFormatCaps, bool use_hdc_bpp, bool window, bool pbuffer, bool double_buffer);
-
-#endif
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: context.h 3139 2008-10-28 09:53:16Z elias_naur $
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3139 $
+ */
+
+#ifndef __LWJGL_CONTEXT_H
+#define __LWJGL_CONTEXT_H
+
+#include <windows.h>
+#include <jni.h>
+#include "common_tools.h"
+#include "extgl.h"
+#include "extgl_wgl.h"
+
+typedef struct {
+ union {
+ HWND hwnd;
+ struct {
+ HPBUFFERARB pbuffer;
+ // Contains the function pointers that
+ // created the pbuffer
+ WGLExtensions extensions;
+ } pbuffer;
+ } u;
+ HDC drawable_hdc;
+} WindowsPeerInfo;
+
+/*
+ * Register the LWJGL window class.
+ * Returns true for success, or false for failure
+ */
+extern bool registerWindow();
+
+extern bool applyPixelFormat(JNIEnv *env, HDC hdc, int iPixelFormat);
+
+/*
+ * Close the window
+ */
+extern void closeWindow(HWND *hwnd, HDC *hdc);
+
+/**
+ * Create a dummy window suitable to create contexts from
+ */
+extern HWND createDummyWindow(int x, int y);
+
+/**
+ * Return appropriate window and extended style flags from the given fullscreen and undecorated property
+ */
+extern void getWindowFlags(DWORD *windowflags_return, DWORD *exstyle_return, bool undecorated, bool child_window);
+
+/*
+ * Create a window with the specified position, size, and
+ * fullscreen attribute. The window will have DirectInput associated
+ * with it.
+ *
+ * Returns true for success, or false for failure
+ */
+extern HWND createWindow(LPCTSTR window_class_name, int x, int y, int width, int height, bool undecorated, bool child_window, HWND parent);
+
+extern int findPixelFormatOnDC(JNIEnv *env, HDC hdc, int origin_x, int origin_y, jobject pixel_format, jobject pixelFormatCaps, bool use_hdc_bpp, bool window, bool pbuffer, bool double_buffer);
+
+#endif
diff --git a/src/native/windows/display.c b/src/native/windows/display.c
index a858745..50b8319 100644
--- a/src/native/windows/display.c
+++ b/src/native/windows/display.c
@@ -1,277 +1,277 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: display.c 2985 2008-04-07 18:42:36Z matzon $
- *
- * Windows specific library for display handling.
- *
- * @author cix_foo <cix_foo at users.sourceforge.net>
- * @version $Revision: 2985 $
- */
-
-#include <windows.h>
-#include <jni.h>
-#include "org_lwjgl_opengl_WindowsDisplay.h"
-#include "display.h"
-#include "common_tools.h"
-
-static jobject createDisplayMode(JNIEnv *env, DEVMODE *devmode) {
- jclass displayModeClass;
-
- jmethodID displayModeConstructor;
-
- displayModeClass = (*env)->FindClass(env, "org/lwjgl/opengl/DisplayMode");
- if (displayModeClass == NULL)
- return NULL;
- displayModeConstructor = (*env)->GetMethodID(env, displayModeClass, "<init>", "(IIII)V");
- if (displayModeConstructor == NULL)
- return NULL;
-
- return (*env)->NewObject(env, displayModeClass, displayModeConstructor,
- devmode->dmPelsWidth, devmode->dmPelsHeight,
- devmode->dmBitsPerPel, devmode->dmDisplayFrequency);
-}
-
-/**
- * Choose displaymodes using extended codepath (multiple displaydevices)
- */
-jobjectArray getAvailableDisplayModes(JNIEnv * env) {
-
- int i = 0, j = 0, n = 0;
-
-// DISPLAY_DEVICE DisplayDevice;
- DEVMODE DevMode;
- jobject *display_mode_objects = NULL;
- int list_size = 0;
-
- jclass displayModeClass;
- jobjectArray ret;
- displayModeClass = (*env)->FindClass(env, "org/lwjgl/opengl/DisplayMode");
-
- ZeroMemory(&DevMode, sizeof(DEVMODE));
-// ZeroMemory(&DisplayDevice, sizeof(DISPLAY_DEVICE));
-
- DevMode.dmSize = sizeof(DEVMODE);
-// DisplayDevice.cb = sizeof(DISPLAY_DEVICE);
-
- /* Multi-monitor stuff commented out since we're only really interested in the primary monitor */
-/* while(EnumDisplayDevices(NULL, i++, &DisplayDevice, 0) != 0) {
- // continue if mirroring device
- if((DisplayDevice.StateFlags & DISPLAY_DEVICE_MIRRORING_DRIVER) != 0) {
- continue;
- }
-
- j = 0;
- while(EnumDisplaySettings((const char *) DisplayDevice.DeviceName, j++, &DevMode) != 0) {*/
- while(EnumDisplaySettings(NULL, j++, &DevMode) != 0) {
- // Filter out indexed modes
- if (DevMode.dmBitsPerPel > 8 && ChangeDisplaySettings(&DevMode, CDS_FULLSCREEN | CDS_TEST) == DISP_CHANGE_SUCCESSFUL) {
- jobject displayMode;
- if (list_size <= n) {
- list_size += 1;
- display_mode_objects = (jobject *)realloc(display_mode_objects, sizeof(jobject)*list_size);
- if (display_mode_objects == NULL)
- return NULL;
- }
- displayMode = createDisplayMode(env, &DevMode);
- display_mode_objects[n++] = displayMode;
- }
- }
-// }
- printfDebugJava(env, "Found %d displaymodes", n);
-
- ret = (*env)->NewObjectArray(env, n, displayModeClass, NULL);
- for (i = 0; i < n; i++) {
- (*env)->SetObjectArrayElement(env, ret, i, display_mode_objects[i]);
- }
- free(display_mode_objects);
- return ret;
-}
-
-void switchDisplayMode(JNIEnv * env, jobject mode) {
- DEVMODE devmode;
-
- jclass cls_displayMode = (*env)->GetObjectClass(env, mode);
- jfieldID fid_width = (*env)->GetFieldID(env, cls_displayMode, "width", "I");
- jfieldID fid_height = (*env)->GetFieldID(env, cls_displayMode, "height", "I");
- jfieldID fid_bpp = (*env)->GetFieldID(env, cls_displayMode, "bpp", "I");
- jfieldID fid_freq = (*env)->GetFieldID(env, cls_displayMode, "freq", "I");
-
- int width = (*env)->GetIntField(env, mode, fid_width);
- int height = (*env)->GetIntField(env, mode, fid_height);
- int bpp = (*env)->GetIntField(env, mode, fid_bpp);
- int freq = (*env)->GetIntField(env, mode, fid_freq);
- LONG cdsret;
-
- ZeroMemory(&devmode, sizeof(DEVMODE));
- devmode.dmSize = sizeof(DEVMODE);
- devmode.dmBitsPerPel = bpp;
- devmode.dmPelsWidth = width;
- devmode.dmPelsHeight = height;
- devmode.dmDisplayFrequency = freq;
- devmode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
- if (freq != 0)
- devmode.dmFields |= DM_DISPLAYFREQUENCY;
- cdsret = ChangeDisplaySettings(&devmode, CDS_FULLSCREEN);
-
- if (cdsret != DISP_CHANGE_SUCCESSFUL) {
- /* What's the proper way to do this multiply with 2 thing, if at all necessary? */
-/* // Failed: so let's check to see if it's a wierd dual screen display
- printfDebugJava(env, "Failed to set display mode (%ld) ... assuming dual monitors", cdsret);
- devmode.dmPelsWidth = width * 2;
- cdsret = ChangeDisplaySettings(&devmode, CDS_FULLSCREEN);
-
- if (cdsret != DISP_CHANGE_SUCCESSFUL) {
- printfDebugJava(env, "Failed to set display mode using dual monitors (%ld)", cdsret);*/
- throwFormattedException(env, "Failed to set display mode (%ld).", cdsret);
- return;
-// }
- }
-}
-
-static jobject createNativeGammaBuffer(JNIEnv *env) {
- return newJavaManagedByteBuffer(env, sizeof(WORD)*3*org_lwjgl_opengl_WindowsDisplay_GAMMA_LENGTH);
-}
-
-jobject getCurrentGammaRamp(JNIEnv *env) {
- jobject gamma_buffer;
- WORD *gamma;
- HDC screenDC;
-
- gamma_buffer = createNativeGammaBuffer(env);
- if (gamma_buffer == NULL)
- return NULL;
- gamma = (WORD *)(*env)->GetDirectBufferAddress(env, gamma_buffer);
-
- // Get the screen
- screenDC = GetDC(NULL);
- if (screenDC == NULL) {
- throwException(env, "Couldn't get screen DC!");
- return NULL;
- }
- // Get the default gamma ramp
- if (GetDeviceGammaRamp(screenDC, gamma) == FALSE) {
- printfDebugJava(env, "Failed to get initial device gamma");
- }
- ReleaseDC(NULL, screenDC);
- return gamma_buffer;
-}
-
-void setGammaRamp(JNIEnv * env, jobject gammaRampBuffer) {
- HDC screenDC;
- WORD *gammaRamp = (WORD *)(*env)->GetDirectBufferAddress(env, gammaRampBuffer);
-
- screenDC = GetDC(NULL);
- if (SetDeviceGammaRamp(screenDC, gammaRamp) == FALSE) {
- throwException(env, "Failed to set device gamma.");
- }
- ReleaseDC(NULL, screenDC);
-}
-
-jobject convertToNativeRamp(JNIEnv *env, jobject float_gamma_obj) {
- int i;
- float scaledRampEntry;
- WORD rampEntry;
- const float *gammaRamp = (const float *)(*env)->GetDirectBufferAddress(env, float_gamma_obj);
- jint gamma_ramp_length = (*env)->GetDirectBufferCapacity(env, float_gamma_obj);
- jobject native_ramp;
- WORD *native_ramp_buffer;
-
- native_ramp = createNativeGammaBuffer(env);
- if (native_ramp == NULL)
- return NULL;
- native_ramp_buffer = (WORD *)(*env)->GetDirectBufferAddress(env, native_ramp);
- // Turn array of floats into array of RGB WORDs
-
- for (i = 0; i < gamma_ramp_length; i++) {
- scaledRampEntry = gammaRamp[i]*0xffff;
- rampEntry = (WORD)scaledRampEntry;
- native_ramp_buffer[i] = rampEntry;
- native_ramp_buffer[i + org_lwjgl_opengl_WindowsDisplay_GAMMA_LENGTH] = rampEntry;
- native_ramp_buffer[i + 2*org_lwjgl_opengl_WindowsDisplay_GAMMA_LENGTH] = rampEntry;
- }
- return native_ramp;
-}
-
-jobject getCurrentDisplayMode(JNIEnv * env) {
- DEVMODE devmode;
- if (!EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &devmode)) {
- throwFormattedException(env, "Couldn't get current display settings (%ld)", GetLastError());
- return NULL;
- }
- return createDisplayMode(env, &devmode);
-}
-
-void resetDisplayMode(JNIEnv * env) {
- // Under Windows, all we have to do is:
- ChangeDisplaySettings(NULL, 0);
-}
-
-jobject getVersion(JNIEnv * env, char *driver)
-{
- DWORD var = 0;
- DWORD dwInfoSize;
- LPVOID lpInfoBuff;
- BOOL bRetval;
- jclass version_class;
- jmethodID version_cons;
- jobject ret = NULL;
-
- version_class = (*env)->FindClass(env, "org/lwjgl/opengl/WindowsFileVersion");
- if (version_class == NULL)
- return NULL;
- version_cons = (*env)->GetMethodID(env, version_class, "<init>", "(II)V");
- if (version_cons == NULL)
- return NULL;
-
- dwInfoSize = GetFileVersionInfoSize(driver, &var);
- lpInfoBuff = malloc(dwInfoSize);
- if (lpInfoBuff == NULL) {
- throwException(env, "Failed to allocate lpInfoBuff");
- return NULL;
- }
- bRetval = GetFileVersionInfo(driver, 0, dwInfoSize, lpInfoBuff);
- if (bRetval != 0) {
- VS_FIXEDFILEINFO * fxdFileInfo;
-
- UINT uiLen = 0;
- bRetval = VerQueryValue(lpInfoBuff, TEXT("\\"), (void *)&fxdFileInfo, &uiLen);
- if (bRetval != 0)
- ret = (*env)->NewObject(env, version_class, version_cons, fxdFileInfo->dwProductVersionMS, fxdFileInfo->dwProductVersionLS);
- }
-
- free(lpInfoBuff);
-
- return ret;
-}
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: display.c 2985 2008-04-07 18:42:36Z matzon $
+ *
+ * Windows specific library for display handling.
+ *
+ * @author cix_foo <cix_foo at users.sourceforge.net>
+ * @version $Revision: 2985 $
+ */
+
+#include <windows.h>
+#include <jni.h>
+#include "org_lwjgl_opengl_WindowsDisplay.h"
+#include "display.h"
+#include "common_tools.h"
+
+static jobject createDisplayMode(JNIEnv *env, DEVMODE *devmode) {
+ jclass displayModeClass;
+
+ jmethodID displayModeConstructor;
+
+ displayModeClass = (*env)->FindClass(env, "org/lwjgl/opengl/DisplayMode");
+ if (displayModeClass == NULL)
+ return NULL;
+ displayModeConstructor = (*env)->GetMethodID(env, displayModeClass, "<init>", "(IIII)V");
+ if (displayModeConstructor == NULL)
+ return NULL;
+
+ return (*env)->NewObject(env, displayModeClass, displayModeConstructor,
+ devmode->dmPelsWidth, devmode->dmPelsHeight,
+ devmode->dmBitsPerPel, devmode->dmDisplayFrequency);
+}
+
+/**
+ * Choose displaymodes using extended codepath (multiple displaydevices)
+ */
+jobjectArray getAvailableDisplayModes(JNIEnv * env) {
+
+ int i = 0, j = 0, n = 0;
+
+// DISPLAY_DEVICE DisplayDevice;
+ DEVMODE DevMode;
+ jobject *display_mode_objects = NULL;
+ int list_size = 0;
+
+ jclass displayModeClass;
+ jobjectArray ret;
+ displayModeClass = (*env)->FindClass(env, "org/lwjgl/opengl/DisplayMode");
+
+ ZeroMemory(&DevMode, sizeof(DEVMODE));
+// ZeroMemory(&DisplayDevice, sizeof(DISPLAY_DEVICE));
+
+ DevMode.dmSize = sizeof(DEVMODE);
+// DisplayDevice.cb = sizeof(DISPLAY_DEVICE);
+
+ /* Multi-monitor stuff commented out since we're only really interested in the primary monitor */
+/* while(EnumDisplayDevices(NULL, i++, &DisplayDevice, 0) != 0) {
+ // continue if mirroring device
+ if((DisplayDevice.StateFlags & DISPLAY_DEVICE_MIRRORING_DRIVER) != 0) {
+ continue;
+ }
+
+ j = 0;
+ while(EnumDisplaySettings((const char *) DisplayDevice.DeviceName, j++, &DevMode) != 0) {*/
+ while(EnumDisplaySettings(NULL, j++, &DevMode) != 0) {
+ // Filter out indexed modes
+ if (DevMode.dmBitsPerPel > 8 && ChangeDisplaySettings(&DevMode, CDS_FULLSCREEN | CDS_TEST) == DISP_CHANGE_SUCCESSFUL) {
+ jobject displayMode;
+ if (list_size <= n) {
+ list_size += 1;
+ display_mode_objects = (jobject *)realloc(display_mode_objects, sizeof(jobject)*list_size);
+ if (display_mode_objects == NULL)
+ return NULL;
+ }
+ displayMode = createDisplayMode(env, &DevMode);
+ display_mode_objects[n++] = displayMode;
+ }
+ }
+// }
+ printfDebugJava(env, "Found %d displaymodes", n);
+
+ ret = (*env)->NewObjectArray(env, n, displayModeClass, NULL);
+ for (i = 0; i < n; i++) {
+ (*env)->SetObjectArrayElement(env, ret, i, display_mode_objects[i]);
+ }
+ free(display_mode_objects);
+ return ret;
+}
+
+void switchDisplayMode(JNIEnv * env, jobject mode) {
+ DEVMODE devmode;
+
+ jclass cls_displayMode = (*env)->GetObjectClass(env, mode);
+ jfieldID fid_width = (*env)->GetFieldID(env, cls_displayMode, "width", "I");
+ jfieldID fid_height = (*env)->GetFieldID(env, cls_displayMode, "height", "I");
+ jfieldID fid_bpp = (*env)->GetFieldID(env, cls_displayMode, "bpp", "I");
+ jfieldID fid_freq = (*env)->GetFieldID(env, cls_displayMode, "freq", "I");
+
+ int width = (*env)->GetIntField(env, mode, fid_width);
+ int height = (*env)->GetIntField(env, mode, fid_height);
+ int bpp = (*env)->GetIntField(env, mode, fid_bpp);
+ int freq = (*env)->GetIntField(env, mode, fid_freq);
+ LONG cdsret;
+
+ ZeroMemory(&devmode, sizeof(DEVMODE));
+ devmode.dmSize = sizeof(DEVMODE);
+ devmode.dmBitsPerPel = bpp;
+ devmode.dmPelsWidth = width;
+ devmode.dmPelsHeight = height;
+ devmode.dmDisplayFrequency = freq;
+ devmode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
+ if (freq != 0)
+ devmode.dmFields |= DM_DISPLAYFREQUENCY;
+ cdsret = ChangeDisplaySettings(&devmode, CDS_FULLSCREEN);
+
+ if (cdsret != DISP_CHANGE_SUCCESSFUL) {
+ /* What's the proper way to do this multiply with 2 thing, if at all necessary? */
+/* // Failed: so let's check to see if it's a wierd dual screen display
+ printfDebugJava(env, "Failed to set display mode (%ld) ... assuming dual monitors", cdsret);
+ devmode.dmPelsWidth = width * 2;
+ cdsret = ChangeDisplaySettings(&devmode, CDS_FULLSCREEN);
+
+ if (cdsret != DISP_CHANGE_SUCCESSFUL) {
+ printfDebugJava(env, "Failed to set display mode using dual monitors (%ld)", cdsret);*/
+ throwFormattedException(env, "Failed to set display mode (%ld).", cdsret);
+ return;
+// }
+ }
+}
+
+static jobject createNativeGammaBuffer(JNIEnv *env) {
+ return newJavaManagedByteBuffer(env, sizeof(WORD)*3*org_lwjgl_opengl_WindowsDisplay_GAMMA_LENGTH);
+}
+
+jobject getCurrentGammaRamp(JNIEnv *env) {
+ jobject gamma_buffer;
+ WORD *gamma;
+ HDC screenDC;
+
+ gamma_buffer = createNativeGammaBuffer(env);
+ if (gamma_buffer == NULL)
+ return NULL;
+ gamma = (WORD *)(*env)->GetDirectBufferAddress(env, gamma_buffer);
+
+ // Get the screen
+ screenDC = GetDC(NULL);
+ if (screenDC == NULL) {
+ throwException(env, "Couldn't get screen DC!");
+ return NULL;
+ }
+ // Get the default gamma ramp
+ if (GetDeviceGammaRamp(screenDC, gamma) == FALSE) {
+ printfDebugJava(env, "Failed to get initial device gamma");
+ }
+ ReleaseDC(NULL, screenDC);
+ return gamma_buffer;
+}
+
+void setGammaRamp(JNIEnv * env, jobject gammaRampBuffer) {
+ HDC screenDC;
+ WORD *gammaRamp = (WORD *)(*env)->GetDirectBufferAddress(env, gammaRampBuffer);
+
+ screenDC = GetDC(NULL);
+ if (SetDeviceGammaRamp(screenDC, gammaRamp) == FALSE) {
+ throwException(env, "Failed to set device gamma.");
+ }
+ ReleaseDC(NULL, screenDC);
+}
+
+jobject convertToNativeRamp(JNIEnv *env, jobject float_gamma_obj) {
+ int i;
+ float scaledRampEntry;
+ WORD rampEntry;
+ const float *gammaRamp = (const float *)(*env)->GetDirectBufferAddress(env, float_gamma_obj);
+ jint gamma_ramp_length = (*env)->GetDirectBufferCapacity(env, float_gamma_obj);
+ jobject native_ramp;
+ WORD *native_ramp_buffer;
+
+ native_ramp = createNativeGammaBuffer(env);
+ if (native_ramp == NULL)
+ return NULL;
+ native_ramp_buffer = (WORD *)(*env)->GetDirectBufferAddress(env, native_ramp);
+ // Turn array of floats into array of RGB WORDs
+
+ for (i = 0; i < gamma_ramp_length; i++) {
+ scaledRampEntry = gammaRamp[i]*0xffff;
+ rampEntry = (WORD)scaledRampEntry;
+ native_ramp_buffer[i] = rampEntry;
+ native_ramp_buffer[i + org_lwjgl_opengl_WindowsDisplay_GAMMA_LENGTH] = rampEntry;
+ native_ramp_buffer[i + 2*org_lwjgl_opengl_WindowsDisplay_GAMMA_LENGTH] = rampEntry;
+ }
+ return native_ramp;
+}
+
+jobject getCurrentDisplayMode(JNIEnv * env) {
+ DEVMODE devmode;
+ if (!EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &devmode)) {
+ throwFormattedException(env, "Couldn't get current display settings (%ld)", GetLastError());
+ return NULL;
+ }
+ return createDisplayMode(env, &devmode);
+}
+
+void resetDisplayMode(JNIEnv * env) {
+ // Under Windows, all we have to do is:
+ ChangeDisplaySettings(NULL, 0);
+}
+
+jobject getVersion(JNIEnv * env, char *driver)
+{
+ DWORD var = 0;
+ DWORD dwInfoSize;
+ LPVOID lpInfoBuff;
+ BOOL bRetval;
+ jclass version_class;
+ jmethodID version_cons;
+ jobject ret = NULL;
+
+ version_class = (*env)->FindClass(env, "org/lwjgl/opengl/WindowsFileVersion");
+ if (version_class == NULL)
+ return NULL;
+ version_cons = (*env)->GetMethodID(env, version_class, "<init>", "(II)V");
+ if (version_cons == NULL)
+ return NULL;
+
+ dwInfoSize = GetFileVersionInfoSize(driver, &var);
+ lpInfoBuff = malloc(dwInfoSize);
+ if (lpInfoBuff == NULL) {
+ throwException(env, "Failed to allocate lpInfoBuff");
+ return NULL;
+ }
+ bRetval = GetFileVersionInfo(driver, 0, dwInfoSize, lpInfoBuff);
+ if (bRetval != 0) {
+ VS_FIXEDFILEINFO * fxdFileInfo;
+
+ UINT uiLen = 0;
+ bRetval = VerQueryValue(lpInfoBuff, TEXT("\\"), (void *)&fxdFileInfo, &uiLen);
+ if (bRetval != 0)
+ ret = (*env)->NewObject(env, version_class, version_cons, fxdFileInfo->dwProductVersionMS, fxdFileInfo->dwProductVersionLS);
+ }
+
+ free(lpInfoBuff);
+
+ return ret;
+}
+
diff --git a/src/native/windows/display.h b/src/native/windows/display.h
index ba0a510..53de5df 100644
--- a/src/native/windows/display.h
+++ b/src/native/windows/display.h
@@ -1,57 +1,57 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: display.h 2985 2008-04-07 18:42:36Z matzon $
- *
- * Windows specific library for display handling.
- *
- * @author cix_foo <cix_foo at users.sourceforge.net>
- * @version $Revision: 2985 $
- */
-
-#ifndef _DISPLAY_H
-#define _DISPLAY_H
-
-#include <jni.h>
-
-extern jobjectArray getAvailableDisplayModes(JNIEnv *env);
-extern void switchDisplayMode(JNIEnv * env, jobject mode);
-extern void resetDisplayMode(JNIEnv * env);
-extern void restoreDisplayMode(void);
-extern void setGammaRamp(JNIEnv * env, jobject gammaRampBuffer);
-extern jobject getCurrentGammaRamp(JNIEnv *env);
-extern jobject getCurrentDisplayMode(JNIEnv * env);
-extern jobject getVersion(JNIEnv * env, char *driver);
-extern jobject convertToNativeRamp(JNIEnv *env, jobject float_gamma_obj);
-
-#endif
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: display.h 2985 2008-04-07 18:42:36Z matzon $
+ *
+ * Windows specific library for display handling.
+ *
+ * @author cix_foo <cix_foo at users.sourceforge.net>
+ * @version $Revision: 2985 $
+ */
+
+#ifndef _DISPLAY_H
+#define _DISPLAY_H
+
+#include <jni.h>
+
+extern jobjectArray getAvailableDisplayModes(JNIEnv *env);
+extern void switchDisplayMode(JNIEnv * env, jobject mode);
+extern void resetDisplayMode(JNIEnv * env);
+extern void restoreDisplayMode(void);
+extern void setGammaRamp(JNIEnv * env, jobject gammaRampBuffer);
+extern jobject getCurrentGammaRamp(JNIEnv *env);
+extern jobject getCurrentDisplayMode(JNIEnv * env);
+extern jobject getVersion(JNIEnv * env, char *driver);
+extern jobject convertToNativeRamp(JNIEnv *env, jobject float_gamma_obj);
+
+#endif
diff --git a/src/native/windows/extgl_wgl.c b/src/native/windows/extgl_wgl.c
index 5c88289..75d8c6a 100644
--- a/src/native/windows/extgl_wgl.c
+++ b/src/native/windows/extgl_wgl.c
@@ -1,183 +1,183 @@
-/* ----------------------------------------------------------------------------
-Copyright (c) 2001-2002, Lev Povalahev
-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.
- * The name of the author 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.
-------------------------------------------------------------------------------*/
-/*
- Lev Povalahev
-
- levp at gmx.net
-
- http://www.uni-karlsruhe.de/~uli2/
-
-*/
-
-#include <stdio.h>
-#include <string.h>
-#include "extgl_wgl.h"
-#include "extgl.h"
-
-static HMODULE lib_gl_handle = NULL;
-
-void *extgl_GetProcAddress(const char *name) {
- void *t = wglGetProcAddress(name);
- if (t == NULL)
- {
- t = GetProcAddress(lib_gl_handle, name);
- if (t == NULL)
- {
- printfDebug("Could not locate symbol %s\n", name);
- }
- }
- return t;
-}
-
-bool extgl_Open(JNIEnv *env) {
- if (lib_gl_handle != NULL)
- return true;
- // load the dynamic libraries for OpenGL
- lib_gl_handle = LoadLibrary("opengl32.dll");
- if (lib_gl_handle == NULL) {
- throwException(env, "Could not load OpenGL library");
- return false;
- }
- return true;
-}
-
-void extgl_Close(void) {
- FreeLibrary(lib_gl_handle);
- lib_gl_handle = NULL;
-}
-
-/** returns true if the extension is available */
-static bool WGLQueryExtension(WGLExtensions *extensions, const char *name) {
- const GLubyte *extension_string;
-
- if (!extensions->WGL_ARB_extensions_string)
- if (!extensions->WGL_EXT_extensions_string)
- return false;
- else
- extension_string = (GLubyte*)extensions->wglGetExtensionsStringEXT();
- else
- extension_string = (GLubyte*)extensions->wglGetExtensionsStringARB(wglGetCurrentDC());
- return extgl_QueryExtension(extension_string, name);
-}
-
-static void extgl_InitWGLARBPbuffer(WGLExtensions *extensions) {
- ExtFunction functions[] = {
- {"wglCreatePbufferARB", (void *)&extensions->wglCreatePbufferARB},
- {"wglGetPbufferDCARB", (void *)&extensions->wglGetPbufferDCARB},
- {"wglReleasePbufferDCARB", (void *)&extensions->wglReleasePbufferDCARB},
- {"wglDestroyPbufferARB", (void *)&extensions->wglDestroyPbufferARB},
- {"wglQueryPbufferARB", (void *)&extensions->wglQueryPbufferARB}};
- if (extensions->WGL_ARB_pbuffer)
- extensions->WGL_ARB_pbuffer = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions);
-}
-
-static void extgl_InitWGLARBPixelFormat(WGLExtensions *extensions) {
- ExtFunction functions[] = {
- {"wglGetPixelFormatAttribivARB", (void *)&extensions->wglGetPixelFormatAttribivARB},
- {"wglGetPixelFormatAttribfvARB", (void *)&extensions->wglGetPixelFormatAttribfvARB},
- {"wglChoosePixelFormatARB", (void *)&extensions->wglChoosePixelFormatARB}};
- if (extensions->WGL_ARB_pixel_format)
- extensions->WGL_ARB_pixel_format = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions);
-}
-
-static void extgl_InitWGLARBRenderTexture(WGLExtensions *extensions) {
- ExtFunction functions[] = {
- {"wglBindTexImageARB", (void *)&extensions->wglBindTexImageARB},
- {"wglReleaseTexImageARB", (void *)&extensions->wglReleaseTexImageARB},
- {"wglSetPbufferAttribARB", (void *)&extensions->wglSetPbufferAttribARB}};
- if (extensions->WGL_ARB_render_texture)
- extensions->WGL_ARB_render_texture = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions);
-}
-
-static void extgl_InitWGLEXTSwapControl(WGLExtensions *extensions) {
- ExtFunction functions[] = {
- {"wglSwapIntervalEXT", (void *)&extensions->wglSwapIntervalEXT},
- {"wglGetSwapIntervalEXT", (void *)&extensions->wglGetSwapIntervalEXT}};
- if (extensions->WGL_EXT_swap_control)
- extensions->WGL_EXT_swap_control = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions);
-}
-
-static void extgl_InitWGLARBMakeCurrentRead(WGLExtensions *extensions) {
- ExtFunction functions[] = {
- {"wglMakeContextCurrentARB", (void *)&extensions->wglMakeContextCurrentARB},
- {"wglGetCurrentReadDCARB", (void *)&extensions->wglGetCurrentReadDCARB}};
- if (extensions->WGL_ARB_make_current_read)
- extensions->WGL_ARB_make_current_read = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions);
-}
-
-static void extgl_InitWGLARBCreateContext(WGLExtensions *extensions) {
- ExtFunction functions[] = {
- {"wglCreateContextAttribsARB", (void *)&extensions->wglCreateContextAttribsARB}
- };
- if (extensions->WGL_ARB_create_context)
- extensions->WGL_ARB_create_context = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions);
-}
-
-static void extgl_InitSupportedWGLExtensions(WGLExtensions *extensions) {
- extensions->WGL_ARB_buffer_region = WGLQueryExtension(extensions, "WGL_ARB_buffer_region");
- extensions->WGL_ARB_make_current_read = WGLQueryExtension(extensions, "WGL_ARB_make_current_read");
- extensions->WGL_ARB_multisample = WGLQueryExtension(extensions, "WGL_ARB_multisample");
- extensions->WGL_ARB_pixel_format_float = WGLQueryExtension(extensions, "WGL_ARB_pixel_format_float");
- extensions->WGL_ATI_pixel_format_float = WGLQueryExtension(extensions, "WGL_ATI_pixel_format_float");
- extensions->WGL_ARB_pbuffer = WGLQueryExtension(extensions, "WGL_ARB_pbuffer");
- extensions->WGL_ARB_pixel_format = WGLQueryExtension(extensions, "WGL_ARB_pixel_format");
- extensions->WGL_ARB_render_texture = WGLQueryExtension(extensions, "WGL_ARB_render_texture");
- extensions->WGL_EXT_swap_control = WGLQueryExtension(extensions, "WGL_EXT_swap_control");
- extensions->WGL_NV_render_depth_texture = WGLQueryExtension(extensions, "WGL_NV_render_depth_texture");
- extensions->WGL_NV_render_texture_rectangle = WGLQueryExtension(extensions, "WGL_NV_render_texture_rectangle");
- extensions->WGL_ARB_framebuffer_sRGB = WGLQueryExtension(extensions, "WGL_ARB_framebuffer_sRGB") || WGLQueryExtension(extensions, "WGL_EXT_framebuffer_sRGB");
- extensions->WGL_EXT_pixel_format_packed_float = WGLQueryExtension(extensions, "WGL_EXT_pixel_format_packed_float");
- extensions->WGL_ARB_create_context = WGLQueryExtension(extensions, "WGL_ARB_create_context");
-}
-
-static void extgl_InitWGLEXTExtensionsString(WGLExtensions *extensions) {
- ExtFunction functions[] = {
- {"wglGetExtensionsStringEXT", (void *)&extensions->wglGetExtensionsStringEXT}
- };
- extensions->WGL_EXT_extensions_string = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions);
-}
-
-static void extgl_InitWGLARBExtensionsString(WGLExtensions *extensions) {
- ExtFunction functions[] = {
- {"wglGetExtensionsStringARB", (void *)&extensions->wglGetExtensionsStringARB}
- };
- extensions->WGL_ARB_extensions_string = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions);
-}
-
-void extgl_InitWGL(WGLExtensions *extensions) {
- extgl_InitWGLARBExtensionsString(extensions);
- extgl_InitWGLEXTExtensionsString(extensions);
-
- extgl_InitSupportedWGLExtensions(extensions);
-
- extgl_InitWGLARBMakeCurrentRead(extensions);
- extgl_InitWGLEXTSwapControl(extensions);
- extgl_InitWGLARBRenderTexture(extensions);
- extgl_InitWGLARBPixelFormat(extensions);
- extgl_InitWGLARBPbuffer(extensions);
- extgl_InitWGLARBCreateContext(extensions);
-}
+/* ----------------------------------------------------------------------------
+Copyright (c) 2001-2002, Lev Povalahev
+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.
+ * The name of the author 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.
+------------------------------------------------------------------------------*/
+/*
+ Lev Povalahev
+
+ levp at gmx.net
+
+ http://www.uni-karlsruhe.de/~uli2/
+
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include "extgl_wgl.h"
+#include "extgl.h"
+
+static HMODULE lib_gl_handle = NULL;
+
+void *extgl_GetProcAddress(const char *name) {
+ void *t = wglGetProcAddress(name);
+ if (t == NULL)
+ {
+ t = GetProcAddress(lib_gl_handle, name);
+ if (t == NULL)
+ {
+ printfDebug("Could not locate symbol %s\n", name);
+ }
+ }
+ return t;
+}
+
+bool extgl_Open(JNIEnv *env) {
+ if (lib_gl_handle != NULL)
+ return true;
+ // load the dynamic libraries for OpenGL
+ lib_gl_handle = LoadLibrary("opengl32.dll");
+ if (lib_gl_handle == NULL) {
+ throwException(env, "Could not load OpenGL library");
+ return false;
+ }
+ return true;
+}
+
+void extgl_Close(void) {
+ FreeLibrary(lib_gl_handle);
+ lib_gl_handle = NULL;
+}
+
+/** returns true if the extension is available */
+static bool WGLQueryExtension(WGLExtensions *extensions, const char *name) {
+ const GLubyte *extension_string;
+
+ if (!extensions->WGL_ARB_extensions_string)
+ if (!extensions->WGL_EXT_extensions_string)
+ return false;
+ else
+ extension_string = (GLubyte*)extensions->wglGetExtensionsStringEXT();
+ else
+ extension_string = (GLubyte*)extensions->wglGetExtensionsStringARB(wglGetCurrentDC());
+ return extgl_QueryExtension(extension_string, name);
+}
+
+static void extgl_InitWGLARBPbuffer(WGLExtensions *extensions) {
+ ExtFunction functions[] = {
+ {"wglCreatePbufferARB", (void *)&extensions->wglCreatePbufferARB},
+ {"wglGetPbufferDCARB", (void *)&extensions->wglGetPbufferDCARB},
+ {"wglReleasePbufferDCARB", (void *)&extensions->wglReleasePbufferDCARB},
+ {"wglDestroyPbufferARB", (void *)&extensions->wglDestroyPbufferARB},
+ {"wglQueryPbufferARB", (void *)&extensions->wglQueryPbufferARB}};
+ if (extensions->WGL_ARB_pbuffer)
+ extensions->WGL_ARB_pbuffer = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions);
+}
+
+static void extgl_InitWGLARBPixelFormat(WGLExtensions *extensions) {
+ ExtFunction functions[] = {
+ {"wglGetPixelFormatAttribivARB", (void *)&extensions->wglGetPixelFormatAttribivARB},
+ {"wglGetPixelFormatAttribfvARB", (void *)&extensions->wglGetPixelFormatAttribfvARB},
+ {"wglChoosePixelFormatARB", (void *)&extensions->wglChoosePixelFormatARB}};
+ if (extensions->WGL_ARB_pixel_format)
+ extensions->WGL_ARB_pixel_format = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions);
+}
+
+static void extgl_InitWGLARBRenderTexture(WGLExtensions *extensions) {
+ ExtFunction functions[] = {
+ {"wglBindTexImageARB", (void *)&extensions->wglBindTexImageARB},
+ {"wglReleaseTexImageARB", (void *)&extensions->wglReleaseTexImageARB},
+ {"wglSetPbufferAttribARB", (void *)&extensions->wglSetPbufferAttribARB}};
+ if (extensions->WGL_ARB_render_texture)
+ extensions->WGL_ARB_render_texture = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions);
+}
+
+static void extgl_InitWGLEXTSwapControl(WGLExtensions *extensions) {
+ ExtFunction functions[] = {
+ {"wglSwapIntervalEXT", (void *)&extensions->wglSwapIntervalEXT},
+ {"wglGetSwapIntervalEXT", (void *)&extensions->wglGetSwapIntervalEXT}};
+ if (extensions->WGL_EXT_swap_control)
+ extensions->WGL_EXT_swap_control = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions);
+}
+
+static void extgl_InitWGLARBMakeCurrentRead(WGLExtensions *extensions) {
+ ExtFunction functions[] = {
+ {"wglMakeContextCurrentARB", (void *)&extensions->wglMakeContextCurrentARB},
+ {"wglGetCurrentReadDCARB", (void *)&extensions->wglGetCurrentReadDCARB}};
+ if (extensions->WGL_ARB_make_current_read)
+ extensions->WGL_ARB_make_current_read = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions);
+}
+
+static void extgl_InitWGLARBCreateContext(WGLExtensions *extensions) {
+ ExtFunction functions[] = {
+ {"wglCreateContextAttribsARB", (void *)&extensions->wglCreateContextAttribsARB}
+ };
+ if (extensions->WGL_ARB_create_context)
+ extensions->WGL_ARB_create_context = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions);
+}
+
+static void extgl_InitSupportedWGLExtensions(WGLExtensions *extensions) {
+ extensions->WGL_ARB_buffer_region = WGLQueryExtension(extensions, "WGL_ARB_buffer_region");
+ extensions->WGL_ARB_make_current_read = WGLQueryExtension(extensions, "WGL_ARB_make_current_read");
+ extensions->WGL_ARB_multisample = WGLQueryExtension(extensions, "WGL_ARB_multisample");
+ extensions->WGL_ARB_pixel_format_float = WGLQueryExtension(extensions, "WGL_ARB_pixel_format_float");
+ extensions->WGL_ATI_pixel_format_float = WGLQueryExtension(extensions, "WGL_ATI_pixel_format_float");
+ extensions->WGL_ARB_pbuffer = WGLQueryExtension(extensions, "WGL_ARB_pbuffer");
+ extensions->WGL_ARB_pixel_format = WGLQueryExtension(extensions, "WGL_ARB_pixel_format");
+ extensions->WGL_ARB_render_texture = WGLQueryExtension(extensions, "WGL_ARB_render_texture");
+ extensions->WGL_EXT_swap_control = WGLQueryExtension(extensions, "WGL_EXT_swap_control");
+ extensions->WGL_NV_render_depth_texture = WGLQueryExtension(extensions, "WGL_NV_render_depth_texture");
+ extensions->WGL_NV_render_texture_rectangle = WGLQueryExtension(extensions, "WGL_NV_render_texture_rectangle");
+ extensions->WGL_ARB_framebuffer_sRGB = WGLQueryExtension(extensions, "WGL_ARB_framebuffer_sRGB") || WGLQueryExtension(extensions, "WGL_EXT_framebuffer_sRGB");
+ extensions->WGL_EXT_pixel_format_packed_float = WGLQueryExtension(extensions, "WGL_EXT_pixel_format_packed_float");
+ extensions->WGL_ARB_create_context = WGLQueryExtension(extensions, "WGL_ARB_create_context");
+}
+
+static void extgl_InitWGLEXTExtensionsString(WGLExtensions *extensions) {
+ ExtFunction functions[] = {
+ {"wglGetExtensionsStringEXT", (void *)&extensions->wglGetExtensionsStringEXT}
+ };
+ extensions->WGL_EXT_extensions_string = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions);
+}
+
+static void extgl_InitWGLARBExtensionsString(WGLExtensions *extensions) {
+ ExtFunction functions[] = {
+ {"wglGetExtensionsStringARB", (void *)&extensions->wglGetExtensionsStringARB}
+ };
+ extensions->WGL_ARB_extensions_string = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions);
+}
+
+void extgl_InitWGL(WGLExtensions *extensions) {
+ extgl_InitWGLARBExtensionsString(extensions);
+ extgl_InitWGLEXTExtensionsString(extensions);
+
+ extgl_InitSupportedWGLExtensions(extensions);
+
+ extgl_InitWGLARBMakeCurrentRead(extensions);
+ extgl_InitWGLEXTSwapControl(extensions);
+ extgl_InitWGLARBRenderTexture(extensions);
+ extgl_InitWGLARBPixelFormat(extensions);
+ extgl_InitWGLARBPbuffer(extensions);
+ extgl_InitWGLARBCreateContext(extensions);
+}
diff --git a/src/native/windows/extgl_wgl.h b/src/native/windows/extgl_wgl.h
index a6ead0f..43c06b4 100644
--- a/src/native/windows/extgl_wgl.h
+++ b/src/native/windows/extgl_wgl.h
@@ -1,251 +1,251 @@
-/* ----------------------------------------------------------------------------
-Copyright (c) 2001-2002, Lev Povalahev
-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.
- * The name of the author 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.
-------------------------------------------------------------------------------*/
-/*
- Lev Povalahev
-
- levp at gmx.net
-
- http://www.uni-karlsruhe.de/~uli2/
-
-*/
-
-#ifndef _EXTGL_WGL_H
-#define _EXTGL_WGL_H
-
-#include <windows.h>
-#include "extgl.h"
-#include "common_tools.h"
-
-/*-------------------------------------------------------------------*/
-/*------------WGL_EXT_EXTENSION_STRING-------------------------------*/
-/*-------------------------------------------------------------------*/
-
-typedef const char* (APIENTRY * wglGetExtensionsStringEXTPROC) ();
-
-/*-------------------------------------------------------------------*/
-/*------------WGL_ARB_EXTENSION_STRING-------------------------------*/
-/*-------------------------------------------------------------------*/
-
-typedef const char* (APIENTRY * wglGetExtensionsStringARBPROC) (HDC hdc);
-
-/*-------------------------------------------------------------------*/
-/*------------WGL_ARB_PBUFFER----------------------------------------*/
-/*-------------------------------------------------------------------*/
-
-#define WGL_DRAW_TO_PBUFFER_ARB 0x202D
-#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
-
-DECLARE_HANDLE(HPBUFFERARB);
-
-typedef HPBUFFERARB (APIENTRY * wglCreatePbufferARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
-typedef HDC (APIENTRY * wglGetPbufferDCARBPROC) (HPBUFFERARB hPbuffer);
-typedef int (APIENTRY * wglReleasePbufferDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC);
-typedef BOOL (APIENTRY * wglDestroyPbufferARBPROC) (HPBUFFERARB hPbuffer);
-typedef BOOL (APIENTRY * wglQueryPbufferARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
-
-/*-------------------------------------------------------------------*/
-/*------------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
-
-typedef BOOL (APIENTRY * wglGetPixelFormatAttribivARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
-typedef BOOL (APIENTRY * wglGetPixelFormatAttribfvARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
-typedef BOOL (APIENTRY * wglChoosePixelFormatARBPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
-
-typedef BOOL (APIENTRY * wglBindTexImageARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
-typedef BOOL (APIENTRY * wglReleaseTexImageARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
-typedef BOOL (APIENTRY * wglSetPbufferAttribARBPROC) (HPBUFFERARB hPbuffer, const int *piAttribList);
-
-/*-------------------------------------------------------------------*/
-/*------------WGL_EXT_SWAP_CONTROL-----------------------------------*/
-/*-------------------------------------------------------------------*/
-
-typedef BOOL (APIENTRY * wglSwapIntervalEXTPROC) (int interval);
-typedef int (APIENTRY * wglGetSwapIntervalEXTPROC) (void);
-
-/*-------------------------------------------------------------------*/
-/*------------WGL_ARB_MAKE_CURRENT_READ------------------------------*/
-/*-------------------------------------------------------------------*/
-
-#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043
-#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054
-
-typedef BOOL (APIENTRY * wglMakeContextCurrentARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
-typedef HDC (APIENTRY * wglGetCurrentReadDCARBPROC) (void);
-
-/*-------------------------------------------------------------------*/
-/*------------WGL_ARB_MULTISAMPLE------------------------------------*/
-/*-------------------------------------------------------------------*/
-
-#define WGL_SAMPLE_BUFFERS_ARB 0x2041
-#define WGL_SAMPLES_ARB 0x2042
-
-/*-------------------------------------------------------------------*/
-/*------------WGL_ARB_pixel_format_float ----------------------------*/
-/*-------------------------------------------------------------------*/
-
-#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0
-
-/*-------------------------------------------------------------------*/
-/*------------WGL_ATI_pixel_format_float ----------------------------*/
-/*-------------------------------------------------------------------*/
-
-#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0
-
-/*------------------------------------------------------------------*/
-/*------------ WGL_ARB_framebuffer_sRGB ----------------------------*/
-/*------------------------------------------------------------------*/
-
-#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9
-
-/*---------------------------------------------------------------------------*/
-/*------------ WGL_EXT_pixel_format_packed_float ----------------------------*/
-/*---------------------------------------------------------------------------*/
-
-#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8
-
-/*----------------------------------------------------------------*/
-/*------------ 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
-
-typedef HGLRC (APIENTRY * wglCreateContextAttribsARBPROC) (HDC hDC, HGLRC hShareContext, const int *attribList);
-
-typedef struct {
- bool WGL_ARB_buffer_region;
- bool WGL_ARB_extensions_string;
- bool WGL_ARB_make_current_read;
- bool WGL_ARB_multisample;
- bool WGL_ARB_pbuffer;
- bool WGL_ARB_pixel_format;
- bool WGL_ARB_render_texture;
- bool WGL_EXT_extensions_string;
- bool WGL_EXT_swap_control;
- bool WGL_NV_render_depth_texture;
- bool WGL_NV_render_texture_rectangle;
- bool WGL_ARB_pixel_format_float;
- bool WGL_ATI_pixel_format_float;
- bool WGL_ARB_framebuffer_sRGB;
- bool WGL_EXT_pixel_format_packed_float;
- bool WGL_ARB_create_context;
-
- wglGetExtensionsStringEXTPROC wglGetExtensionsStringEXT;
-
- wglGetExtensionsStringARBPROC wglGetExtensionsStringARB;
-
- wglCreatePbufferARBPROC wglCreatePbufferARB;
- wglGetPbufferDCARBPROC wglGetPbufferDCARB;
- wglReleasePbufferDCARBPROC wglReleasePbufferDCARB;
- wglDestroyPbufferARBPROC wglDestroyPbufferARB;
- wglQueryPbufferARBPROC wglQueryPbufferARB;
-
- wglGetPixelFormatAttribivARBPROC wglGetPixelFormatAttribivARB;
- wglGetPixelFormatAttribfvARBPROC wglGetPixelFormatAttribfvARB;
- wglChoosePixelFormatARBPROC wglChoosePixelFormatARB;
-
- wglBindTexImageARBPROC wglBindTexImageARB;
- wglReleaseTexImageARBPROC wglReleaseTexImageARB;
- wglSetPbufferAttribARBPROC wglSetPbufferAttribARB;
-
- wglSwapIntervalEXTPROC wglSwapIntervalEXT;
- wglGetSwapIntervalEXTPROC wglGetSwapIntervalEXT;
-
- wglMakeContextCurrentARBPROC wglMakeContextCurrentARB;
- wglGetCurrentReadDCARBPROC wglGetCurrentReadDCARB;
-
- wglCreateContextAttribsARBPROC wglCreateContextAttribsARB;
-} WGLExtensions;
-
-extern void extgl_InitWGL(WGLExtensions *extensions);
-
-
-#endif
+/* ----------------------------------------------------------------------------
+Copyright (c) 2001-2002, Lev Povalahev
+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.
+ * The name of the author 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.
+------------------------------------------------------------------------------*/
+/*
+ Lev Povalahev
+
+ levp at gmx.net
+
+ http://www.uni-karlsruhe.de/~uli2/
+
+*/
+
+#ifndef _EXTGL_WGL_H
+#define _EXTGL_WGL_H
+
+#include <windows.h>
+#include "extgl.h"
+#include "common_tools.h"
+
+/*-------------------------------------------------------------------*/
+/*------------WGL_EXT_EXTENSION_STRING-------------------------------*/
+/*-------------------------------------------------------------------*/
+
+typedef const char* (APIENTRY * wglGetExtensionsStringEXTPROC) ();
+
+/*-------------------------------------------------------------------*/
+/*------------WGL_ARB_EXTENSION_STRING-------------------------------*/
+/*-------------------------------------------------------------------*/
+
+typedef const char* (APIENTRY * wglGetExtensionsStringARBPROC) (HDC hdc);
+
+/*-------------------------------------------------------------------*/
+/*------------WGL_ARB_PBUFFER----------------------------------------*/
+/*-------------------------------------------------------------------*/
+
+#define WGL_DRAW_TO_PBUFFER_ARB 0x202D
+#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
+
+DECLARE_HANDLE(HPBUFFERARB);
+
+typedef HPBUFFERARB (APIENTRY * wglCreatePbufferARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
+typedef HDC (APIENTRY * wglGetPbufferDCARBPROC) (HPBUFFERARB hPbuffer);
+typedef int (APIENTRY * wglReleasePbufferDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC);
+typedef BOOL (APIENTRY * wglDestroyPbufferARBPROC) (HPBUFFERARB hPbuffer);
+typedef BOOL (APIENTRY * wglQueryPbufferARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
+
+/*-------------------------------------------------------------------*/
+/*------------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
+
+typedef BOOL (APIENTRY * wglGetPixelFormatAttribivARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
+typedef BOOL (APIENTRY * wglGetPixelFormatAttribfvARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
+typedef BOOL (APIENTRY * wglChoosePixelFormatARBPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
+
+typedef BOOL (APIENTRY * wglBindTexImageARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
+typedef BOOL (APIENTRY * wglReleaseTexImageARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
+typedef BOOL (APIENTRY * wglSetPbufferAttribARBPROC) (HPBUFFERARB hPbuffer, const int *piAttribList);
+
+/*-------------------------------------------------------------------*/
+/*------------WGL_EXT_SWAP_CONTROL-----------------------------------*/
+/*-------------------------------------------------------------------*/
+
+typedef BOOL (APIENTRY * wglSwapIntervalEXTPROC) (int interval);
+typedef int (APIENTRY * wglGetSwapIntervalEXTPROC) (void);
+
+/*-------------------------------------------------------------------*/
+/*------------WGL_ARB_MAKE_CURRENT_READ------------------------------*/
+/*-------------------------------------------------------------------*/
+
+#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043
+#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054
+
+typedef BOOL (APIENTRY * wglMakeContextCurrentARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
+typedef HDC (APIENTRY * wglGetCurrentReadDCARBPROC) (void);
+
+/*-------------------------------------------------------------------*/
+/*------------WGL_ARB_MULTISAMPLE------------------------------------*/
+/*-------------------------------------------------------------------*/
+
+#define WGL_SAMPLE_BUFFERS_ARB 0x2041
+#define WGL_SAMPLES_ARB 0x2042
+
+/*-------------------------------------------------------------------*/
+/*------------WGL_ARB_pixel_format_float ----------------------------*/
+/*-------------------------------------------------------------------*/
+
+#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0
+
+/*-------------------------------------------------------------------*/
+/*------------WGL_ATI_pixel_format_float ----------------------------*/
+/*-------------------------------------------------------------------*/
+
+#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0
+
+/*------------------------------------------------------------------*/
+/*------------ WGL_ARB_framebuffer_sRGB ----------------------------*/
+/*------------------------------------------------------------------*/
+
+#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9
+
+/*---------------------------------------------------------------------------*/
+/*------------ WGL_EXT_pixel_format_packed_float ----------------------------*/
+/*---------------------------------------------------------------------------*/
+
+#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8
+
+/*----------------------------------------------------------------*/
+/*------------ 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
+
+typedef HGLRC (APIENTRY * wglCreateContextAttribsARBPROC) (HDC hDC, HGLRC hShareContext, const int *attribList);
+
+typedef struct {
+ bool WGL_ARB_buffer_region;
+ bool WGL_ARB_extensions_string;
+ bool WGL_ARB_make_current_read;
+ bool WGL_ARB_multisample;
+ bool WGL_ARB_pbuffer;
+ bool WGL_ARB_pixel_format;
+ bool WGL_ARB_render_texture;
+ bool WGL_EXT_extensions_string;
+ bool WGL_EXT_swap_control;
+ bool WGL_NV_render_depth_texture;
+ bool WGL_NV_render_texture_rectangle;
+ bool WGL_ARB_pixel_format_float;
+ bool WGL_ATI_pixel_format_float;
+ bool WGL_ARB_framebuffer_sRGB;
+ bool WGL_EXT_pixel_format_packed_float;
+ bool WGL_ARB_create_context;
+
+ wglGetExtensionsStringEXTPROC wglGetExtensionsStringEXT;
+
+ wglGetExtensionsStringARBPROC wglGetExtensionsStringARB;
+
+ wglCreatePbufferARBPROC wglCreatePbufferARB;
+ wglGetPbufferDCARBPROC wglGetPbufferDCARB;
+ wglReleasePbufferDCARBPROC wglReleasePbufferDCARB;
+ wglDestroyPbufferARBPROC wglDestroyPbufferARB;
+ wglQueryPbufferARBPROC wglQueryPbufferARB;
+
+ wglGetPixelFormatAttribivARBPROC wglGetPixelFormatAttribivARB;
+ wglGetPixelFormatAttribfvARBPROC wglGetPixelFormatAttribfvARB;
+ wglChoosePixelFormatARBPROC wglChoosePixelFormatARB;
+
+ wglBindTexImageARBPROC wglBindTexImageARB;
+ wglReleaseTexImageARBPROC wglReleaseTexImageARB;
+ wglSetPbufferAttribARBPROC wglSetPbufferAttribARB;
+
+ wglSwapIntervalEXTPROC wglSwapIntervalEXT;
+ wglGetSwapIntervalEXTPROC wglGetSwapIntervalEXT;
+
+ wglMakeContextCurrentARBPROC wglMakeContextCurrentARB;
+ wglGetCurrentReadDCARBPROC wglGetCurrentReadDCARB;
+
+ wglCreateContextAttribsARBPROC wglCreateContextAttribsARB;
+} WGLExtensions;
+
+extern void extgl_InitWGL(WGLExtensions *extensions);
+
+
+#endif
diff --git a/src/native/windows/org_lwjgl_Sys.c b/src/native/windows/org_lwjgl_Sys.c
index 390d218..28166ba 100644
--- a/src/native/windows/org_lwjgl_Sys.c
+++ b/src/native/windows/org_lwjgl_Sys.c
@@ -1,121 +1,121 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: org_lwjgl_Sys.c 3259 2009-12-02 23:11:14Z matzon $
- *
- * Windows system library.
- *
- * @author cix_foo <cix_foo at users.sourceforge.net>
- * @version $Revision: 3259 $
- */
-
-#include "Window.h"
-#include "mmsystem.h"
-#include "org_lwjgl_WindowsSysImplementation.h"
-#include "common_tools.h"
-#include <malloc.h>
-#include <commctrl.h>
-
-JNIEXPORT jlong JNICALL Java_org_lwjgl_WindowsSysImplementation_nGetTime(JNIEnv * env, jclass unused) {
- DWORD time;
-
- timeBeginPeriod(1);
- time = timeGetTime();
- timeEndPeriod(1);
-
- return time;
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_WindowsSysImplementation_nAlert(JNIEnv * env, jclass unused, jlong hwnd_ptr, jstring title, jstring message) {
- HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
- char * eMessageText = GetStringNativeChars(env, message);
- char * cTitleBarText = GetStringNativeChars(env, title);
- MessageBox(hwnd, eMessageText, cTitleBarText, MB_OK | MB_TOPMOST);
-
- printfDebugJava(env, "*** Alert ***%s\n%s\n", cTitleBarText, eMessageText);
-
- free(eMessageText);
- free(cTitleBarText);
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_WindowsSysImplementation_initCommonControls(JNIEnv * env, jclass unused) {
- InitCommonControls();
-}
-
-JNIEXPORT jstring JNICALL Java_org_lwjgl_WindowsSysImplementation_nGetClipboard
- (JNIEnv * env, jclass unused)
-{
- // Check to see if there's text available in the clipboard
- BOOL textAvailable = IsClipboardFormatAvailable(CF_TEXT);
- BOOL unicodeAvailable = IsClipboardFormatAvailable(CF_UNICODETEXT);
- void *clipboard_data;
- jstring ret;
- HANDLE hglb;
- const wchar_t * str;
-
- if (unicodeAvailable) {
- if (!OpenClipboard(NULL))
- return NULL;
- hglb = GetClipboardData(CF_UNICODETEXT);
- if (hglb == NULL) {
- CloseClipboard();
- return NULL;
- }
- clipboard_data = GlobalLock(hglb);
- if (clipboard_data == NULL) {
- CloseClipboard();
- return NULL;
- }
- str = (const wchar_t *)clipboard_data;
- ret = (*env)->NewString(env, str, wcslen(str));
- } else if (textAvailable) {
- if (!OpenClipboard(NULL))
- return NULL;
- hglb = GetClipboardData(CF_TEXT);
- if (hglb == NULL) {
- CloseClipboard();
- return NULL;
- }
- clipboard_data = GlobalLock(hglb);
- if (clipboard_data == NULL) {
- CloseClipboard();
- return NULL;
- }
- ret = NewStringNativeWithLength(env, (const char *) clipboard_data, strlen(clipboard_data));
- } else {
- return NULL;
- }
- GlobalUnlock(hglb);
- CloseClipboard();
- return ret;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: org_lwjgl_Sys.c 3259 2009-12-02 23:11:14Z matzon $
+ *
+ * Windows system library.
+ *
+ * @author cix_foo <cix_foo at users.sourceforge.net>
+ * @version $Revision: 3259 $
+ */
+
+#include "Window.h"
+#include "mmsystem.h"
+#include "org_lwjgl_WindowsSysImplementation.h"
+#include "common_tools.h"
+#include <malloc.h>
+#include <commctrl.h>
+
+JNIEXPORT jlong JNICALL Java_org_lwjgl_WindowsSysImplementation_nGetTime(JNIEnv * env, jclass unused) {
+ DWORD time;
+
+ timeBeginPeriod(1);
+ time = timeGetTime();
+ timeEndPeriod(1);
+
+ return time;
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_WindowsSysImplementation_nAlert(JNIEnv * env, jclass unused, jlong hwnd_ptr, jstring title, jstring message) {
+ HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
+ char * eMessageText = GetStringNativeChars(env, message);
+ char * cTitleBarText = GetStringNativeChars(env, title);
+ MessageBox(hwnd, eMessageText, cTitleBarText, MB_OK | MB_TOPMOST);
+
+ printfDebugJava(env, "*** Alert ***%s\n%s\n", cTitleBarText, eMessageText);
+
+ free(eMessageText);
+ free(cTitleBarText);
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_WindowsSysImplementation_initCommonControls(JNIEnv * env, jclass unused) {
+ InitCommonControls();
+}
+
+JNIEXPORT jstring JNICALL Java_org_lwjgl_WindowsSysImplementation_nGetClipboard
+ (JNIEnv * env, jclass unused)
+{
+ // Check to see if there's text available in the clipboard
+ BOOL textAvailable = IsClipboardFormatAvailable(CF_TEXT);
+ BOOL unicodeAvailable = IsClipboardFormatAvailable(CF_UNICODETEXT);
+ void *clipboard_data;
+ jstring ret;
+ HANDLE hglb;
+ const wchar_t * str;
+
+ if (unicodeAvailable) {
+ if (!OpenClipboard(NULL))
+ return NULL;
+ hglb = GetClipboardData(CF_UNICODETEXT);
+ if (hglb == NULL) {
+ CloseClipboard();
+ return NULL;
+ }
+ clipboard_data = GlobalLock(hglb);
+ if (clipboard_data == NULL) {
+ CloseClipboard();
+ return NULL;
+ }
+ str = (const wchar_t *)clipboard_data;
+ ret = (*env)->NewString(env, str, wcslen(str));
+ } else if (textAvailable) {
+ if (!OpenClipboard(NULL))
+ return NULL;
+ hglb = GetClipboardData(CF_TEXT);
+ if (hglb == NULL) {
+ CloseClipboard();
+ return NULL;
+ }
+ clipboard_data = GlobalLock(hglb);
+ if (clipboard_data == NULL) {
+ CloseClipboard();
+ return NULL;
+ }
+ ret = NewStringNativeWithLength(env, (const char *) clipboard_data, strlen(clipboard_data));
+ } else {
+ return NULL;
+ }
+ GlobalUnlock(hglb);
+ CloseClipboard();
+ return ret;
+}
diff --git a/src/native/windows/org_lwjgl_input_Cursor.c b/src/native/windows/org_lwjgl_input_Cursor.c
index be93262..cd1b9ad 100644
--- a/src/native/windows/org_lwjgl_input_Cursor.c
+++ b/src/native/windows/org_lwjgl_input_Cursor.c
@@ -1,167 +1,167 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: org_lwjgl_input_Cursor.c 3263 2010-01-10 22:46:41Z matzon $
- *
- * win32 mouse handling.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3263 $
- */
-
-#include "Window.h"
-#include "org_lwjgl_input_Cursor.h"
-#include "org_lwjgl_opengl_WindowsDisplay.h"
-#include "common_tools.h"
-
-JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nCreateCursor
-(JNIEnv *env, jclass unused, jint width, jint height, jint x_hotspot, jint y_hotspot, jint num_images, jobject image_buffer, jint images_offset, jobject delay_buffer, jint delays_offset)
-{
- unsigned char col0, col1, col2, col3, col4, col5, col6, col7;
- unsigned char mask;
- BITMAPINFO bitmapInfo;
-
- HBITMAP cursorMask;
- HCURSOR *cursor_handle;
-
- HCURSOR cursor = NULL;
- ICONINFO iconInfo;
- char *ptrCursorImage;
- HBITMAP colorDIB;
- int *srcPtr;
- char *dstPtr;
- int bitWidth;
- int scanlinePad;
- int imageSize; // Size in bits
- unsigned char *maskPixels;
- int pixelCount = 0;
- int maskCount = 0;
- HBITMAP colorBitmap;
- int x, y;
- HDC hDC;
- jobject handle_buffer = newJavaManagedByteBuffer(env, sizeof(HCURSOR));
-
- int *pixels;
- if (handle_buffer == NULL) {
- throwException(env, "Could not allocate handle");
- return NULL;
- }
- pixels = (int *)(*env)->GetDirectBufferAddress(env, image_buffer) + images_offset;
-
- memset(&bitmapInfo, 0, sizeof(BITMAPINFO));
- bitmapInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
- bitmapInfo.bmiHeader.biWidth = width;
- bitmapInfo.bmiHeader.biHeight = -height;
- bitmapInfo.bmiHeader.biPlanes = 1;
-
- bitmapInfo.bmiHeader.biBitCount = 24;
- bitmapInfo.bmiHeader.biCompression = BI_RGB;
-
- hDC = GetDC(NULL);
-
- colorDIB = CreateDIBSection(hDC, (BITMAPINFO*)&(bitmapInfo),
- DIB_RGB_COLORS,
- (void*)&(ptrCursorImage),
- NULL, 0);
- srcPtr = pixels;
- dstPtr = ptrCursorImage;
- if (!dstPtr) {
- throwException(env, "Could not allocate DIB section.");
- ReleaseDC(NULL, hDC);
- return NULL;
- }
- for (y = 0; y < height; y++ ) {
- for (x = 0; x < width; x++ ) {
- dstPtr[2] = (*srcPtr >> 0x10) & 0xFF;
- dstPtr[1] = (*srcPtr >> 0x08) & 0xFF;
- dstPtr[0] = *srcPtr & 0xFF;
-
- srcPtr++;
- dstPtr += 3;
- }
- }
-
- colorBitmap = CreateDIBitmap(hDC,
- (BITMAPINFOHEADER*)&bitmapInfo.bmiHeader,
- CBM_INIT,
- (void *)ptrCursorImage,
- (BITMAPINFO*)&bitmapInfo,
- DIB_RGB_COLORS);
-
- DeleteObject(colorDIB);
-
- // Convert alpha map to pixel packed mask
- bitWidth = width >> 3;
- scanlinePad = bitWidth & (sizeof(WORD) - 1);
- imageSize = (bitWidth + scanlinePad)*height; // Size in bits
- maskPixels = (unsigned char*)malloc(sizeof(unsigned char)*imageSize);
- memset(maskPixels, 0, imageSize);
- for (y = 0; y < height; y++)
- for (x = 0; x < bitWidth; x++) {
- col0 = (pixels[pixelCount++] & 0x01000000) >> 17;
- col1 = (pixels[pixelCount++] & 0x01000000) >> 18;
- col2 = (pixels[pixelCount++] & 0x01000000) >> 19;
- col3 = (pixels[pixelCount++] & 0x01000000) >> 20;
- col4 = (pixels[pixelCount++] & 0x01000000) >> 21;
- col5 = (pixels[pixelCount++] & 0x01000000) >> 22;
- col6 = (pixels[pixelCount++] & 0x01000000) >> 23;
- col7 = (pixels[pixelCount++] & 0x01000000) >> 24;
- mask = col0 | col1 | col2 | col3 | col4 | col5 | col6 | col7;
- maskPixels[maskCount++] = ~mask; // 1 is tranparant, 0 opaque
- }
-
- cursorMask = CreateBitmap(width, height, 1, 1, maskPixels);
-
- memset(&iconInfo, 0, sizeof(ICONINFO));
- iconInfo.hbmMask = cursorMask;
- iconInfo.hbmColor = colorBitmap;
- iconInfo.fIcon = FALSE;
- iconInfo.xHotspot = x_hotspot;
- iconInfo.yHotspot = y_hotspot;
- cursor = CreateIconIndirect(&iconInfo);
- DeleteObject(colorBitmap);
- DeleteObject(cursorMask);
- free(maskPixels);
- ReleaseDC(NULL, hDC);
-
- cursor_handle = (HCURSOR *)(*env)->GetDirectBufferAddress(env, handle_buffer);
- *cursor_handle = cursor;
- return handle_buffer;
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_doDestroyCursor
-(JNIEnv *env, jclass unused, jobject handle_buffer)
-{
- HCURSOR *cursor_handle = (HCURSOR *)(*env)->GetDirectBufferAddress(env, handle_buffer);
- DestroyCursor(*cursor_handle);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: org_lwjgl_input_Cursor.c 3263 2010-01-10 22:46:41Z matzon $
+ *
+ * win32 mouse handling.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3263 $
+ */
+
+#include "Window.h"
+#include "org_lwjgl_input_Cursor.h"
+#include "org_lwjgl_opengl_WindowsDisplay.h"
+#include "common_tools.h"
+
+JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nCreateCursor
+(JNIEnv *env, jclass unused, jint width, jint height, jint x_hotspot, jint y_hotspot, jint num_images, jobject image_buffer, jint images_offset, jobject delay_buffer, jint delays_offset)
+{
+ unsigned char col0, col1, col2, col3, col4, col5, col6, col7;
+ unsigned char mask;
+ BITMAPINFO bitmapInfo;
+
+ HBITMAP cursorMask;
+ HCURSOR *cursor_handle;
+
+ HCURSOR cursor = NULL;
+ ICONINFO iconInfo;
+ char *ptrCursorImage;
+ HBITMAP colorDIB;
+ int *srcPtr;
+ char *dstPtr;
+ int bitWidth;
+ int scanlinePad;
+ int imageSize; // Size in bits
+ unsigned char *maskPixels;
+ int pixelCount = 0;
+ int maskCount = 0;
+ HBITMAP colorBitmap;
+ int x, y;
+ HDC hDC;
+ jobject handle_buffer = newJavaManagedByteBuffer(env, sizeof(HCURSOR));
+
+ int *pixels;
+ if (handle_buffer == NULL) {
+ throwException(env, "Could not allocate handle");
+ return NULL;
+ }
+ pixels = (int *)(*env)->GetDirectBufferAddress(env, image_buffer) + images_offset;
+
+ memset(&bitmapInfo, 0, sizeof(BITMAPINFO));
+ bitmapInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+ bitmapInfo.bmiHeader.biWidth = width;
+ bitmapInfo.bmiHeader.biHeight = -height;
+ bitmapInfo.bmiHeader.biPlanes = 1;
+
+ bitmapInfo.bmiHeader.biBitCount = 24;
+ bitmapInfo.bmiHeader.biCompression = BI_RGB;
+
+ hDC = GetDC(NULL);
+
+ colorDIB = CreateDIBSection(hDC, (BITMAPINFO*)&(bitmapInfo),
+ DIB_RGB_COLORS,
+ (void*)&(ptrCursorImage),
+ NULL, 0);
+ srcPtr = pixels;
+ dstPtr = ptrCursorImage;
+ if (!dstPtr) {
+ throwException(env, "Could not allocate DIB section.");
+ ReleaseDC(NULL, hDC);
+ return NULL;
+ }
+ for (y = 0; y < height; y++ ) {
+ for (x = 0; x < width; x++ ) {
+ dstPtr[2] = (*srcPtr >> 0x10) & 0xFF;
+ dstPtr[1] = (*srcPtr >> 0x08) & 0xFF;
+ dstPtr[0] = *srcPtr & 0xFF;
+
+ srcPtr++;
+ dstPtr += 3;
+ }
+ }
+
+ colorBitmap = CreateDIBitmap(hDC,
+ (BITMAPINFOHEADER*)&bitmapInfo.bmiHeader,
+ CBM_INIT,
+ (void *)ptrCursorImage,
+ (BITMAPINFO*)&bitmapInfo,
+ DIB_RGB_COLORS);
+
+ DeleteObject(colorDIB);
+
+ // Convert alpha map to pixel packed mask
+ bitWidth = width >> 3;
+ scanlinePad = bitWidth & (sizeof(WORD) - 1);
+ imageSize = (bitWidth + scanlinePad)*height; // Size in bits
+ maskPixels = (unsigned char*)malloc(sizeof(unsigned char)*imageSize);
+ memset(maskPixels, 0, imageSize);
+ for (y = 0; y < height; y++)
+ for (x = 0; x < bitWidth; x++) {
+ col0 = (pixels[pixelCount++] & 0x01000000) >> 17;
+ col1 = (pixels[pixelCount++] & 0x01000000) >> 18;
+ col2 = (pixels[pixelCount++] & 0x01000000) >> 19;
+ col3 = (pixels[pixelCount++] & 0x01000000) >> 20;
+ col4 = (pixels[pixelCount++] & 0x01000000) >> 21;
+ col5 = (pixels[pixelCount++] & 0x01000000) >> 22;
+ col6 = (pixels[pixelCount++] & 0x01000000) >> 23;
+ col7 = (pixels[pixelCount++] & 0x01000000) >> 24;
+ mask = col0 | col1 | col2 | col3 | col4 | col5 | col6 | col7;
+ maskPixels[maskCount++] = ~mask; // 1 is tranparant, 0 opaque
+ }
+
+ cursorMask = CreateBitmap(width, height, 1, 1, maskPixels);
+
+ memset(&iconInfo, 0, sizeof(ICONINFO));
+ iconInfo.hbmMask = cursorMask;
+ iconInfo.hbmColor = colorBitmap;
+ iconInfo.fIcon = FALSE;
+ iconInfo.xHotspot = x_hotspot;
+ iconInfo.yHotspot = y_hotspot;
+ cursor = CreateIconIndirect(&iconInfo);
+ DeleteObject(colorBitmap);
+ DeleteObject(cursorMask);
+ free(maskPixels);
+ ReleaseDC(NULL, hDC);
+
+ cursor_handle = (HCURSOR *)(*env)->GetDirectBufferAddress(env, handle_buffer);
+ *cursor_handle = cursor;
+ return handle_buffer;
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_doDestroyCursor
+(JNIEnv *env, jclass unused, jobject handle_buffer)
+{
+ HCURSOR *cursor_handle = (HCURSOR *)(*env)->GetDirectBufferAddress(env, handle_buffer);
+ DestroyCursor(*cursor_handle);
+}
diff --git a/src/native/windows/org_lwjgl_opengl_Display.c b/src/native/windows/org_lwjgl_opengl_Display.c
index c24a135..b029238 100644
--- a/src/native/windows/org_lwjgl_opengl_Display.c
+++ b/src/native/windows/org_lwjgl_opengl_Display.c
@@ -1,481 +1,481 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: org_lwjgl_opengl_Display.c 3302 2010-03-31 23:56:24Z spasi $
- *
- * Base Windows display
- *
- * @author cix_foo <cix_foo at users.sourceforge.net>
- * @version $Revision: 3302 $
- */
-
-#define _PRIVATE_WINDOW_H_
-#include <windowsx.h>
-#include <malloc.h>
-#include "Window.h"
-#include "extgl_wgl.h"
-#include "common_tools.h"
-#include "display.h"
-#include "org_lwjgl_opengl_WindowsDisplay.h"
-#include "org_lwjgl_WindowsSysImplementation.h"
-#include "context.h"
-#include <commctrl.h>
-
-#define WINDOWCLASSNAME "LWJGL"
-
-/*
- * WindowProc for the GL window.
- */
-static LRESULT CALLBACK lwjglWindowProc(HWND hWnd,
- UINT msg,
- WPARAM wParam,
- LPARAM lParam)
-{
- jclass display_class;
- jclass display_class_global;
- jmethodID handleMessage_method;
- LONG message_time;
- JNIEnv *env = getThreadEnv();
- if (env != NULL && !(*env)->ExceptionOccurred(env)) {
- /*
- * We'll cache a global reference to the WindowsDisplay class in the window's user data.
- * This is not so much to avoid lookup overhead as it is to avoid problems
- * with AWT. Specifically, awt code can indirectly call this message handler
- * when it does a SendMessage on the main thread to the currently focused window,
- * which could be a LWJGL window. The FindClass will then fail because the calling
- * internal awt class is using the system class loader, not the application loader
- * where lwjgl is found.
- *
- * The very first message sent to this handler is sent when
- * a window is created, where we are sure that the calling class' classloader has
- * LWJGL classes in it.
- */
- display_class_global = (jclass)(LONG_PTR)GetWindowLongPtr(hWnd, GWLP_USERDATA);
- if (display_class_global == NULL) {
- display_class = (*env)->FindClass(env, "org/lwjgl/opengl/WindowsDisplay");
- if (display_class != NULL) {
- display_class_global = (*env)->NewGlobalRef(env, display_class);
- if (display_class_global != NULL)
- SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR)display_class_global);
- }
- }
- if (display_class_global != NULL) {
- message_time = GetMessageTime();
- handleMessage_method = (*env)->GetStaticMethodID(env, display_class_global, "handleMessage", "(JIJJJ)I");
- if (handleMessage_method != NULL)
- return (*env)->CallStaticIntMethod(env, display_class_global, handleMessage_method, (jlong)(intptr_t)hWnd, (jint)msg, (jlong)wParam, (jlong)lParam, (jlong)message_time);
- }
- }
- return DefWindowProc(hWnd, msg, wParam, lParam);
-}
-
-JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_WindowsDisplay_defWindowProc(JNIEnv *env, jclass unused, jlong hWnd, jint msg, jlong wParam, jlong lParam) {
- return DefWindowProc((HWND)(INT_PTR)hWnd, msg, wParam, lParam);
-}
-
-/*
- * Handle native Windows messages
- */
-static void handleMessages(JNIEnv *env) {
- /*
- * Now's our chance to deal with Windows messages that are
- * otherwise just piling up and causing everything not to
- * work properly
- */
- MSG msg;
- while (!(*env)->ExceptionOccurred(env) && PeekMessage(
- &msg, // message information
- NULL, // handle to window
- 0, // first message
- 0, // last message
- PM_REMOVE // removal options
- ))
- {
- if (msg.message == WM_QUIT)
- break;
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
-}
-
-JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_getDC(JNIEnv *env, jclass unused, jlong hwnd_ptr) {
- HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
- return (INT_PTR)GetDC(hwnd);
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nSetTitle
- (JNIEnv * env, jclass unused, jlong hwnd_ptr, jstring title_obj) {
- HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
- char * title = GetStringNativeChars(env, title_obj);
- SetWindowText(hwnd, title);
- free(title);
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nUpdate(JNIEnv * env, jclass class) {
- handleMessages(env);
-}
-
-JNIEXPORT jobjectArray JNICALL Java_org_lwjgl_opengl_WindowsDisplay_getAvailableDisplayModes(JNIEnv *env, jobject self) {
- return getAvailableDisplayModes(env);
-}
-
-JNIEXPORT jint JNICALL Java_org_lwjgl_DefaultSysImplementation_getJNIVersion
- (JNIEnv *env, jobject ignored) {
- return org_lwjgl_WindowsSysImplementation_JNI_VERSION;
-}
-
-JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nCreateWindow(JNIEnv *env, jclass unused, jint x, jint y, jint width, jint height, jboolean undecorated, jboolean child_window, jlong parent_hwnd) {
- HWND hwnd;
- static bool oneShotInitialised = false;
- if (!oneShotInitialised) {
- if (!registerWindow(lwjglWindowProc, WINDOWCLASSNAME)) {
- throwException(env, "Could not register window class");
- return 0;
- }
- oneShotInitialised = true;
- }
-
- hwnd = createWindow(WINDOWCLASSNAME, x, y, width, height, undecorated, child_window, (HWND)(INT_PTR)parent_hwnd);
- return (INT_PTR)hwnd;
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nReleaseDC(JNIEnv *env, jclass clazz, jlong hwnd_ptr, jlong hdc_ptr) {
- HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
- HDC hdc = (HDC)(INT_PTR)hdc_ptr;
- ReleaseDC(hwnd, hdc);
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nDestroyWindow(JNIEnv *env, jclass clazz, jlong hwnd_ptr) {
- jclass display_class_global;
- HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
- display_class_global = (jclass)(LONG_PTR)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- ShowWindow(hwnd, SW_HIDE);
- DestroyWindow(hwnd);
- if (display_class_global != NULL)
- (*env)->DeleteGlobalRef(env, display_class_global);
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_clientToScreen(JNIEnv *env, jclass unused, jlong hwnd_int, jobject buffer_handle) {
- HWND hwnd = (HWND)(INT_PTR)hwnd_int;
- POINT point;
- jint *buffer = (jint *)(*env)->GetDirectBufferAddress(env, buffer_handle);
- jlong size = (*env)->GetDirectBufferCapacity(env, buffer_handle);
- if (size < 2) {
- throwFormattedRuntimeException(env, "Buffer size < 2", size);
- return;
- }
- point.x = buffer[0];
- point.y = buffer[1];
- ClientToScreen(hwnd, &point);
- buffer[0] = point.x;
- buffer[1] = point.y;
-}
-
-JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_getForegroundWindow(JNIEnv *env, jclass unused) {
- return (INT_PTR)GetForegroundWindow();
-}
-
-JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_getDesktopWindow(JNIEnv *env, jclass unused) {
- return (INT_PTR)GetDesktopWindow();
-}
-
-static void copyBufferToRect(JNIEnv *env, jobject buffer_handle, RECT *rect) {
- jint *buffer = (jint *)(*env)->GetDirectBufferAddress(env, buffer_handle);
- jlong size = (*env)->GetDirectBufferCapacity(env, buffer_handle);
- if (size < 4) {
- throwFormattedRuntimeException(env, "Buffer size < 4", size);
- return;
- }
- rect->top = buffer[0];
- rect->bottom = buffer[1];
- rect->left = buffer[2];
- rect->right = buffer[3];
-}
-
-static void copyRectToBuffer(JNIEnv *env, RECT *rect, jobject buffer_handle) {
- jint *buffer = (jint *)(*env)->GetDirectBufferAddress(env, buffer_handle);
- jlong size = (*env)->GetDirectBufferCapacity(env, buffer_handle);
- if (size < 4) {
- throwFormattedRuntimeException(env, "Buffer size < 4", size);
- return;
- }
- buffer[0] = rect->top;
- buffer[1] = rect->bottom;
- buffer[2] = rect->left;
- buffer[3] = rect->right;
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_clipCursor(JNIEnv *env, jclass unused, jobject handle_buffer) {
- RECT clip_rect;
- LPRECT clip_rect_ptr;
- if (handle_buffer != NULL) {
- copyBufferToRect(env, handle_buffer, &clip_rect);
- clip_rect_ptr = &clip_rect;
- } else
- clip_rect_ptr = NULL;
- if (ClipCursor(clip_rect_ptr) == 0)
- throwFormattedException(env, "ClipCursor failed (%d)", GetLastError());
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nSwitchDisplayMode(JNIEnv *env, jobject self, jobject mode) {
- switchDisplayMode(env, mode);
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nResetDisplayMode(JNIEnv *env, jobject self) {
- resetDisplayMode(env);
-}
-
-JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_WindowsDisplay_getCurrentDisplayMode(JNIEnv *env, jclass unused) {
- return getCurrentDisplayMode(env);
-}
-
-JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_WindowsDisplay_convertToNativeRamp(JNIEnv *env, jclass unused, jobject float_ramp) {
- return convertToNativeRamp(env, float_ramp);
-}
-
-JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_WindowsDisplay_getCurrentGammaRamp(JNIEnv *env, jclass unused) {
- return getCurrentGammaRamp(env);
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nSetGammaRamp(JNIEnv *env, jclass unused, jobject gamma_buffer) {
- setGammaRamp(env, gamma_buffer);
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_showWindow(JNIEnv *env, jclass unused, jlong hwnd_ptr, jint mode) {
- HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
- ShowWindow(hwnd, mode);
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_setForegroundWindow(JNIEnv *env, jclass unused, jlong hwnd_ptr) {
- HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
- SetForegroundWindow(hwnd);
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_setFocus(JNIEnv *env, jclass unused, jlong hwnd_ptr) {
- HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
- SetFocus(hwnd);
-}
-
-JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nGetVersion(JNIEnv *env, jobject self, jstring driver) {
- char *driver_str;
- jstring result;
- driver_str = GetStringNativeChars(env, driver);
- if (driver_str == NULL)
- return NULL;
- result = getVersion(env, driver_str);
- free(driver_str);
- return result;
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nReshape(JNIEnv *env, jclass unused, jlong hwnd_ptr, jint x, jint y, jint width, jint height, jboolean undecorated, jboolean child) {
- HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
- DWORD exstyle, windowflags;
- RECT clientSize;
-
- getWindowFlags(&windowflags, &exstyle, undecorated, child);
-
- // If we're not a fullscreen window, adjust the height to account for the
- // height of the title bar:
- clientSize.bottom = height;
- clientSize.left = 0;
- clientSize.right = width;
- clientSize.top = 0;
-
- AdjustWindowRectEx(
- &clientSize, // client-rectangle structure
- windowflags, // window styles
- FALSE, // menu-present option
- exstyle // extended window style
- );
-
- SetWindowPos(hwnd, HWND_TOP, x, y, clientSize.right - clientSize.left, clientSize.bottom - clientSize.top, SWP_NOZORDER);
-}
-
-static HICON createWindowIcon(JNIEnv *env, jint *pixels, jint width, jint height) {
- unsigned char col;
- unsigned char mask;
- BITMAPV5HEADER bitmapInfo;
- HBITMAP cursorMask;
- HBITMAP colorBitmap;
- ICONINFO iconInfo;
- HICON icon;
- char *ptrCursorImage;
- int x, y;
- char *dstPtr;
- int imageSize;
- unsigned char *maskPixels;
- int widthInBytes;
- int leftShift;
- int maskPixelsOff;
- int scanlineWidth;
- HBITMAP colorDIB;
-
- memset(&bitmapInfo, 0, sizeof(BITMAPV5HEADER));
- bitmapInfo.bV5Size = sizeof(BITMAPV5HEADER);
- bitmapInfo.bV5Width = width;
- bitmapInfo.bV5Height = -height;
- bitmapInfo.bV5Planes = 1;
- bitmapInfo.bV5BitCount = 32;
- bitmapInfo.bV5Compression = BI_BITFIELDS;
- bitmapInfo.bV5RedMask = 0x00FF0000;
- bitmapInfo.bV5GreenMask = 0x0000FF00;
- bitmapInfo.bV5BlueMask = 0x000000FF;
- bitmapInfo.bV5AlphaMask = 0xFF000000;
-
- colorDIB = CreateDIBSection(GetDC(NULL), (BITMAPINFO*)&(bitmapInfo),
- DIB_RGB_COLORS, (void*)&(ptrCursorImage), NULL, 0);
- if (!ptrCursorImage) {
- throwException(env, "Could not allocate DIB section.");
- }
-
- for (y = 0; y < height; y++ ) {
- dstPtr = ptrCursorImage + width*4*y;;
- for (x = 0; x < width; x++ ) {
- dstPtr[0] = (pixels[y*width+x] >> 0x10) & 0xFF;
- dstPtr[1] = (pixels[y*width+x] >> 0x08) & 0xFF;
- dstPtr[2] = pixels[y*width+x] & 0xFF;
- dstPtr[3] = (pixels[y*width+x] >> 0x18) & 0xFF;
- dstPtr += 4;
- }
- }
-
-
- colorBitmap = CreateDIBitmap(GetDC(NULL),
- (BITMAPINFOHEADER*)&bitmapInfo,
- CBM_INIT,
- (void *)ptrCursorImage,
- (BITMAPINFO*)&bitmapInfo,
- DIB_RGB_COLORS);
-
- DeleteObject(colorDIB);
-
- // Convert alpha map to pixel packed mask
-
- // number of bytes it takes to fit a bit packed scan line.
- widthInBytes = (width & 0x7) != 0 ? (width >> 3) + 1 : (width >> 3);
-
- // number of bytes it takes to fit WORD padded scan line.
- scanlineWidth = widthInBytes;
- if (scanlineWidth % sizeof(WORD) != 0) {
- scanlineWidth = (scanlineWidth / sizeof(WORD)) * sizeof(WORD) + sizeof(WORD);
- }
- imageSize = scanlineWidth*height;
- maskPixels = (unsigned char*)malloc(sizeof(unsigned char)*imageSize);
- memset(maskPixels, 0xFF, sizeof(unsigned char)*imageSize);
-
- cursorMask = CreateBitmap(width, height, 1, 1, maskPixels);
-
- memset(&iconInfo, 0, sizeof(ICONINFO));
- iconInfo.hbmMask = cursorMask;
- iconInfo.hbmColor = colorBitmap;
- iconInfo.fIcon = TRUE;
- iconInfo.xHotspot = 0;
- iconInfo.yHotspot = 0;
- icon = CreateIconIndirect(&iconInfo);
- DeleteObject(colorBitmap);
- DeleteObject(cursorMask);
- free(maskPixels);
-
- return icon;
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_destroyIcon
- (JNIEnv *env, jclass clazz, jlong handle) {
- HICON icon = (HICON)(INT_PTR)handle;
- DestroyIcon(icon);
-}
-
-JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_createIcon
- (JNIEnv *env, jclass clazz, jint width, jint height, jobject iconBuffer) {
- jint *imgData = (jint *)(*env)->GetDirectBufferAddress(env, iconBuffer);
- return (INT_PTR)createWindowIcon(env, imgData, width, height);
-}
-
-JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_sendMessage
- (JNIEnv *env, jclass clazz, jlong hwnd_ptr, jlong msg, jlong wparam, jlong lparam) {
- HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
- return SendMessage(hwnd, (UINT)msg, (WPARAM)wparam, (LPARAM)lparam);
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nSetCursorPosition
-(JNIEnv * env, jclass unused, jint x, jint y) {
- if (!SetCursorPos(x, y))
- printfDebugJava(env, "SetCursorPos failed");
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_getClientRect
- (JNIEnv *env, jclass unused, jlong hwnd_int, jobject rect_buffer) {
- HWND hwnd = (HWND)(INT_PTR)hwnd_int;
- RECT clientRect;
- GetClientRect(hwnd, &clientRect);
- copyRectToBuffer(env, &clientRect, rect_buffer);
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nSetNativeCursor
- (JNIEnv *env, jclass unused, jlong hwnd_int, jobject handle_buffer)
-{
- HWND hwnd = (HWND)(INT_PTR)hwnd_int;
- HCURSOR *cursor_handle;
- HCURSOR cursor;
- if (handle_buffer != NULL) {
- cursor_handle = (HCURSOR *)(*env)->GetDirectBufferAddress(env, handle_buffer);
- cursor = *cursor_handle;
- SetClassLongPtr(hwnd, GCLP_HCURSOR, (LONG_PTR)cursor);
- SetCursor(cursor);
- } else {
- SetClassLongPtr(hwnd, GCLP_HCURSOR, (LONG_PTR)NULL);
- SetCursor(LoadCursor(NULL, IDC_ARROW));
- }
-}
-
-JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_WindowsDisplay_getSystemMetrics(JNIEnv *env, jclass unused, jint index) {
- return GetSystemMetrics(index);
-}
-
-JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nSetCapture(JNIEnv *env, jclass unused, jlong hwnd_int) {
- HWND hwnd = (HWND)(INT_PTR)hwnd_int;
- return (INT_PTR) SetCapture(hwnd);
-}
-
-JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nReleaseCapture(JNIEnv *env, jclass unused) {
- return ReleaseCapture();
-}
-
-JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nTrackMouseEvent(JNIEnv *env, jclass clazz, jlong hwnd_ptr) {
- HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
- TRACKMOUSEEVENT tme;
- tme.cbSize = sizeof(TRACKMOUSEEVENT);
- tme.dwFlags = TME_LEAVE;
- tme.hwndTrack = hwnd;
- return TrackMouseEvent(&tme);
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: org_lwjgl_opengl_Display.c 3302 2010-03-31 23:56:24Z spasi $
+ *
+ * Base Windows display
+ *
+ * @author cix_foo <cix_foo at users.sourceforge.net>
+ * @version $Revision: 3302 $
+ */
+
+#define _PRIVATE_WINDOW_H_
+#include <windowsx.h>
+#include <malloc.h>
+#include "Window.h"
+#include "extgl_wgl.h"
+#include "common_tools.h"
+#include "display.h"
+#include "org_lwjgl_opengl_WindowsDisplay.h"
+#include "org_lwjgl_WindowsSysImplementation.h"
+#include "context.h"
+#include <commctrl.h>
+
+#define WINDOWCLASSNAME "LWJGL"
+
+/*
+ * WindowProc for the GL window.
+ */
+static LRESULT CALLBACK lwjglWindowProc(HWND hWnd,
+ UINT msg,
+ WPARAM wParam,
+ LPARAM lParam)
+{
+ jclass display_class;
+ jclass display_class_global;
+ jmethodID handleMessage_method;
+ LONG message_time;
+ JNIEnv *env = getThreadEnv();
+ if (env != NULL && !(*env)->ExceptionOccurred(env)) {
+ /*
+ * We'll cache a global reference to the WindowsDisplay class in the window's user data.
+ * This is not so much to avoid lookup overhead as it is to avoid problems
+ * with AWT. Specifically, awt code can indirectly call this message handler
+ * when it does a SendMessage on the main thread to the currently focused window,
+ * which could be a LWJGL window. The FindClass will then fail because the calling
+ * internal awt class is using the system class loader, not the application loader
+ * where lwjgl is found.
+ *
+ * The very first message sent to this handler is sent when
+ * a window is created, where we are sure that the calling class' classloader has
+ * LWJGL classes in it.
+ */
+ display_class_global = (jclass)(LONG_PTR)GetWindowLongPtr(hWnd, GWLP_USERDATA);
+ if (display_class_global == NULL) {
+ display_class = (*env)->FindClass(env, "org/lwjgl/opengl/WindowsDisplay");
+ if (display_class != NULL) {
+ display_class_global = (*env)->NewGlobalRef(env, display_class);
+ if (display_class_global != NULL)
+ SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR)display_class_global);
+ }
+ }
+ if (display_class_global != NULL) {
+ message_time = GetMessageTime();
+ handleMessage_method = (*env)->GetStaticMethodID(env, display_class_global, "handleMessage", "(JIJJJ)I");
+ if (handleMessage_method != NULL)
+ return (*env)->CallStaticIntMethod(env, display_class_global, handleMessage_method, (jlong)(intptr_t)hWnd, (jint)msg, (jlong)wParam, (jlong)lParam, (jlong)message_time);
+ }
+ }
+ return DefWindowProc(hWnd, msg, wParam, lParam);
+}
+
+JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_WindowsDisplay_defWindowProc(JNIEnv *env, jclass unused, jlong hWnd, jint msg, jlong wParam, jlong lParam) {
+ return DefWindowProc((HWND)(INT_PTR)hWnd, msg, wParam, lParam);
+}
+
+/*
+ * Handle native Windows messages
+ */
+static void handleMessages(JNIEnv *env) {
+ /*
+ * Now's our chance to deal with Windows messages that are
+ * otherwise just piling up and causing everything not to
+ * work properly
+ */
+ MSG msg;
+ while (!(*env)->ExceptionOccurred(env) && PeekMessage(
+ &msg, // message information
+ NULL, // handle to window
+ 0, // first message
+ 0, // last message
+ PM_REMOVE // removal options
+ ))
+ {
+ if (msg.message == WM_QUIT)
+ break;
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+}
+
+JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_getDC(JNIEnv *env, jclass unused, jlong hwnd_ptr) {
+ HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
+ return (INT_PTR)GetDC(hwnd);
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nSetTitle
+ (JNIEnv * env, jclass unused, jlong hwnd_ptr, jstring title_obj) {
+ HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
+ char * title = GetStringNativeChars(env, title_obj);
+ SetWindowText(hwnd, title);
+ free(title);
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nUpdate(JNIEnv * env, jclass class) {
+ handleMessages(env);
+}
+
+JNIEXPORT jobjectArray JNICALL Java_org_lwjgl_opengl_WindowsDisplay_getAvailableDisplayModes(JNIEnv *env, jobject self) {
+ return getAvailableDisplayModes(env);
+}
+
+JNIEXPORT jint JNICALL Java_org_lwjgl_DefaultSysImplementation_getJNIVersion
+ (JNIEnv *env, jobject ignored) {
+ return org_lwjgl_WindowsSysImplementation_JNI_VERSION;
+}
+
+JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nCreateWindow(JNIEnv *env, jclass unused, jint x, jint y, jint width, jint height, jboolean undecorated, jboolean child_window, jlong parent_hwnd) {
+ HWND hwnd;
+ static bool oneShotInitialised = false;
+ if (!oneShotInitialised) {
+ if (!registerWindow(lwjglWindowProc, WINDOWCLASSNAME)) {
+ throwException(env, "Could not register window class");
+ return 0;
+ }
+ oneShotInitialised = true;
+ }
+
+ hwnd = createWindow(WINDOWCLASSNAME, x, y, width, height, undecorated, child_window, (HWND)(INT_PTR)parent_hwnd);
+ return (INT_PTR)hwnd;
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nReleaseDC(JNIEnv *env, jclass clazz, jlong hwnd_ptr, jlong hdc_ptr) {
+ HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
+ HDC hdc = (HDC)(INT_PTR)hdc_ptr;
+ ReleaseDC(hwnd, hdc);
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nDestroyWindow(JNIEnv *env, jclass clazz, jlong hwnd_ptr) {
+ jclass display_class_global;
+ HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
+ display_class_global = (jclass)(LONG_PTR)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ ShowWindow(hwnd, SW_HIDE);
+ DestroyWindow(hwnd);
+ if (display_class_global != NULL)
+ (*env)->DeleteGlobalRef(env, display_class_global);
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_clientToScreen(JNIEnv *env, jclass unused, jlong hwnd_int, jobject buffer_handle) {
+ HWND hwnd = (HWND)(INT_PTR)hwnd_int;
+ POINT point;
+ jint *buffer = (jint *)(*env)->GetDirectBufferAddress(env, buffer_handle);
+ jlong size = (*env)->GetDirectBufferCapacity(env, buffer_handle);
+ if (size < 2) {
+ throwFormattedRuntimeException(env, "Buffer size < 2", size);
+ return;
+ }
+ point.x = buffer[0];
+ point.y = buffer[1];
+ ClientToScreen(hwnd, &point);
+ buffer[0] = point.x;
+ buffer[1] = point.y;
+}
+
+JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_getForegroundWindow(JNIEnv *env, jclass unused) {
+ return (INT_PTR)GetForegroundWindow();
+}
+
+JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_getDesktopWindow(JNIEnv *env, jclass unused) {
+ return (INT_PTR)GetDesktopWindow();
+}
+
+static void copyBufferToRect(JNIEnv *env, jobject buffer_handle, RECT *rect) {
+ jint *buffer = (jint *)(*env)->GetDirectBufferAddress(env, buffer_handle);
+ jlong size = (*env)->GetDirectBufferCapacity(env, buffer_handle);
+ if (size < 4) {
+ throwFormattedRuntimeException(env, "Buffer size < 4", size);
+ return;
+ }
+ rect->top = buffer[0];
+ rect->bottom = buffer[1];
+ rect->left = buffer[2];
+ rect->right = buffer[3];
+}
+
+static void copyRectToBuffer(JNIEnv *env, RECT *rect, jobject buffer_handle) {
+ jint *buffer = (jint *)(*env)->GetDirectBufferAddress(env, buffer_handle);
+ jlong size = (*env)->GetDirectBufferCapacity(env, buffer_handle);
+ if (size < 4) {
+ throwFormattedRuntimeException(env, "Buffer size < 4", size);
+ return;
+ }
+ buffer[0] = rect->top;
+ buffer[1] = rect->bottom;
+ buffer[2] = rect->left;
+ buffer[3] = rect->right;
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_clipCursor(JNIEnv *env, jclass unused, jobject handle_buffer) {
+ RECT clip_rect;
+ LPRECT clip_rect_ptr;
+ if (handle_buffer != NULL) {
+ copyBufferToRect(env, handle_buffer, &clip_rect);
+ clip_rect_ptr = &clip_rect;
+ } else
+ clip_rect_ptr = NULL;
+ if (ClipCursor(clip_rect_ptr) == 0)
+ throwFormattedException(env, "ClipCursor failed (%d)", GetLastError());
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nSwitchDisplayMode(JNIEnv *env, jobject self, jobject mode) {
+ switchDisplayMode(env, mode);
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nResetDisplayMode(JNIEnv *env, jobject self) {
+ resetDisplayMode(env);
+}
+
+JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_WindowsDisplay_getCurrentDisplayMode(JNIEnv *env, jclass unused) {
+ return getCurrentDisplayMode(env);
+}
+
+JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_WindowsDisplay_convertToNativeRamp(JNIEnv *env, jclass unused, jobject float_ramp) {
+ return convertToNativeRamp(env, float_ramp);
+}
+
+JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_WindowsDisplay_getCurrentGammaRamp(JNIEnv *env, jclass unused) {
+ return getCurrentGammaRamp(env);
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nSetGammaRamp(JNIEnv *env, jclass unused, jobject gamma_buffer) {
+ setGammaRamp(env, gamma_buffer);
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_showWindow(JNIEnv *env, jclass unused, jlong hwnd_ptr, jint mode) {
+ HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
+ ShowWindow(hwnd, mode);
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_setForegroundWindow(JNIEnv *env, jclass unused, jlong hwnd_ptr) {
+ HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
+ SetForegroundWindow(hwnd);
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_setFocus(JNIEnv *env, jclass unused, jlong hwnd_ptr) {
+ HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
+ SetFocus(hwnd);
+}
+
+JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nGetVersion(JNIEnv *env, jobject self, jstring driver) {
+ char *driver_str;
+ jstring result;
+ driver_str = GetStringNativeChars(env, driver);
+ if (driver_str == NULL)
+ return NULL;
+ result = getVersion(env, driver_str);
+ free(driver_str);
+ return result;
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nReshape(JNIEnv *env, jclass unused, jlong hwnd_ptr, jint x, jint y, jint width, jint height, jboolean undecorated, jboolean child) {
+ HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
+ DWORD exstyle, windowflags;
+ RECT clientSize;
+
+ getWindowFlags(&windowflags, &exstyle, undecorated, child);
+
+ // If we're not a fullscreen window, adjust the height to account for the
+ // height of the title bar:
+ clientSize.bottom = height;
+ clientSize.left = 0;
+ clientSize.right = width;
+ clientSize.top = 0;
+
+ AdjustWindowRectEx(
+ &clientSize, // client-rectangle structure
+ windowflags, // window styles
+ FALSE, // menu-present option
+ exstyle // extended window style
+ );
+
+ SetWindowPos(hwnd, HWND_TOP, x, y, clientSize.right - clientSize.left, clientSize.bottom - clientSize.top, SWP_NOZORDER);
+}
+
+static HICON createWindowIcon(JNIEnv *env, jint *pixels, jint width, jint height) {
+ unsigned char col;
+ unsigned char mask;
+ BITMAPV5HEADER bitmapInfo;
+ HBITMAP cursorMask;
+ HBITMAP colorBitmap;
+ ICONINFO iconInfo;
+ HICON icon;
+ char *ptrCursorImage;
+ int x, y;
+ char *dstPtr;
+ int imageSize;
+ unsigned char *maskPixels;
+ int widthInBytes;
+ int leftShift;
+ int maskPixelsOff;
+ int scanlineWidth;
+ HBITMAP colorDIB;
+
+ memset(&bitmapInfo, 0, sizeof(BITMAPV5HEADER));
+ bitmapInfo.bV5Size = sizeof(BITMAPV5HEADER);
+ bitmapInfo.bV5Width = width;
+ bitmapInfo.bV5Height = -height;
+ bitmapInfo.bV5Planes = 1;
+ bitmapInfo.bV5BitCount = 32;
+ bitmapInfo.bV5Compression = BI_BITFIELDS;
+ bitmapInfo.bV5RedMask = 0x00FF0000;
+ bitmapInfo.bV5GreenMask = 0x0000FF00;
+ bitmapInfo.bV5BlueMask = 0x000000FF;
+ bitmapInfo.bV5AlphaMask = 0xFF000000;
+
+ colorDIB = CreateDIBSection(GetDC(NULL), (BITMAPINFO*)&(bitmapInfo),
+ DIB_RGB_COLORS, (void*)&(ptrCursorImage), NULL, 0);
+ if (!ptrCursorImage) {
+ throwException(env, "Could not allocate DIB section.");
+ }
+
+ for (y = 0; y < height; y++ ) {
+ dstPtr = ptrCursorImage + width*4*y;;
+ for (x = 0; x < width; x++ ) {
+ dstPtr[0] = (pixels[y*width+x] >> 0x10) & 0xFF;
+ dstPtr[1] = (pixels[y*width+x] >> 0x08) & 0xFF;
+ dstPtr[2] = pixels[y*width+x] & 0xFF;
+ dstPtr[3] = (pixels[y*width+x] >> 0x18) & 0xFF;
+ dstPtr += 4;
+ }
+ }
+
+
+ colorBitmap = CreateDIBitmap(GetDC(NULL),
+ (BITMAPINFOHEADER*)&bitmapInfo,
+ CBM_INIT,
+ (void *)ptrCursorImage,
+ (BITMAPINFO*)&bitmapInfo,
+ DIB_RGB_COLORS);
+
+ DeleteObject(colorDIB);
+
+ // Convert alpha map to pixel packed mask
+
+ // number of bytes it takes to fit a bit packed scan line.
+ widthInBytes = (width & 0x7) != 0 ? (width >> 3) + 1 : (width >> 3);
+
+ // number of bytes it takes to fit WORD padded scan line.
+ scanlineWidth = widthInBytes;
+ if (scanlineWidth % sizeof(WORD) != 0) {
+ scanlineWidth = (scanlineWidth / sizeof(WORD)) * sizeof(WORD) + sizeof(WORD);
+ }
+ imageSize = scanlineWidth*height;
+ maskPixels = (unsigned char*)malloc(sizeof(unsigned char)*imageSize);
+ memset(maskPixels, 0xFF, sizeof(unsigned char)*imageSize);
+
+ cursorMask = CreateBitmap(width, height, 1, 1, maskPixels);
+
+ memset(&iconInfo, 0, sizeof(ICONINFO));
+ iconInfo.hbmMask = cursorMask;
+ iconInfo.hbmColor = colorBitmap;
+ iconInfo.fIcon = TRUE;
+ iconInfo.xHotspot = 0;
+ iconInfo.yHotspot = 0;
+ icon = CreateIconIndirect(&iconInfo);
+ DeleteObject(colorBitmap);
+ DeleteObject(cursorMask);
+ free(maskPixels);
+
+ return icon;
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_destroyIcon
+ (JNIEnv *env, jclass clazz, jlong handle) {
+ HICON icon = (HICON)(INT_PTR)handle;
+ DestroyIcon(icon);
+}
+
+JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_createIcon
+ (JNIEnv *env, jclass clazz, jint width, jint height, jobject iconBuffer) {
+ jint *imgData = (jint *)(*env)->GetDirectBufferAddress(env, iconBuffer);
+ return (INT_PTR)createWindowIcon(env, imgData, width, height);
+}
+
+JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_sendMessage
+ (JNIEnv *env, jclass clazz, jlong hwnd_ptr, jlong msg, jlong wparam, jlong lparam) {
+ HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
+ return SendMessage(hwnd, (UINT)msg, (WPARAM)wparam, (LPARAM)lparam);
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nSetCursorPosition
+(JNIEnv * env, jclass unused, jint x, jint y) {
+ if (!SetCursorPos(x, y))
+ printfDebugJava(env, "SetCursorPos failed");
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_getClientRect
+ (JNIEnv *env, jclass unused, jlong hwnd_int, jobject rect_buffer) {
+ HWND hwnd = (HWND)(INT_PTR)hwnd_int;
+ RECT clientRect;
+ GetClientRect(hwnd, &clientRect);
+ copyRectToBuffer(env, &clientRect, rect_buffer);
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nSetNativeCursor
+ (JNIEnv *env, jclass unused, jlong hwnd_int, jobject handle_buffer)
+{
+ HWND hwnd = (HWND)(INT_PTR)hwnd_int;
+ HCURSOR *cursor_handle;
+ HCURSOR cursor;
+ if (handle_buffer != NULL) {
+ cursor_handle = (HCURSOR *)(*env)->GetDirectBufferAddress(env, handle_buffer);
+ cursor = *cursor_handle;
+ SetClassLongPtr(hwnd, GCLP_HCURSOR, (LONG_PTR)cursor);
+ SetCursor(cursor);
+ } else {
+ SetClassLongPtr(hwnd, GCLP_HCURSOR, (LONG_PTR)NULL);
+ SetCursor(LoadCursor(NULL, IDC_ARROW));
+ }
+}
+
+JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_WindowsDisplay_getSystemMetrics(JNIEnv *env, jclass unused, jint index) {
+ return GetSystemMetrics(index);
+}
+
+JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nSetCapture(JNIEnv *env, jclass unused, jlong hwnd_int) {
+ HWND hwnd = (HWND)(INT_PTR)hwnd_int;
+ return (INT_PTR) SetCapture(hwnd);
+}
+
+JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nReleaseCapture(JNIEnv *env, jclass unused) {
+ return ReleaseCapture();
+}
+
+JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nTrackMouseEvent(JNIEnv *env, jclass clazz, jlong hwnd_ptr) {
+ HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
+ TRACKMOUSEEVENT tme;
+ tme.cbSize = sizeof(TRACKMOUSEEVENT);
+ tme.dwFlags = TME_LEAVE;
+ tme.hwndTrack = hwnd;
+ return TrackMouseEvent(&tme);
}
\ No newline at end of file
diff --git a/src/native/windows/org_lwjgl_opengl_Pbuffer.c b/src/native/windows/org_lwjgl_opengl_Pbuffer.c
index 76afce9..9090f2f 100644
--- a/src/native/windows/org_lwjgl_opengl_Pbuffer.c
+++ b/src/native/windows/org_lwjgl_opengl_Pbuffer.c
@@ -1,212 +1,212 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: org_lwjgl_opengl_Pbuffer.c 3149 2008-11-22 14:54:15Z elias_naur $
- *
- * Windows Pbuffer.
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3149 $
- */
-
-#include <stdlib.h>
-#include "org_lwjgl_opengl_WindowsDisplay.h"
-#include "org_lwjgl_opengl_Pbuffer.h"
-#include "context.h"
-
-#include "extgl.h"
-#include "extgl_wgl.h"
-
-#include "common_tools.h"
-
-static bool isPbufferSupported(WGLExtensions *extensions) {
- return extensions->WGL_ARB_pixel_format && extensions->WGL_ARB_pbuffer;
-}
-
-static bool getExtensions(JNIEnv *env, WGLExtensions *extensions, jobject pixel_format, jobject pixelFormatCaps) {
- int origin_x = 0; int origin_y = 0;
- HWND dummy_hwnd;
- HDC dummy_hdc;
- HGLRC dummy_context;
- HDC saved_hdc;
- HGLRC saved_context;
- int pixel_format_id;
-
- dummy_hwnd = createDummyWindow(origin_x, origin_y);
- if (dummy_hwnd == NULL) {
- throwException(env, "Could not create dummy window");
- return false;
- }
- dummy_hdc = GetDC(dummy_hwnd);
- pixel_format_id = findPixelFormatOnDC(env, dummy_hdc, origin_x, origin_y, pixel_format, pixelFormatCaps, false, true, false, false);
- if (pixel_format_id == -1) {
- closeWindow(&dummy_hwnd, &dummy_hdc);
- return false;
- }
- if (!applyPixelFormat(env, dummy_hdc, pixel_format_id)) {
- closeWindow(&dummy_hwnd, &dummy_hdc);
- return false;
- }
- dummy_context = wglCreateContext(dummy_hdc);
- if (dummy_context == NULL) {
- closeWindow(&dummy_hwnd, &dummy_hdc);
- throwException(env, "Could not create dummy context");
- return false;
- }
- saved_hdc = wglGetCurrentDC();
- saved_context = wglGetCurrentContext();
- if (!wglMakeCurrent(dummy_hdc, dummy_context)) {
- wglMakeCurrent(saved_hdc, saved_context);
- closeWindow(&dummy_hwnd, &dummy_hdc);
- wglDeleteContext(dummy_context);
- throwException(env, "Could not make dummy context current");
- return false;
- }
- extgl_InitWGL(extensions);
- if (!wglMakeCurrent(saved_hdc, saved_context))
- printfDebugJava(env, "ERROR: Could not restore current context");
- closeWindow(&dummy_hwnd, &dummy_hdc);
- wglDeleteContext(dummy_context);
- return true;
-}
-
-JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nGetPbufferCapabilities
- (JNIEnv *env, jobject self, jobject pixel_format)
-{
- int caps = 0;
- WGLExtensions extensions;
- if (!getExtensions(env, &extensions, pixel_format, NULL))
- return 0;
- if (isPbufferSupported(&extensions))
- caps |= org_lwjgl_opengl_Pbuffer_PBUFFER_SUPPORTED;
-
- if (extensions.WGL_ARB_render_texture)
- caps |= org_lwjgl_opengl_Pbuffer_RENDER_TEXTURE_SUPPORTED;
-
- if (extensions.WGL_NV_render_texture_rectangle)
- caps |= org_lwjgl_opengl_Pbuffer_RENDER_TEXTURE_RECTANGLE_SUPPORTED;
-
- if (extensions.WGL_NV_render_depth_texture)
- caps |= org_lwjgl_opengl_Pbuffer_RENDER_DEPTH_TEXTURE_SUPPORTED;
-
- return caps;
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsPbufferPeerInfo_nCreate
- (JNIEnv *env, jobject self, jobject peer_info_handle,
- jint width, jint height, jobject pixel_format,
- jobject pixelFormatCaps, jobject pBufferAttribs)
-{
- int origin_x = 0; int origin_y = 0;
- HWND dummy_hwnd;
- HDC dummy_hdc;
- HPBUFFERARB Pbuffer;
- HDC Pbuffer_dc;
- WGLExtensions extensions;
- const int *pBufferAttribs_ptr;
- WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
- int pixel_format_id;
-
- if ( pBufferAttribs != NULL ) {
- pBufferAttribs_ptr = (const int *)(*env)->GetDirectBufferAddress(env, pBufferAttribs);
- } else {
- pBufferAttribs_ptr = NULL;
- }
- if (!getExtensions(env, &extensions, pixel_format, pixelFormatCaps))
- return;
- dummy_hwnd = createDummyWindow(origin_x, origin_y);
- if (dummy_hwnd == NULL) {
- throwException(env, "Could not create dummy window");
- return;
- }
- dummy_hdc = GetDC(dummy_hwnd);
- pixel_format_id = findPixelFormatOnDC(env, dummy_hdc, origin_x, origin_y, pixel_format, pixelFormatCaps, false, false, true, false);
- if (pixel_format_id == -1) {
- closeWindow(&dummy_hwnd, &dummy_hdc);
- return;
- }
- Pbuffer = extensions.wglCreatePbufferARB(dummy_hdc, pixel_format_id, width, height, pBufferAttribs_ptr);
- closeWindow(&dummy_hwnd, &dummy_hdc);
- if (Pbuffer == NULL) {
- throwException(env, "Could not create Pbuffer");
- return;
- }
- Pbuffer_dc = extensions.wglGetPbufferDCARB(Pbuffer);
- if (Pbuffer_dc == NULL) {
- extensions.wglDestroyPbufferARB(Pbuffer);
- throwException(env, "Could not get Pbuffer DC");
- return;
- }
- peer_info->u.pbuffer.extensions = extensions;
- peer_info->u.pbuffer.pbuffer = Pbuffer;
- peer_info->drawable_hdc = Pbuffer_dc;
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsPbufferPeerInfo_nDestroy
- (JNIEnv *env, jclass clazz, jobject peer_info_handle) {
- WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
- peer_info->u.pbuffer.extensions.wglReleasePbufferDCARB(peer_info->u.pbuffer.pbuffer, peer_info->drawable_hdc);
- peer_info->u.pbuffer.extensions.wglDestroyPbufferARB(peer_info->u.pbuffer.pbuffer);
-}
-
-JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_WindowsPbufferPeerInfo_nIsBufferLost
- (JNIEnv *env, jclass clazz, jobject peer_info_handle) {
- WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
- BOOL buffer_lost;
- peer_info->u.pbuffer.extensions.wglQueryPbufferARB(peer_info->u.pbuffer.pbuffer, WGL_PBUFFER_LOST_ARB, &buffer_lost);
- return buffer_lost ? JNI_TRUE : JNI_FALSE;
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsPbufferPeerInfo_nSetPbufferAttrib
- (JNIEnv *env, jclass clazz, jobject peer_info_handle, jint attrib, jint value) {
- WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
- int attribs[3];
-
- attribs[0] = attrib;
- attribs[1] = value;
- attribs[2] = 0;
-
- peer_info->u.pbuffer.extensions.wglSetPbufferAttribARB(peer_info->u.pbuffer.pbuffer, attribs);
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsPbufferPeerInfo_nBindTexImageToPbuffer
- (JNIEnv *env, jclass clazz, jobject peer_info_handle, jint buffer) {
- WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
- peer_info->u.pbuffer.extensions.wglBindTexImageARB(peer_info->u.pbuffer.pbuffer, buffer);
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsPbufferPeerInfo_nReleaseTexImageFromPbuffer
- (JNIEnv *env, jclass clazz, jobject peer_info_handle, jint buffer) {
- WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
- peer_info->u.pbuffer.extensions.wglReleaseTexImageARB(peer_info->u.pbuffer.pbuffer, buffer);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: org_lwjgl_opengl_Pbuffer.c 3149 2008-11-22 14:54:15Z elias_naur $
+ *
+ * Windows Pbuffer.
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3149 $
+ */
+
+#include <stdlib.h>
+#include "org_lwjgl_opengl_WindowsDisplay.h"
+#include "org_lwjgl_opengl_Pbuffer.h"
+#include "context.h"
+
+#include "extgl.h"
+#include "extgl_wgl.h"
+
+#include "common_tools.h"
+
+static bool isPbufferSupported(WGLExtensions *extensions) {
+ return extensions->WGL_ARB_pixel_format && extensions->WGL_ARB_pbuffer;
+}
+
+static bool getExtensions(JNIEnv *env, WGLExtensions *extensions, jobject pixel_format, jobject pixelFormatCaps) {
+ int origin_x = 0; int origin_y = 0;
+ HWND dummy_hwnd;
+ HDC dummy_hdc;
+ HGLRC dummy_context;
+ HDC saved_hdc;
+ HGLRC saved_context;
+ int pixel_format_id;
+
+ dummy_hwnd = createDummyWindow(origin_x, origin_y);
+ if (dummy_hwnd == NULL) {
+ throwException(env, "Could not create dummy window");
+ return false;
+ }
+ dummy_hdc = GetDC(dummy_hwnd);
+ pixel_format_id = findPixelFormatOnDC(env, dummy_hdc, origin_x, origin_y, pixel_format, pixelFormatCaps, false, true, false, false);
+ if (pixel_format_id == -1) {
+ closeWindow(&dummy_hwnd, &dummy_hdc);
+ return false;
+ }
+ if (!applyPixelFormat(env, dummy_hdc, pixel_format_id)) {
+ closeWindow(&dummy_hwnd, &dummy_hdc);
+ return false;
+ }
+ dummy_context = wglCreateContext(dummy_hdc);
+ if (dummy_context == NULL) {
+ closeWindow(&dummy_hwnd, &dummy_hdc);
+ throwException(env, "Could not create dummy context");
+ return false;
+ }
+ saved_hdc = wglGetCurrentDC();
+ saved_context = wglGetCurrentContext();
+ if (!wglMakeCurrent(dummy_hdc, dummy_context)) {
+ wglMakeCurrent(saved_hdc, saved_context);
+ closeWindow(&dummy_hwnd, &dummy_hdc);
+ wglDeleteContext(dummy_context);
+ throwException(env, "Could not make dummy context current");
+ return false;
+ }
+ extgl_InitWGL(extensions);
+ if (!wglMakeCurrent(saved_hdc, saved_context))
+ printfDebugJava(env, "ERROR: Could not restore current context");
+ closeWindow(&dummy_hwnd, &dummy_hdc);
+ wglDeleteContext(dummy_context);
+ return true;
+}
+
+JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nGetPbufferCapabilities
+ (JNIEnv *env, jobject self, jobject pixel_format)
+{
+ int caps = 0;
+ WGLExtensions extensions;
+ if (!getExtensions(env, &extensions, pixel_format, NULL))
+ return 0;
+ if (isPbufferSupported(&extensions))
+ caps |= org_lwjgl_opengl_Pbuffer_PBUFFER_SUPPORTED;
+
+ if (extensions.WGL_ARB_render_texture)
+ caps |= org_lwjgl_opengl_Pbuffer_RENDER_TEXTURE_SUPPORTED;
+
+ if (extensions.WGL_NV_render_texture_rectangle)
+ caps |= org_lwjgl_opengl_Pbuffer_RENDER_TEXTURE_RECTANGLE_SUPPORTED;
+
+ if (extensions.WGL_NV_render_depth_texture)
+ caps |= org_lwjgl_opengl_Pbuffer_RENDER_DEPTH_TEXTURE_SUPPORTED;
+
+ return caps;
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsPbufferPeerInfo_nCreate
+ (JNIEnv *env, jobject self, jobject peer_info_handle,
+ jint width, jint height, jobject pixel_format,
+ jobject pixelFormatCaps, jobject pBufferAttribs)
+{
+ int origin_x = 0; int origin_y = 0;
+ HWND dummy_hwnd;
+ HDC dummy_hdc;
+ HPBUFFERARB Pbuffer;
+ HDC Pbuffer_dc;
+ WGLExtensions extensions;
+ const int *pBufferAttribs_ptr;
+ WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
+ int pixel_format_id;
+
+ if ( pBufferAttribs != NULL ) {
+ pBufferAttribs_ptr = (const int *)(*env)->GetDirectBufferAddress(env, pBufferAttribs);
+ } else {
+ pBufferAttribs_ptr = NULL;
+ }
+ if (!getExtensions(env, &extensions, pixel_format, pixelFormatCaps))
+ return;
+ dummy_hwnd = createDummyWindow(origin_x, origin_y);
+ if (dummy_hwnd == NULL) {
+ throwException(env, "Could not create dummy window");
+ return;
+ }
+ dummy_hdc = GetDC(dummy_hwnd);
+ pixel_format_id = findPixelFormatOnDC(env, dummy_hdc, origin_x, origin_y, pixel_format, pixelFormatCaps, false, false, true, false);
+ if (pixel_format_id == -1) {
+ closeWindow(&dummy_hwnd, &dummy_hdc);
+ return;
+ }
+ Pbuffer = extensions.wglCreatePbufferARB(dummy_hdc, pixel_format_id, width, height, pBufferAttribs_ptr);
+ closeWindow(&dummy_hwnd, &dummy_hdc);
+ if (Pbuffer == NULL) {
+ throwException(env, "Could not create Pbuffer");
+ return;
+ }
+ Pbuffer_dc = extensions.wglGetPbufferDCARB(Pbuffer);
+ if (Pbuffer_dc == NULL) {
+ extensions.wglDestroyPbufferARB(Pbuffer);
+ throwException(env, "Could not get Pbuffer DC");
+ return;
+ }
+ peer_info->u.pbuffer.extensions = extensions;
+ peer_info->u.pbuffer.pbuffer = Pbuffer;
+ peer_info->drawable_hdc = Pbuffer_dc;
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsPbufferPeerInfo_nDestroy
+ (JNIEnv *env, jclass clazz, jobject peer_info_handle) {
+ WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
+ peer_info->u.pbuffer.extensions.wglReleasePbufferDCARB(peer_info->u.pbuffer.pbuffer, peer_info->drawable_hdc);
+ peer_info->u.pbuffer.extensions.wglDestroyPbufferARB(peer_info->u.pbuffer.pbuffer);
+}
+
+JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_WindowsPbufferPeerInfo_nIsBufferLost
+ (JNIEnv *env, jclass clazz, jobject peer_info_handle) {
+ WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
+ BOOL buffer_lost;
+ peer_info->u.pbuffer.extensions.wglQueryPbufferARB(peer_info->u.pbuffer.pbuffer, WGL_PBUFFER_LOST_ARB, &buffer_lost);
+ return buffer_lost ? JNI_TRUE : JNI_FALSE;
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsPbufferPeerInfo_nSetPbufferAttrib
+ (JNIEnv *env, jclass clazz, jobject peer_info_handle, jint attrib, jint value) {
+ WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
+ int attribs[3];
+
+ attribs[0] = attrib;
+ attribs[1] = value;
+ attribs[2] = 0;
+
+ peer_info->u.pbuffer.extensions.wglSetPbufferAttribARB(peer_info->u.pbuffer.pbuffer, attribs);
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsPbufferPeerInfo_nBindTexImageToPbuffer
+ (JNIEnv *env, jclass clazz, jobject peer_info_handle, jint buffer) {
+ WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
+ peer_info->u.pbuffer.extensions.wglBindTexImageARB(peer_info->u.pbuffer.pbuffer, buffer);
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsPbufferPeerInfo_nReleaseTexImageFromPbuffer
+ (JNIEnv *env, jclass clazz, jobject peer_info_handle, jint buffer) {
+ WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
+ peer_info->u.pbuffer.extensions.wglReleaseTexImageARB(peer_info->u.pbuffer.pbuffer, buffer);
+}
diff --git a/src/native/windows/org_lwjgl_opengl_WindowsAWTGLCanvasPeerInfo.c b/src/native/windows/org_lwjgl_opengl_WindowsAWTGLCanvasPeerInfo.c
index d3d340a..67f3374 100644
--- a/src/native/windows/org_lwjgl_opengl_WindowsAWTGLCanvasPeerInfo.c
+++ b/src/native/windows/org_lwjgl_opengl_WindowsAWTGLCanvasPeerInfo.c
@@ -1,54 +1,54 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: org_lwjgl_opengl_WindowsAWTGLCanvasPeerInfo.c 2985 2008-04-07 18:42:36Z matzon $
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2985 $
- */
-
-#include <jni.h>
-#include <jawt_md.h>
-#include "awt_tools.h"
-#include "org_lwjgl_opengl_WindowsAWTGLCanvasPeerInfo.h"
-#include "context.h"
-#include "common_tools.h"
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsAWTGLCanvasPeerInfo_nInitHandle
- (JNIEnv *env, jclass clazz, jobject lock_buffer_handle, jobject peer_info_handle) {
- WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
- AWTSurfaceLock *surface = (AWTSurfaceLock *)(*env)->GetDirectBufferAddress(env, lock_buffer_handle);
- JAWT_Win32DrawingSurfaceInfo *win32_dsi = (JAWT_Win32DrawingSurfaceInfo *)surface->dsi->platformInfo;
- peer_info->drawable_hdc = win32_dsi->hdc;
- peer_info->u.hwnd = win32_dsi->hwnd;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: org_lwjgl_opengl_WindowsAWTGLCanvasPeerInfo.c 2985 2008-04-07 18:42:36Z matzon $
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2985 $
+ */
+
+#include <jni.h>
+#include <jawt_md.h>
+#include "awt_tools.h"
+#include "org_lwjgl_opengl_WindowsAWTGLCanvasPeerInfo.h"
+#include "context.h"
+#include "common_tools.h"
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsAWTGLCanvasPeerInfo_nInitHandle
+ (JNIEnv *env, jclass clazz, jobject lock_buffer_handle, jobject peer_info_handle) {
+ WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
+ AWTSurfaceLock *surface = (AWTSurfaceLock *)(*env)->GetDirectBufferAddress(env, lock_buffer_handle);
+ JAWT_Win32DrawingSurfaceInfo *win32_dsi = (JAWT_Win32DrawingSurfaceInfo *)surface->dsi->platformInfo;
+ peer_info->drawable_hdc = win32_dsi->hdc;
+ peer_info->u.hwnd = win32_dsi->hwnd;
+}
diff --git a/src/native/windows/org_lwjgl_opengl_WindowsContextImplementation.c b/src/native/windows/org_lwjgl_opengl_WindowsContextImplementation.c
index e494eec..a0b5b33 100644
--- a/src/native/windows/org_lwjgl_opengl_WindowsContextImplementation.c
+++ b/src/native/windows/org_lwjgl_opengl_WindowsContextImplementation.c
@@ -1,162 +1,162 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: org_lwjgl_opengl_WindowsContextImplementation.c 3116 2008-08-19 16:46:03Z spasi $
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3116 $
- */
-
-#include <jni.h>
-#include "org_lwjgl_opengl_WindowsContextImplementation.h"
-#include "context.h"
-#include "extgl_wgl.h"
-#include "common_tools.h"
-
-typedef struct {
- HGLRC context;
-} WindowsContext;
-
-JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_WindowsContextImplementation_nCreate
- (JNIEnv *env, jclass clazz, jobject peer_info_handle, jobject attribs, jobject shared_context_handle) {
- WindowsPeerInfo *peer_info;
- WindowsContext *shared_context_info;
- WindowsContext *context_info;
- HGLRC context;
- HGLRC shared_context = NULL;
-
- // -- We need to create a temporary context to detect the presence of WGL_ARB_create_context
- HDC saved_current_hdc;
- HGLRC saved_current_hglrc;
- WGLExtensions extensions;
- const int *attribList = attribs == NULL ? NULL : ((const int *)(*env)->GetDirectBufferAddress(env, attribs));
-
- jobject context_handle = newJavaManagedByteBuffer(env, sizeof(WindowsContext));
- if (context_handle == NULL) {
- throwException(env, "Could not create handle buffer");
- return NULL;
- }
-
- peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
- if (shared_context_handle != NULL) {
- shared_context_info = (WindowsContext *)(*env)->GetDirectBufferAddress(env, shared_context_handle);
- shared_context = shared_context_info->context;
- }
-
- // Create the context
- context = wglCreateContext(peer_info->drawable_hdc);
- if (context == NULL) {
- throwException(env, "Could not create context");
- return NULL;
- }
-
- // Save the current HDC and HGLRC to avoid disruption
- saved_current_hdc = wglGetCurrentDC();
- saved_current_hglrc = wglGetCurrentContext();
-
- // Make context current and detect extensions
- if (!wglMakeCurrent(peer_info->drawable_hdc, context)) {
- throwException(env, "Could not bind dummy context");
- return NULL;
- }
- extgl_InitWGL(&extensions);
-
- // Restore previous context
- wglMakeCurrent(saved_current_hdc, saved_current_hglrc);
-
- //
- if ( extensions.WGL_ARB_create_context ) { // We support WGL_ARB_create_context, use the new context creation routine
- // If we have no context to share and no special attributes, we don't have to recreate the context - wglCreateContext is equivalent to wglCreateContextAttribs(hdc,0,NULL).
- if ( shared_context != NULL || attribList != NULL ) {
- // Delete the oldschool context
- wglDeleteContext(context);
- // Create a new context using WGL_ARB_create_context
- context = (HGLRC)extensions.wglCreateContextAttribsARB(peer_info->drawable_hdc, shared_context, attribList);
- if (context == NULL) {
- throwException(env, "Could not create context (WGL_ARB_create_context)");
- return NULL;
- }
- }
- } else { // We don't support WGL_ARB_create_context, use the old context creation routine
- if (shared_context != NULL && !wglShareLists(shared_context, context)) { // Use wglShareLists to share context data
- wglDeleteContext(context);
- throwException(env, "Could not share contexts");
- return NULL;
- }
- }
-
- context_info = (WindowsContext *)(*env)->GetDirectBufferAddress(env, context_handle);
- context_info->context = context;
- return context_handle;
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsContextImplementation_nSwapBuffers
- (JNIEnv *env, jclass clazz, jobject peer_info_handle) {
- WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
- SwapBuffers(peer_info->drawable_hdc);
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsContextImplementation_nReleaseCurrentContext
- (JNIEnv *env, jclass clazz) {
- wglMakeCurrent(NULL, NULL);
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsContextImplementation_nMakeCurrent
- (JNIEnv *env, jclass clazz, jobject peer_info_handle, jobject context_handle) {
- WindowsContext *context_info = (WindowsContext *)(*env)->GetDirectBufferAddress(env, context_handle);
- WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
- if (!wglMakeCurrent(peer_info->drawable_hdc, context_info->context))
- throwException(env, "Could not make context current");
-}
-
-JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_WindowsContextImplementation_nIsCurrent
- (JNIEnv *env, jclass clazz, jobject context_handle) {
- WindowsContext *context_info = (WindowsContext *)(*env)->GetDirectBufferAddress(env, context_handle);
- return wglGetCurrentContext() == context_info->context;
-}
-
-JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_WindowsContextImplementation_nSetSwapInterval
- (JNIEnv *env, jclass clazz, jint value) {
- WGLExtensions extensions;
- extgl_InitWGL(&extensions);
- if (extensions.WGL_EXT_swap_control) {
- return extensions.wglSwapIntervalEXT(value) ? JNI_TRUE : JNI_FALSE;
- } else
- return JNI_FALSE;
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsContextImplementation_nDestroy
- (JNIEnv *env, jclass clazz, jobject context_handle) {
- WindowsContext *context_info = (WindowsContext *)(*env)->GetDirectBufferAddress(env, context_handle);
- wglDeleteContext(context_info->context);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: org_lwjgl_opengl_WindowsContextImplementation.c 3116 2008-08-19 16:46:03Z spasi $
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3116 $
+ */
+
+#include <jni.h>
+#include "org_lwjgl_opengl_WindowsContextImplementation.h"
+#include "context.h"
+#include "extgl_wgl.h"
+#include "common_tools.h"
+
+typedef struct {
+ HGLRC context;
+} WindowsContext;
+
+JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_WindowsContextImplementation_nCreate
+ (JNIEnv *env, jclass clazz, jobject peer_info_handle, jobject attribs, jobject shared_context_handle) {
+ WindowsPeerInfo *peer_info;
+ WindowsContext *shared_context_info;
+ WindowsContext *context_info;
+ HGLRC context;
+ HGLRC shared_context = NULL;
+
+ // -- We need to create a temporary context to detect the presence of WGL_ARB_create_context
+ HDC saved_current_hdc;
+ HGLRC saved_current_hglrc;
+ WGLExtensions extensions;
+ const int *attribList = attribs == NULL ? NULL : ((const int *)(*env)->GetDirectBufferAddress(env, attribs));
+
+ jobject context_handle = newJavaManagedByteBuffer(env, sizeof(WindowsContext));
+ if (context_handle == NULL) {
+ throwException(env, "Could not create handle buffer");
+ return NULL;
+ }
+
+ peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
+ if (shared_context_handle != NULL) {
+ shared_context_info = (WindowsContext *)(*env)->GetDirectBufferAddress(env, shared_context_handle);
+ shared_context = shared_context_info->context;
+ }
+
+ // Create the context
+ context = wglCreateContext(peer_info->drawable_hdc);
+ if (context == NULL) {
+ throwException(env, "Could not create context");
+ return NULL;
+ }
+
+ // Save the current HDC and HGLRC to avoid disruption
+ saved_current_hdc = wglGetCurrentDC();
+ saved_current_hglrc = wglGetCurrentContext();
+
+ // Make context current and detect extensions
+ if (!wglMakeCurrent(peer_info->drawable_hdc, context)) {
+ throwException(env, "Could not bind dummy context");
+ return NULL;
+ }
+ extgl_InitWGL(&extensions);
+
+ // Restore previous context
+ wglMakeCurrent(saved_current_hdc, saved_current_hglrc);
+
+ //
+ if ( extensions.WGL_ARB_create_context ) { // We support WGL_ARB_create_context, use the new context creation routine
+ // If we have no context to share and no special attributes, we don't have to recreate the context - wglCreateContext is equivalent to wglCreateContextAttribs(hdc,0,NULL).
+ if ( shared_context != NULL || attribList != NULL ) {
+ // Delete the oldschool context
+ wglDeleteContext(context);
+ // Create a new context using WGL_ARB_create_context
+ context = (HGLRC)extensions.wglCreateContextAttribsARB(peer_info->drawable_hdc, shared_context, attribList);
+ if (context == NULL) {
+ throwException(env, "Could not create context (WGL_ARB_create_context)");
+ return NULL;
+ }
+ }
+ } else { // We don't support WGL_ARB_create_context, use the old context creation routine
+ if (shared_context != NULL && !wglShareLists(shared_context, context)) { // Use wglShareLists to share context data
+ wglDeleteContext(context);
+ throwException(env, "Could not share contexts");
+ return NULL;
+ }
+ }
+
+ context_info = (WindowsContext *)(*env)->GetDirectBufferAddress(env, context_handle);
+ context_info->context = context;
+ return context_handle;
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsContextImplementation_nSwapBuffers
+ (JNIEnv *env, jclass clazz, jobject peer_info_handle) {
+ WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
+ SwapBuffers(peer_info->drawable_hdc);
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsContextImplementation_nReleaseCurrentContext
+ (JNIEnv *env, jclass clazz) {
+ wglMakeCurrent(NULL, NULL);
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsContextImplementation_nMakeCurrent
+ (JNIEnv *env, jclass clazz, jobject peer_info_handle, jobject context_handle) {
+ WindowsContext *context_info = (WindowsContext *)(*env)->GetDirectBufferAddress(env, context_handle);
+ WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
+ if (!wglMakeCurrent(peer_info->drawable_hdc, context_info->context))
+ throwException(env, "Could not make context current");
+}
+
+JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_WindowsContextImplementation_nIsCurrent
+ (JNIEnv *env, jclass clazz, jobject context_handle) {
+ WindowsContext *context_info = (WindowsContext *)(*env)->GetDirectBufferAddress(env, context_handle);
+ return wglGetCurrentContext() == context_info->context;
+}
+
+JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_WindowsContextImplementation_nSetSwapInterval
+ (JNIEnv *env, jclass clazz, jint value) {
+ WGLExtensions extensions;
+ extgl_InitWGL(&extensions);
+ if (extensions.WGL_EXT_swap_control) {
+ return extensions.wglSwapIntervalEXT(value) ? JNI_TRUE : JNI_FALSE;
+ } else
+ return JNI_FALSE;
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsContextImplementation_nDestroy
+ (JNIEnv *env, jclass clazz, jobject context_handle) {
+ WindowsContext *context_info = (WindowsContext *)(*env)->GetDirectBufferAddress(env, context_handle);
+ wglDeleteContext(context_info->context);
+}
diff --git a/src/native/windows/org_lwjgl_opengl_WindowsDisplayPeerInfo.c b/src/native/windows/org_lwjgl_opengl_WindowsDisplayPeerInfo.c
index 66e8548..7150eef 100644
--- a/src/native/windows/org_lwjgl_opengl_WindowsDisplayPeerInfo.c
+++ b/src/native/windows/org_lwjgl_opengl_WindowsDisplayPeerInfo.c
@@ -1,53 +1,53 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: org_lwjgl_opengl_WindowsDisplayPeerInfo.c 3057 2008-04-30 16:01:25Z elias_naur $
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3057 $
- */
-
-#include <jni.h>
-#include "Window.h"
-#include "org_lwjgl_opengl_WindowsDisplayPeerInfo.h"
-#include "context.h"
-#include "common_tools.h"
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplayPeerInfo_nInitDC
- (JNIEnv *env, jclass clazz, jobject peer_info_handle, jlong hwnd_ptr, jlong hdc_ptr) {
- HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
- HDC hdc = (HDC)(INT_PTR)hdc_ptr;
- WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
- peer_info->drawable_hdc = hdc;
- peer_info->u.hwnd = hwnd;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: org_lwjgl_opengl_WindowsDisplayPeerInfo.c 3057 2008-04-30 16:01:25Z elias_naur $
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3057 $
+ */
+
+#include <jni.h>
+#include "Window.h"
+#include "org_lwjgl_opengl_WindowsDisplayPeerInfo.h"
+#include "context.h"
+#include "common_tools.h"
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplayPeerInfo_nInitDC
+ (JNIEnv *env, jclass clazz, jobject peer_info_handle, jlong hwnd_ptr, jlong hdc_ptr) {
+ HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
+ HDC hdc = (HDC)(INT_PTR)hdc_ptr;
+ WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
+ peer_info->drawable_hdc = hdc;
+ peer_info->u.hwnd = hwnd;
+}
diff --git a/src/native/windows/org_lwjgl_opengl_WindowsPeerInfo.c b/src/native/windows/org_lwjgl_opengl_WindowsPeerInfo.c
index 5806e9d..6508932 100644
--- a/src/native/windows/org_lwjgl_opengl_WindowsPeerInfo.c
+++ b/src/native/windows/org_lwjgl_opengl_WindowsPeerInfo.c
@@ -1,70 +1,70 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: org_lwjgl_opengl_WindowsPeerInfo.c 3148 2008-11-22 14:51:36Z elias_naur $
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 3148 $
- */
-
-#include <jni.h>
-#include "org_lwjgl_opengl_WindowsPeerInfo.h"
-#include "context.h"
-#include "common_tools.h"
-
-JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_WindowsPeerInfo_createHandle
- (JNIEnv *env, jclass clazz) {
- return newJavaManagedByteBuffer(env, sizeof(WindowsPeerInfo));
-}
-
-JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_WindowsPeerInfo_nChoosePixelFormat
- (JNIEnv *env, jclass clazz, jlong hdc_ptr, jint origin_x, jint origin_y, jobject pixel_format, jobject pixel_format_caps, jboolean use_hdc_bpp, jboolean window, jboolean pbuffer, jboolean double_buffer) {
- HDC hdc = (HDC)(INT_PTR)hdc_ptr;
- return findPixelFormatOnDC(env, hdc, origin_x, origin_y, pixel_format, pixel_format_caps, use_hdc_bpp, window, pbuffer, double_buffer);
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsPeerInfo_setPixelFormat
- (JNIEnv *env, jclass clazz, jlong hdc_ptr, jint pixel_format) {
- HDC hdc = (HDC)(INT_PTR)hdc_ptr;
- applyPixelFormat(env, hdc, pixel_format);
-}
-
-JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsPeerInfo_nGetHdc(JNIEnv *env, jclass unused, jobject peer_info_handle) {
- WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
- return (intptr_t)peer_info->drawable_hdc;
-}
-
-JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsPeerInfo_nGetHwnd(JNIEnv *env, jclass unused, jobject peer_info_handle) {
- WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
- return (intptr_t)peer_info->u.hwnd;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: org_lwjgl_opengl_WindowsPeerInfo.c 3148 2008-11-22 14:51:36Z elias_naur $
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 3148 $
+ */
+
+#include <jni.h>
+#include "org_lwjgl_opengl_WindowsPeerInfo.h"
+#include "context.h"
+#include "common_tools.h"
+
+JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_WindowsPeerInfo_createHandle
+ (JNIEnv *env, jclass clazz) {
+ return newJavaManagedByteBuffer(env, sizeof(WindowsPeerInfo));
+}
+
+JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_WindowsPeerInfo_nChoosePixelFormat
+ (JNIEnv *env, jclass clazz, jlong hdc_ptr, jint origin_x, jint origin_y, jobject pixel_format, jobject pixel_format_caps, jboolean use_hdc_bpp, jboolean window, jboolean pbuffer, jboolean double_buffer) {
+ HDC hdc = (HDC)(INT_PTR)hdc_ptr;
+ return findPixelFormatOnDC(env, hdc, origin_x, origin_y, pixel_format, pixel_format_caps, use_hdc_bpp, window, pbuffer, double_buffer);
+}
+
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsPeerInfo_setPixelFormat
+ (JNIEnv *env, jclass clazz, jlong hdc_ptr, jint pixel_format) {
+ HDC hdc = (HDC)(INT_PTR)hdc_ptr;
+ applyPixelFormat(env, hdc, pixel_format);
+}
+
+JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsPeerInfo_nGetHdc(JNIEnv *env, jclass unused, jobject peer_info_handle) {
+ WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
+ return (intptr_t)peer_info->drawable_hdc;
+}
+
+JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsPeerInfo_nGetHwnd(JNIEnv *env, jclass unused, jobject peer_info_handle) {
+ WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
+ return (intptr_t)peer_info->u.hwnd;
+}
diff --git a/src/native/windows/org_lwjgl_opengl_WindowsRegistry.c b/src/native/windows/org_lwjgl_opengl_WindowsRegistry.c
index 9059048..3a2df1b 100644
--- a/src/native/windows/org_lwjgl_opengl_WindowsRegistry.c
+++ b/src/native/windows/org_lwjgl_opengl_WindowsRegistry.c
@@ -1,145 +1,145 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-/**
- * $Id: org_lwjgl_opengl_WindowsRegistry.c 2985 2008-04-07 18:42:36Z matzon $
- *
- * @author elias_naur <elias_naur at users.sourceforge.net>
- * @version $Revision: 2985 $
- */
-
-#include <jni.h>
-#include <windows.h>
-#include "org_lwjgl_opengl_WindowsRegistry.h"
-#include "common_tools.h"
-
-/*
- * Return a string containing the queried value, or NULL of the method fails.
- * In that case, a java exception is thrown.
- */
-static jstring queryRegistrationKey(JNIEnv *env, HKEY root_key, LPCTSTR subkey, LPCTSTR value) {
- DWORD buf_size = 1;
- char *result;
- HKEY hKey;
- LONG lRet;
- jstring java_result;
-
-
- if(RegOpenKeyEx(root_key,
- TEXT(subkey),
- 0,
- KEY_QUERY_VALUE,
- &hKey) != ERROR_SUCCESS) {
- throwException(env, "Failed to open registry key");
- return NULL;
- }
-
- result = (char *)malloc(buf_size);
- if (result == NULL) {
- RegCloseKey(hKey);
- throwException(env, "Failed to allocate buffer");
- return NULL;
- }
-
- while (1) {
- lRet = RegQueryValueEx(hKey,
- TEXT(value),
- NULL,
- NULL,
- (LPBYTE)result,
- &buf_size);
- if (lRet != ERROR_SUCCESS && lRet != ERROR_MORE_DATA) {
- RegCloseKey(hKey);
- free(result);
- throwException(env, "Failed query key value");
- return NULL;
- }
- if (lRet == ERROR_SUCCESS) {
- RegCloseKey(hKey);
- // make sure the result has a terminating null
- buf_size += 1;
- result = (char *)realloc(result, buf_size);
- if (result == NULL) {
- throwException(env, "Failed to resize buffer");
- return NULL;
- }
- result[buf_size - 1] = '\0';
- java_result = NewStringNativeWithLength(env, result, strlen(result));
- free(result);
- return java_result;
- }
- result = (char *)realloc(result, buf_size);
- if (result == NULL) {
- RegCloseKey(hKey);
- throwException(env, "Failed to resize buffer");
- return NULL;
- }
- }
-}
-
-static HKEY enumToRootKey(jint root_key_enum) {
- switch (root_key_enum) {
- case org_lwjgl_opengl_WindowsRegistry_HKEY_CLASSES_ROOT:
- return HKEY_CLASSES_ROOT;
- case org_lwjgl_opengl_WindowsRegistry_HKEY_CURRENT_USER:
- return HKEY_CURRENT_USER;
- case org_lwjgl_opengl_WindowsRegistry_HKEY_LOCAL_MACHINE:
- return HKEY_LOCAL_MACHINE;
- case org_lwjgl_opengl_WindowsRegistry_HKEY_USERS:
- return HKEY_USERS;
- default:
- return 0;
- }
-}
-
-JNIEXPORT jstring JNICALL Java_org_lwjgl_opengl_WindowsRegistry_nQueryRegistrationKey (JNIEnv *env, jclass unused, jint root_key, jstring subkey, jstring value) {
- HKEY root = enumToRootKey(root_key);
- char *subkey_native;
- char *value_native;
- jstring result;
-
- subkey_native = GetStringNativeChars(env, subkey);
- if (subkey_native == NULL) {
- throwException(env, "Failed to fetch the native string");
- return NULL;
- }
- value_native = GetStringNativeChars(env, value);
- if (value_native == NULL) {
- free(subkey_native);
- throwException(env, "Failed to fetch the native string");
- return NULL;
- }
- result = queryRegistrationKey(env, root, subkey_native, value_native);
- free(subkey_native);
- free(value_native);
- return result;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+/**
+ * $Id: org_lwjgl_opengl_WindowsRegistry.c 2985 2008-04-07 18:42:36Z matzon $
+ *
+ * @author elias_naur <elias_naur at users.sourceforge.net>
+ * @version $Revision: 2985 $
+ */
+
+#include <jni.h>
+#include <windows.h>
+#include "org_lwjgl_opengl_WindowsRegistry.h"
+#include "common_tools.h"
+
+/*
+ * Return a string containing the queried value, or NULL of the method fails.
+ * In that case, a java exception is thrown.
+ */
+static jstring queryRegistrationKey(JNIEnv *env, HKEY root_key, LPCTSTR subkey, LPCTSTR value) {
+ DWORD buf_size = 1;
+ char *result;
+ HKEY hKey;
+ LONG lRet;
+ jstring java_result;
+
+
+ if(RegOpenKeyEx(root_key,
+ TEXT(subkey),
+ 0,
+ KEY_QUERY_VALUE,
+ &hKey) != ERROR_SUCCESS) {
+ throwException(env, "Failed to open registry key");
+ return NULL;
+ }
+
+ result = (char *)malloc(buf_size);
+ if (result == NULL) {
+ RegCloseKey(hKey);
+ throwException(env, "Failed to allocate buffer");
+ return NULL;
+ }
+
+ while (1) {
+ lRet = RegQueryValueEx(hKey,
+ TEXT(value),
+ NULL,
+ NULL,
+ (LPBYTE)result,
+ &buf_size);
+ if (lRet != ERROR_SUCCESS && lRet != ERROR_MORE_DATA) {
+ RegCloseKey(hKey);
+ free(result);
+ throwException(env, "Failed query key value");
+ return NULL;
+ }
+ if (lRet == ERROR_SUCCESS) {
+ RegCloseKey(hKey);
+ // make sure the result has a terminating null
+ buf_size += 1;
+ result = (char *)realloc(result, buf_size);
+ if (result == NULL) {
+ throwException(env, "Failed to resize buffer");
+ return NULL;
+ }
+ result[buf_size - 1] = '\0';
+ java_result = NewStringNativeWithLength(env, result, strlen(result));
+ free(result);
+ return java_result;
+ }
+ result = (char *)realloc(result, buf_size);
+ if (result == NULL) {
+ RegCloseKey(hKey);
+ throwException(env, "Failed to resize buffer");
+ return NULL;
+ }
+ }
+}
+
+static HKEY enumToRootKey(jint root_key_enum) {
+ switch (root_key_enum) {
+ case org_lwjgl_opengl_WindowsRegistry_HKEY_CLASSES_ROOT:
+ return HKEY_CLASSES_ROOT;
+ case org_lwjgl_opengl_WindowsRegistry_HKEY_CURRENT_USER:
+ return HKEY_CURRENT_USER;
+ case org_lwjgl_opengl_WindowsRegistry_HKEY_LOCAL_MACHINE:
+ return HKEY_LOCAL_MACHINE;
+ case org_lwjgl_opengl_WindowsRegistry_HKEY_USERS:
+ return HKEY_USERS;
+ default:
+ return 0;
+ }
+}
+
+JNIEXPORT jstring JNICALL Java_org_lwjgl_opengl_WindowsRegistry_nQueryRegistrationKey (JNIEnv *env, jclass unused, jint root_key, jstring subkey, jstring value) {
+ HKEY root = enumToRootKey(root_key);
+ char *subkey_native;
+ char *value_native;
+ jstring result;
+
+ subkey_native = GetStringNativeChars(env, subkey);
+ if (subkey_native == NULL) {
+ throwException(env, "Failed to fetch the native string");
+ return NULL;
+ }
+ value_native = GetStringNativeChars(env, value);
+ if (value_native == NULL) {
+ free(subkey_native);
+ throwException(env, "Failed to fetch the native string");
+ return NULL;
+ }
+ result = queryRegistrationKey(env, root, subkey_native, value_native);
+ free(subkey_native);
+ free(value_native);
+ return result;
+}
diff --git a/src/native/windows/windows_al.c b/src/native/windows/windows_al.c
index ea5eab7..b0e4f96 100644
--- a/src/native/windows/windows_al.c
+++ b/src/native/windows/windows_al.c
@@ -1,71 +1,71 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "extal.h"
-#include "common_tools.h"
-
-/**
- * $Id: windows_al.c 2985 2008-04-07 18:42:36Z matzon $
- *
- * This file contains the AL extension assigning mechanism
- *
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 2985 $
- */
-/* Handle to OpenAL Library */
-static HMODULE handleOAL;
-
-void *NativeGetFunctionPointer(const char *function) {
- return GetProcAddress(handleOAL, function);
-}
-
-void tryLoadLibrary(JNIEnv *env, jstring path) {
- char *path_str = GetStringNativeChars(env, path);
- printfDebugJava(env, "Testing '%s'", path_str);
- handleOAL = LoadLibrary(path_str);
- if (handleOAL != NULL) {
- printfDebugJava(env, "Found OpenAL at '%s'", path_str);
- } else {
- throwFormattedException(env, "Could not load OpenAL library (%d)", GetLastError());
- }
- free(path_str);
-}
-
-/**
- * Unloads the OpenAL Library
- */
-void UnLoadOpenAL() {
- FreeLibrary(handleOAL);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "extal.h"
+#include "common_tools.h"
+
+/**
+ * $Id: windows_al.c 2985 2008-04-07 18:42:36Z matzon $
+ *
+ * This file contains the AL extension assigning mechanism
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 2985 $
+ */
+/* Handle to OpenAL Library */
+static HMODULE handleOAL;
+
+void *NativeGetFunctionPointer(const char *function) {
+ return GetProcAddress(handleOAL, function);
+}
+
+void tryLoadLibrary(JNIEnv *env, jstring path) {
+ char *path_str = GetStringNativeChars(env, path);
+ printfDebugJava(env, "Testing '%s'", path_str);
+ handleOAL = LoadLibrary(path_str);
+ if (handleOAL != NULL) {
+ printfDebugJava(env, "Found OpenAL at '%s'", path_str);
+ } else {
+ throwFormattedException(env, "Could not load OpenAL library (%d)", GetLastError());
+ }
+ free(path_str);
+}
+
+/**
+ * Unloads the OpenAL Library
+ */
+void UnLoadOpenAL() {
+ FreeLibrary(handleOAL);
+}
diff --git a/src/templates/org/lwjgl/openal/AL10.java b/src/templates/org/lwjgl/openal/AL10.java
index 4bf327b..26cc390 100644
--- a/src/templates/org/lwjgl/openal/AL10.java
+++ b/src/templates/org/lwjgl/openal/AL10.java
@@ -1,1262 +1,1262 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.openal;
-
-import java.nio.Buffer;
-import java.nio.IntBuffer;
-import java.nio.FloatBuffer;
-import java.nio.DoubleBuffer;
-
-import org.lwjgl.util.generator.*;
-
-/**
- * <br>
- * This is the core OpenAL class. This class implements
- * AL.h version 1.0
- *
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 3288 $
- * $Id: AL10.java 3288 2010-03-16 17:58:48Z spasi $
- */
-public interface AL10 {
- /** Bad value */
- int AL_INVALID = -1;
-
- /** Disable value */
- int AL_NONE = 0;
-
- /** Boolean False */
- int AL_FALSE = 0;
-
- /** Boolean True */
- int AL_TRUE = 1;
-
- /**
- * Indicate the type of SOURCE.
- * Sources can be spatialized
- */
- int AL_SOURCE_TYPE = 0x1027;
-
- /** Indicate source has absolute coordinates */
- int AL_SOURCE_ABSOLUTE = 0x201;
-
- /** Indicate Source has listener relative coordinates */
- int AL_SOURCE_RELATIVE = 0x202;
-
- /**
- * Directional source, inner cone angle, in degrees
- * Range: [0-360]
- * Default: 360
- */
- int AL_CONE_INNER_ANGLE = 0x1001;
-
- /**
- * Directional source, outer cone angle, in degrees.
- * Range: [0-360]
- * Default: 360
- */
- int AL_CONE_OUTER_ANGLE = 0x1002;
-
- /**
- * Specify the pitch to be applied, either at source,
- * or on mixer results, at listener.
- * Range: [0.5-2.0]
- * Default: 1.0
- */
- int AL_PITCH = 0x1003;
-
- /**
- * Specify the current location in three dimensional space.
- * OpenAL, like OpenGL, uses a right handed coordinate system,
- * where in a frontal default view X (thumb) points right,
- * Y points up (index finger), and Z points towards the
- * viewer/camera (middle finger).
- * To switch from a left handed coordinate system, flip the
- * sign on the Z coordinate.
- * Listener position is always in the world coordinate system.
- */
- int AL_POSITION = 0x1004;
-
- /** Specify the current direction as forward vector. */
- int AL_DIRECTION = 0x1005;
-
- /** Specify the current velocity in three dimensional space. */
- int AL_VELOCITY = 0x1006;
-
- /**
- * Indicate whether source has to loop infinite.
- * Type: ALboolean
- * Range: [TRUE, FALSE]
- * Default: FALSE
- */
- int AL_LOOPING = 0x1007;
-
- /**
- * Indicate the buffer to provide sound samples.
- * Type: ALuint.
- * Range: any valid Buffer id.
- */
- int AL_BUFFER = 0x1009;
-
- /**
- * Indicate the gain (volume amplification) applied.
- * Type: ALfloat.
- * Range: ]0.0- ]
- * A value of 1.0 means un-attenuated/unchanged.
- * Each division by 2 equals an attenuation of -6dB.
- * Each multiplicaton with 2 equals an amplification of +6dB.
- * A value of 0.0 is meaningless with respect to a logarithmic
- * scale; it is interpreted as zero volume - the channel
- * is effectively disabled.
- */
- int AL_GAIN = 0x100A;
-
- /**
- * Indicate minimum source attenuation.
- * Type: ALfloat
- * Range: [0.0 - 1.0]
- */
- int AL_MIN_GAIN = 0x100D;
-
- /**
- * Indicate maximum source attenuation.
- * Type: ALfloat
- * Range: [0.0 - 1.0]
- */
- int AL_MAX_GAIN = 0x100E;
-
- /**
- * Specify the current orientation.
- * Type: ALfv6 (at/up)
- * Range: N/A
- */
- int AL_ORIENTATION = 0x100F;
-
- /* byte offset into source (in canon format). -1 if source
- * is not playing. Don't set this, get this.
- *
- * Type: ALfloat
- * Range: [0.0 - ]
- * Default: 1.0
- */
- int AL_REFERENCE_DISTANCE = 0x1020;
-
- /**
- * Indicate the rolloff factor for the source.
- * Type: ALfloat
- * Range: [0.0 - ]
- * Default: 1.0
- */
- int AL_ROLLOFF_FACTOR = 0x1021;
-
- /**
- * Indicate the gain (volume amplification) applied.
- * Type: ALfloat.
- * Range: ]0.0- ]
- * A value of 1.0 means un-attenuated/unchanged.
- * Each division by 2 equals an attenuation of -6dB.
- * Each multiplicaton with 2 equals an amplification of +6dB.
- * A value of 0.0 is meaningless with respect to a logarithmic
- * scale; it is interpreted as zero volume - the channel
- * is effectively disabled.
- */
- int AL_CONE_OUTER_GAIN = 0x1022;
-
- /**
- * Specify the maximum distance.
- * Type: ALfloat
- * Range: [0.0 - ]
- */
- int AL_MAX_DISTANCE = 0x1023;
-
- /**
- * Specify the channel mask. (Creative)
- * Type: ALuint
- * Range: [0 - 255]
- */
- int AL_CHANNEL_MASK = 0x3000;
-
- /** Source state information */
- int AL_SOURCE_STATE = 0x1010;
-
- /** Source state information */
- int AL_INITIAL = 0x1011;
-
- /** Source state information */
- int AL_PLAYING = 0x1012;
-
- /** Source state information */
- int AL_PAUSED = 0x1013;
-
- /** Source state information */
- int AL_STOPPED = 0x1014;
-
- /** Buffer Queue params */
- int AL_BUFFERS_QUEUED = 0x1015;
-
- /** Buffer Queue params */
- int AL_BUFFERS_PROCESSED = 0x1016;
-
- /** Sound buffers: format specifier. */
- int AL_FORMAT_MONO8 = 0x1100;
-
- /** Sound buffers: format specifier. */
- int AL_FORMAT_MONO16 = 0x1101;
-
- /** Sound buffers: format specifier. */
- int AL_FORMAT_STEREO8 = 0x1102;
-
- /** Sound buffers: format specifier. */
- int AL_FORMAT_STEREO16 = 0x1103;
-
- /** Ogg Vorbis format specifier. */
- int AL_FORMAT_VORBIS_EXT = 0x10003;
-
- /**
- * Sound buffers: frequency, in units of Hertz [Hz].
- * This is the number of samples per second. Half of the
- * sample frequency marks the maximum significant
- * frequency component.
- */
- int AL_FREQUENCY = 0x2001;
-
- /**
- * Sound buffers: frequency, in units of Hertz [Hz].
- * This is the number of samples per second. Half of the
- * sample frequency marks the maximum significant
- * frequency component.
- */
- int AL_BITS = 0x2002;
-
- /**
- * Sound buffers: frequency, in units of Hertz [Hz].
- * This is the number of samples per second. Half of the
- * sample frequency marks the maximum significant
- * frequency component.
- */
- int AL_CHANNELS = 0x2003;
-
- /**
- * Sound buffers: frequency, in units of Hertz [Hz].
- * This is the number of samples per second. Half of the
- * sample frequency marks the maximum significant
- * frequency component.
- */
- int AL_SIZE = 0x2004;
-
- /**
- * Sound buffers: frequency, in units of Hertz [Hz].
- * This is the number of samples per second. Half of the
- * sample frequency marks the maximum significant
- * frequency component.
- */
- int AL_DATA = 0x2005;
-
- /**
- * Buffer state.
- *
- * Not supported for public use (yet).
- */
- int AL_UNUSED = 0x2010;
-
- /**
- * Buffer state.
- *
- * Not supported for public use (yet).
- */
- int AL_PENDING = 0x2011;
-
- /**
- * Buffer state.
- *
- * Not supported for public use (yet).
- */
- int AL_PROCESSED = 0x2012;
-
- /** Errors: No Error. */
- int AL_NO_ERROR = AL_FALSE;
-
- /** Illegal name passed as an argument to an AL call. */
- int AL_INVALID_NAME = 0xA001;
-
- /** Illegal enum passed as an argument to an AL call. */
- int AL_INVALID_ENUM = 0xA002;
-
- /**
- * Illegal value passed as an argument to an AL call.
- * Applies to parameter values, but not to enumerations.
- */
- int AL_INVALID_VALUE = 0xA003;
-
- /**
- * A function was called at inappropriate time,
- * or in an inappropriate way, causing an illegal state.
- * This can be an incompatible ALenum, object ID,
- * and/or function.
- */
- int AL_INVALID_OPERATION = 0xA004;
-
- /**
- * A function could not be completed,
- * because there is not enough memory available.
- */
- int AL_OUT_OF_MEMORY = 0xA005;
-
- /** Context strings: Vendor */
- int AL_VENDOR = 0xB001;
-
- /** Context strings: Version */
- int AL_VERSION = 0xB002;
-
- /** Context strings: Renderer */
- int AL_RENDERER = 0xB003;
-
- /** Context strings: Extensions */
- int AL_EXTENSIONS = 0xB004;
-
- /** Doppler scale. Default 1.0 */
- int AL_DOPPLER_FACTOR = 0xC000;
-
- /** Doppler velocity. Default 1.0 */
- int AL_DOPPLER_VELOCITY = 0xC001;
-
- /** Distance model. Default INVERSE_DISTANCE_CLAMPED */
- int AL_DISTANCE_MODEL = 0xD000;
-
- /** Distance model */
- int AL_INVERSE_DISTANCE = 0xD001;
-
- /** Distance model */
- int AL_INVERSE_DISTANCE_CLAMPED = 0xD002;
-
- /**
- * The application can temporarily disable certain AL capabilities on a per Context
- * basis. This allows the driver implementation to optimize for certain subsets of
- * operations. Enabling and disabling capabilities is handled using a function pair.
- *
- * @param capability name of a capability to enable
- */
- @ALvoid
- void alEnable(int capability);
-
- /**
- * The application can temporarily disable certain AL capabilities on a per Context
- * basis. This allows the driver implementation to optimize for certain subsets of
- * operations. Enabling and disabling capabilities is handled using a function pair.
- *
- * @param capability name of a capability to disable
- */
- @ALvoid
- void alDisable(@ALenum int capability);
-
- /**
- * The application can also query whether a given capability is currently enabled or
- * not.
- * <p>
- * If the token used to specify target is not legal, an AL_INVALID_ENUM error will be
- * generated.
- * </p>
- * <p>
- * At this time, this mechanism is not used. There are no valid targets.
- * </p>
- *
- * @param capability name of a capability to check
- * @return true if named feature is enabled
- */
- boolean alIsEnabled(@ALenum int capability);
-
- /**
- * Hinting for implementation
- * NOTE: This method is a NOP, but is provided for completeness.
- *
- * @param target The target to hint
- * @param mode Mode to hint
- */
-// @ALvoid
-// void alHint(@ALenum int target, @ALenum int mode);
-
- /**
- * Like OpenGL, AL uses a simplified interface for querying global state.
- *
- * Legal values are e.g. AL_DOPPLER_FACTOR, AL_DOPPLER_VELOCITY,
- * AL_DISTANCE_MODEL.
- * <p>
- * <code>null</code> destinations are quietly ignored. AL_INVALID_ENUM is the response to errors
- * in specifying pName. The amount of memory required in the destination
- * depends on the actual state requested.
- * </p>
- *
- * @return boolean state described by pname will be returned.
- */
- boolean alGetBoolean(@ALenum int pname);
-
- /**
- * Like OpenGL, AL uses a simplified interface for querying global state.
- *
- * Legal values are e.g. AL_DOPPLER_FACTOR, AL_DOPPLER_VELOCITY,
- * AL_DISTANCE_MODEL.
- * <p>
- * <code>null</code> destinations are quietly ignored. AL_INVALID_ENUM is the response to errors
- * in specifying pName. The amount of memory required in the destination
- * depends on the actual state requested.
- * </p>
- *
- * @return int state described by pname will be returned.
- */
- int alGetInteger(@ALenum int pname);
-
- /**
- * Like OpenGL, AL uses a simplified interface for querying global state.
- *
- * Legal values are e.g. AL_DOPPLER_FACTOR, AL_DOPPLER_VELOCITY,
- * AL_DISTANCE_MODEL.
- * <p>
- * <code>null</code> destinations are quietly ignored. AL_INVALID_ENUM is the response to errors
- * in specifying pName. The amount of memory required in the destination
- * depends on the actual state requested.
- * </p>
- *
- * @return float state described by pname will be returned.
- */
- float alGetFloat(@ALenum int pname);
-
- /**
- * Like OpenGL, AL uses a simplified interface for querying global state.
- *
- * Legal values are e.g. AL_DOPPLER_FACTOR, AL_DOPPLER_VELOCITY,
- * AL_DISTANCE_MODEL.
- * <p>
- * <code>null</code> destinations are quietly ignored. AL_INVALID_ENUM is the response to errors
- * in specifying pName. The amount of memory required in the destination
- * depends on the actual state requested.
- * </p>
- *
- * @return double state described by pname will be returned.
- */
- double alGetDouble(@ALenum int pname);
-
- /**
- * Like OpenGL, AL uses a simplified interface for querying global state.
- *
- * Legal values are e.g. AL_DOPPLER_FACTOR, AL_DOPPLER_VELOCITY,
- * AL_DISTANCE_MODEL.
- * <p>
- * <code>null</code> destinations are quietly ignored. AL_INVALID_ENUM is the response to errors
- * in specifying pName. The amount of memory required in the destination
- * depends on the actual state requested.
- * </p>
- *
- * @param pname state to be queried
- * @param data Buffer to place the integers in
- */
- @StripPostfix("data")
- @ALvoid
- void alGetIntegerv(@ALenum int pname, @OutParameter @Check("1") IntBuffer data);
-
- /**
- * Like OpenGL, AL uses a simplified interface for querying global state.
- *
- * Legal values are e.g. AL_DOPPLER_FACTOR, AL_DOPPLER_VELOCITY,
- * AL_DISTANCE_MODEL.
- * <p>
- * <code>null</code> destinations are quietly ignored. AL_INVALID_ENUM is the response to errors
- * in specifying pName. The amount of memory required in the destination
- * depends on the actual state requested.
- * </p>
- *
- * @param pname state to be queried
- * @param data Buffer to place the floats in
- */
- @StripPostfix("data")
- @ALvoid
- void alGetFloatv(@ALenum int pname, @OutParameter @Check("1") FloatBuffer data);
-
- /**
- * Like OpenGL, AL uses a simplified interface for querying global state.
- *
- * Legal values are e.g. AL_DOPPLER_FACTOR, AL_DOPPLER_VELOCITY,
- * AL_DISTANCE_MODEL.
- * <p>
- * <code>null</code> destinations are quietly ignored. AL_INVALID_ENUM is the response to errors
- * in specifying pName. The amount of memory required in the destination
- * depends on the actual state requested.
- * </p>
- *
- * @param pname state to be queried
- * @param data Buffer to place the doubles in
- */
- @StripPostfix("data")
- @ALvoid
- void alGetDoublev(@ALenum int pname, @OutParameter @Check("1") DoubleBuffer data);
-
- /**
- * The application can retrieve state information global to the current AL Context.
- * GetString will return a pointer to a constant string. Valid values for param are
- * VERSION, RENDERER, VENDOR, and EXTENSIONS, as well as the error codes
- * defined by AL. The application can use GetString to retrieve a string for an error
- * code.
- *
- * @param pname The property to be returned
- * @return OpenAL String property
- */
- @NoErrorCheck
- String alGetString(@ALenum int pname);
-
- /**
- * The AL detects only a subset of those conditions that could be considered errors.
- * This is because in many cases error checking would adversely impact the
- * performance of an error-free program.
- * <p>
- * Each detectable error is assigned a numeric
- * code. When an error is detected by AL, a flag is set and the error code is recorded.
- * Further errors, if they occur, do not affect this recorded code. When GetError is
- * called, the code is returned and the flag is cleared, so that a further error will again
- * record its code. If a call to GetError returns AL_NO_ERROR then there has been no
- * detectable error since the last call to GetError (or since the AL was initialized).
- * </p>
- * <p>
- * Error codes can be mapped to strings. The GetString function returns a pointer to a
- * constant (literal) string that is identical to the identifier used for the enumeration
- * value, as defined in the specification.
- * </p>
- * <p>
- * AL_NO_ERROR - "No Error" token.<br>
- * AL_INVALID_NAME - Invalid Name parameter.<br>
- * AL_INVALID_ENUM - Invalid parameter.<br>
- * AL_INVALID_VALUE - Invalid enum parameter value.<br>
- * AL_INVALID_OPERATION - Illegal call.<br>
- * AL_OUT_OF_MEMORY - Unable to allocate memory.<br>
- * </p>
- * <p>
- * The table summarizes the AL errors. Currently, when an error flag is set, results of
- * AL operations are undefined only if AL_OUT_OF_MEMORY has occured. In other
- * cases, the command generating the error is ignored so that it has no effect on AL
- * state or output buffer contents. If the error generating command returns a value, it
- * returns zero. If the generating command modifies values through a pointer
- * argument, no change is made to these values. These error semantics apply only to
- * AL errors, not to system errors such as memory access errors.
- * </p>
- * <p>
- * Several error generation conditions are implicit in the description of the various AL
- * commands. First, if a command that requires an enumerated value is passed a value
- * that is not one of those specified as allowable for that command, the error
- * AL_INVALID_ENUM results. This is the case even if the argument is a pointer to a
- * symbolic constant if that value is not allowable for the given command. This will
- * occur whether the value is allowable for other functions, or an invalid integer value.
- * </p>
- * <p>
- * Integer parameters that are used as names for AL objects such as Buffers and
- * Sources are checked for validity. If an invalid name parameter is specified in an AL
- * command, an AL_INVALID_NAME error will be generated, and the command is
- * ignored.
- * </p>
- * <p>
- * If a negative integer is provided where an argument of type sizei is specified, the
- * error AL_INVALID_VALUE results. The same error will result from attempts to set
- * integral and floating point values for attributes exceeding the legal range for these.
- * The specification does not guarantee that the implementation emits
- * AL_INVALID_VALUE if a NaN or Infinity value is passed in for a float or double
- * argument (as the specification does not enforce possibly expensive testing of
- * floating point values).
- * </p>
- * <p>
- * Commands can be invalid. For example, certain commands might not be applicable
- * to a given object. There are also illegal combinations of tokens and values as
- * arguments to a command. AL responds to any such illegal command with an
- * AL_INVALID_OPERATION error.
- * </p>
- * <p>
- * If memory is exhausted as a side effect of the execution of an AL command, either
- * on system level or by exhausting the allocated resources at AL's internal disposal,
- * the error AL_OUT_OF_MEMORY may be generated. This can also happen independent
- * of recent commands if AL has to request memory for an internal task and fails to
- * allocate the required memory from the operating system.
- * </p>
- * <p>
- * Otherwise errors are generated only for conditions that are explicitely described in
- * this specification.
- * </p>
- *
- * @return current error state
- */
- @NoErrorCheck
- @ALenum int alGetError();
-
- /**
- * To verify that a given extension is available for the current context and the device it
- * is associated with, use this method.
- * <p>
- * A <code>null</code> name argument returns AL_FALSE, as do invalid and unsupported string
- * tokens. A <code>null</code> deviceHandle will result in an INVALID_DEVICE error.
- * </p>
- *
- * @param fname String describing the desired extension
- * @return true if extension is available, false if not
- */
- boolean alIsExtensionPresent(String fname);
-
- /**
- * <p>
- * To obtain enumeration values for extensions, the application has to use
- * GetEnumValue of an extension token. Enumeration values are defined within the
- * AL namespace and allocated according to specification of the core API and the
- * extensions, thus they are context-independent.
- * </p>
- * <p>
- * Returns 0 if the enumeration can not be found. The presence of an enum value does
- * not guarantee the applicability of an extension to the current context. A non-zero
- * return indicates merely that the implementation is aware of the existence of this
- * extension. Implementations should not attempt to return 0 to indicate that the
- * extensions is not supported for the current context.
- * </p>
- *
- * @param ename String describing an OpenAL enum
- * @return Actual int for the described enumeration name
- */
- @ALenum int alGetEnumValue(String ename);
-
- /**
- * Listener attributes are changed using the Listener group of commands.
- *
- * @param pname name of the attribute to be set
- * @param value value to set the attribute to
- */
- @ALvoid
- void alListeneri(@ALenum int pname, int value);
-
- /**
- * Listener attributes are changed using the Listener group of commands.
- *
- * @param pname name of the attribute to be set
- * @param value floating point value to set the attribute to
- */
- @ALvoid
- void alListenerf(@ALenum int pname, float value);
-
- /**
- * Listener attributes are changed using the Listener group of commands.
- *
- * @param pname name of the attribute to be set
- * @param value FloatBuffer containing value to set the attribute to
- */
- @StripPostfix("value")
- @ALvoid
- void alListenerfv(@ALenum int pname, @Check("1") @Const FloatBuffer value);
-
- /**
- * Listener attributes are changed using the Listener group of commands.
- *
- * @param pname name of the attribute to be set
- * @param v1 value value 1
- * @param v2 value value 2
- * @param v3 float value 3
- */
- @ALvoid
- void alListener3f(@ALenum int pname, float v1, float v2, float v3);
-
- /**
- * Listener state is maintained inside the AL implementation and can be queried in
- * full.
- *
- * @param pname name of the attribute to be retrieved
- * @return int
- */
- void alGetListeneri(@ALenum int pname, @Result @ALint int value);
-
- /**
- * Listener state is maintained inside the AL implementation and can be queried in
- * full.
- *
- * @param pname name of the attribute to be retrieved
- * @return float
- */
- void alGetListenerf(@ALenum int pname, @Result float value);
-
- /**
- * Listener state is maintained inside the AL implementation and can be queried in
- * full.
- *
- * @param pname name of the attribute to be retrieved
- * @param floatdata Buffer to write floats to
- */
- // TODO: What's the real minimum number of elements?
- @StripPostfix("floatdata")
- @ALvoid
- void alGetListenerfv(@ALenum int pname, @OutParameter @Check("1") FloatBuffer floatdata);
-
- /**
- * The application requests a number of Sources using GenSources.
- *
- * @param sources array holding sources
- */
- @ALvoid
- void alGenSources(@AutoSize("sources") @ALsizei int n, @OutParameter @ALuint IntBuffer sources);
-
- @Alternate(value = "alGenSources", nativeAlt = true)
- @ALvoid
- void alGenSources2(@Constant("1") @ALsizei int n, @Result @ALuint int source);
-
- /**
- * The application requests deletion of a number of Sources by DeleteSources.
- *
- * @param sources Source array to delete from
- */
- @ALvoid
- void alDeleteSources(@AutoSize("sources") @ALsizei int n, @ALuint IntBuffer sources);
-
- @Alternate(value = "alDeleteSources", nativeAlt = true)
- @ALvoid
- void alDeleteSources2(@Constant("1") @ALsizei int n, @Indirect @ALuint int source);
-
- /**
- * The application can verify whether a source name is valid using the IsSource query.
- *
- * @param id id of source to be testes for validity
- * @return true if id is valid, false if not
- */
- boolean alIsSource(@ALuint int id);
-
- /**
- * Specifies the position and other properties as taken into account during
- * sound processing.
- *
- * @param source Source to det property on
- * @param pname property to set
- * @param value value of property
- */
- @ALvoid
- void alSourcei(@ALuint int source, @ALenum int pname, int value);
-
- /**
- * Specifies the position and other properties as taken into account during
- * sound processing.
- *
- * @param source Source to det property on
- * @param pname property to set
- * @param value value of property
- */
- @ALvoid
- void alSourcef(@ALuint int source, @ALenum int pname, float value);
-
- /**
- * Specifies the position and other properties as taken into account during
- * sound processing.
- *
- * @param source Source to set property on
- * @param pname property to set
- * @param value FloatBuffer containing value of property
- */
- // TODO: What's the correct minimum value?
- @StripPostfix("value")
- @ALvoid
- void alSourcefv(@ALuint int source, @ALenum int pname, @Check("1") @Const FloatBuffer value);
-
- /**
- * Specifies the position and other properties as taken into account during
- * sound processing.
- *
- * @param source Source to set property on
- * @param pname property to set
- * @param v1 value 1 of property
- * @param v2 value 2 of property
- * @param v3 value 3 of property
- */
- @ALvoid
- void alSource3f(
- @ALuint int source,
- @ALenum int pname,
- float v1,
- float v2,
- float v3);
-
-
- /**
- * Source state is maintained inside the AL implementation, and the current attributes
- * can be queried. The performance of such queries is implementation dependent, no
- * performance guarantees are made.
- *
- * @param source source to get property from
- * @param pname name of property
- * @return int
- */
- @ALvoid
- void alGetSourcei(@ALuint int source, @ALenum int pname, @Result int value);
-
- /**
- * Source state is maintained inside the AL implementation, and the current attributes
- * can be queried. The performance of such queries is implementation dependent, no
- * performance guarantees are made.
- *
- * @param source source to get property from
- * @param pname name of property
- * @return float
- */
- @ALvoid
- void alGetSourcef(@ALuint int source, @ALenum int pname, @Result float value);
-
- /**
- * Source state is maintained inside the AL implementation, and the current attributes
- * can be queried. The performance of such queries is implementation dependent, no
- * performance guarantees are made.
- *
- * @param source Source to get property from
- * @param pname property to get
- * @param floatdata Buffer to write floats to
- */
- // TODO: What's the correct minimum value?
- @StripPostfix("floatdata")
- @ALvoid
- void alGetSourcefv(@ALuint int source, @ALenum int pname, @OutParameter @Check("1") FloatBuffer floatdata);
-
- /**
- * Play() applied to an AL_INITIAL Source will promote the Source to AL_PLAYING, thus
- * the data found in the Buffer will be fed into the processing, starting at the
- * beginning. Play() applied to a AL_PLAYING Source will restart the Source from the
- * beginning. It will not affect the configuration, and will leave the Source in
- * AL_PLAYING state, but reset the sampling offset to the beginning. Play() applied to a
- * AL_PAUSED Source will resume processing using the Source state as preserved at the
- * Pause() operation. Play() applied to a AL_STOPPED Source will propagate it to
- * AL_INITIAL then to AL_PLAYING immediately.
- *
- * @param sources array of sources to play
- */
- @StripPostfix("sources")
- @ALvoid
- void alSourcePlayv(@AutoSize("sources") @ALsizei int n, @ALuint IntBuffer sources);
-
- /**
- * Pause() applied to an AL_INITIAL Source is a legal NOP. Pause() applied to a
- * AL_PLAYING Source will change its state to AL_PAUSED. The Source is exempt from
- * processing, its current state is preserved. Pause() applied to a AL_PAUSED Source is a
- * legal NOP. Pause() applied to a AL_STOPPED Source is a legal NOP.
- *
- * @param sources array of sources to pause
- */
- @StripPostfix("sources")
- @ALvoid
- void alSourcePausev(@AutoSize("sources") @ALsizei int n, @ALuint IntBuffer sources);
-
- /**
- * Stop() applied to an AL_INITIAL Source is a legal NOP. Stop() applied to a AL_PLAYING
- * Source will change its state to AL_STOPPED. The Source is exempt from processing,
- * its current state is preserved. Stop() applied to a AL_PAUSED Source will change its
- * state to AL_STOPPED, with the same consequences as on a AL_PLAYING Source. Stop()
- * applied to a AL_STOPPED Source is a legal NOP.
- *
- * @param sources array of sources to stop
- */
- @StripPostfix("sources")
- @ALvoid
- void alSourceStopv(@AutoSize("sources") @ALsizei int n, @ALuint IntBuffer sources);
-
- /**
- * Rewind() applied to an AL_INITIAL Source is a legal NOP. Rewind() applied to a
- * AL_PLAYING Source will change its state to AL_STOPPED then AL_INITIAL. The Source is
- * exempt from processing, its current state is preserved, with the exception of the
- * sampling offset which is reset to the beginning. Rewind() applied to a AL_PAUSED
- * Source will change its state to AL_INITIAL, with the same consequences as on a
- * AL_PLAYING Source. Rewind() applied to a AL_STOPPED Source promotes the Source to
- * AL_INITIAL, resetting the sampling offset to the beginning.
- *
- * @param sources array of sources to rewind
- */
- @StripPostfix("sources")
- @ALvoid
- void alSourceRewindv(@AutoSize("sources") @ALsizei int n, @ALuint IntBuffer sources);
-
- /**
- * Play() applied to an AL_INITIAL Source will promote the Source to AL_PLAYING, thus
- * the data found in the Buffer will be fed into the processing, starting at the
- * beginning. Play() applied to a AL_PLAYING Source will restart the Source from the
- * beginning. It will not affect the configuration, and will leave the Source in
- * AL_PLAYING state, but reset the sampling offset to the beginning. Play() applied to a
- * AL_PAUSED Source will resume processing using the Source state as preserved at the
- * Pause() operation. Play() applied to a AL_STOPPED Source will propagate it to
- * AL_INITIAL then to AL_PLAYING immediately.
- *
- * @param source Source to play
- */
- @ALvoid
- void alSourcePlay(@ALuint int source);
-
- /**
- * Pause() applied to an AL_INITIAL Source is a legal NOP. Pause() applied to a
- * AL_PLAYING Source will change its state to AL_PAUSED. The Source is exempt from
- * processing, its current state is preserved. Pause() applied to a AL_PAUSED Source is a
- * legal NOP. Pause() applied to a AL_STOPPED Source is a legal NOP.
- *
- * @param source Source to pause
- */
- @ALvoid
- void alSourcePause(@ALuint int source);
-
- /**
- * Stop() applied to an AL_INITIAL Source is a legal NOP. Stop() applied to a AL_PLAYING
- * Source will change its state to AL_STOPPED. The Source is exempt from processing,
- * its current state is preserved. Stop() applied to a AL_PAUSED Source will change its
- * state to AL_STOPPED, with the same consequences as on a AL_PLAYING Source. Stop()
- * applied to a AL_STOPPED Source is a legal NOP.
- *
- * @param source Source to stop
- */
- @ALvoid
- void alSourceStop(@ALuint int source);
-
- /**
- * Rewind() applied to an AL_INITIAL Source is a legal NOP. Rewind() applied to a
- * AL_PLAYING Source will change its state to AL_STOPPED then AL_INITIAL. The Source is
- * exempt from processing, its current state is preserved, with the exception of the
- * sampling offset which is reset to the beginning. Rewind() applied to a AL_PAUSED
- * Source will change its state to AL_INITIAL, with the same consequences as on a
- * AL_PLAYING Source. Rewind() applied to a AL_STOPPED Source promotes the Source to
- * AL_INITIAL, resetting the sampling offset to the beginning.
- *
- * @param source Source to rewind
- */
- @ALvoid
- void alSourceRewind(@ALuint int source);
-
- /**
- * The application requests a number of Buffers using GenBuffers.
- *
- * @param buffers holding buffers
- */
- @ALvoid
- void alGenBuffers(@AutoSize("buffers") @ALsizei int n, @OutParameter @ALuint IntBuffer buffers);
-
- @Alternate(value = "alGenBuffers", nativeAlt = true)
- @ALvoid
- void alGenBuffers2(@Constant("1") @ALsizei int n, @Result @ALuint int buffer);
-
- /**
- * <p>
- * The application requests deletion of a number of Buffers by calling DeleteBuffers.
- * </p>
- * <p>
- * Once deleted, Names are no longer valid for use with AL function calls. Any such
- * use will cause an AL_INVALID_NAME error. The implementation is free to defer actual
- * release of resources.
- * </p>
- * <p>
- * IsBuffer(bname) can be used to verify deletion of a buffer. Deleting bufferName 0 is
- * a legal NOP in both scalar and vector forms of the command. The same is true for
- * unused buffer names, e.g. such as not allocated yet, or as released already.
- *
- * @param buffers Buffer to delete from
- */
- @ALvoid
- void alDeleteBuffers(@AutoSize("buffers") @ALsizei int n, @ALuint IntBuffer buffers);
-
- @Alternate(value = "alDeleteBuffers", nativeAlt = true)
- @ALvoid
- void alDeleteBuffers2(@Constant("1") @ALsizei int n, @Indirect @ALuint int buffer);
-
- /**
- * The application can verify whether a buffer Name is valid using the IsBuffer query.
- *
- * @param buffer buffer to be tested for validity
- * @return true if supplied buffer is valid, false if not
- */
- boolean alIsBuffer(@ALuint int buffer);
-
- /**
- * <p>
- * A special case of Buffer state is the actual sound sample data stored in asociation
- * with the Buffer. Applications can specify sample data using BufferData.
- * </p>
- * <p>
- * The data specified is copied to an internal software, or if possible, hardware buffer.
- * The implementation is free to apply decompression, conversion, resampling, and
- * filtering as needed. The internal format of the Buffer is not exposed to the
- * application, and not accessible. Valid formats are AL_FORMAT_MONO8,
- * AL_FORMAT_MONO16, AL_FORMAT_STEREO8, and AL_FORMAT_STEREO16. An
- * implementation may expose other formats, see the chapter on Extensions for
- * information on determining if additional formats are supported.
- * </p>
- * <p>
- * Applications should always check for an error condition after attempting to specify
- * buffer data in case an implementation has to generate an AL_OUT_OF_MEMORY or
- * conversion related AL_INVALID_VALUE error. The application is free to reuse the
- * memory specified by the data pointer once the call to BufferData returns. The
- * implementation has to dereference, e.g. copy, the data during BufferData execution.
- * </p>
- *
- * @param buffer Buffer to fill
- * @param format format sound data is in
- * @param data location of data
- * @param freq frequency of data
- */
- @ALvoid
- void alBufferData(
- @ALuint int buffer,
- @ALenum int format,
- @ALbyte
- @ALshort
- @ALint
- Buffer data,
- @AutoSize("data")
- @ALsizei int size,
- @ALsizei int freq);
-
- /**
- * Buffer state is maintained inside the AL implementation and can be queried in full.<br>
- * ALC_FREQUENCY - specified in samples per second, i.e. units of Hertz [Hz].<br>
- * ALC_SIZE - Size in bytes of the buffer data.<br>
- *
- * @param buffer buffer to get property from
- * @param pname name of property to retrieve
- */
- @ALvoid
- void alGetBufferi(@ALuint int buffer, @ALenum int pname, @Result int value);
-
- /**
- * Buffer state is maintained inside the AL implementation and can be queried in full.<br>
- * ALC_FREQUENCY - specified in samples per second, i.e. units of Hertz [Hz].<br>
- * ALC_SIZE - Size in bytes of the buffer data.<br>
- *
- * @param buffer buffer to get property from
- * @param pname name of property to retrieve
- * @return float
- */
- @ALvoid
- void alGetBufferf(@ALuint int buffer, @ALenum int pname, @Result float value);
-
- /**
- * <p>
- * The application can queue up one or multiple buffer names using
- * SourceQueueBuffers. The buffers will be queued in the sequence in which they
- * appear in the array.
- * </p>
- * <p>
- * This command is legal on a Source in any state (to allow for streaming, queueing
- * has to be possible on a AL_PLAYING Source). Queues are read-only with exception of
- * the unqueue operation. The Buffer Name AL_NONE (i.e. 0) can be queued.
- * </p>
- *
- * @param source source to queue buffers onto
- * @param buffers buffers to be queued
- */
- @ALvoid
- void alSourceQueueBuffers(@ALuint int source, @AutoSize("buffers") @ALsizei int n, @ALuint IntBuffer buffers);
-
- @Alternate(value = "alSourceQueueBuffers", nativeAlt = true)
- @ALvoid
- void alSourceQueueBuffers2(@ALuint int source, @Constant("1") @ALsizei int n, @Indirect @ALuint int buffer);
-
- /**
- * <p>
- * Once a queue entry for a buffer has been appended to a queue and is pending
- * processing, it should not be changed. Removal of a given queue entry is not possible
- * unless either the Source is AL_STOPPED (in which case then entire queue is considered
- * processed), or if the queue entry has already been processed (AL_PLAYING or AL_PAUSED
- * Source).
- * </p>
- * <p>
- * The Unqueue command removes a number of buffers entries that have finished
- * processing, in the order of appearance, from the queue. The operation will fail if
- * more buffers are requested than available, leaving the destination arguments
- * unchanged. An AL_INVALID_VALUE error will be thrown. If no error, the destination
- * argument will have been updated accordingly.
- * </p>
- *
- * @param source source to unqueue buffers from
- * @param buffers IntBuffer containing list of names that were unqueued
- */
- @ALvoid
- void alSourceUnqueueBuffers(@ALuint int source, @AutoSize("buffers") @ALsizei int n, @OutParameter @ALuint IntBuffer buffers);
-
- @Alternate(value = "alSourceUnqueueBuffers", nativeAlt = true)
- @ALvoid
- void alSourceUnqueueBuffers2(@ALuint int source, @Constant("1") @ALsizei int n, @Result @ALuint int buffer);
-
- /**
- * <p>
- * Samples usually use the entire dynamic range of the chosen format/encoding,
- * independent of their real world intensity. In other words, a jet engine and a
- * clockwork both will have samples with full amplitude. The application will then
- * have to adjust Source AL_GAIN accordingly to account for relative differences.
- * </p>
- * <p>
- * Source AL_GAIN is then attenuated by distance. The effective attenuation of a Source
- * depends on many factors, among which distance attenuation and source and
- * Listener AL_GAIN are only some of the contributing factors. Even if the source and
- * Listener AL_GAIN exceed 1.0 (amplification beyond the guaranteed dynamic range),
- * distance and other attenuation might ultimately limit the overall AL_GAIN to a value
- * below 1.0.
- * </p>
- * <p>
- * AL currently supports three modes of operation with respect to distance
- * attenuation. It supports two distance-dependent attenuation models, one which is
- * similar to the IASIG I3DL2 (and DS3D) model. The application choses one of these
- * two models (or can chose to disable distance-dependent attenuation effects model)
- * on a per-context basis.
- * </p>
- * <p>
- * Legal arguments are AL_NONE, AL_INVERSE_DISTANCE, and
- * AL_INVERSE_DISTANCE_CLAMPED.
- * <br>
- * <br>
- * AL_NONE bypasses all distance attenuation
- * calculation for all Sources. The implementation is expected to optimize this
- * situation.
- * <br>
- * <br>
- * AL_INVERSE_DISTANCE_CLAMPED is the DS3D model, with
- * AL_REFERENCE_DISTANCE indicating both the reference distance and the distance
- * below which gain will be clamped.
- * <br>
- * <br>
- * AL_INVERSE_DISTANCE is equivalent to the DS3D
- * model with the exception that AL_REFERENCE_DISTANCE does not imply any
- * clamping.
- * <br>
- * <br>
- * The AL implementation is still free to apply any range clamping as
- * necessary. The current distance model chosen can be queried using GetIntegerv and
- * AL_DISTANCE_MODEL.
- * </p>
- *
- * @param value distance model to be set
- */
- @ALvoid
- void alDistanceModel(@ALenum int value);
-
- /**
- * The Doppler Effect depends on the velocities of Source and Listener relative to the
- * medium, and the propagation speed of sound in that medium. The application
- * might want to emphasize or de-emphasize the Doppler Effect as physically accurate
- * calculation might not give the desired results. The amount of frequency shift (pitch
- * change) is proportional to the speed of listener and source along their line of sight.
- * The application can increase or decrease that frequency shift by specifying the
- * scaling factor AL should apply to the result of the calculation.
- * <br>
- * <br>
- * The Doppler Effect as implemented by AL is described by the formula below. Effects
- * of the medium (air, water) moving with respect to listener and source are ignored.
- * AL_DOPPLER_VELOCITY is the propagation speed relative to which the Source
- * velocities are interpreted.
- *
- * <p>
- * <pre>
- * VD: AL_DOPPLER_VELOCITY
- * DF: AL_DOPPLER_FACTOR
- * vl: Listener velocity (scalar, projected on source-listener vector)
- * vs: Source verlocity (scalar, projected on source-listener vector)
- * f: Frequency in sample
- * f': effective Doppler shifted frequency
- *
- * f' = DF * f * (VD-vl)/(VD+vs)
- *
- * vl<0, vs>0 : source and listener approaching each other
- * vl>0, vs<0 : source and listener moving away from each other
- * </pre>
- * </p>
- * <p>
- * The implementation has to clamp the projected Listener velocity vl, if abs(vl) is
- * greater or equal VD. It similarly has to clamp the projected Source velocity vs if
- * abs(vs) is greater or equal VD.
- * </p>
- * <p>
- * There are two API calls global to the current context that provide control of the two
- * related parameters.
- * </p>
- * <p>
- * AL_DOPPLER_FACTOR is a simple scaling to exaggerate or
- * deemphasize the Doppler (pitch) shift resulting from the calculation.
- * </p>
- * <p>
- * A negative value will result in an AL_INVALID_VALUE error, the command is then
- * ignored. The default value is 1. The current setting can be queried using GetFloatv
- * and AL_DOPPLER_FACTOR. The implementation is free to optimize the case of
- * AL_DOPPLER_FACTOR being set to zero, as this effectively disables the effect.
- * </p>
- *
- * @param value Doppler scale value to set
- */
- @ALvoid
- void alDopplerFactor(float value);
-
- /**
- * The Doppler Effect depends on the velocities of Source and Listener relative to the
- * medium, and the propagation speed of sound in that medium. The application
- * might want to emphasize or de-emphasize the Doppler Effect as physically accurate
- * calculation might not give the desired results. The amount of frequency shift (pitch
- * change) is proportional to the speed of listener and source along their line of sight.
- * The application can increase or decrease that frequency shift by specifying the
- * scaling factor AL should apply to the result of the calculation.
- * <br>
- * <br>
- * The Doppler Effect as implemented by AL is described by the formula below. Effects
- * of the medium (air, water) moving with respect to listener and source are ignored.
- * AL_DOPPLER_VELOCITY is the propagation speed relative to which the Source
- * velocities are interpreted.
- *
- * <p>
- * <pre>
- * VD: AL_DOPPLER_VELOCITY
- * DF: AL_DOPPLER_FACTOR
- * vl: Listener velocity (scalar, projected on source-listener vector)
- * vs: Source verlocity (scalar, projected on source-listener vector)
- * f: Frequency in sample
- * f': effective Doppler shifted frequency
- *
- * f' = DF * f * (VD-vl)/(VD+vs)
- *
- * vl<0, vs>0 : source and listener approaching each other
- * vl>0, vs<0 : source and listener moving away from each other
- * </pre>
- * </p>
- * <p>
- * The implementation has to clamp the projected Listener velocity vl, if abs(vl) is
- * greater or equal VD. It similarly has to clamp the projected Source velocity vs if
- * abs(vs) is greater or equal VD.
- * </p>
- * <p>
- * There are two API calls global to the current context that provide control of the two
- * related parameters.
- * </p>
- * <p>
- * AL_DOPPLER_VELOCITY allows the application to change the reference (propagation)
- * velocity used in the Doppler Effect calculation. This permits the application to use a
- * velocity scale appropriate to its purposes.
- * </p>
- * <p>
- * A negative or zero value will result in an AL_INVALID_VALUE error, the command is
- * then ignored. The default value is 1. The current setting can be queried using
- * GetFloatv and AL_DOPPLER_VELOCITY.
- * </p>
- *
- * @param value Doppler velocity value to set
- */
- @ALvoid
- void alDopplerVelocity(float value);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.openal;
+
+import java.nio.Buffer;
+import java.nio.IntBuffer;
+import java.nio.FloatBuffer;
+import java.nio.DoubleBuffer;
+
+import org.lwjgl.util.generator.*;
+
+/**
+ * <br>
+ * This is the core OpenAL class. This class implements
+ * AL.h version 1.0
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 3288 $
+ * $Id: AL10.java 3288 2010-03-16 17:58:48Z spasi $
+ */
+public interface AL10 {
+ /** Bad value */
+ int AL_INVALID = -1;
+
+ /** Disable value */
+ int AL_NONE = 0;
+
+ /** Boolean False */
+ int AL_FALSE = 0;
+
+ /** Boolean True */
+ int AL_TRUE = 1;
+
+ /**
+ * Indicate the type of SOURCE.
+ * Sources can be spatialized
+ */
+ int AL_SOURCE_TYPE = 0x1027;
+
+ /** Indicate source has absolute coordinates */
+ int AL_SOURCE_ABSOLUTE = 0x201;
+
+ /** Indicate Source has listener relative coordinates */
+ int AL_SOURCE_RELATIVE = 0x202;
+
+ /**
+ * Directional source, inner cone angle, in degrees
+ * Range: [0-360]
+ * Default: 360
+ */
+ int AL_CONE_INNER_ANGLE = 0x1001;
+
+ /**
+ * Directional source, outer cone angle, in degrees.
+ * Range: [0-360]
+ * Default: 360
+ */
+ int AL_CONE_OUTER_ANGLE = 0x1002;
+
+ /**
+ * Specify the pitch to be applied, either at source,
+ * or on mixer results, at listener.
+ * Range: [0.5-2.0]
+ * Default: 1.0
+ */
+ int AL_PITCH = 0x1003;
+
+ /**
+ * Specify the current location in three dimensional space.
+ * OpenAL, like OpenGL, uses a right handed coordinate system,
+ * where in a frontal default view X (thumb) points right,
+ * Y points up (index finger), and Z points towards the
+ * viewer/camera (middle finger).
+ * To switch from a left handed coordinate system, flip the
+ * sign on the Z coordinate.
+ * Listener position is always in the world coordinate system.
+ */
+ int AL_POSITION = 0x1004;
+
+ /** Specify the current direction as forward vector. */
+ int AL_DIRECTION = 0x1005;
+
+ /** Specify the current velocity in three dimensional space. */
+ int AL_VELOCITY = 0x1006;
+
+ /**
+ * Indicate whether source has to loop infinite.
+ * Type: ALboolean
+ * Range: [TRUE, FALSE]
+ * Default: FALSE
+ */
+ int AL_LOOPING = 0x1007;
+
+ /**
+ * Indicate the buffer to provide sound samples.
+ * Type: ALuint.
+ * Range: any valid Buffer id.
+ */
+ int AL_BUFFER = 0x1009;
+
+ /**
+ * Indicate the gain (volume amplification) applied.
+ * Type: ALfloat.
+ * Range: ]0.0- ]
+ * A value of 1.0 means un-attenuated/unchanged.
+ * Each division by 2 equals an attenuation of -6dB.
+ * Each multiplicaton with 2 equals an amplification of +6dB.
+ * A value of 0.0 is meaningless with respect to a logarithmic
+ * scale; it is interpreted as zero volume - the channel
+ * is effectively disabled.
+ */
+ int AL_GAIN = 0x100A;
+
+ /**
+ * Indicate minimum source attenuation.
+ * Type: ALfloat
+ * Range: [0.0 - 1.0]
+ */
+ int AL_MIN_GAIN = 0x100D;
+
+ /**
+ * Indicate maximum source attenuation.
+ * Type: ALfloat
+ * Range: [0.0 - 1.0]
+ */
+ int AL_MAX_GAIN = 0x100E;
+
+ /**
+ * Specify the current orientation.
+ * Type: ALfv6 (at/up)
+ * Range: N/A
+ */
+ int AL_ORIENTATION = 0x100F;
+
+ /* byte offset into source (in canon format). -1 if source
+ * is not playing. Don't set this, get this.
+ *
+ * Type: ALfloat
+ * Range: [0.0 - ]
+ * Default: 1.0
+ */
+ int AL_REFERENCE_DISTANCE = 0x1020;
+
+ /**
+ * Indicate the rolloff factor for the source.
+ * Type: ALfloat
+ * Range: [0.0 - ]
+ * Default: 1.0
+ */
+ int AL_ROLLOFF_FACTOR = 0x1021;
+
+ /**
+ * Indicate the gain (volume amplification) applied.
+ * Type: ALfloat.
+ * Range: ]0.0- ]
+ * A value of 1.0 means un-attenuated/unchanged.
+ * Each division by 2 equals an attenuation of -6dB.
+ * Each multiplicaton with 2 equals an amplification of +6dB.
+ * A value of 0.0 is meaningless with respect to a logarithmic
+ * scale; it is interpreted as zero volume - the channel
+ * is effectively disabled.
+ */
+ int AL_CONE_OUTER_GAIN = 0x1022;
+
+ /**
+ * Specify the maximum distance.
+ * Type: ALfloat
+ * Range: [0.0 - ]
+ */
+ int AL_MAX_DISTANCE = 0x1023;
+
+ /**
+ * Specify the channel mask. (Creative)
+ * Type: ALuint
+ * Range: [0 - 255]
+ */
+ int AL_CHANNEL_MASK = 0x3000;
+
+ /** Source state information */
+ int AL_SOURCE_STATE = 0x1010;
+
+ /** Source state information */
+ int AL_INITIAL = 0x1011;
+
+ /** Source state information */
+ int AL_PLAYING = 0x1012;
+
+ /** Source state information */
+ int AL_PAUSED = 0x1013;
+
+ /** Source state information */
+ int AL_STOPPED = 0x1014;
+
+ /** Buffer Queue params */
+ int AL_BUFFERS_QUEUED = 0x1015;
+
+ /** Buffer Queue params */
+ int AL_BUFFERS_PROCESSED = 0x1016;
+
+ /** Sound buffers: format specifier. */
+ int AL_FORMAT_MONO8 = 0x1100;
+
+ /** Sound buffers: format specifier. */
+ int AL_FORMAT_MONO16 = 0x1101;
+
+ /** Sound buffers: format specifier. */
+ int AL_FORMAT_STEREO8 = 0x1102;
+
+ /** Sound buffers: format specifier. */
+ int AL_FORMAT_STEREO16 = 0x1103;
+
+ /** Ogg Vorbis format specifier. */
+ int AL_FORMAT_VORBIS_EXT = 0x10003;
+
+ /**
+ * Sound buffers: frequency, in units of Hertz [Hz].
+ * This is the number of samples per second. Half of the
+ * sample frequency marks the maximum significant
+ * frequency component.
+ */
+ int AL_FREQUENCY = 0x2001;
+
+ /**
+ * Sound buffers: frequency, in units of Hertz [Hz].
+ * This is the number of samples per second. Half of the
+ * sample frequency marks the maximum significant
+ * frequency component.
+ */
+ int AL_BITS = 0x2002;
+
+ /**
+ * Sound buffers: frequency, in units of Hertz [Hz].
+ * This is the number of samples per second. Half of the
+ * sample frequency marks the maximum significant
+ * frequency component.
+ */
+ int AL_CHANNELS = 0x2003;
+
+ /**
+ * Sound buffers: frequency, in units of Hertz [Hz].
+ * This is the number of samples per second. Half of the
+ * sample frequency marks the maximum significant
+ * frequency component.
+ */
+ int AL_SIZE = 0x2004;
+
+ /**
+ * Sound buffers: frequency, in units of Hertz [Hz].
+ * This is the number of samples per second. Half of the
+ * sample frequency marks the maximum significant
+ * frequency component.
+ */
+ int AL_DATA = 0x2005;
+
+ /**
+ * Buffer state.
+ *
+ * Not supported for public use (yet).
+ */
+ int AL_UNUSED = 0x2010;
+
+ /**
+ * Buffer state.
+ *
+ * Not supported for public use (yet).
+ */
+ int AL_PENDING = 0x2011;
+
+ /**
+ * Buffer state.
+ *
+ * Not supported for public use (yet).
+ */
+ int AL_PROCESSED = 0x2012;
+
+ /** Errors: No Error. */
+ int AL_NO_ERROR = AL_FALSE;
+
+ /** Illegal name passed as an argument to an AL call. */
+ int AL_INVALID_NAME = 0xA001;
+
+ /** Illegal enum passed as an argument to an AL call. */
+ int AL_INVALID_ENUM = 0xA002;
+
+ /**
+ * Illegal value passed as an argument to an AL call.
+ * Applies to parameter values, but not to enumerations.
+ */
+ int AL_INVALID_VALUE = 0xA003;
+
+ /**
+ * A function was called at inappropriate time,
+ * or in an inappropriate way, causing an illegal state.
+ * This can be an incompatible ALenum, object ID,
+ * and/or function.
+ */
+ int AL_INVALID_OPERATION = 0xA004;
+
+ /**
+ * A function could not be completed,
+ * because there is not enough memory available.
+ */
+ int AL_OUT_OF_MEMORY = 0xA005;
+
+ /** Context strings: Vendor */
+ int AL_VENDOR = 0xB001;
+
+ /** Context strings: Version */
+ int AL_VERSION = 0xB002;
+
+ /** Context strings: Renderer */
+ int AL_RENDERER = 0xB003;
+
+ /** Context strings: Extensions */
+ int AL_EXTENSIONS = 0xB004;
+
+ /** Doppler scale. Default 1.0 */
+ int AL_DOPPLER_FACTOR = 0xC000;
+
+ /** Doppler velocity. Default 1.0 */
+ int AL_DOPPLER_VELOCITY = 0xC001;
+
+ /** Distance model. Default INVERSE_DISTANCE_CLAMPED */
+ int AL_DISTANCE_MODEL = 0xD000;
+
+ /** Distance model */
+ int AL_INVERSE_DISTANCE = 0xD001;
+
+ /** Distance model */
+ int AL_INVERSE_DISTANCE_CLAMPED = 0xD002;
+
+ /**
+ * The application can temporarily disable certain AL capabilities on a per Context
+ * basis. This allows the driver implementation to optimize for certain subsets of
+ * operations. Enabling and disabling capabilities is handled using a function pair.
+ *
+ * @param capability name of a capability to enable
+ */
+ @ALvoid
+ void alEnable(int capability);
+
+ /**
+ * The application can temporarily disable certain AL capabilities on a per Context
+ * basis. This allows the driver implementation to optimize for certain subsets of
+ * operations. Enabling and disabling capabilities is handled using a function pair.
+ *
+ * @param capability name of a capability to disable
+ */
+ @ALvoid
+ void alDisable(@ALenum int capability);
+
+ /**
+ * The application can also query whether a given capability is currently enabled or
+ * not.
+ * <p>
+ * If the token used to specify target is not legal, an AL_INVALID_ENUM error will be
+ * generated.
+ * </p>
+ * <p>
+ * At this time, this mechanism is not used. There are no valid targets.
+ * </p>
+ *
+ * @param capability name of a capability to check
+ * @return true if named feature is enabled
+ */
+ boolean alIsEnabled(@ALenum int capability);
+
+ /**
+ * Hinting for implementation
+ * NOTE: This method is a NOP, but is provided for completeness.
+ *
+ * @param target The target to hint
+ * @param mode Mode to hint
+ */
+// @ALvoid
+// void alHint(@ALenum int target, @ALenum int mode);
+
+ /**
+ * Like OpenGL, AL uses a simplified interface for querying global state.
+ *
+ * Legal values are e.g. AL_DOPPLER_FACTOR, AL_DOPPLER_VELOCITY,
+ * AL_DISTANCE_MODEL.
+ * <p>
+ * <code>null</code> destinations are quietly ignored. AL_INVALID_ENUM is the response to errors
+ * in specifying pName. The amount of memory required in the destination
+ * depends on the actual state requested.
+ * </p>
+ *
+ * @return boolean state described by pname will be returned.
+ */
+ boolean alGetBoolean(@ALenum int pname);
+
+ /**
+ * Like OpenGL, AL uses a simplified interface for querying global state.
+ *
+ * Legal values are e.g. AL_DOPPLER_FACTOR, AL_DOPPLER_VELOCITY,
+ * AL_DISTANCE_MODEL.
+ * <p>
+ * <code>null</code> destinations are quietly ignored. AL_INVALID_ENUM is the response to errors
+ * in specifying pName. The amount of memory required in the destination
+ * depends on the actual state requested.
+ * </p>
+ *
+ * @return int state described by pname will be returned.
+ */
+ int alGetInteger(@ALenum int pname);
+
+ /**
+ * Like OpenGL, AL uses a simplified interface for querying global state.
+ *
+ * Legal values are e.g. AL_DOPPLER_FACTOR, AL_DOPPLER_VELOCITY,
+ * AL_DISTANCE_MODEL.
+ * <p>
+ * <code>null</code> destinations are quietly ignored. AL_INVALID_ENUM is the response to errors
+ * in specifying pName. The amount of memory required in the destination
+ * depends on the actual state requested.
+ * </p>
+ *
+ * @return float state described by pname will be returned.
+ */
+ float alGetFloat(@ALenum int pname);
+
+ /**
+ * Like OpenGL, AL uses a simplified interface for querying global state.
+ *
+ * Legal values are e.g. AL_DOPPLER_FACTOR, AL_DOPPLER_VELOCITY,
+ * AL_DISTANCE_MODEL.
+ * <p>
+ * <code>null</code> destinations are quietly ignored. AL_INVALID_ENUM is the response to errors
+ * in specifying pName. The amount of memory required in the destination
+ * depends on the actual state requested.
+ * </p>
+ *
+ * @return double state described by pname will be returned.
+ */
+ double alGetDouble(@ALenum int pname);
+
+ /**
+ * Like OpenGL, AL uses a simplified interface for querying global state.
+ *
+ * Legal values are e.g. AL_DOPPLER_FACTOR, AL_DOPPLER_VELOCITY,
+ * AL_DISTANCE_MODEL.
+ * <p>
+ * <code>null</code> destinations are quietly ignored. AL_INVALID_ENUM is the response to errors
+ * in specifying pName. The amount of memory required in the destination
+ * depends on the actual state requested.
+ * </p>
+ *
+ * @param pname state to be queried
+ * @param data Buffer to place the integers in
+ */
+ @StripPostfix("data")
+ @ALvoid
+ void alGetIntegerv(@ALenum int pname, @OutParameter @Check("1") IntBuffer data);
+
+ /**
+ * Like OpenGL, AL uses a simplified interface for querying global state.
+ *
+ * Legal values are e.g. AL_DOPPLER_FACTOR, AL_DOPPLER_VELOCITY,
+ * AL_DISTANCE_MODEL.
+ * <p>
+ * <code>null</code> destinations are quietly ignored. AL_INVALID_ENUM is the response to errors
+ * in specifying pName. The amount of memory required in the destination
+ * depends on the actual state requested.
+ * </p>
+ *
+ * @param pname state to be queried
+ * @param data Buffer to place the floats in
+ */
+ @StripPostfix("data")
+ @ALvoid
+ void alGetFloatv(@ALenum int pname, @OutParameter @Check("1") FloatBuffer data);
+
+ /**
+ * Like OpenGL, AL uses a simplified interface for querying global state.
+ *
+ * Legal values are e.g. AL_DOPPLER_FACTOR, AL_DOPPLER_VELOCITY,
+ * AL_DISTANCE_MODEL.
+ * <p>
+ * <code>null</code> destinations are quietly ignored. AL_INVALID_ENUM is the response to errors
+ * in specifying pName. The amount of memory required in the destination
+ * depends on the actual state requested.
+ * </p>
+ *
+ * @param pname state to be queried
+ * @param data Buffer to place the doubles in
+ */
+ @StripPostfix("data")
+ @ALvoid
+ void alGetDoublev(@ALenum int pname, @OutParameter @Check("1") DoubleBuffer data);
+
+ /**
+ * The application can retrieve state information global to the current AL Context.
+ * GetString will return a pointer to a constant string. Valid values for param are
+ * VERSION, RENDERER, VENDOR, and EXTENSIONS, as well as the error codes
+ * defined by AL. The application can use GetString to retrieve a string for an error
+ * code.
+ *
+ * @param pname The property to be returned
+ * @return OpenAL String property
+ */
+ @NoErrorCheck
+ String alGetString(@ALenum int pname);
+
+ /**
+ * The AL detects only a subset of those conditions that could be considered errors.
+ * This is because in many cases error checking would adversely impact the
+ * performance of an error-free program.
+ * <p>
+ * Each detectable error is assigned a numeric
+ * code. When an error is detected by AL, a flag is set and the error code is recorded.
+ * Further errors, if they occur, do not affect this recorded code. When GetError is
+ * called, the code is returned and the flag is cleared, so that a further error will again
+ * record its code. If a call to GetError returns AL_NO_ERROR then there has been no
+ * detectable error since the last call to GetError (or since the AL was initialized).
+ * </p>
+ * <p>
+ * Error codes can be mapped to strings. The GetString function returns a pointer to a
+ * constant (literal) string that is identical to the identifier used for the enumeration
+ * value, as defined in the specification.
+ * </p>
+ * <p>
+ * AL_NO_ERROR - "No Error" token.<br>
+ * AL_INVALID_NAME - Invalid Name parameter.<br>
+ * AL_INVALID_ENUM - Invalid parameter.<br>
+ * AL_INVALID_VALUE - Invalid enum parameter value.<br>
+ * AL_INVALID_OPERATION - Illegal call.<br>
+ * AL_OUT_OF_MEMORY - Unable to allocate memory.<br>
+ * </p>
+ * <p>
+ * The table summarizes the AL errors. Currently, when an error flag is set, results of
+ * AL operations are undefined only if AL_OUT_OF_MEMORY has occured. In other
+ * cases, the command generating the error is ignored so that it has no effect on AL
+ * state or output buffer contents. If the error generating command returns a value, it
+ * returns zero. If the generating command modifies values through a pointer
+ * argument, no change is made to these values. These error semantics apply only to
+ * AL errors, not to system errors such as memory access errors.
+ * </p>
+ * <p>
+ * Several error generation conditions are implicit in the description of the various AL
+ * commands. First, if a command that requires an enumerated value is passed a value
+ * that is not one of those specified as allowable for that command, the error
+ * AL_INVALID_ENUM results. This is the case even if the argument is a pointer to a
+ * symbolic constant if that value is not allowable for the given command. This will
+ * occur whether the value is allowable for other functions, or an invalid integer value.
+ * </p>
+ * <p>
+ * Integer parameters that are used as names for AL objects such as Buffers and
+ * Sources are checked for validity. If an invalid name parameter is specified in an AL
+ * command, an AL_INVALID_NAME error will be generated, and the command is
+ * ignored.
+ * </p>
+ * <p>
+ * If a negative integer is provided where an argument of type sizei is specified, the
+ * error AL_INVALID_VALUE results. The same error will result from attempts to set
+ * integral and floating point values for attributes exceeding the legal range for these.
+ * The specification does not guarantee that the implementation emits
+ * AL_INVALID_VALUE if a NaN or Infinity value is passed in for a float or double
+ * argument (as the specification does not enforce possibly expensive testing of
+ * floating point values).
+ * </p>
+ * <p>
+ * Commands can be invalid. For example, certain commands might not be applicable
+ * to a given object. There are also illegal combinations of tokens and values as
+ * arguments to a command. AL responds to any such illegal command with an
+ * AL_INVALID_OPERATION error.
+ * </p>
+ * <p>
+ * If memory is exhausted as a side effect of the execution of an AL command, either
+ * on system level or by exhausting the allocated resources at AL's internal disposal,
+ * the error AL_OUT_OF_MEMORY may be generated. This can also happen independent
+ * of recent commands if AL has to request memory for an internal task and fails to
+ * allocate the required memory from the operating system.
+ * </p>
+ * <p>
+ * Otherwise errors are generated only for conditions that are explicitely described in
+ * this specification.
+ * </p>
+ *
+ * @return current error state
+ */
+ @NoErrorCheck
+ @ALenum int alGetError();
+
+ /**
+ * To verify that a given extension is available for the current context and the device it
+ * is associated with, use this method.
+ * <p>
+ * A <code>null</code> name argument returns AL_FALSE, as do invalid and unsupported string
+ * tokens. A <code>null</code> deviceHandle will result in an INVALID_DEVICE error.
+ * </p>
+ *
+ * @param fname String describing the desired extension
+ * @return true if extension is available, false if not
+ */
+ boolean alIsExtensionPresent(String fname);
+
+ /**
+ * <p>
+ * To obtain enumeration values for extensions, the application has to use
+ * GetEnumValue of an extension token. Enumeration values are defined within the
+ * AL namespace and allocated according to specification of the core API and the
+ * extensions, thus they are context-independent.
+ * </p>
+ * <p>
+ * Returns 0 if the enumeration can not be found. The presence of an enum value does
+ * not guarantee the applicability of an extension to the current context. A non-zero
+ * return indicates merely that the implementation is aware of the existence of this
+ * extension. Implementations should not attempt to return 0 to indicate that the
+ * extensions is not supported for the current context.
+ * </p>
+ *
+ * @param ename String describing an OpenAL enum
+ * @return Actual int for the described enumeration name
+ */
+ @ALenum int alGetEnumValue(String ename);
+
+ /**
+ * Listener attributes are changed using the Listener group of commands.
+ *
+ * @param pname name of the attribute to be set
+ * @param value value to set the attribute to
+ */
+ @ALvoid
+ void alListeneri(@ALenum int pname, int value);
+
+ /**
+ * Listener attributes are changed using the Listener group of commands.
+ *
+ * @param pname name of the attribute to be set
+ * @param value floating point value to set the attribute to
+ */
+ @ALvoid
+ void alListenerf(@ALenum int pname, float value);
+
+ /**
+ * Listener attributes are changed using the Listener group of commands.
+ *
+ * @param pname name of the attribute to be set
+ * @param value FloatBuffer containing value to set the attribute to
+ */
+ @StripPostfix("value")
+ @ALvoid
+ void alListenerfv(@ALenum int pname, @Check("1") @Const FloatBuffer value);
+
+ /**
+ * Listener attributes are changed using the Listener group of commands.
+ *
+ * @param pname name of the attribute to be set
+ * @param v1 value value 1
+ * @param v2 value value 2
+ * @param v3 float value 3
+ */
+ @ALvoid
+ void alListener3f(@ALenum int pname, float v1, float v2, float v3);
+
+ /**
+ * Listener state is maintained inside the AL implementation and can be queried in
+ * full.
+ *
+ * @param pname name of the attribute to be retrieved
+ * @return int
+ */
+ void alGetListeneri(@ALenum int pname, @Result @ALint int value);
+
+ /**
+ * Listener state is maintained inside the AL implementation and can be queried in
+ * full.
+ *
+ * @param pname name of the attribute to be retrieved
+ * @return float
+ */
+ void alGetListenerf(@ALenum int pname, @Result float value);
+
+ /**
+ * Listener state is maintained inside the AL implementation and can be queried in
+ * full.
+ *
+ * @param pname name of the attribute to be retrieved
+ * @param floatdata Buffer to write floats to
+ */
+ // TODO: What's the real minimum number of elements?
+ @StripPostfix("floatdata")
+ @ALvoid
+ void alGetListenerfv(@ALenum int pname, @OutParameter @Check("1") FloatBuffer floatdata);
+
+ /**
+ * The application requests a number of Sources using GenSources.
+ *
+ * @param sources array holding sources
+ */
+ @ALvoid
+ void alGenSources(@AutoSize("sources") @ALsizei int n, @OutParameter @ALuint IntBuffer sources);
+
+ @Alternate(value = "alGenSources", nativeAlt = true)
+ @ALvoid
+ void alGenSources2(@Constant("1") @ALsizei int n, @Result @ALuint int source);
+
+ /**
+ * The application requests deletion of a number of Sources by DeleteSources.
+ *
+ * @param sources Source array to delete from
+ */
+ @ALvoid
+ void alDeleteSources(@AutoSize("sources") @ALsizei int n, @ALuint IntBuffer sources);
+
+ @Alternate(value = "alDeleteSources", nativeAlt = true)
+ @ALvoid
+ void alDeleteSources2(@Constant("1") @ALsizei int n, @Indirect @ALuint int source);
+
+ /**
+ * The application can verify whether a source name is valid using the IsSource query.
+ *
+ * @param id id of source to be testes for validity
+ * @return true if id is valid, false if not
+ */
+ boolean alIsSource(@ALuint int id);
+
+ /**
+ * Specifies the position and other properties as taken into account during
+ * sound processing.
+ *
+ * @param source Source to det property on
+ * @param pname property to set
+ * @param value value of property
+ */
+ @ALvoid
+ void alSourcei(@ALuint int source, @ALenum int pname, int value);
+
+ /**
+ * Specifies the position and other properties as taken into account during
+ * sound processing.
+ *
+ * @param source Source to det property on
+ * @param pname property to set
+ * @param value value of property
+ */
+ @ALvoid
+ void alSourcef(@ALuint int source, @ALenum int pname, float value);
+
+ /**
+ * Specifies the position and other properties as taken into account during
+ * sound processing.
+ *
+ * @param source Source to set property on
+ * @param pname property to set
+ * @param value FloatBuffer containing value of property
+ */
+ // TODO: What's the correct minimum value?
+ @StripPostfix("value")
+ @ALvoid
+ void alSourcefv(@ALuint int source, @ALenum int pname, @Check("1") @Const FloatBuffer value);
+
+ /**
+ * Specifies the position and other properties as taken into account during
+ * sound processing.
+ *
+ * @param source Source to set property on
+ * @param pname property to set
+ * @param v1 value 1 of property
+ * @param v2 value 2 of property
+ * @param v3 value 3 of property
+ */
+ @ALvoid
+ void alSource3f(
+ @ALuint int source,
+ @ALenum int pname,
+ float v1,
+ float v2,
+ float v3);
+
+
+ /**
+ * Source state is maintained inside the AL implementation, and the current attributes
+ * can be queried. The performance of such queries is implementation dependent, no
+ * performance guarantees are made.
+ *
+ * @param source source to get property from
+ * @param pname name of property
+ * @return int
+ */
+ @ALvoid
+ void alGetSourcei(@ALuint int source, @ALenum int pname, @Result int value);
+
+ /**
+ * Source state is maintained inside the AL implementation, and the current attributes
+ * can be queried. The performance of such queries is implementation dependent, no
+ * performance guarantees are made.
+ *
+ * @param source source to get property from
+ * @param pname name of property
+ * @return float
+ */
+ @ALvoid
+ void alGetSourcef(@ALuint int source, @ALenum int pname, @Result float value);
+
+ /**
+ * Source state is maintained inside the AL implementation, and the current attributes
+ * can be queried. The performance of such queries is implementation dependent, no
+ * performance guarantees are made.
+ *
+ * @param source Source to get property from
+ * @param pname property to get
+ * @param floatdata Buffer to write floats to
+ */
+ // TODO: What's the correct minimum value?
+ @StripPostfix("floatdata")
+ @ALvoid
+ void alGetSourcefv(@ALuint int source, @ALenum int pname, @OutParameter @Check("1") FloatBuffer floatdata);
+
+ /**
+ * Play() applied to an AL_INITIAL Source will promote the Source to AL_PLAYING, thus
+ * the data found in the Buffer will be fed into the processing, starting at the
+ * beginning. Play() applied to a AL_PLAYING Source will restart the Source from the
+ * beginning. It will not affect the configuration, and will leave the Source in
+ * AL_PLAYING state, but reset the sampling offset to the beginning. Play() applied to a
+ * AL_PAUSED Source will resume processing using the Source state as preserved at the
+ * Pause() operation. Play() applied to a AL_STOPPED Source will propagate it to
+ * AL_INITIAL then to AL_PLAYING immediately.
+ *
+ * @param sources array of sources to play
+ */
+ @StripPostfix("sources")
+ @ALvoid
+ void alSourcePlayv(@AutoSize("sources") @ALsizei int n, @ALuint IntBuffer sources);
+
+ /**
+ * Pause() applied to an AL_INITIAL Source is a legal NOP. Pause() applied to a
+ * AL_PLAYING Source will change its state to AL_PAUSED. The Source is exempt from
+ * processing, its current state is preserved. Pause() applied to a AL_PAUSED Source is a
+ * legal NOP. Pause() applied to a AL_STOPPED Source is a legal NOP.
+ *
+ * @param sources array of sources to pause
+ */
+ @StripPostfix("sources")
+ @ALvoid
+ void alSourcePausev(@AutoSize("sources") @ALsizei int n, @ALuint IntBuffer sources);
+
+ /**
+ * Stop() applied to an AL_INITIAL Source is a legal NOP. Stop() applied to a AL_PLAYING
+ * Source will change its state to AL_STOPPED. The Source is exempt from processing,
+ * its current state is preserved. Stop() applied to a AL_PAUSED Source will change its
+ * state to AL_STOPPED, with the same consequences as on a AL_PLAYING Source. Stop()
+ * applied to a AL_STOPPED Source is a legal NOP.
+ *
+ * @param sources array of sources to stop
+ */
+ @StripPostfix("sources")
+ @ALvoid
+ void alSourceStopv(@AutoSize("sources") @ALsizei int n, @ALuint IntBuffer sources);
+
+ /**
+ * Rewind() applied to an AL_INITIAL Source is a legal NOP. Rewind() applied to a
+ * AL_PLAYING Source will change its state to AL_STOPPED then AL_INITIAL. The Source is
+ * exempt from processing, its current state is preserved, with the exception of the
+ * sampling offset which is reset to the beginning. Rewind() applied to a AL_PAUSED
+ * Source will change its state to AL_INITIAL, with the same consequences as on a
+ * AL_PLAYING Source. Rewind() applied to a AL_STOPPED Source promotes the Source to
+ * AL_INITIAL, resetting the sampling offset to the beginning.
+ *
+ * @param sources array of sources to rewind
+ */
+ @StripPostfix("sources")
+ @ALvoid
+ void alSourceRewindv(@AutoSize("sources") @ALsizei int n, @ALuint IntBuffer sources);
+
+ /**
+ * Play() applied to an AL_INITIAL Source will promote the Source to AL_PLAYING, thus
+ * the data found in the Buffer will be fed into the processing, starting at the
+ * beginning. Play() applied to a AL_PLAYING Source will restart the Source from the
+ * beginning. It will not affect the configuration, and will leave the Source in
+ * AL_PLAYING state, but reset the sampling offset to the beginning. Play() applied to a
+ * AL_PAUSED Source will resume processing using the Source state as preserved at the
+ * Pause() operation. Play() applied to a AL_STOPPED Source will propagate it to
+ * AL_INITIAL then to AL_PLAYING immediately.
+ *
+ * @param source Source to play
+ */
+ @ALvoid
+ void alSourcePlay(@ALuint int source);
+
+ /**
+ * Pause() applied to an AL_INITIAL Source is a legal NOP. Pause() applied to a
+ * AL_PLAYING Source will change its state to AL_PAUSED. The Source is exempt from
+ * processing, its current state is preserved. Pause() applied to a AL_PAUSED Source is a
+ * legal NOP. Pause() applied to a AL_STOPPED Source is a legal NOP.
+ *
+ * @param source Source to pause
+ */
+ @ALvoid
+ void alSourcePause(@ALuint int source);
+
+ /**
+ * Stop() applied to an AL_INITIAL Source is a legal NOP. Stop() applied to a AL_PLAYING
+ * Source will change its state to AL_STOPPED. The Source is exempt from processing,
+ * its current state is preserved. Stop() applied to a AL_PAUSED Source will change its
+ * state to AL_STOPPED, with the same consequences as on a AL_PLAYING Source. Stop()
+ * applied to a AL_STOPPED Source is a legal NOP.
+ *
+ * @param source Source to stop
+ */
+ @ALvoid
+ void alSourceStop(@ALuint int source);
+
+ /**
+ * Rewind() applied to an AL_INITIAL Source is a legal NOP. Rewind() applied to a
+ * AL_PLAYING Source will change its state to AL_STOPPED then AL_INITIAL. The Source is
+ * exempt from processing, its current state is preserved, with the exception of the
+ * sampling offset which is reset to the beginning. Rewind() applied to a AL_PAUSED
+ * Source will change its state to AL_INITIAL, with the same consequences as on a
+ * AL_PLAYING Source. Rewind() applied to a AL_STOPPED Source promotes the Source to
+ * AL_INITIAL, resetting the sampling offset to the beginning.
+ *
+ * @param source Source to rewind
+ */
+ @ALvoid
+ void alSourceRewind(@ALuint int source);
+
+ /**
+ * The application requests a number of Buffers using GenBuffers.
+ *
+ * @param buffers holding buffers
+ */
+ @ALvoid
+ void alGenBuffers(@AutoSize("buffers") @ALsizei int n, @OutParameter @ALuint IntBuffer buffers);
+
+ @Alternate(value = "alGenBuffers", nativeAlt = true)
+ @ALvoid
+ void alGenBuffers2(@Constant("1") @ALsizei int n, @Result @ALuint int buffer);
+
+ /**
+ * <p>
+ * The application requests deletion of a number of Buffers by calling DeleteBuffers.
+ * </p>
+ * <p>
+ * Once deleted, Names are no longer valid for use with AL function calls. Any such
+ * use will cause an AL_INVALID_NAME error. The implementation is free to defer actual
+ * release of resources.
+ * </p>
+ * <p>
+ * IsBuffer(bname) can be used to verify deletion of a buffer. Deleting bufferName 0 is
+ * a legal NOP in both scalar and vector forms of the command. The same is true for
+ * unused buffer names, e.g. such as not allocated yet, or as released already.
+ *
+ * @param buffers Buffer to delete from
+ */
+ @ALvoid
+ void alDeleteBuffers(@AutoSize("buffers") @ALsizei int n, @ALuint IntBuffer buffers);
+
+ @Alternate(value = "alDeleteBuffers", nativeAlt = true)
+ @ALvoid
+ void alDeleteBuffers2(@Constant("1") @ALsizei int n, @Indirect @ALuint int buffer);
+
+ /**
+ * The application can verify whether a buffer Name is valid using the IsBuffer query.
+ *
+ * @param buffer buffer to be tested for validity
+ * @return true if supplied buffer is valid, false if not
+ */
+ boolean alIsBuffer(@ALuint int buffer);
+
+ /**
+ * <p>
+ * A special case of Buffer state is the actual sound sample data stored in asociation
+ * with the Buffer. Applications can specify sample data using BufferData.
+ * </p>
+ * <p>
+ * The data specified is copied to an internal software, or if possible, hardware buffer.
+ * The implementation is free to apply decompression, conversion, resampling, and
+ * filtering as needed. The internal format of the Buffer is not exposed to the
+ * application, and not accessible. Valid formats are AL_FORMAT_MONO8,
+ * AL_FORMAT_MONO16, AL_FORMAT_STEREO8, and AL_FORMAT_STEREO16. An
+ * implementation may expose other formats, see the chapter on Extensions for
+ * information on determining if additional formats are supported.
+ * </p>
+ * <p>
+ * Applications should always check for an error condition after attempting to specify
+ * buffer data in case an implementation has to generate an AL_OUT_OF_MEMORY or
+ * conversion related AL_INVALID_VALUE error. The application is free to reuse the
+ * memory specified by the data pointer once the call to BufferData returns. The
+ * implementation has to dereference, e.g. copy, the data during BufferData execution.
+ * </p>
+ *
+ * @param buffer Buffer to fill
+ * @param format format sound data is in
+ * @param data location of data
+ * @param freq frequency of data
+ */
+ @ALvoid
+ void alBufferData(
+ @ALuint int buffer,
+ @ALenum int format,
+ @ALbyte
+ @ALshort
+ @ALint
+ Buffer data,
+ @AutoSize("data")
+ @ALsizei int size,
+ @ALsizei int freq);
+
+ /**
+ * Buffer state is maintained inside the AL implementation and can be queried in full.<br>
+ * ALC_FREQUENCY - specified in samples per second, i.e. units of Hertz [Hz].<br>
+ * ALC_SIZE - Size in bytes of the buffer data.<br>
+ *
+ * @param buffer buffer to get property from
+ * @param pname name of property to retrieve
+ */
+ @ALvoid
+ void alGetBufferi(@ALuint int buffer, @ALenum int pname, @Result int value);
+
+ /**
+ * Buffer state is maintained inside the AL implementation and can be queried in full.<br>
+ * ALC_FREQUENCY - specified in samples per second, i.e. units of Hertz [Hz].<br>
+ * ALC_SIZE - Size in bytes of the buffer data.<br>
+ *
+ * @param buffer buffer to get property from
+ * @param pname name of property to retrieve
+ * @return float
+ */
+ @ALvoid
+ void alGetBufferf(@ALuint int buffer, @ALenum int pname, @Result float value);
+
+ /**
+ * <p>
+ * The application can queue up one or multiple buffer names using
+ * SourceQueueBuffers. The buffers will be queued in the sequence in which they
+ * appear in the array.
+ * </p>
+ * <p>
+ * This command is legal on a Source in any state (to allow for streaming, queueing
+ * has to be possible on a AL_PLAYING Source). Queues are read-only with exception of
+ * the unqueue operation. The Buffer Name AL_NONE (i.e. 0) can be queued.
+ * </p>
+ *
+ * @param source source to queue buffers onto
+ * @param buffers buffers to be queued
+ */
+ @ALvoid
+ void alSourceQueueBuffers(@ALuint int source, @AutoSize("buffers") @ALsizei int n, @ALuint IntBuffer buffers);
+
+ @Alternate(value = "alSourceQueueBuffers", nativeAlt = true)
+ @ALvoid
+ void alSourceQueueBuffers2(@ALuint int source, @Constant("1") @ALsizei int n, @Indirect @ALuint int buffer);
+
+ /**
+ * <p>
+ * Once a queue entry for a buffer has been appended to a queue and is pending
+ * processing, it should not be changed. Removal of a given queue entry is not possible
+ * unless either the Source is AL_STOPPED (in which case then entire queue is considered
+ * processed), or if the queue entry has already been processed (AL_PLAYING or AL_PAUSED
+ * Source).
+ * </p>
+ * <p>
+ * The Unqueue command removes a number of buffers entries that have finished
+ * processing, in the order of appearance, from the queue. The operation will fail if
+ * more buffers are requested than available, leaving the destination arguments
+ * unchanged. An AL_INVALID_VALUE error will be thrown. If no error, the destination
+ * argument will have been updated accordingly.
+ * </p>
+ *
+ * @param source source to unqueue buffers from
+ * @param buffers IntBuffer containing list of names that were unqueued
+ */
+ @ALvoid
+ void alSourceUnqueueBuffers(@ALuint int source, @AutoSize("buffers") @ALsizei int n, @OutParameter @ALuint IntBuffer buffers);
+
+ @Alternate(value = "alSourceUnqueueBuffers", nativeAlt = true)
+ @ALvoid
+ void alSourceUnqueueBuffers2(@ALuint int source, @Constant("1") @ALsizei int n, @Result @ALuint int buffer);
+
+ /**
+ * <p>
+ * Samples usually use the entire dynamic range of the chosen format/encoding,
+ * independent of their real world intensity. In other words, a jet engine and a
+ * clockwork both will have samples with full amplitude. The application will then
+ * have to adjust Source AL_GAIN accordingly to account for relative differences.
+ * </p>
+ * <p>
+ * Source AL_GAIN is then attenuated by distance. The effective attenuation of a Source
+ * depends on many factors, among which distance attenuation and source and
+ * Listener AL_GAIN are only some of the contributing factors. Even if the source and
+ * Listener AL_GAIN exceed 1.0 (amplification beyond the guaranteed dynamic range),
+ * distance and other attenuation might ultimately limit the overall AL_GAIN to a value
+ * below 1.0.
+ * </p>
+ * <p>
+ * AL currently supports three modes of operation with respect to distance
+ * attenuation. It supports two distance-dependent attenuation models, one which is
+ * similar to the IASIG I3DL2 (and DS3D) model. The application choses one of these
+ * two models (or can chose to disable distance-dependent attenuation effects model)
+ * on a per-context basis.
+ * </p>
+ * <p>
+ * Legal arguments are AL_NONE, AL_INVERSE_DISTANCE, and
+ * AL_INVERSE_DISTANCE_CLAMPED.
+ * <br>
+ * <br>
+ * AL_NONE bypasses all distance attenuation
+ * calculation for all Sources. The implementation is expected to optimize this
+ * situation.
+ * <br>
+ * <br>
+ * AL_INVERSE_DISTANCE_CLAMPED is the DS3D model, with
+ * AL_REFERENCE_DISTANCE indicating both the reference distance and the distance
+ * below which gain will be clamped.
+ * <br>
+ * <br>
+ * AL_INVERSE_DISTANCE is equivalent to the DS3D
+ * model with the exception that AL_REFERENCE_DISTANCE does not imply any
+ * clamping.
+ * <br>
+ * <br>
+ * The AL implementation is still free to apply any range clamping as
+ * necessary. The current distance model chosen can be queried using GetIntegerv and
+ * AL_DISTANCE_MODEL.
+ * </p>
+ *
+ * @param value distance model to be set
+ */
+ @ALvoid
+ void alDistanceModel(@ALenum int value);
+
+ /**
+ * The Doppler Effect depends on the velocities of Source and Listener relative to the
+ * medium, and the propagation speed of sound in that medium. The application
+ * might want to emphasize or de-emphasize the Doppler Effect as physically accurate
+ * calculation might not give the desired results. The amount of frequency shift (pitch
+ * change) is proportional to the speed of listener and source along their line of sight.
+ * The application can increase or decrease that frequency shift by specifying the
+ * scaling factor AL should apply to the result of the calculation.
+ * <br>
+ * <br>
+ * The Doppler Effect as implemented by AL is described by the formula below. Effects
+ * of the medium (air, water) moving with respect to listener and source are ignored.
+ * AL_DOPPLER_VELOCITY is the propagation speed relative to which the Source
+ * velocities are interpreted.
+ *
+ * <p>
+ * <pre>
+ * VD: AL_DOPPLER_VELOCITY
+ * DF: AL_DOPPLER_FACTOR
+ * vl: Listener velocity (scalar, projected on source-listener vector)
+ * vs: Source verlocity (scalar, projected on source-listener vector)
+ * f: Frequency in sample
+ * f': effective Doppler shifted frequency
+ *
+ * f' = DF * f * (VD-vl)/(VD+vs)
+ *
+ * vl<0, vs>0 : source and listener approaching each other
+ * vl>0, vs<0 : source and listener moving away from each other
+ * </pre>
+ * </p>
+ * <p>
+ * The implementation has to clamp the projected Listener velocity vl, if abs(vl) is
+ * greater or equal VD. It similarly has to clamp the projected Source velocity vs if
+ * abs(vs) is greater or equal VD.
+ * </p>
+ * <p>
+ * There are two API calls global to the current context that provide control of the two
+ * related parameters.
+ * </p>
+ * <p>
+ * AL_DOPPLER_FACTOR is a simple scaling to exaggerate or
+ * deemphasize the Doppler (pitch) shift resulting from the calculation.
+ * </p>
+ * <p>
+ * A negative value will result in an AL_INVALID_VALUE error, the command is then
+ * ignored. The default value is 1. The current setting can be queried using GetFloatv
+ * and AL_DOPPLER_FACTOR. The implementation is free to optimize the case of
+ * AL_DOPPLER_FACTOR being set to zero, as this effectively disables the effect.
+ * </p>
+ *
+ * @param value Doppler scale value to set
+ */
+ @ALvoid
+ void alDopplerFactor(float value);
+
+ /**
+ * The Doppler Effect depends on the velocities of Source and Listener relative to the
+ * medium, and the propagation speed of sound in that medium. The application
+ * might want to emphasize or de-emphasize the Doppler Effect as physically accurate
+ * calculation might not give the desired results. The amount of frequency shift (pitch
+ * change) is proportional to the speed of listener and source along their line of sight.
+ * The application can increase or decrease that frequency shift by specifying the
+ * scaling factor AL should apply to the result of the calculation.
+ * <br>
+ * <br>
+ * The Doppler Effect as implemented by AL is described by the formula below. Effects
+ * of the medium (air, water) moving with respect to listener and source are ignored.
+ * AL_DOPPLER_VELOCITY is the propagation speed relative to which the Source
+ * velocities are interpreted.
+ *
+ * <p>
+ * <pre>
+ * VD: AL_DOPPLER_VELOCITY
+ * DF: AL_DOPPLER_FACTOR
+ * vl: Listener velocity (scalar, projected on source-listener vector)
+ * vs: Source verlocity (scalar, projected on source-listener vector)
+ * f: Frequency in sample
+ * f': effective Doppler shifted frequency
+ *
+ * f' = DF * f * (VD-vl)/(VD+vs)
+ *
+ * vl<0, vs>0 : source and listener approaching each other
+ * vl>0, vs<0 : source and listener moving away from each other
+ * </pre>
+ * </p>
+ * <p>
+ * The implementation has to clamp the projected Listener velocity vl, if abs(vl) is
+ * greater or equal VD. It similarly has to clamp the projected Source velocity vs if
+ * abs(vs) is greater or equal VD.
+ * </p>
+ * <p>
+ * There are two API calls global to the current context that provide control of the two
+ * related parameters.
+ * </p>
+ * <p>
+ * AL_DOPPLER_VELOCITY allows the application to change the reference (propagation)
+ * velocity used in the Doppler Effect calculation. This permits the application to use a
+ * velocity scale appropriate to its purposes.
+ * </p>
+ * <p>
+ * A negative or zero value will result in an AL_INVALID_VALUE error, the command is
+ * then ignored. The default value is 1. The current setting can be queried using
+ * GetFloatv and AL_DOPPLER_VELOCITY.
+ * </p>
+ *
+ * @param value Doppler velocity value to set
+ */
+ @ALvoid
+ void alDopplerVelocity(float value);
+}
diff --git a/src/templates/org/lwjgl/openal/AL11.java b/src/templates/org/lwjgl/openal/AL11.java
index f484849..f97ab44 100644
--- a/src/templates/org/lwjgl/openal/AL11.java
+++ b/src/templates/org/lwjgl/openal/AL11.java
@@ -1,278 +1,278 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.openal;
-
-import java.nio.Buffer;
-import java.nio.IntBuffer;
-import java.nio.FloatBuffer;
-import java.nio.DoubleBuffer;
-
-import org.lwjgl.openal.AL10;
-import org.lwjgl.util.generator.*;
-
-/**
- * <br>
- * This is the core OpenAL class. This class implements
- * AL.h version 1.1
- *
- * @author Brian Matzon <brian at matzon.dk>
- * @version $Revision: 2286 $
- * $Id: AL10.java 2286 2006-03-23 19:32:21Z matzon $
- */
-public interface AL11 {
-
- /** Source buffer position information in seconds */
- public static final int AL_SEC_OFFSET = 0x1024;
-
- /** Source buffer position information in samples */
- public static final int AL_SAMPLE_OFFSET = 0x1025;
-
- /** Source buffer position information in bytes */
- public static final int AL_BYTE_OFFSET = 0x1026;
-
- /** Type of source: Buffer has been attached using AL_BUFFER */
- public static final int AL_STATIC = 0x1028;
-
- /** Type of source: if one or more Buffers have been attached using alSourceQueueBuffers */
- public static final int AL_STREAMING = 0x1029;
-
- /** Type of source: when it has the NULL buffer attached */
- public static final int AL_UNDETERMINED = 0x1030;
-
- /** @see AL10#AL_INVALID_OPERATION */
- public static final int AL_ILLEGAL_COMMAND = 0xA004;
-
- /** Speed of Sound in units per second */
- public static final int AL_SPEED_OF_SOUND = 0xC003;
-
- public static final int AL_LINEAR_DISTANCE = 0xD003;
- public static final int AL_LINEAR_DISTANCE_CLAMPED = 0xD004;
- public static final int AL_EXPONENT_DISTANCE = 0xD005;
- public static final int AL_EXPONENT_DISTANCE_CLAMPED = 0xD006;
-
- /**
- * Listener attributes are changed using the Listener group of commands.
- *
- * @param pname name of the attribute to be set
- * @param v1 value value 1
- * @param v2 value value 2
- * @param v3 value value 3
- */
- @ALvoid
- void alListener3i(@ALenum int pname, int v1, int v2, int v3);
-
- /**
- * Listener state is maintained inside the AL implementation and can be queried in
- * full.
- *
- * @param pname name of the attribute to be retrieved
- * @param intdata Buffer to write ints to
- */
- // TODO: What's the real minimum number of elements?
- @StripPostfix("intdata")
- @ALvoid
- void alGetListeneriv(@ALenum int pname, @OutParameter @Check("1") FloatBuffer intdata);
-
- /**
- * Specifies the position and other properties as taken into account during
- * sound processing.
- *
- * @param source Source to set property on
- * @param pname property to set
- * @param v1 value 1 of property
- * @param v2 value 2 of property
- * @param v3 value 3 of property
- */
- @ALvoid
- void alSource3i(@ALuint int source, @ALenum int pname, int v1, int v2, int v3);
-
- /**
- * Specifies the position and other properties as taken into account during
- * sound processing.
- *
- * @param source Source to set property on
- * @param pname property to set
- * @param value IntBuffer containing value of property
- */
- // TODO: What's the correct minimum value?
- @StripPostfix("value")
- @ALvoid
- void alSourceiv(@ALuint int source, @ALenum int pname, @Check("1") @Const IntBuffer value);
-
- /**
- * This function sets a floating point property of a buffer.
- * <i>note: There are no relevant buffer properties defined in OpenAL 1.1 which can be affected by
- * this call, but this function may be used by OpenAL extensions.</i>
- *
- * @param buffer Buffer to set property on
- * @param pname property to set
- * @param value value of property
- */
- @ALvoid
- void alBufferf(@ALuint int buffer, @ALenum int pname, float value);
-
- /**
- * This function sets a floating point property of a buffer.
- * <i>note: There are no relevant buffer properties defined in OpenAL 1.1 which can be affected by
- * this call, but this function may be used by OpenAL extensions.</i>
- *
- * @param buffer Buffer to set property on
- * @param pname property to set
- * @param v1 value of property
- * @param v2 value of property
- * @param v3 value of property
- */
- @ALvoid
- void alBuffer3f(@ALuint int buffer, @ALenum int pname, float v1, float v2, float v3);
-
- /**
- * This function sets a floating point property of a buffer.
- * <i>note: There are no relevant buffer properties defined in OpenAL 1.1 which can be affected by
- * this call, but this function may be used by OpenAL extensions.</i>
- *
- * @param buffer Buffer to set property on
- * @param pname property to set
- * @param value FloatBuffer containing value of property
- */
- // TODO: What's the correct minimum value?
- @StripPostfix("value")
- @ALvoid
- void alBufferfv(@ALuint int buffer, @ALenum int pname, @Check("1") @Const FloatBuffer value);
-
- /**
- * This function sets an integer property of a buffer.
- * <i>note: There are no relevant buffer properties defined in OpenAL 1.1 which can be affected by
- * this call, but this function may be used by OpenAL extensions.</i>
- *
- * @param buffer Buffer to set property on
- * @param pname property to set
- * @param value value of property
- */
- @ALvoid
- void alBufferi(@ALuint int buffer, @ALenum int pname, int value);
-
- /**
- * This function sets an integer property of a buffer.
- * <i>note: There are no relevant buffer properties defined in OpenAL 1.1 which can be affected by
- * this call, but this function may be used by OpenAL extensions.</i>
- *
- * @param buffer Buffer to set property on
- * @param pname property to set
- * @param v1 value of property
- * @param v2 value of property
- * @param v3 value of property
- */
- @ALvoid
- void alBuffer3i(@ALuint int buffer, @ALenum int pname, int v1, int v2, int v3);
-
- /**
- * This function sets an integer property of a buffer.
- * <i>note: There are no relevant buffer properties defined in OpenAL 1.1 which can be affected by
- * this call, but this function may be used by OpenAL extensions.</i>
- *
- * @param buffer Buffer to set property on
- * @param pname property to set
- * @param value IntBuffer containing value of property
- */
- // TODO: What's the correct minimum value?
- @StripPostfix("value")
- @ALvoid
- void alBufferiv(@ALuint int buffer, @ALenum int pname, @Check("1") @Const IntBuffer value);
-
- /**
- * This function retrieves an integer property of a buffer.
- * <i>note: There are no relevant buffer properties defined in OpenAL 1.1 which can be affected by
- * this call, but this function may be used by OpenAL extensions.</i>
- *
- * @param buffer Buffer to get property from
- * @param pname name of property
- * @return int
- */
- @ALvoid
- void alGetBufferi(@ALuint int buffer, @ALenum int pname, @Result int value);
-
- /**
- * This function retrieves an integer property of a buffer.
- *
- * @param buffer Buffer to get property from
- * @param pname name of property
- */
- // TODO: What's the correct minimum value?
- @StripPostfix("values")
- @ALvoid
- void alGetBufferiv(@ALuint int buffer, @ALenum int pname, @OutParameter @Check("1") IntBuffer values);
-
- /**
- * This function retrieves a floating point property of a buffer.
- * <i>note: There are no relevant buffer properties defined in OpenAL 1.1 which can be affected by
- * this call, but this function may be used by OpenAL extensions.</i>
- *
- * @param buffer Buffer to get property from
- * @param pname name of property
- * @return floating point property
- */
- @ALvoid
- void alGetBufferf(@ALuint int buffer, @ALenum int pname, @Result float value);
-
- /**
- * This function retrieves a floating point property of a buffer.
- * <i>note: There are no relevant buffer properties defined in OpenAL 1.1 which can be affected by
- * this call, but this function may be used by OpenAL extensions.</i>
- *
- * @param buffer Buffer to get property from
- * @param pname name of property
- */
- // TODO: What's the correct minimum value?
- @StripPostfix("values")
- @ALvoid
- void alGetBufferfv(@ALuint int buffer, @ALenum int pname, @OutParameter @Check("1") FloatBuffer values);
-
- /**
- * <p>
- * AL_SPEED_OF_SOUND allows the application to change the reference (propagation)
- * speed used in the Doppler calculation. The source and listener velocities should be
- * expressed in the same units as the speed of sound.
- * </p>
- * <p>
- * A negative or zero value will result in an AL_INVALID_VALUE error, and the
- * command is ignored. The default value is 343.3 (appropriate for velocity units of meters
- * and air as the propagation medium). The current setting can be queried using
- * alGetFloat{v} and AL_SPEED_OF_SOUND.
- * Distance and velocity units are completely independent of one another (so you could use
- * different units for each if desired).
- * </p>
- *
- * @param value distance model to be set
- */
- @ALvoid
- void alSpeedOfSound(float value);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.openal;
+
+import java.nio.Buffer;
+import java.nio.IntBuffer;
+import java.nio.FloatBuffer;
+import java.nio.DoubleBuffer;
+
+import org.lwjgl.openal.AL10;
+import org.lwjgl.util.generator.*;
+
+/**
+ * <br>
+ * This is the core OpenAL class. This class implements
+ * AL.h version 1.1
+ *
+ * @author Brian Matzon <brian at matzon.dk>
+ * @version $Revision: 2286 $
+ * $Id: AL10.java 2286 2006-03-23 19:32:21Z matzon $
+ */
+public interface AL11 {
+
+ /** Source buffer position information in seconds */
+ public static final int AL_SEC_OFFSET = 0x1024;
+
+ /** Source buffer position information in samples */
+ public static final int AL_SAMPLE_OFFSET = 0x1025;
+
+ /** Source buffer position information in bytes */
+ public static final int AL_BYTE_OFFSET = 0x1026;
+
+ /** Type of source: Buffer has been attached using AL_BUFFER */
+ public static final int AL_STATIC = 0x1028;
+
+ /** Type of source: if one or more Buffers have been attached using alSourceQueueBuffers */
+ public static final int AL_STREAMING = 0x1029;
+
+ /** Type of source: when it has the NULL buffer attached */
+ public static final int AL_UNDETERMINED = 0x1030;
+
+ /** @see AL10#AL_INVALID_OPERATION */
+ public static final int AL_ILLEGAL_COMMAND = 0xA004;
+
+ /** Speed of Sound in units per second */
+ public static final int AL_SPEED_OF_SOUND = 0xC003;
+
+ public static final int AL_LINEAR_DISTANCE = 0xD003;
+ public static final int AL_LINEAR_DISTANCE_CLAMPED = 0xD004;
+ public static final int AL_EXPONENT_DISTANCE = 0xD005;
+ public static final int AL_EXPONENT_DISTANCE_CLAMPED = 0xD006;
+
+ /**
+ * Listener attributes are changed using the Listener group of commands.
+ *
+ * @param pname name of the attribute to be set
+ * @param v1 value value 1
+ * @param v2 value value 2
+ * @param v3 value value 3
+ */
+ @ALvoid
+ void alListener3i(@ALenum int pname, int v1, int v2, int v3);
+
+ /**
+ * Listener state is maintained inside the AL implementation and can be queried in
+ * full.
+ *
+ * @param pname name of the attribute to be retrieved
+ * @param intdata Buffer to write ints to
+ */
+ // TODO: What's the real minimum number of elements?
+ @StripPostfix("intdata")
+ @ALvoid
+ void alGetListeneriv(@ALenum int pname, @OutParameter @Check("1") FloatBuffer intdata);
+
+ /**
+ * Specifies the position and other properties as taken into account during
+ * sound processing.
+ *
+ * @param source Source to set property on
+ * @param pname property to set
+ * @param v1 value 1 of property
+ * @param v2 value 2 of property
+ * @param v3 value 3 of property
+ */
+ @ALvoid
+ void alSource3i(@ALuint int source, @ALenum int pname, int v1, int v2, int v3);
+
+ /**
+ * Specifies the position and other properties as taken into account during
+ * sound processing.
+ *
+ * @param source Source to set property on
+ * @param pname property to set
+ * @param value IntBuffer containing value of property
+ */
+ // TODO: What's the correct minimum value?
+ @StripPostfix("value")
+ @ALvoid
+ void alSourceiv(@ALuint int source, @ALenum int pname, @Check("1") @Const IntBuffer value);
+
+ /**
+ * This function sets a floating point property of a buffer.
+ * <i>note: There are no relevant buffer properties defined in OpenAL 1.1 which can be affected by
+ * this call, but this function may be used by OpenAL extensions.</i>
+ *
+ * @param buffer Buffer to set property on
+ * @param pname property to set
+ * @param value value of property
+ */
+ @ALvoid
+ void alBufferf(@ALuint int buffer, @ALenum int pname, float value);
+
+ /**
+ * This function sets a floating point property of a buffer.
+ * <i>note: There are no relevant buffer properties defined in OpenAL 1.1 which can be affected by
+ * this call, but this function may be used by OpenAL extensions.</i>
+ *
+ * @param buffer Buffer to set property on
+ * @param pname property to set
+ * @param v1 value of property
+ * @param v2 value of property
+ * @param v3 value of property
+ */
+ @ALvoid
+ void alBuffer3f(@ALuint int buffer, @ALenum int pname, float v1, float v2, float v3);
+
+ /**
+ * This function sets a floating point property of a buffer.
+ * <i>note: There are no relevant buffer properties defined in OpenAL 1.1 which can be affected by
+ * this call, but this function may be used by OpenAL extensions.</i>
+ *
+ * @param buffer Buffer to set property on
+ * @param pname property to set
+ * @param value FloatBuffer containing value of property
+ */
+ // TODO: What's the correct minimum value?
+ @StripPostfix("value")
+ @ALvoid
+ void alBufferfv(@ALuint int buffer, @ALenum int pname, @Check("1") @Const FloatBuffer value);
+
+ /**
+ * This function sets an integer property of a buffer.
+ * <i>note: There are no relevant buffer properties defined in OpenAL 1.1 which can be affected by
+ * this call, but this function may be used by OpenAL extensions.</i>
+ *
+ * @param buffer Buffer to set property on
+ * @param pname property to set
+ * @param value value of property
+ */
+ @ALvoid
+ void alBufferi(@ALuint int buffer, @ALenum int pname, int value);
+
+ /**
+ * This function sets an integer property of a buffer.
+ * <i>note: There are no relevant buffer properties defined in OpenAL 1.1 which can be affected by
+ * this call, but this function may be used by OpenAL extensions.</i>
+ *
+ * @param buffer Buffer to set property on
+ * @param pname property to set
+ * @param v1 value of property
+ * @param v2 value of property
+ * @param v3 value of property
+ */
+ @ALvoid
+ void alBuffer3i(@ALuint int buffer, @ALenum int pname, int v1, int v2, int v3);
+
+ /**
+ * This function sets an integer property of a buffer.
+ * <i>note: There are no relevant buffer properties defined in OpenAL 1.1 which can be affected by
+ * this call, but this function may be used by OpenAL extensions.</i>
+ *
+ * @param buffer Buffer to set property on
+ * @param pname property to set
+ * @param value IntBuffer containing value of property
+ */
+ // TODO: What's the correct minimum value?
+ @StripPostfix("value")
+ @ALvoid
+ void alBufferiv(@ALuint int buffer, @ALenum int pname, @Check("1") @Const IntBuffer value);
+
+ /**
+ * This function retrieves an integer property of a buffer.
+ * <i>note: There are no relevant buffer properties defined in OpenAL 1.1 which can be affected by
+ * this call, but this function may be used by OpenAL extensions.</i>
+ *
+ * @param buffer Buffer to get property from
+ * @param pname name of property
+ * @return int
+ */
+ @ALvoid
+ void alGetBufferi(@ALuint int buffer, @ALenum int pname, @Result int value);
+
+ /**
+ * This function retrieves an integer property of a buffer.
+ *
+ * @param buffer Buffer to get property from
+ * @param pname name of property
+ */
+ // TODO: What's the correct minimum value?
+ @StripPostfix("values")
+ @ALvoid
+ void alGetBufferiv(@ALuint int buffer, @ALenum int pname, @OutParameter @Check("1") IntBuffer values);
+
+ /**
+ * This function retrieves a floating point property of a buffer.
+ * <i>note: There are no relevant buffer properties defined in OpenAL 1.1 which can be affected by
+ * this call, but this function may be used by OpenAL extensions.</i>
+ *
+ * @param buffer Buffer to get property from
+ * @param pname name of property
+ * @return floating point property
+ */
+ @ALvoid
+ void alGetBufferf(@ALuint int buffer, @ALenum int pname, @Result float value);
+
+ /**
+ * This function retrieves a floating point property of a buffer.
+ * <i>note: There are no relevant buffer properties defined in OpenAL 1.1 which can be affected by
+ * this call, but this function may be used by OpenAL extensions.</i>
+ *
+ * @param buffer Buffer to get property from
+ * @param pname name of property
+ */
+ // TODO: What's the correct minimum value?
+ @StripPostfix("values")
+ @ALvoid
+ void alGetBufferfv(@ALuint int buffer, @ALenum int pname, @OutParameter @Check("1") FloatBuffer values);
+
+ /**
+ * <p>
+ * AL_SPEED_OF_SOUND allows the application to change the reference (propagation)
+ * speed used in the Doppler calculation. The source and listener velocities should be
+ * expressed in the same units as the speed of sound.
+ * </p>
+ * <p>
+ * A negative or zero value will result in an AL_INVALID_VALUE error, and the
+ * command is ignored. The default value is 343.3 (appropriate for velocity units of meters
+ * and air as the propagation medium). The current setting can be queried using
+ * alGetFloat{v} and AL_SPEED_OF_SOUND.
+ * Distance and velocity units are completely independent of one another (so you could use
+ * different units for each if desired).
+ * </p>
+ *
+ * @param value distance model to be set
+ */
+ @ALvoid
+ void alSpeedOfSound(float value);
+}
diff --git a/src/templates/org/lwjgl/opengl/AMD_performance_monitor.java b/src/templates/org/lwjgl/opengl/AMD_performance_monitor.java
index 3f18a04..cff428e 100644
--- a/src/templates/org/lwjgl/opengl/AMD_performance_monitor.java
+++ b/src/templates/org/lwjgl/opengl/AMD_performance_monitor.java
@@ -1,122 +1,122 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.ByteBuffer;
-import java.nio.IntBuffer;
-
-public interface AMD_performance_monitor {
-
- /** Accepted by the <pame> parameter of GetPerfMonitorCounterInfoAMD */
- int GL_COUNTER_TYPE_AMD = 0x8BC0;
- int GL_COUNTER_RANGE_AMD = 0x8BC1;
-
- /**
- * Returned as a valid value in <data> parameter of
- * GetPerfMonitorCounterInfoAMD if <pname> = COUNTER_TYPE_AMD
- */
- int GL_UNSIGNED_INT = 0x1405;
- int GL_FLOAT = 0x1406;
- int GL_UNSIGNED_INT64_AMD = 0x8BC2;
- int GL_PERCENTAGE_AMD = 0x8BC3;
-
- /** Accepted by the <pname> parameter of GetPerfMonitorCounterDataAMD */
-
- int GL_PERFMON_RESULT_AVAILABLE_AMD = 0x8BC4;
- int GL_PERFMON_RESULT_SIZE_AMD = 0x8BC5;
- int GL_PERFMON_RESULT_AMD = 0x8BC6;
-
- void glGetPerfMonitorGroupsAMD(@OutParameter @Check(value = "1", canBeNull = true) @GLint IntBuffer numGroups,
- @AutoSize("groups") @GLsizei int groupsSize, @GLuint IntBuffer groups);
-
- void glGetPerfMonitorCountersAMD(@GLuint int group,
- @OutParameter @Check(value = "1") @GLint IntBuffer numCounters,
- @OutParameter @Check(value = "1") @GLint IntBuffer maxActiveCounters,
- @AutoSize("counters") @GLsizei int countersSize,
- @GLuint IntBuffer counters);
-
- void glGetPerfMonitorGroupStringAMD(@GLuint int group,
- @AutoSize("groupString") @GLsizei int bufSize,
- @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
- @OutParameter @GLchar ByteBuffer groupString);
-
- @Alternate("glGetPerfMonitorGroupStringAMD")
- @GLreturn(value = "groupString", maxLength = "bufSize")
- void glGetPerfMonitorGroupStringAMD2(@GLuint int group, @GLsizei int bufSize,
- @OutParameter @GLsizei @Constant("groupString_length, 0") IntBuffer length,
- @OutParameter @GLchar ByteBuffer groupString);
-
- void glGetPerfMonitorCounterStringAMD(@GLuint int group, @GLuint int counter, @AutoSize("counterString") @GLsizei int bufSize,
- @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
- @OutParameter @GLchar ByteBuffer counterString);
-
- @Alternate("glGetPerfMonitorCounterStringAMD")
- @GLreturn(value = "counterString", maxLength = "bufSize")
- void glGetPerfMonitorCounterStringAMD2(@GLuint int group, @GLuint int counter, @GLsizei int bufSize,
- @OutParameter @GLsizei @Constant("counterString_length, 0") IntBuffer length,
- @OutParameter @GLchar ByteBuffer counterString);
-
- void glGetPerfMonitorCounterInfoAMD(@GLuint int group, @GLuint int counter, @GLenum int pname, @Check(value = "16") @GLvoid ByteBuffer data);
-
- void glGenPerfMonitorsAMD(@AutoSize("monitors") @GLsizei int n, @OutParameter @GLuint IntBuffer monitors);
-
- @Alternate("glGenPerfMonitorsAMD")
- @GLreturn("monitors")
- void glGenPerfMonitorsAMD2(@Constant("1") @GLsizei int n, @OutParameter @GLuint IntBuffer monitors);
-
- void glDeletePerfMonitorsAMD(@AutoSize("monitors") @GLsizei int n, @GLuint IntBuffer monitors);
-
- @Alternate("glDeletePerfMonitorsAMD")
- void glDeletePerfMonitorsAMD(@Constant("1") @GLsizei int n, @Constant(value = "APIUtils.getBufferInt().put(0, monitor), 0", keepParam = true) int monitor);
-
- void glSelectPerfMonitorCountersAMD(@GLuint int monitor, boolean enable, @GLuint int group, @AutoSize("counterList") int numCounters, @GLuint IntBuffer counterList);
-
- @Alternate("glSelectPerfMonitorCountersAMD")
- void glSelectPerfMonitorCountersAMD(@GLuint int monitor, boolean enable, @GLuint int group, @Constant("1") int numCounters, @Constant(value = "APIUtils.getBufferInt().put(0, counter), 0", keepParam = true) int counter);
-
- void glBeginPerfMonitorAMD(@GLuint int monitor);
-
- void glEndPerfMonitorAMD(@GLuint int monitor);
-
- void glGetPerfMonitorCounterDataAMD(@GLuint int monitor, @GLenum int pname, @AutoSize("data") @GLsizei int dataSize,
- @OutParameter @GLuint IntBuffer data,
- @OutParameter @GLint @Check(value = "1", canBeNull = true) IntBuffer bytesWritten);
-
- @Alternate("glGetPerfMonitorCounterDataAMD")
- @GLreturn("data")
- void glGetPerfMonitorCounterDataAMD2(@GLuint int monitor, @GLenum int pname, @Constant("4") @GLsizei int dataSize,
- @OutParameter @GLuint IntBuffer data,
- @OutParameter @GLint @Constant("null, 0") IntBuffer bytesWritten);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.ByteBuffer;
+import java.nio.IntBuffer;
+
+public interface AMD_performance_monitor {
+
+ /** Accepted by the <pame> parameter of GetPerfMonitorCounterInfoAMD */
+ int GL_COUNTER_TYPE_AMD = 0x8BC0;
+ int GL_COUNTER_RANGE_AMD = 0x8BC1;
+
+ /**
+ * Returned as a valid value in <data> parameter of
+ * GetPerfMonitorCounterInfoAMD if <pname> = COUNTER_TYPE_AMD
+ */
+ int GL_UNSIGNED_INT = 0x1405;
+ int GL_FLOAT = 0x1406;
+ int GL_UNSIGNED_INT64_AMD = 0x8BC2;
+ int GL_PERCENTAGE_AMD = 0x8BC3;
+
+ /** Accepted by the <pname> parameter of GetPerfMonitorCounterDataAMD */
+
+ int GL_PERFMON_RESULT_AVAILABLE_AMD = 0x8BC4;
+ int GL_PERFMON_RESULT_SIZE_AMD = 0x8BC5;
+ int GL_PERFMON_RESULT_AMD = 0x8BC6;
+
+ void glGetPerfMonitorGroupsAMD(@OutParameter @Check(value = "1", canBeNull = true) @GLint IntBuffer numGroups,
+ @AutoSize("groups") @GLsizei int groupsSize, @GLuint IntBuffer groups);
+
+ void glGetPerfMonitorCountersAMD(@GLuint int group,
+ @OutParameter @Check(value = "1") @GLint IntBuffer numCounters,
+ @OutParameter @Check(value = "1") @GLint IntBuffer maxActiveCounters,
+ @AutoSize("counters") @GLsizei int countersSize,
+ @GLuint IntBuffer counters);
+
+ void glGetPerfMonitorGroupStringAMD(@GLuint int group,
+ @AutoSize("groupString") @GLsizei int bufSize,
+ @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
+ @OutParameter @GLchar ByteBuffer groupString);
+
+ @Alternate("glGetPerfMonitorGroupStringAMD")
+ @GLreturn(value = "groupString", maxLength = "bufSize")
+ void glGetPerfMonitorGroupStringAMD2(@GLuint int group, @GLsizei int bufSize,
+ @OutParameter @GLsizei @Constant("groupString_length, 0") IntBuffer length,
+ @OutParameter @GLchar ByteBuffer groupString);
+
+ void glGetPerfMonitorCounterStringAMD(@GLuint int group, @GLuint int counter, @AutoSize("counterString") @GLsizei int bufSize,
+ @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
+ @OutParameter @GLchar ByteBuffer counterString);
+
+ @Alternate("glGetPerfMonitorCounterStringAMD")
+ @GLreturn(value = "counterString", maxLength = "bufSize")
+ void glGetPerfMonitorCounterStringAMD2(@GLuint int group, @GLuint int counter, @GLsizei int bufSize,
+ @OutParameter @GLsizei @Constant("counterString_length, 0") IntBuffer length,
+ @OutParameter @GLchar ByteBuffer counterString);
+
+ void glGetPerfMonitorCounterInfoAMD(@GLuint int group, @GLuint int counter, @GLenum int pname, @Check(value = "16") @GLvoid ByteBuffer data);
+
+ void glGenPerfMonitorsAMD(@AutoSize("monitors") @GLsizei int n, @OutParameter @GLuint IntBuffer monitors);
+
+ @Alternate("glGenPerfMonitorsAMD")
+ @GLreturn("monitors")
+ void glGenPerfMonitorsAMD2(@Constant("1") @GLsizei int n, @OutParameter @GLuint IntBuffer monitors);
+
+ void glDeletePerfMonitorsAMD(@AutoSize("monitors") @GLsizei int n, @GLuint IntBuffer monitors);
+
+ @Alternate("glDeletePerfMonitorsAMD")
+ void glDeletePerfMonitorsAMD(@Constant("1") @GLsizei int n, @Constant(value = "APIUtils.getBufferInt().put(0, monitor), 0", keepParam = true) int monitor);
+
+ void glSelectPerfMonitorCountersAMD(@GLuint int monitor, boolean enable, @GLuint int group, @AutoSize("counterList") int numCounters, @GLuint IntBuffer counterList);
+
+ @Alternate("glSelectPerfMonitorCountersAMD")
+ void glSelectPerfMonitorCountersAMD(@GLuint int monitor, boolean enable, @GLuint int group, @Constant("1") int numCounters, @Constant(value = "APIUtils.getBufferInt().put(0, counter), 0", keepParam = true) int counter);
+
+ void glBeginPerfMonitorAMD(@GLuint int monitor);
+
+ void glEndPerfMonitorAMD(@GLuint int monitor);
+
+ void glGetPerfMonitorCounterDataAMD(@GLuint int monitor, @GLenum int pname, @AutoSize("data") @GLsizei int dataSize,
+ @OutParameter @GLuint IntBuffer data,
+ @OutParameter @GLint @Check(value = "1", canBeNull = true) IntBuffer bytesWritten);
+
+ @Alternate("glGetPerfMonitorCounterDataAMD")
+ @GLreturn("data")
+ void glGetPerfMonitorCounterDataAMD2(@GLuint int monitor, @GLenum int pname, @Constant("4") @GLsizei int dataSize,
+ @OutParameter @GLuint IntBuffer data,
+ @OutParameter @GLint @Constant("null, 0") IntBuffer bytesWritten);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/AMD_seamless_cubemap_per_texture.java b/src/templates/org/lwjgl/opengl/AMD_seamless_cubemap_per_texture.java
index f0ce360..bbd87eb 100644
--- a/src/templates/org/lwjgl/opengl/AMD_seamless_cubemap_per_texture.java
+++ b/src/templates/org/lwjgl/opengl/AMD_seamless_cubemap_per_texture.java
@@ -1,42 +1,42 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface AMD_seamless_cubemap_per_texture {
-
- /**
- * Accepted by the <pname> parameter of TexParameterf, TexParameteri,
- * TexParameterfv, TexParameteriv, GetTexParameterfv, and GetTexParameteriv:
- */
- int GL_TEXTURE_CUBE_MAP_SEAMLESS = ARB_seamless_cube_map.GL_TEXTURE_CUBE_MAP_SEAMLESS;
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface AMD_seamless_cubemap_per_texture {
+
+ /**
+ * Accepted by the <pname> parameter of TexParameterf, TexParameteri,
+ * TexParameterfv, TexParameteriv, GetTexParameterfv, and GetTexParameteriv:
+ */
+ int GL_TEXTURE_CUBE_MAP_SEAMLESS = ARB_seamless_cube_map.GL_TEXTURE_CUBE_MAP_SEAMLESS;
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/AMD_shader_stencil_export.java b/src/templates/org/lwjgl/opengl/AMD_shader_stencil_export.java
index c7824fa..14b6c4e 100644
--- a/src/templates/org/lwjgl/opengl/AMD_shader_stencil_export.java
+++ b/src/templates/org/lwjgl/opengl/AMD_shader_stencil_export.java
@@ -1,35 +1,35 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface AMD_shader_stencil_export {
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface AMD_shader_stencil_export {
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/AMD_texture_texture4.java b/src/templates/org/lwjgl/opengl/AMD_texture_texture4.java
index 5958ace..d3b8b0c 100644
--- a/src/templates/org/lwjgl/opengl/AMD_texture_texture4.java
+++ b/src/templates/org/lwjgl/opengl/AMD_texture_texture4.java
@@ -1,35 +1,35 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface AMD_texture_texture4 {
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface AMD_texture_texture4 {
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/AMD_vertex_shader_tessellator.java b/src/templates/org/lwjgl/opengl/AMD_vertex_shader_tessellator.java
index 5a596db..c786973 100644
--- a/src/templates/org/lwjgl/opengl/AMD_vertex_shader_tessellator.java
+++ b/src/templates/org/lwjgl/opengl/AMD_vertex_shader_tessellator.java
@@ -1,57 +1,57 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.GLenum;
-
-public interface AMD_vertex_shader_tessellator {
-
- /** Returned by the <type> parameter of GetActiveUniform: */
- int GL_SAMPLER_BUFFER_AMD = 0x9001;
- int GL_INT_SAMPLER_BUFFER_AMD = 0x9002;
- int GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD = 0x9003;
-
- /** Accepted by TessellationModeAMD */
- int GL_DISCRETE_AMD = 0x9006;
- int GL_CONTINUOUS_AMD = 0x9007;
-
- /** Accepted by GetIntegerv */
- int GL_TESSELLATION_MODE_AMD = 0x9004;
-
- /** Accepted by GetFloatv */
- int GL_TESSELLATION_FACTOR_AMD = 0x9005;
-
- void glTessellationFactorAMD(float factor);
-
- void glTessellationModeAMD(@GLenum int mode);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.GLenum;
+
+public interface AMD_vertex_shader_tessellator {
+
+ /** Returned by the <type> parameter of GetActiveUniform: */
+ int GL_SAMPLER_BUFFER_AMD = 0x9001;
+ int GL_INT_SAMPLER_BUFFER_AMD = 0x9002;
+ int GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD = 0x9003;
+
+ /** Accepted by TessellationModeAMD */
+ int GL_DISCRETE_AMD = 0x9006;
+ int GL_CONTINUOUS_AMD = 0x9007;
+
+ /** Accepted by GetIntegerv */
+ int GL_TESSELLATION_MODE_AMD = 0x9004;
+
+ /** Accepted by GetFloatv */
+ int GL_TESSELLATION_FACTOR_AMD = 0x9005;
+
+ void glTessellationFactorAMD(float factor);
+
+ void glTessellationModeAMD(@GLenum int mode);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/APPLE_fence.java b/src/templates/org/lwjgl/opengl/APPLE_fence.java
index 073bff7..0bd87be 100644
--- a/src/templates/org/lwjgl/opengl/APPLE_fence.java
+++ b/src/templates/org/lwjgl/opengl/APPLE_fence.java
@@ -1,67 +1,67 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.IntBuffer;
-
-public interface APPLE_fence {
-
- /** Accepted by the <object> parameter of TestObjectAPPLE and FinishObjectAPPLE: */
- int GL_DRAW_PIXELS_APPLE = 0x8A0A;
- int GL_FENCE_APPLE = 0x8A0B;
-
- void glGenFencesAPPLE(@AutoSize("fences") @GLsizei int n, @OutParameter @GLuint IntBuffer fences);
-
- @Alternate("glGenFencesAPPLE")
- @GLreturn("fences")
- void glGenFencesAPPLE2(@Constant("1") @GLsizei int n, @OutParameter @GLuint IntBuffer fences);
-
- void glDeleteFencesAPPLE(@AutoSize("fences") @GLsizei int n, @Const @GLuint IntBuffer fences);
-
- @Alternate("glDeleteFencesAPPLE")
- void glDeleteFencesAPPLE(@Constant("1") @GLsizei int n, @Const @GLuint @Constant(value = "APIUtils.getBufferInt().put(0, fence), 0", keepParam = true) int fence);
-
- void glSetFenceAPPLE(@GLuint int fence);
-
- boolean glIsFenceAPPLE(@GLuint int fence);
-
- boolean glTestFenceAPPLE(@GLuint int fence);
-
- void glFinishFenceAPPLE(@GLuint int fence);
-
- boolean glTestObjectAPPLE(@GLenum int object, @GLuint int name);
-
- void glFinishObjectAPPLE(@GLenum int object, int name);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.IntBuffer;
+
+public interface APPLE_fence {
+
+ /** Accepted by the <object> parameter of TestObjectAPPLE and FinishObjectAPPLE: */
+ int GL_DRAW_PIXELS_APPLE = 0x8A0A;
+ int GL_FENCE_APPLE = 0x8A0B;
+
+ void glGenFencesAPPLE(@AutoSize("fences") @GLsizei int n, @OutParameter @GLuint IntBuffer fences);
+
+ @Alternate("glGenFencesAPPLE")
+ @GLreturn("fences")
+ void glGenFencesAPPLE2(@Constant("1") @GLsizei int n, @OutParameter @GLuint IntBuffer fences);
+
+ void glDeleteFencesAPPLE(@AutoSize("fences") @GLsizei int n, @Const @GLuint IntBuffer fences);
+
+ @Alternate("glDeleteFencesAPPLE")
+ void glDeleteFencesAPPLE(@Constant("1") @GLsizei int n, @Const @GLuint @Constant(value = "APIUtils.getBufferInt().put(0, fence), 0", keepParam = true) int fence);
+
+ void glSetFenceAPPLE(@GLuint int fence);
+
+ boolean glIsFenceAPPLE(@GLuint int fence);
+
+ boolean glTestFenceAPPLE(@GLuint int fence);
+
+ void glFinishFenceAPPLE(@GLuint int fence);
+
+ boolean glTestObjectAPPLE(@GLenum int object, @GLuint int name);
+
+ void glFinishObjectAPPLE(@GLenum int object, int name);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/APPLE_flush_buffer_range.java b/src/templates/org/lwjgl/opengl/APPLE_flush_buffer_range.java
index 342c7dd..cabf362 100644
--- a/src/templates/org/lwjgl/opengl/APPLE_flush_buffer_range.java
+++ b/src/templates/org/lwjgl/opengl/APPLE_flush_buffer_range.java
@@ -1,51 +1,51 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.GLenum;
-import org.lwjgl.util.generator.GLintptr;
-import org.lwjgl.util.generator.GLsizeiptr;
-
-public interface APPLE_flush_buffer_range {
-
- /**
- * Accepted by the <pname> parameter of BufferParameteriAPPLE and
- * GetBufferParameteriv:
- */
- int GL_BUFFER_SERIALIZED_MODIFY_APPLE = 0x8A12;
- int GL_BUFFER_FLUSHING_UNMAP_APPLE = 0x8A13;
-
- void glBufferParameteriAPPLE(@GLenum int target, @GLenum int pname, int param);
-
- void glFlushMappedBufferRangeAPPLE(@GLenum int target, @GLintptr long offset, @GLsizeiptr long size);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.GLenum;
+import org.lwjgl.util.generator.GLintptr;
+import org.lwjgl.util.generator.GLsizeiptr;
+
+public interface APPLE_flush_buffer_range {
+
+ /**
+ * Accepted by the <pname> parameter of BufferParameteriAPPLE and
+ * GetBufferParameteriv:
+ */
+ int GL_BUFFER_SERIALIZED_MODIFY_APPLE = 0x8A12;
+ int GL_BUFFER_FLUSHING_UNMAP_APPLE = 0x8A13;
+
+ void glBufferParameteriAPPLE(@GLenum int target, @GLenum int pname, int param);
+
+ void glFlushMappedBufferRangeAPPLE(@GLenum int target, @GLintptr long offset, @GLsizeiptr long size);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/APPLE_object_purgeable.java b/src/templates/org/lwjgl/opengl/APPLE_object_purgeable.java
index 87c3847..df1fba6 100644
--- a/src/templates/org/lwjgl/opengl/APPLE_object_purgeable.java
+++ b/src/templates/org/lwjgl/opengl/APPLE_object_purgeable.java
@@ -1,77 +1,77 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.IntBuffer;
-
-public interface APPLE_object_purgeable {
-
- /**
- * Accepted by the <option> parameter of ObjectPurgeable, and returned
- * by ObjectPurgeable:
- */
- int GL_RELEASED_APPLE = 0x8A19;
- int GL_VOLATILE_APPLE = 0x8A1A;
-
- /**
- * Accepted by the <option> parameters of ObjectUnpurgeable, and
- * returned by ObjectUnpurgeable:
- */
- int GL_RETAINED_APPLE = 0x8A1B;
- int GL_UNDEFINED_APPLE = 0x8A1C;
-
- /** Accepted by the <pname> parameters of GetObjectParameteriv: */
- int GL_PURGEABLE_APPLE = 0x8A1D;
-
- /**
- * Accepted by the <objectType> parameters of ObjectPurgeableAPPLE,
- * ObjectUnpurgeableAPPLE and GetObjectParameteriv:
- */
- int GL_BUFFER_OBJECT_APPLE = 0x85B3;
-
- @GLenum
- int glObjectPurgeableAPPLE(@GLenum int objectType, @GLuint int name, @GLenum int option);
-
- @GLenum
- int glObjectUnpurgeableAPPLE(@GLenum int objectType, @GLuint int name, @GLenum int option);
-
- @StripPostfix("params")
- void glGetObjectParameterivAPPLE(@GLenum int objectType, @GLuint int name, @GLenum int pname, @OutParameter @Check("1") IntBuffer params);
-
- @Alternate("glGetObjectParameterivAPPLE")
- @GLreturn("params")
- @StripPostfix("params")
- void glGetObjectParameterivAPPLE2(@GLenum int objectType, @GLuint int name, @GLenum int pname, @OutParameter IntBuffer params);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.IntBuffer;
+
+public interface APPLE_object_purgeable {
+
+ /**
+ * Accepted by the <option> parameter of ObjectPurgeable, and returned
+ * by ObjectPurgeable:
+ */
+ int GL_RELEASED_APPLE = 0x8A19;
+ int GL_VOLATILE_APPLE = 0x8A1A;
+
+ /**
+ * Accepted by the <option> parameters of ObjectUnpurgeable, and
+ * returned by ObjectUnpurgeable:
+ */
+ int GL_RETAINED_APPLE = 0x8A1B;
+ int GL_UNDEFINED_APPLE = 0x8A1C;
+
+ /** Accepted by the <pname> parameters of GetObjectParameteriv: */
+ int GL_PURGEABLE_APPLE = 0x8A1D;
+
+ /**
+ * Accepted by the <objectType> parameters of ObjectPurgeableAPPLE,
+ * ObjectUnpurgeableAPPLE and GetObjectParameteriv:
+ */
+ int GL_BUFFER_OBJECT_APPLE = 0x85B3;
+
+ @GLenum
+ int glObjectPurgeableAPPLE(@GLenum int objectType, @GLuint int name, @GLenum int option);
+
+ @GLenum
+ int glObjectUnpurgeableAPPLE(@GLenum int objectType, @GLuint int name, @GLenum int option);
+
+ @StripPostfix("params")
+ void glGetObjectParameterivAPPLE(@GLenum int objectType, @GLuint int name, @GLenum int pname, @OutParameter @Check("1") IntBuffer params);
+
+ @Alternate("glGetObjectParameterivAPPLE")
+ @GLreturn("params")
+ @StripPostfix("params")
+ void glGetObjectParameterivAPPLE2(@GLenum int objectType, @GLuint int name, @GLenum int pname, @OutParameter IntBuffer params);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/APPLE_texture_range.java b/src/templates/org/lwjgl/opengl/APPLE_texture_range.java
index b4dd4ca..ba1fbbd 100644
--- a/src/templates/org/lwjgl/opengl/APPLE_texture_range.java
+++ b/src/templates/org/lwjgl/opengl/APPLE_texture_range.java
@@ -1,69 +1,69 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.Buffer;
-import java.nio.ByteBuffer;
-
-public interface APPLE_texture_range {
-
- /**
- * Accepted by the <pname> parameters of TexParameteri, TexParameterf,
- * TexParameteriv, TexParameterfv, GetTexParameteriv, and
- * GetTexParameterfv:
- */
- int GL_TEXTURE_STORAGE_HINT_APPLE = 0x85BC;
-
- /**
- * Accepted by the <param> parameters of TexParameteri, TexParameterf,
- * TexParameteriv, and TexParameterfv:
- */
- int GL_STORAGE_PRIVATE_APPLE = 0x85BD;
- int GL_STORAGE_CACHED_APPLE = 0x85BE;
- int GL_STORAGE_SHARED_APPLE = 0x85BF;
-
- /**
- * Accepted by the <pname> parameters of GetTexParameteriv and
- * GetTexParameterfv:
- */
- int GL_TEXTURE_RANGE_LENGTH_APPLE = 0x85B7;
-
- /** Accepted by the <pname> parameters of GetTexParameterPointerv: */
- int GL_TEXTURE_RANGE_POINTER_APPLE = 0x85B8;
-
- void glTextureRangeAPPLE(@GLenum int target, @AutoSize("pointer") @GLsizei int length, @GLvoid ByteBuffer pointer);
-
- void glGetTexParameterPointervAPPLE(@GLenum int target, @GLenum int pname, @Result @GLvoid Buffer params);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.Buffer;
+import java.nio.ByteBuffer;
+
+public interface APPLE_texture_range {
+
+ /**
+ * Accepted by the <pname> parameters of TexParameteri, TexParameterf,
+ * TexParameteriv, TexParameterfv, GetTexParameteriv, and
+ * GetTexParameterfv:
+ */
+ int GL_TEXTURE_STORAGE_HINT_APPLE = 0x85BC;
+
+ /**
+ * Accepted by the <param> parameters of TexParameteri, TexParameterf,
+ * TexParameteriv, and TexParameterfv:
+ */
+ int GL_STORAGE_PRIVATE_APPLE = 0x85BD;
+ int GL_STORAGE_CACHED_APPLE = 0x85BE;
+ int GL_STORAGE_SHARED_APPLE = 0x85BF;
+
+ /**
+ * Accepted by the <pname> parameters of GetTexParameteriv and
+ * GetTexParameterfv:
+ */
+ int GL_TEXTURE_RANGE_LENGTH_APPLE = 0x85B7;
+
+ /** Accepted by the <pname> parameters of GetTexParameterPointerv: */
+ int GL_TEXTURE_RANGE_POINTER_APPLE = 0x85B8;
+
+ void glTextureRangeAPPLE(@GLenum int target, @AutoSize("pointer") @GLsizei int length, @GLvoid ByteBuffer pointer);
+
+ void glGetTexParameterPointervAPPLE(@GLenum int target, @GLenum int pname, @Result @GLvoid Buffer params);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/APPLE_vertex_array_object.java b/src/templates/org/lwjgl/opengl/APPLE_vertex_array_object.java
index ea98f2a..d34ce2f 100644
--- a/src/templates/org/lwjgl/opengl/APPLE_vertex_array_object.java
+++ b/src/templates/org/lwjgl/opengl/APPLE_vertex_array_object.java
@@ -1,61 +1,61 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.IntBuffer;
-
-public interface APPLE_vertex_array_object {
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
- * and GetDoublev:
- */
- int GL_VERTEX_ARRAY_BINDING_APPLE = 0x85B5;
-
- void glBindVertexArrayAPPLE(@GLuint int array);
-
- void glDeleteVertexArraysAPPLE(@AutoSize("arrays") @GLsizei int n, @Const @GLuint IntBuffer arrays);
-
- @Alternate("glDeleteVertexArraysAPPLE")
- void glDeleteVertexArraysAPPLE(@Constant("1") @GLsizei int n, @Const @GLuint @Constant(value = "APIUtils.getBufferInt().put(0, array), 0", keepParam = true) int array);
-
- void glGenVertexArraysAPPLE(@AutoSize("arrays") @GLsizei int n, @OutParameter @GLuint IntBuffer arrays);
-
- @Alternate("glGenVertexArraysAPPLE")
- @GLreturn("arrays")
- void glGenVertexArraysAPPLE2(@Constant("1") @GLsizei int n, @OutParameter @GLuint IntBuffer arrays);
-
- boolean glIsVertexArrayAPPLE(@GLuint int array);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.IntBuffer;
+
+public interface APPLE_vertex_array_object {
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
+ * and GetDoublev:
+ */
+ int GL_VERTEX_ARRAY_BINDING_APPLE = 0x85B5;
+
+ void glBindVertexArrayAPPLE(@GLuint int array);
+
+ void glDeleteVertexArraysAPPLE(@AutoSize("arrays") @GLsizei int n, @Const @GLuint IntBuffer arrays);
+
+ @Alternate("glDeleteVertexArraysAPPLE")
+ void glDeleteVertexArraysAPPLE(@Constant("1") @GLsizei int n, @Const @GLuint @Constant(value = "APIUtils.getBufferInt().put(0, array), 0", keepParam = true) int array);
+
+ void glGenVertexArraysAPPLE(@AutoSize("arrays") @GLsizei int n, @OutParameter @GLuint IntBuffer arrays);
+
+ @Alternate("glGenVertexArraysAPPLE")
+ @GLreturn("arrays")
+ void glGenVertexArraysAPPLE2(@Constant("1") @GLsizei int n, @OutParameter @GLuint IntBuffer arrays);
+
+ boolean glIsVertexArrayAPPLE(@GLuint int array);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/APPLE_vertex_array_range.java b/src/templates/org/lwjgl/opengl/APPLE_vertex_array_range.java
index 2eca457..c37fc32 100644
--- a/src/templates/org/lwjgl/opengl/APPLE_vertex_array_range.java
+++ b/src/templates/org/lwjgl/opengl/APPLE_vertex_array_range.java
@@ -1,83 +1,83 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.AutoSize;
-import org.lwjgl.util.generator.GLenum;
-import org.lwjgl.util.generator.GLsizei;
-import org.lwjgl.util.generator.GLvoid;
-
-import java.nio.ByteBuffer;
-
-public interface APPLE_vertex_array_range {
-
- /**
- * Accepted by the <cap> parameter of EnableClientState, DisableClientState,
- * and IsEnabled:
- */
- int GL_VERTEX_ARRAY_RANGE_APPLE = 0x851D;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
- * and GetDoublev:
- */
-
- int GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE = 0x851E;
- int GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_APPLE = 0x8520;
-
- /** Accepted by the <pname> parameter of GetPointerv: */
-
- int GL_VERTEX_ARRAY_RANGE_POINTER_APPLE = 0x8521;
-
- /**
- * Accepted by the <pname> parameter of VertexArrayParameteriAPPLE,
- * GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev:
- */
-
- int GL_VERTEX_ARRAY_STORAGE_HINT_APPLE = 0x851F;
-
- /** Accepted by the <param> parameter of VertexArrayParameteriAPPLE: */
-
- int GL_STORAGE_CACHED_APPLE = 0x85BE;
- int GL_STORAGE_SHARED_APPLE = 0x85BF;
-
- /** Accepted by the <object> parameter of TestObjectAPPLE and FinishObjectAPPLE: */
- int GL_DRAW_PIXELS_APPLE = 0x8A0A;
- int GL_FENCE_APPLE = 0x8A0B;
-
- void glVertexArrayRangeAPPLE(@AutoSize("pointer") @GLsizei int length, @GLvoid ByteBuffer pointer);
-
- void glFlushVertexArrayRangeAPPLE(@AutoSize("pointer") @GLsizei int length, @GLvoid ByteBuffer pointer);
-
- void glVertexArrayParameteriAPPLE(@GLenum int pname, int param);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.AutoSize;
+import org.lwjgl.util.generator.GLenum;
+import org.lwjgl.util.generator.GLsizei;
+import org.lwjgl.util.generator.GLvoid;
+
+import java.nio.ByteBuffer;
+
+public interface APPLE_vertex_array_range {
+
+ /**
+ * Accepted by the <cap> parameter of EnableClientState, DisableClientState,
+ * and IsEnabled:
+ */
+ int GL_VERTEX_ARRAY_RANGE_APPLE = 0x851D;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
+ * and GetDoublev:
+ */
+
+ int GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE = 0x851E;
+ int GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_APPLE = 0x8520;
+
+ /** Accepted by the <pname> parameter of GetPointerv: */
+
+ int GL_VERTEX_ARRAY_RANGE_POINTER_APPLE = 0x8521;
+
+ /**
+ * Accepted by the <pname> parameter of VertexArrayParameteriAPPLE,
+ * GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev:
+ */
+
+ int GL_VERTEX_ARRAY_STORAGE_HINT_APPLE = 0x851F;
+
+ /** Accepted by the <param> parameter of VertexArrayParameteriAPPLE: */
+
+ int GL_STORAGE_CACHED_APPLE = 0x85BE;
+ int GL_STORAGE_SHARED_APPLE = 0x85BF;
+
+ /** Accepted by the <object> parameter of TestObjectAPPLE and FinishObjectAPPLE: */
+ int GL_DRAW_PIXELS_APPLE = 0x8A0A;
+ int GL_FENCE_APPLE = 0x8A0B;
+
+ void glVertexArrayRangeAPPLE(@AutoSize("pointer") @GLsizei int length, @GLvoid ByteBuffer pointer);
+
+ void glFlushVertexArrayRangeAPPLE(@AutoSize("pointer") @GLsizei int length, @GLvoid ByteBuffer pointer);
+
+ void glVertexArrayParameteriAPPLE(@GLenum int pname, int param);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/APPLE_vertex_program_evaluators.java b/src/templates/org/lwjgl/opengl/APPLE_vertex_program_evaluators.java
index 77f625d..f096a7d 100644
--- a/src/templates/org/lwjgl/opengl/APPLE_vertex_program_evaluators.java
+++ b/src/templates/org/lwjgl/opengl/APPLE_vertex_program_evaluators.java
@@ -1,84 +1,84 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.Check;
-import org.lwjgl.util.generator.Const;
-import org.lwjgl.util.generator.GLenum;
-import org.lwjgl.util.generator.GLuint;
-
-import java.nio.DoubleBuffer;
-import java.nio.FloatBuffer;
-
-public interface APPLE_vertex_program_evaluators {
-
- /**
- * Accepted by the <pname> parameter of EnableVertexAttribAPPLE,
- * DisableVertexAttribAPPLE, and IsVertexAttribEnabledAPPLE.
- */
- int GL_VERTEX_ATTRIB_MAP1_APPLE = 0x8A00;
- int GL_VERTEX_ATTRIB_MAP2_APPLE = 0x8A01;
-
- /**
- * Accepted by the <pname> parameter of GetVertexAttribdvARB,
- * GetVertexAttribfvARB, and GetVertexAttribivARB.
- */
- int GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE = 0x8A02;
- int GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE = 0x8A03;
- int GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE = 0x8A04;
- int GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE = 0x8A05;
- int GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE = 0x8A06;
- int GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE = 0x8A07;
- int GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE = 0x8A08;
- int GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE = 0x8A09;
-
- void glEnableVertexAttribAPPLE(@GLuint int index, @GLenum int pname);
-
- void glDisableVertexAttribAPPLE(@GLuint int index, @GLenum int pname);
-
- boolean glIsVertexAttribEnabledAPPLE(@GLuint int index, @GLenum int pname);
-
- void glMapVertexAttrib1dAPPLE(@GLuint int index, @GLuint int size, double u1, double u2,
- int stride, int order, @Check @Const DoubleBuffer points);
-
- void glMapVertexAttrib1fAPPLE(@GLuint int index, @GLuint int size, float u1, float u2,
- int stride, int order, @Check @Const FloatBuffer points);
-
- void glMapVertexAttrib2dAPPLE(@GLuint int index, @GLuint int size, double u1, double u2,
- int ustride, int uorder, double v1, double v2, int vstride, int vorder,
- @Check @Const DoubleBuffer points);
-
- void glMapVertexAttrib2fAPPLE(@GLuint int index, @GLuint int size, float u1, float u2,
- int ustride, int uorder, float v1, float v2, int vstride, int vorder,
- @Check @Const FloatBuffer points);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.Check;
+import org.lwjgl.util.generator.Const;
+import org.lwjgl.util.generator.GLenum;
+import org.lwjgl.util.generator.GLuint;
+
+import java.nio.DoubleBuffer;
+import java.nio.FloatBuffer;
+
+public interface APPLE_vertex_program_evaluators {
+
+ /**
+ * Accepted by the <pname> parameter of EnableVertexAttribAPPLE,
+ * DisableVertexAttribAPPLE, and IsVertexAttribEnabledAPPLE.
+ */
+ int GL_VERTEX_ATTRIB_MAP1_APPLE = 0x8A00;
+ int GL_VERTEX_ATTRIB_MAP2_APPLE = 0x8A01;
+
+ /**
+ * Accepted by the <pname> parameter of GetVertexAttribdvARB,
+ * GetVertexAttribfvARB, and GetVertexAttribivARB.
+ */
+ int GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE = 0x8A02;
+ int GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE = 0x8A03;
+ int GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE = 0x8A04;
+ int GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE = 0x8A05;
+ int GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE = 0x8A06;
+ int GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE = 0x8A07;
+ int GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE = 0x8A08;
+ int GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE = 0x8A09;
+
+ void glEnableVertexAttribAPPLE(@GLuint int index, @GLenum int pname);
+
+ void glDisableVertexAttribAPPLE(@GLuint int index, @GLenum int pname);
+
+ boolean glIsVertexAttribEnabledAPPLE(@GLuint int index, @GLenum int pname);
+
+ void glMapVertexAttrib1dAPPLE(@GLuint int index, @GLuint int size, double u1, double u2,
+ int stride, int order, @Check @Const DoubleBuffer points);
+
+ void glMapVertexAttrib1fAPPLE(@GLuint int index, @GLuint int size, float u1, float u2,
+ int stride, int order, @Check @Const FloatBuffer points);
+
+ void glMapVertexAttrib2dAPPLE(@GLuint int index, @GLuint int size, double u1, double u2,
+ int ustride, int uorder, double v1, double v2, int vstride, int vorder,
+ @Check @Const DoubleBuffer points);
+
+ void glMapVertexAttrib2fAPPLE(@GLuint int index, @GLuint int size, float u1, float u2,
+ int ustride, int uorder, float v1, float v2, int vstride, int vorder,
+ @Check @Const FloatBuffer points);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_blend_func_extended.java b/src/templates/org/lwjgl/opengl/ARB_blend_func_extended.java
index ab6b007..cc267f4 100644
--- a/src/templates/org/lwjgl/opengl/ARB_blend_func_extended.java
+++ b/src/templates/org/lwjgl/opengl/ARB_blend_func_extended.java
@@ -1,66 +1,66 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.ByteBuffer;
-
-public interface ARB_blend_func_extended {
-
- /**
- * Accepted by the <src> and <dst> parameters of BlendFunc and
- * BlendFunci, and by the <srcRGB>, <dstRGB>, <srcAlpha> and <dstAlpha>
- * parameters of BlendFuncSeparate and BlendFuncSeparatei:
- */
- int GL_SRC1_COLOR = 0x88F9;
- int GL_SRC1_ALPHA = GL15.GL_SRC1_ALPHA;
- int GL_ONE_MINUS_SRC1_COLOR = 0x88FA;
- int GL_ONE_MINUS_SRC1_ALPHA = 0x88FB;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv
- * and GetDoublev:
- */
- int GL_MAX_DUAL_SOURCE_DRAW_BUFFERS = 0x88FC;
-
- void glBindFragDataLocationIndexed(@GLuint int program, @GLuint int colorNumber, @GLuint int index, @NullTerminated @Const @GLchar ByteBuffer name);
-
- @Alternate("glBindFragDataLocationIndexed")
- void glBindFragDataLocationIndexed(@GLuint int program, @GLuint int colorNumber, @GLuint int index, @NullTerminated CharSequence name);
-
- int glGetFragDataIndex(@GLuint int program, @NullTerminated @Const @GLchar ByteBuffer name);
-
- @Alternate("glGetFragDataIndex")
- int glGetFragDataIndex(@GLuint int program, @NullTerminated CharSequence name);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.ByteBuffer;
+
+public interface ARB_blend_func_extended {
+
+ /**
+ * Accepted by the <src> and <dst> parameters of BlendFunc and
+ * BlendFunci, and by the <srcRGB>, <dstRGB>, <srcAlpha> and <dstAlpha>
+ * parameters of BlendFuncSeparate and BlendFuncSeparatei:
+ */
+ int GL_SRC1_COLOR = 0x88F9;
+ int GL_SRC1_ALPHA = GL15.GL_SRC1_ALPHA;
+ int GL_ONE_MINUS_SRC1_COLOR = 0x88FA;
+ int GL_ONE_MINUS_SRC1_ALPHA = 0x88FB;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv
+ * and GetDoublev:
+ */
+ int GL_MAX_DUAL_SOURCE_DRAW_BUFFERS = 0x88FC;
+
+ void glBindFragDataLocationIndexed(@GLuint int program, @GLuint int colorNumber, @GLuint int index, @NullTerminated @Const @GLchar ByteBuffer name);
+
+ @Alternate("glBindFragDataLocationIndexed")
+ void glBindFragDataLocationIndexed(@GLuint int program, @GLuint int colorNumber, @GLuint int index, @NullTerminated CharSequence name);
+
+ int glGetFragDataIndex(@GLuint int program, @NullTerminated @Const @GLchar ByteBuffer name);
+
+ @Alternate("glGetFragDataIndex")
+ int glGetFragDataIndex(@GLuint int program, @NullTerminated CharSequence name);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_buffer_object.java b/src/templates/org/lwjgl/opengl/ARB_buffer_object.java
index fcf301e..1c627a9 100644
--- a/src/templates/org/lwjgl/opengl/ARB_buffer_object.java
+++ b/src/templates/org/lwjgl/opengl/ARB_buffer_object.java
@@ -1,150 +1,150 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.Buffer;
-import java.nio.ByteBuffer;
-import java.nio.IntBuffer;
-
- at Extension(postfix = "ARB", isFinal = false)
-public interface ARB_buffer_object {
-
- /** Accepted by the <usage> parameter of BufferDataARB: */
- int GL_STREAM_DRAW_ARB = 0x88E0;
- int GL_STREAM_READ_ARB = 0x88E1;
- int GL_STREAM_COPY_ARB = 0x88E2;
- int GL_STATIC_DRAW_ARB = 0x88E4;
- int GL_STATIC_READ_ARB = 0x88E5;
- int GL_STATIC_COPY_ARB = 0x88E6;
- int GL_DYNAMIC_DRAW_ARB = 0x88E8;
- int GL_DYNAMIC_READ_ARB = 0x88E9;
- int GL_DYNAMIC_COPY_ARB = 0x88EA;
-
- /** Accepted by the <access> parameter of MapBufferARB: */
- int GL_READ_ONLY_ARB = 0x88B8;
- int GL_WRITE_ONLY_ARB = 0x88B9;
- int GL_READ_WRITE_ARB = 0x88BA;
-
- /** Accepted by the <pname> parameter of GetBufferParameterivARB: */
- int GL_BUFFER_SIZE_ARB = 0x8764;
- int GL_BUFFER_USAGE_ARB = 0x8765;
- int GL_BUFFER_ACCESS_ARB = 0x88BB;
- int GL_BUFFER_MAPPED_ARB = 0x88BC;
- int GL_BUFFER_MAP_POINTER_ARB = 0x88BD;
-
- @Code(" StateTracker.bindBuffer(caps, target, buffer);")
- void glBindBufferARB(@GLenum int target, @GLuint int buffer);
-
- void glDeleteBuffersARB(@AutoSize("buffers") @GLsizei int n, @Const @GLuint IntBuffer buffers);
-
- @Alternate("glDeleteBuffersARB")
- void glDeleteBuffersARB(@Constant("1") @GLsizei int n, @Constant(value = "APIUtils.getBufferInt().put(0, buffer), 0", keepParam = true) int buffer);
-
- void glGenBuffersARB(@AutoSize("buffers") @GLsizei int n, @OutParameter @GLuint IntBuffer buffers);
-
- @Alternate("glGenBuffersARB")
- @GLreturn("buffers")
- void glGenBuffersARB2(@Constant("1") @GLsizei int n, @OutParameter @GLuint IntBuffer buffers);
-
- boolean glIsBufferARB(@GLuint int buffer);
-
- @GenerateAutos
- void glBufferDataARB(@GLenum int target, @AutoSize("data") @GLsizeiptrARB long size,
- @Const
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer data, @GLenum int usage);
-
- void glBufferSubDataARB(@GLenum int target, @GLintptrARB long offset, @AutoSize("data") @GLsizeiptrARB long size,
- @Check
- @Const
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer data);
-
- void glGetBufferSubDataARB(@GLenum int target, @GLintptrARB long offset, @AutoSize("data") @GLsizeiptrARB long size,
- @OutParameter
- @Check
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer data);
-
- /**
- * glMapBufferARB maps a GL buffer object to a ByteBuffer. The old_buffer argument can be null,
- * in which case a new ByteBuffer will be created, pointing to the returned memory. If old_buffer is non-null,
- * it will be returned if it points to the same mapped memory and has the same capacity as the buffer object,
- * otherwise a new ByteBuffer is created. That way, an application will normally use glMapBufferARB like this:
- * <p/>
- * ByteBuffer mapped_buffer; mapped_buffer = glMapBufferARB(..., ..., null); ... // Another map on the same buffer mapped_buffer = glMapBufferARB(..., ..., mapped_buffer);
- * <p/>
- * Only ByteBuffers returned from this method are to be passed as the old_buffer argument. User-created ByteBuffers cannot be reused.
- * <p/>
- * The version of this method without an explicit length argument calls glGetBufferParameterARB internally to
- * retrieve the current buffer object size, which may cause a pipeline flush and reduce application performance.
- * <p/>
- * The version of this method with an explicit length argument is a fast alternative to the one without. No GL call
- * is made to retrieve the buffer object size, so the user is responsible for tracking and using the appropriate length.<br>
- * Security warning: The length argument should match the buffer object size. Reading from or writing to outside
- * the memory region that corresponds to the mapped buffer object will cause native crashes.
- *
- * @param length the length of the mapped memory in bytes.
- * @param old_buffer A ByteBuffer. If this argument points to the same address and has the same capacity as the new mapping, it will be returned and no new buffer will be created.
- *
- * @return A ByteBuffer representing the mapped buffer memory.
- */
- @CachedResult
- @GLvoid
- @AutoResultSize("GLChecks.getBufferObjectSizeARB(caps, target)")
- ByteBuffer glMapBufferARB(@GLenum int target, @GLenum int access);
-
- boolean glUnmapBufferARB(@GLenum int target);
-
- @StripPostfix("params")
- void glGetBufferParameterivARB(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
-
- @Alternate("glGetBufferParameterivARB")
- @GLreturn("params")
- @StripPostfix("params")
- void glGetBufferParameterivARB2(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params);
-
- @StripPostfix("pointer")
- @AutoResultSize("GLChecks.getBufferObjectSizeARB(caps, target)")
- void glGetBufferPointervARB(@GLenum int target, @GLenum int pname, @Result @GLvoid ByteBuffer pointer);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.Buffer;
+import java.nio.ByteBuffer;
+import java.nio.IntBuffer;
+
+ at Extension(postfix = "ARB", isFinal = false)
+public interface ARB_buffer_object {
+
+ /** Accepted by the <usage> parameter of BufferDataARB: */
+ int GL_STREAM_DRAW_ARB = 0x88E0;
+ int GL_STREAM_READ_ARB = 0x88E1;
+ int GL_STREAM_COPY_ARB = 0x88E2;
+ int GL_STATIC_DRAW_ARB = 0x88E4;
+ int GL_STATIC_READ_ARB = 0x88E5;
+ int GL_STATIC_COPY_ARB = 0x88E6;
+ int GL_DYNAMIC_DRAW_ARB = 0x88E8;
+ int GL_DYNAMIC_READ_ARB = 0x88E9;
+ int GL_DYNAMIC_COPY_ARB = 0x88EA;
+
+ /** Accepted by the <access> parameter of MapBufferARB: */
+ int GL_READ_ONLY_ARB = 0x88B8;
+ int GL_WRITE_ONLY_ARB = 0x88B9;
+ int GL_READ_WRITE_ARB = 0x88BA;
+
+ /** Accepted by the <pname> parameter of GetBufferParameterivARB: */
+ int GL_BUFFER_SIZE_ARB = 0x8764;
+ int GL_BUFFER_USAGE_ARB = 0x8765;
+ int GL_BUFFER_ACCESS_ARB = 0x88BB;
+ int GL_BUFFER_MAPPED_ARB = 0x88BC;
+ int GL_BUFFER_MAP_POINTER_ARB = 0x88BD;
+
+ @Code(" StateTracker.bindBuffer(caps, target, buffer);")
+ void glBindBufferARB(@GLenum int target, @GLuint int buffer);
+
+ void glDeleteBuffersARB(@AutoSize("buffers") @GLsizei int n, @Const @GLuint IntBuffer buffers);
+
+ @Alternate("glDeleteBuffersARB")
+ void glDeleteBuffersARB(@Constant("1") @GLsizei int n, @Constant(value = "APIUtils.getBufferInt().put(0, buffer), 0", keepParam = true) int buffer);
+
+ void glGenBuffersARB(@AutoSize("buffers") @GLsizei int n, @OutParameter @GLuint IntBuffer buffers);
+
+ @Alternate("glGenBuffersARB")
+ @GLreturn("buffers")
+ void glGenBuffersARB2(@Constant("1") @GLsizei int n, @OutParameter @GLuint IntBuffer buffers);
+
+ boolean glIsBufferARB(@GLuint int buffer);
+
+ @GenerateAutos
+ void glBufferDataARB(@GLenum int target, @AutoSize("data") @GLsizeiptrARB long size,
+ @Const
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer data, @GLenum int usage);
+
+ void glBufferSubDataARB(@GLenum int target, @GLintptrARB long offset, @AutoSize("data") @GLsizeiptrARB long size,
+ @Check
+ @Const
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer data);
+
+ void glGetBufferSubDataARB(@GLenum int target, @GLintptrARB long offset, @AutoSize("data") @GLsizeiptrARB long size,
+ @OutParameter
+ @Check
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer data);
+
+ /**
+ * glMapBufferARB maps a GL buffer object to a ByteBuffer. The old_buffer argument can be null,
+ * in which case a new ByteBuffer will be created, pointing to the returned memory. If old_buffer is non-null,
+ * it will be returned if it points to the same mapped memory and has the same capacity as the buffer object,
+ * otherwise a new ByteBuffer is created. That way, an application will normally use glMapBufferARB like this:
+ * <p/>
+ * ByteBuffer mapped_buffer; mapped_buffer = glMapBufferARB(..., ..., null); ... // Another map on the same buffer mapped_buffer = glMapBufferARB(..., ..., mapped_buffer);
+ * <p/>
+ * Only ByteBuffers returned from this method are to be passed as the old_buffer argument. User-created ByteBuffers cannot be reused.
+ * <p/>
+ * The version of this method without an explicit length argument calls glGetBufferParameterARB internally to
+ * retrieve the current buffer object size, which may cause a pipeline flush and reduce application performance.
+ * <p/>
+ * The version of this method with an explicit length argument is a fast alternative to the one without. No GL call
+ * is made to retrieve the buffer object size, so the user is responsible for tracking and using the appropriate length.<br>
+ * Security warning: The length argument should match the buffer object size. Reading from or writing to outside
+ * the memory region that corresponds to the mapped buffer object will cause native crashes.
+ *
+ * @param length the length of the mapped memory in bytes.
+ * @param old_buffer A ByteBuffer. If this argument points to the same address and has the same capacity as the new mapping, it will be returned and no new buffer will be created.
+ *
+ * @return A ByteBuffer representing the mapped buffer memory.
+ */
+ @CachedResult
+ @GLvoid
+ @AutoResultSize("GLChecks.getBufferObjectSizeARB(caps, target)")
+ ByteBuffer glMapBufferARB(@GLenum int target, @GLenum int access);
+
+ boolean glUnmapBufferARB(@GLenum int target);
+
+ @StripPostfix("params")
+ void glGetBufferParameterivARB(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
+
+ @Alternate("glGetBufferParameterivARB")
+ @GLreturn("params")
+ @StripPostfix("params")
+ void glGetBufferParameterivARB2(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params);
+
+ @StripPostfix("pointer")
+ @AutoResultSize("GLChecks.getBufferObjectSizeARB(caps, target)")
+ void glGetBufferPointervARB(@GLenum int target, @GLenum int pname, @Result @GLvoid ByteBuffer pointer);
+}
diff --git a/src/templates/org/lwjgl/opengl/ARB_color_buffer_float.java b/src/templates/org/lwjgl/opengl/ARB_color_buffer_float.java
index a58e75b..d00de08 100644
--- a/src/templates/org/lwjgl/opengl/ARB_color_buffer_float.java
+++ b/src/templates/org/lwjgl/opengl/ARB_color_buffer_float.java
@@ -1,74 +1,74 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.GLenum;
-
-public interface ARB_color_buffer_float {
-
- /**
- * Accepted by the <pname> parameters of GetBooleanv, GetIntegerv,
- * GetFloatv, and GetDoublev:
- */
- int GL_RGBA_FLOAT_MODE_ARB = 0x8820;
-
- /**
- * Accepted by the <target> parameter of ClampColorARB and the <pname>
- * parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.
- */
- int GL_CLAMP_VERTEX_COLOR_ARB = 0x891A;
- int GL_CLAMP_FRAGMENT_COLOR_ARB = 0x891B;
- int GL_CLAMP_READ_COLOR_ARB = 0x891C;
-
- /** Accepted by the <clamp> parameter of ClampColorARB. */
- int GL_FIXED_ONLY_ARB = 0x891D;
-
- /**
- * Accepted as a value in the <piAttribIList> and <pfAttribFList>
- * parameter arrays of wglChoosePixelFormatARB, and returned in the
- * <piValues> parameter array of wglGetPixelFormatAttribivARB, and the
- * <pfValues> parameter array of wglGetPixelFormatAttribfvARB:
- */
- int WGL_TYPE_RGBA_FLOAT_ARB = 0x21A0;
-
- /**
- * Accepted as values of the <render_type> arguments in the
- * glXCreateNewContext and glXCreateContext functions
- */
- int GLX_RGBA_FLOAT_TYPE = 0x20B9;
-
- /** Accepted as a bit set in the GLX_RENDER_TYPE variable */
- int GLX_RGBA_FLOAT_BIT = 0x00000004;
-
- void glClampColorARB(@GLenum int target, @GLenum int clamp);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.GLenum;
+
+public interface ARB_color_buffer_float {
+
+ /**
+ * Accepted by the <pname> parameters of GetBooleanv, GetIntegerv,
+ * GetFloatv, and GetDoublev:
+ */
+ int GL_RGBA_FLOAT_MODE_ARB = 0x8820;
+
+ /**
+ * Accepted by the <target> parameter of ClampColorARB and the <pname>
+ * parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.
+ */
+ int GL_CLAMP_VERTEX_COLOR_ARB = 0x891A;
+ int GL_CLAMP_FRAGMENT_COLOR_ARB = 0x891B;
+ int GL_CLAMP_READ_COLOR_ARB = 0x891C;
+
+ /** Accepted by the <clamp> parameter of ClampColorARB. */
+ int GL_FIXED_ONLY_ARB = 0x891D;
+
+ /**
+ * Accepted as a value in the <piAttribIList> and <pfAttribFList>
+ * parameter arrays of wglChoosePixelFormatARB, and returned in the
+ * <piValues> parameter array of wglGetPixelFormatAttribivARB, and the
+ * <pfValues> parameter array of wglGetPixelFormatAttribfvARB:
+ */
+ int WGL_TYPE_RGBA_FLOAT_ARB = 0x21A0;
+
+ /**
+ * Accepted as values of the <render_type> arguments in the
+ * glXCreateNewContext and glXCreateContext functions
+ */
+ int GLX_RGBA_FLOAT_TYPE = 0x20B9;
+
+ /** Accepted as a bit set in the GLX_RENDER_TYPE variable */
+ int GLX_RGBA_FLOAT_BIT = 0x00000004;
+
+ void glClampColorARB(@GLenum int target, @GLenum int clamp);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_compatibility.java b/src/templates/org/lwjgl/opengl/ARB_compatibility.java
index 5d053e8..06c72fd 100644
--- a/src/templates/org/lwjgl/opengl/ARB_compatibility.java
+++ b/src/templates/org/lwjgl/opengl/ARB_compatibility.java
@@ -1,35 +1,35 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_compatibility {
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_compatibility {
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_copy_buffer.java b/src/templates/org/lwjgl/opengl/ARB_copy_buffer.java
index 859f908..fd8981b 100644
--- a/src/templates/org/lwjgl/opengl/ARB_copy_buffer.java
+++ b/src/templates/org/lwjgl/opengl/ARB_copy_buffer.java
@@ -1,54 +1,54 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.GLenum;
-import org.lwjgl.util.generator.GLintptr;
-import org.lwjgl.util.generator.GLsizeiptr;
-
-public interface ARB_copy_buffer {
-
- /**
- * Accepted by the target parameters of BindBuffer, BufferData,
- * BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData,
- * GetBufferPointerv, MapBufferRange, FlushMappedBufferRange,
- * GetBufferParameteriv, BindBufferRange, BindBufferBase,
- * and CopyBufferSubData:
- */
- int GL_COPY_READ_BUFFER = 0x8F36;
- int GL_COPY_WRITE_BUFFER = 0x8F37;
-
- void glCopyBufferSubData(@GLenum int readTarget, @GLenum int writeTarget,
- @GLintptr long readOffset, @GLintptr long writeOffset,
- @GLsizeiptr long size);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.GLenum;
+import org.lwjgl.util.generator.GLintptr;
+import org.lwjgl.util.generator.GLsizeiptr;
+
+public interface ARB_copy_buffer {
+
+ /**
+ * Accepted by the target parameters of BindBuffer, BufferData,
+ * BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData,
+ * GetBufferPointerv, MapBufferRange, FlushMappedBufferRange,
+ * GetBufferParameteriv, BindBufferRange, BindBufferBase,
+ * and CopyBufferSubData:
+ */
+ int GL_COPY_READ_BUFFER = 0x8F36;
+ int GL_COPY_WRITE_BUFFER = 0x8F37;
+
+ void glCopyBufferSubData(@GLenum int readTarget, @GLenum int writeTarget,
+ @GLintptr long readOffset, @GLintptr long writeOffset,
+ @GLsizeiptr long size);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_depth_buffer_float.java b/src/templates/org/lwjgl/opengl/ARB_depth_buffer_float.java
index 7e4c372..2baec31 100644
--- a/src/templates/org/lwjgl/opengl/ARB_depth_buffer_float.java
+++ b/src/templates/org/lwjgl/opengl/ARB_depth_buffer_float.java
@@ -1,52 +1,52 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_depth_buffer_float {
-
- /**
- * Accepted by the <internalformat> parameter of TexImage1D, TexImage2D,
- * TexImage3D, CopyTexImage1D, CopyTexImage2D, and RenderbufferStorageEXT,
- * and returned in the <data> parameter of GetTexLevelParameter and
- * GetRenderbufferParameterivEXT:
- */
- int GL_DEPTH_COMPONENT32F = 0x8CAC;
- int GL_DEPTH32F_STENCIL8 = 0x8CAD;
-
- /**
- * Accepted by the <type> parameter of DrawPixels, ReadPixels, TexImage1D,
- * TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D, TexSubImage3D, and
- * GetTexImage:
- */
- int GL_FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD;
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_depth_buffer_float {
+
+ /**
+ * Accepted by the <internalformat> parameter of TexImage1D, TexImage2D,
+ * TexImage3D, CopyTexImage1D, CopyTexImage2D, and RenderbufferStorageEXT,
+ * and returned in the <data> parameter of GetTexLevelParameter and
+ * GetRenderbufferParameterivEXT:
+ */
+ int GL_DEPTH_COMPONENT32F = 0x8CAC;
+ int GL_DEPTH32F_STENCIL8 = 0x8CAD;
+
+ /**
+ * Accepted by the <type> parameter of DrawPixels, ReadPixels, TexImage1D,
+ * TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D, TexSubImage3D, and
+ * GetTexImage:
+ */
+ int GL_FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD;
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_depth_clamp.java b/src/templates/org/lwjgl/opengl/ARB_depth_clamp.java
index c81bf96..5376fe3 100644
--- a/src/templates/org/lwjgl/opengl/ARB_depth_clamp.java
+++ b/src/templates/org/lwjgl/opengl/ARB_depth_clamp.java
@@ -1,43 +1,43 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_depth_clamp {
-
- /**
- * Accepted by the <cap> parameter of Enable, Disable, and IsEnabled,
- * and by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv, and GetDoublev:
- */
- int GL_DEPTH_CLAMP = 0x864F;
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_depth_clamp {
+
+ /**
+ * Accepted by the <cap> parameter of Enable, Disable, and IsEnabled,
+ * and by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, and GetDoublev:
+ */
+ int GL_DEPTH_CLAMP = 0x864F;
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_depth_texture.java b/src/templates/org/lwjgl/opengl/ARB_depth_texture.java
index 4998f08..52eebd8 100644
--- a/src/templates/org/lwjgl/opengl/ARB_depth_texture.java
+++ b/src/templates/org/lwjgl/opengl/ARB_depth_texture.java
@@ -1,55 +1,55 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_depth_texture {
-
- /**
- * Accepted by the <internalFormat> parameter of TexImage1D, TexImage2D,
- * CopyTexImage1D and CopyTexImage2D:
- */
- int GL_DEPTH_COMPONENT16_ARB = 0x81A5;
- int GL_DEPTH_COMPONENT24_ARB = 0x81A6;
- int GL_DEPTH_COMPONENT32_ARB = 0x81A7;
-
- /**
- * Accepted by the <pname> parameter of GetTexLevelParameterfv and
- * GetTexLevelParameteriv:
- */
- int GL_TEXTURE_DEPTH_SIZE_ARB = 0x884A;
-
- /**
- * Accepted by the <pname> parameter of TexParameterf, TexParameteri,
- * TexParameterfv, TexParameteriv, GetTexParameterfv, and GetTexParameteriv:
- */
- int GL_DEPTH_TEXTURE_MODE_ARB = 0x884B;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_depth_texture {
+
+ /**
+ * Accepted by the <internalFormat> parameter of TexImage1D, TexImage2D,
+ * CopyTexImage1D and CopyTexImage2D:
+ */
+ int GL_DEPTH_COMPONENT16_ARB = 0x81A5;
+ int GL_DEPTH_COMPONENT24_ARB = 0x81A6;
+ int GL_DEPTH_COMPONENT32_ARB = 0x81A7;
+
+ /**
+ * Accepted by the <pname> parameter of GetTexLevelParameterfv and
+ * GetTexLevelParameteriv:
+ */
+ int GL_TEXTURE_DEPTH_SIZE_ARB = 0x884A;
+
+ /**
+ * Accepted by the <pname> parameter of TexParameterf, TexParameteri,
+ * TexParameterfv, TexParameteriv, GetTexParameterfv, and GetTexParameteriv:
+ */
+ int GL_DEPTH_TEXTURE_MODE_ARB = 0x884B;
+}
diff --git a/src/templates/org/lwjgl/opengl/ARB_draw_buffers.java b/src/templates/org/lwjgl/opengl/ARB_draw_buffers.java
index d209a31..8ffbdbb 100644
--- a/src/templates/org/lwjgl/opengl/ARB_draw_buffers.java
+++ b/src/templates/org/lwjgl/opengl/ARB_draw_buffers.java
@@ -1,66 +1,66 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-public interface ARB_draw_buffers {
-
- /**
- * Accepted by the <pname> parameters of GetIntegerv, GetFloatv,
- * and GetDoublev:
- */
- int GL_MAX_DRAW_BUFFERS_ARB = 0x8824;
- int GL_DRAW_BUFFER0_ARB = 0x8825;
- int GL_DRAW_BUFFER1_ARB = 0x8826;
- int GL_DRAW_BUFFER2_ARB = 0x8827;
- int GL_DRAW_BUFFER3_ARB = 0x8828;
- int GL_DRAW_BUFFER4_ARB = 0x8829;
- int GL_DRAW_BUFFER5_ARB = 0x882A;
- int GL_DRAW_BUFFER6_ARB = 0x882B;
- int GL_DRAW_BUFFER7_ARB = 0x882C;
- int GL_DRAW_BUFFER8_ARB = 0x882D;
- int GL_DRAW_BUFFER9_ARB = 0x882E;
- int GL_DRAW_BUFFER10_ARB = 0x882F;
- int GL_DRAW_BUFFER11_ARB = 0x8830;
- int GL_DRAW_BUFFER12_ARB = 0x8831;
- int GL_DRAW_BUFFER13_ARB = 0x8832;
- int GL_DRAW_BUFFER14_ARB = 0x8833;
- int GL_DRAW_BUFFER15_ARB = 0x8834;
-
- void glDrawBuffersARB(@AutoSize("buffers") @GLsizei int size, @Const @GLenum IntBuffer buffers);
-
- @Alternate("glDrawBuffersARB")
- void glDrawBuffersARB(@Constant("1") @GLsizei int size, @Constant(value = "APIUtils.getBufferInt().put(0, buffer), 0", keepParam = true) int buffer);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+public interface ARB_draw_buffers {
+
+ /**
+ * Accepted by the <pname> parameters of GetIntegerv, GetFloatv,
+ * and GetDoublev:
+ */
+ int GL_MAX_DRAW_BUFFERS_ARB = 0x8824;
+ int GL_DRAW_BUFFER0_ARB = 0x8825;
+ int GL_DRAW_BUFFER1_ARB = 0x8826;
+ int GL_DRAW_BUFFER2_ARB = 0x8827;
+ int GL_DRAW_BUFFER3_ARB = 0x8828;
+ int GL_DRAW_BUFFER4_ARB = 0x8829;
+ int GL_DRAW_BUFFER5_ARB = 0x882A;
+ int GL_DRAW_BUFFER6_ARB = 0x882B;
+ int GL_DRAW_BUFFER7_ARB = 0x882C;
+ int GL_DRAW_BUFFER8_ARB = 0x882D;
+ int GL_DRAW_BUFFER9_ARB = 0x882E;
+ int GL_DRAW_BUFFER10_ARB = 0x882F;
+ int GL_DRAW_BUFFER11_ARB = 0x8830;
+ int GL_DRAW_BUFFER12_ARB = 0x8831;
+ int GL_DRAW_BUFFER13_ARB = 0x8832;
+ int GL_DRAW_BUFFER14_ARB = 0x8833;
+ int GL_DRAW_BUFFER15_ARB = 0x8834;
+
+ void glDrawBuffersARB(@AutoSize("buffers") @GLsizei int size, @Const @GLenum IntBuffer buffers);
+
+ @Alternate("glDrawBuffersARB")
+ void glDrawBuffersARB(@Constant("1") @GLsizei int size, @Constant(value = "APIUtils.getBufferInt().put(0, buffer), 0", keepParam = true) int buffer);
+}
diff --git a/src/templates/org/lwjgl/opengl/ARB_draw_indirect.java b/src/templates/org/lwjgl/opengl/ARB_draw_indirect.java
index 86cd3db..0e40a93 100644
--- a/src/templates/org/lwjgl/opengl/ARB_draw_indirect.java
+++ b/src/templates/org/lwjgl/opengl/ARB_draw_indirect.java
@@ -1,61 +1,61 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.IntBuffer;
-
-import com.sun.mirror.type.PrimitiveType;
-
-public interface ARB_draw_indirect {
-
- /**
- * Accepted by the <target> parameters of BindBuffer, BufferData,
- * BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData,
- * GetBufferPointerv, MapBufferRange, FlushMappedBufferRange,
- * GetBufferParameteriv, BindBufferRange, BindBufferBase, and
- * CopyBufferSubData:
- */
- int GL_DRAW_INDIRECT_BUFFER = 0x8F3F;
-
- /**
- * Accepted by the <value> parameter of GetIntegerv, GetBooleanv, GetFloatv,
- * and GetDoublev:
- */
- int GL_DRAW_INDIRECT_BUFFER_BINDING = 0x8F43;
-
- void glDrawArraysIndirect(@GLenum int mode, @BufferObject(BufferKind.IndirectBO) @Check("4") @NullTerminated @Const @GLvoid(PrimitiveType.Kind.INT) IntBuffer indirect);
-
- void glDrawElementsIndirect(@GLenum int mode, @GLenum int type, @BufferObject(BufferKind.IndirectBO) @Check("5") @NullTerminated @Const @GLvoid(PrimitiveType.Kind.INT) IntBuffer indirect);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.IntBuffer;
+
+import com.sun.mirror.type.PrimitiveType;
+
+public interface ARB_draw_indirect {
+
+ /**
+ * Accepted by the <target> parameters of BindBuffer, BufferData,
+ * BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData,
+ * GetBufferPointerv, MapBufferRange, FlushMappedBufferRange,
+ * GetBufferParameteriv, BindBufferRange, BindBufferBase, and
+ * CopyBufferSubData:
+ */
+ int GL_DRAW_INDIRECT_BUFFER = 0x8F3F;
+
+ /**
+ * Accepted by the <value> parameter of GetIntegerv, GetBooleanv, GetFloatv,
+ * and GetDoublev:
+ */
+ int GL_DRAW_INDIRECT_BUFFER_BINDING = 0x8F43;
+
+ void glDrawArraysIndirect(@GLenum int mode, @BufferObject(BufferKind.IndirectBO) @Check("4") @NullTerminated @Const @GLvoid(PrimitiveType.Kind.INT) IntBuffer indirect);
+
+ void glDrawElementsIndirect(@GLenum int mode, @GLenum int type, @BufferObject(BufferKind.IndirectBO) @Check("5") @NullTerminated @Const @GLvoid(PrimitiveType.Kind.INT) IntBuffer indirect);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_draw_instanced.java b/src/templates/org/lwjgl/opengl/ARB_draw_instanced.java
index 6fba717..3174191 100644
--- a/src/templates/org/lwjgl/opengl/ARB_draw_instanced.java
+++ b/src/templates/org/lwjgl/opengl/ARB_draw_instanced.java
@@ -1,49 +1,49 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.Buffer;
-
-public interface ARB_draw_instanced {
-
- void glDrawArraysInstancedARB(@GLenum int mode, int first, @GLsizei int count, @GLsizei int primcount);
-
- void glDrawElementsInstancedARB(@GLenum int mode, @AutoSize("indices") @GLsizei int count, @AutoType("indices") @GLenum int type,
- @BufferObject(BufferKind.ElementVBO)
- @Const
- @GLubyte
- @GLushort
- @GLuint Buffer indices, @GLsizei int primcount);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.Buffer;
+
+public interface ARB_draw_instanced {
+
+ void glDrawArraysInstancedARB(@GLenum int mode, int first, @GLsizei int count, @GLsizei int primcount);
+
+ void glDrawElementsInstancedARB(@GLenum int mode, @AutoSize("indices") @GLsizei int count, @AutoType("indices") @GLenum int type,
+ @BufferObject(BufferKind.ElementVBO)
+ @Const
+ @GLubyte
+ @GLushort
+ @GLuint Buffer indices, @GLsizei int primcount);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_explicit_attrib_location.java b/src/templates/org/lwjgl/opengl/ARB_explicit_attrib_location.java
index 07617df..f861a62 100644
--- a/src/templates/org/lwjgl/opengl/ARB_explicit_attrib_location.java
+++ b/src/templates/org/lwjgl/opengl/ARB_explicit_attrib_location.java
@@ -1,35 +1,35 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_explicit_attrib_location {
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_explicit_attrib_location {
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_fragment_coord_conventions.java b/src/templates/org/lwjgl/opengl/ARB_fragment_coord_conventions.java
index d4eedab..6a10c0b 100644
--- a/src/templates/org/lwjgl/opengl/ARB_fragment_coord_conventions.java
+++ b/src/templates/org/lwjgl/opengl/ARB_fragment_coord_conventions.java
@@ -1,35 +1,35 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_fragment_coord_conventions {
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_fragment_coord_conventions {
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_fragment_program.java b/src/templates/org/lwjgl/opengl/ARB_fragment_program.java
index cc767c9..c31fa29 100644
--- a/src/templates/org/lwjgl/opengl/ARB_fragment_program.java
+++ b/src/templates/org/lwjgl/opengl/ARB_fragment_program.java
@@ -1,69 +1,69 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_fragment_program extends ARB_program {
-
- /**
- * Accepted by the <cap> parameter of Disable, Enable, and IsEnabled, by the
- * <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev,
- * and by the <target> parameter of ProgramStringARB, BindProgramARB,
- * ProgramEnvParameter4[df][v]ARB, ProgramLocalParameter4[df][v]ARB,
- * GetProgramEnvParameter[df]vARB, GetProgramLocalParameter[df]vARB,
- * GetProgramivARB and GetProgramStringARB.
- */
- int GL_FRAGMENT_PROGRAM_ARB = 0x8804;
-
- /**
- * Accepted by the <pname> parameter of GetProgramivARB:
- */
- int GL_PROGRAM_ALU_INSTRUCTIONS_ARB = 0x8805;
- int GL_PROGRAM_TEX_INSTRUCTIONS_ARB = 0x8806;
- int GL_PROGRAM_TEX_INDIRECTIONS_ARB = 0x8807;
- int GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB = 0x8808;
- int GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = 0x8809;
- int GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB = 0x880A;
- int GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB = 0x880B;
- int GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB = 0x880C;
- int GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB = 0x880D;
- int GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB = 0x880E;
- int GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = 0x880F;
- int GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB = 0x8810;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
- * and GetDoublev:
- */
- int GL_MAX_TEXTURE_COORDS_ARB = 0x8871;
- int GL_MAX_TEXTURE_IMAGE_UNITS_ARB = 0x8872;
-}
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_fragment_program extends ARB_program {
+
+ /**
+ * Accepted by the <cap> parameter of Disable, Enable, and IsEnabled, by the
+ * <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev,
+ * and by the <target> parameter of ProgramStringARB, BindProgramARB,
+ * ProgramEnvParameter4[df][v]ARB, ProgramLocalParameter4[df][v]ARB,
+ * GetProgramEnvParameter[df]vARB, GetProgramLocalParameter[df]vARB,
+ * GetProgramivARB and GetProgramStringARB.
+ */
+ int GL_FRAGMENT_PROGRAM_ARB = 0x8804;
+
+ /**
+ * Accepted by the <pname> parameter of GetProgramivARB:
+ */
+ int GL_PROGRAM_ALU_INSTRUCTIONS_ARB = 0x8805;
+ int GL_PROGRAM_TEX_INSTRUCTIONS_ARB = 0x8806;
+ int GL_PROGRAM_TEX_INDIRECTIONS_ARB = 0x8807;
+ int GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB = 0x8808;
+ int GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = 0x8809;
+ int GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB = 0x880A;
+ int GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB = 0x880B;
+ int GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB = 0x880C;
+ int GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB = 0x880D;
+ int GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB = 0x880E;
+ int GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = 0x880F;
+ int GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB = 0x8810;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
+ * and GetDoublev:
+ */
+ int GL_MAX_TEXTURE_COORDS_ARB = 0x8871;
+ int GL_MAX_TEXTURE_IMAGE_UNITS_ARB = 0x8872;
+}
+
diff --git a/src/templates/org/lwjgl/opengl/ARB_fragment_program_shadow.java b/src/templates/org/lwjgl/opengl/ARB_fragment_program_shadow.java
index 1900de0..458345c 100644
--- a/src/templates/org/lwjgl/opengl/ARB_fragment_program_shadow.java
+++ b/src/templates/org/lwjgl/opengl/ARB_fragment_program_shadow.java
@@ -1,36 +1,36 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_fragment_program_shadow {
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_fragment_program_shadow {
+
+}
diff --git a/src/templates/org/lwjgl/opengl/ARB_fragment_shader.java b/src/templates/org/lwjgl/opengl/ARB_fragment_shader.java
index 85fb0c2..0babcb3 100644
--- a/src/templates/org/lwjgl/opengl/ARB_fragment_shader.java
+++ b/src/templates/org/lwjgl/opengl/ARB_fragment_shader.java
@@ -1,55 +1,55 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_fragment_shader {
-
- /**
- * Accepted by the <shaderType> argument of CreateShaderObjectARB and
- * returned by the <params> parameter of GetObjectParameter{fi}vARB:
- */
- int GL_FRAGMENT_SHADER_ARB = 0x8B30;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv, and GetDoublev:
- */
- int GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB = 0x8B49;
- int GL_MAX_TEXTURE_COORDS_ARB = 0x8871;
- int GL_MAX_TEXTURE_IMAGE_UNITS_ARB = 0x8872;
-
- /**
- * Accepted by the <target> parameter of Hint and the <pname> parameter of
- * GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev:
- */
- int GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB = 0x8B8B;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_fragment_shader {
+
+ /**
+ * Accepted by the <shaderType> argument of CreateShaderObjectARB and
+ * returned by the <params> parameter of GetObjectParameter{fi}vARB:
+ */
+ int GL_FRAGMENT_SHADER_ARB = 0x8B30;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, and GetDoublev:
+ */
+ int GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB = 0x8B49;
+ int GL_MAX_TEXTURE_COORDS_ARB = 0x8871;
+ int GL_MAX_TEXTURE_IMAGE_UNITS_ARB = 0x8872;
+
+ /**
+ * Accepted by the <target> parameter of Hint and the <pname> parameter of
+ * GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev:
+ */
+ int GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB = 0x8B8B;
+}
diff --git a/src/templates/org/lwjgl/opengl/ARB_framebuffer_object.java b/src/templates/org/lwjgl/opengl/ARB_framebuffer_object.java
index 51a34f1..4ba3cc2 100644
--- a/src/templates/org/lwjgl/opengl/ARB_framebuffer_object.java
+++ b/src/templates/org/lwjgl/opengl/ARB_framebuffer_object.java
@@ -1,267 +1,267 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.IntBuffer;
-
- at Extension(postfix = "")
-public interface ARB_framebuffer_object {
-
- /**
- * Accepted by the <target> parameter of BindFramebuffer,
- * CheckFramebufferStatus, FramebufferTexture{1D|2D|3D},
- * FramebufferRenderbuffer, and
- * GetFramebufferAttachmentParameteriv:
- */
- int GL_FRAMEBUFFER = 0x8D40;
- int GL_READ_FRAMEBUFFER = 0x8CA8;
- int GL_DRAW_FRAMEBUFFER = 0x8CA9;
-
- /**
- * Accepted by the <target> parameter of BindRenderbuffer,
- * RenderbufferStorage, and GetRenderbufferParameteriv, and
- * returned by GetFramebufferAttachmentParameteriv:
- */
- int GL_RENDERBUFFER = 0x8D41;
-
- /**
- * Accepted by the <internalformat> parameter of
- * RenderbufferStorage:
- */
- int GL_STENCIL_INDEX1 = 0x8D46;
- int GL_STENCIL_INDEX4 = 0x8D47;
- int GL_STENCIL_INDEX8 = 0x8D48;
- int GL_STENCIL_INDEX16 = 0x8D49;
-
- /** Accepted by the <pname> parameter of GetRenderbufferParameteriv: */
- int GL_RENDERBUFFER_WIDTH = 0x8D42;
- int GL_RENDERBUFFER_HEIGHT = 0x8D43;
- int GL_RENDERBUFFER_INTERNAL_FORMAT = 0x8D44;
- int GL_RENDERBUFFER_RED_SIZE = 0x8D50;
- int GL_RENDERBUFFER_GREEN_SIZE = 0x8D51;
- int GL_RENDERBUFFER_BLUE_SIZE = 0x8D52;
- int GL_RENDERBUFFER_ALPHA_SIZE = 0x8D53;
- int GL_RENDERBUFFER_DEPTH_SIZE = 0x8D54;
- int GL_RENDERBUFFER_STENCIL_SIZE = 0x8D55;
- int GL_RENDERBUFFER_SAMPLES = 0x8CAB;
-
- /**
- * Accepted by the <pname> parameter of
- * GetFramebufferAttachmentParameteriv:
- */
- int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0;
- int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1;
- int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2;
- int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3;
- int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 0x8CD4;
- int GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 0x8210;
- int GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 0x8211;
- int GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE = 0x8212;
- int GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 0x8213;
- int GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 0x8214;
- int GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 0x8215;
- int GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 0x8216;
- int GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 0x8217;
-
- /** Returned in <params> by GetFramebufferAttachmentParameteriv: */
- int GL_SRGB = 0x8C40;
- int GL_UNSIGNED_NORMALIZED = 0x8C17;
- int GL_FRAMEBUFFER_DEFAULT = 0x8218;
- int GL_INDEX = 0x8222;
-
- /**
- * Accepted by the <attachment> parameter of
- * FramebufferTexture{1D|2D|3D}, FramebufferRenderbuffer, and
- * GetFramebufferAttachmentParameteriv
- */
- int GL_COLOR_ATTACHMENT0 = 0x8CE0;
- int GL_COLOR_ATTACHMENT1 = 0x8CE1;
- int GL_COLOR_ATTACHMENT2 = 0x8CE2;
- int GL_COLOR_ATTACHMENT3 = 0x8CE3;
- int GL_COLOR_ATTACHMENT4 = 0x8CE4;
- int GL_COLOR_ATTACHMENT5 = 0x8CE5;
- int GL_COLOR_ATTACHMENT6 = 0x8CE6;
- int GL_COLOR_ATTACHMENT7 = 0x8CE7;
- int GL_COLOR_ATTACHMENT8 = 0x8CE8;
- int GL_COLOR_ATTACHMENT9 = 0x8CE9;
- int GL_COLOR_ATTACHMENT10 = 0x8CEA;
- int GL_COLOR_ATTACHMENT11 = 0x8CEB;
- int GL_COLOR_ATTACHMENT12 = 0x8CEC;
- int GL_COLOR_ATTACHMENT13 = 0x8CED;
- int GL_COLOR_ATTACHMENT14 = 0x8CEE;
- int GL_COLOR_ATTACHMENT15 = 0x8CEF;
- int GL_DEPTH_ATTACHMENT = 0x8D00;
- int GL_STENCIL_ATTACHMENT = 0x8D20;
- int GL_DEPTH_STENCIL_ATTACHMENT = 0x821A;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv, and GetDoublev:
- */
- int GL_MAX_SAMPLES = 0x8D57;
-
- /** Returned by CheckFramebufferStatus(): */
- int GL_FRAMEBUFFER_COMPLETE = 0x8CD5;
- int GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6;
- int GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7;
- int GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER = 0x8CDB;
- int GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER = 0x8CDC;
- int GL_FRAMEBUFFER_UNSUPPORTED = 0x8CDD;
- int GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0x8D56;
- int GL_FRAMEBUFFER_UNDEFINED = 0x8219;
-
- /**
- * Accepted by the <pname> parameters of GetIntegerv, GetFloatv,
- * and GetDoublev:
- */
- int GL_FRAMEBUFFER_BINDING = 0x8CA6; // alias DRAW_FRAMEBUFFER_BINDING
- int GL_DRAW_FRAMEBUFFER_BINDING = 0x8CA6;
- int GL_READ_FRAMEBUFFER_BINDING = 0x8CAA;
- int GL_RENDERBUFFER_BINDING = 0x8CA7;
- int GL_MAX_COLOR_ATTACHMENTS = 0x8CDF;
- int GL_MAX_RENDERBUFFER_SIZE = 0x84E8;
-
- /** Returned by GetError(): */
- int GL_INVALID_FRAMEBUFFER_OPERATION = 0x0506;
-
- /**
- * Accepted by the <format> parameter of DrawPixels, ReadPixels,
- * TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D,
- * TexSubImage3D, and GetTexImage, by the <type> parameter of
- * CopyPixels, by the <internalformat> parameter of TexImage1D,
- * TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D, and
- * RenderbufferStorage, and returned in the <data> parameter of
- * GetTexLevelParameter and GetRenderbufferParameteriv:
- */
- int GL_DEPTH_STENCIL = 0x84F9;
-
- /**
- * Accepted by the <type> parameter of DrawPixels, ReadPixels,
- * TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D,
- * TexSubImage3D, and GetTexImage:
- */
- int GL_UNSIGNED_INT_24_8 = 0x84FA;
-
- /**
- * Accepted by the <internalformat> parameter of TexImage1D,
- * TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D, and
- * RenderbufferStorage, and returned in the <data> parameter of
- * GetTexLevelParameter and GetRenderbufferParameteriv:
- */
- int GL_DEPTH24_STENCIL8 = 0x88F0;
-
- /** Accepted by the <value> parameter of GetTexLevelParameter: */
- int GL_TEXTURE_STENCIL_SIZE = 0x88F1;
-
- boolean glIsRenderbuffer(@GLuint int renderbuffer);
-
- void glBindRenderbuffer(@GLenum int target, @GLuint int renderbuffer);
-
- void glDeleteRenderbuffers(@AutoSize("renderbuffers") @GLsizei int n, @Const @GLuint IntBuffer renderbuffers);
-
- @Alternate("glDeleteRenderbuffers")
- void glDeleteRenderbuffers(@Constant("1") @GLsizei int n, @Constant(value = "APIUtils.getBufferInt().put(0, renderbuffer), 0", keepParam = true) int renderbuffer);
-
- void glGenRenderbuffers(@AutoSize("renderbuffers") @GLsizei int n, @OutParameter @GLuint IntBuffer renderbuffers);
-
- @Alternate("glGenRenderbuffers")
- @GLreturn("renderbuffers")
- void glGenRenderbuffers2(@Constant("1") @GLsizei int n, @OutParameter @GLuint IntBuffer renderbuffers);
-
- void glRenderbufferStorage(@GLenum int target, @GLenum int internalformat,
- @GLsizei int width, @GLsizei int height);
-
- void glRenderbufferStorageMultisample(@GLenum int target, @GLsizei int samples,
- @GLenum int internalformat,
- @GLsizei int width, @GLsizei int height);
-
- @StripPostfix("params")
- void glGetRenderbufferParameteriv(@GLenum int target, @GLenum int pname, @Check("4") @OutParameter IntBuffer params);
-
- @Alternate("glGetRenderbufferParameteriv")
- @GLreturn("params")
- @StripPostfix("params")
- void glGetRenderbufferParameteriv2(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params);
-
- boolean glIsFramebuffer(@GLuint int framebuffer);
-
- void glBindFramebuffer(@GLenum int target, @GLuint int framebuffer);
-
- void glDeleteFramebuffers(@AutoSize("framebuffers") @GLsizei int n, @Const @GLuint IntBuffer framebuffers);
-
- @Alternate("glDeleteFramebuffers")
- void glDeleteFramebuffers(@Constant("1") @GLsizei int n, @Constant(value = "APIUtils.getBufferInt().put(0, framebuffer), 0", keepParam = true) int framebuffer);
-
- void glGenFramebuffers(@AutoSize("framebuffers") @GLsizei int n, @OutParameter @GLuint IntBuffer framebuffers);
-
- @Alternate("glGenFramebuffers")
- @GLreturn("framebuffers")
- void glGenFramebuffers2(@Constant("1") @GLsizei int n, @OutParameter @GLuint IntBuffer framebuffers);
-
- @GLenum
- int glCheckFramebufferStatus(@GLenum int target);
-
- void glFramebufferTexture1D(@GLenum int target, @GLenum int attachment,
- @GLenum int textarget, @GLuint int texture, int level);
-
- void glFramebufferTexture2D(@GLenum int target, @GLenum int attachment,
- @GLenum int textarget, @GLuint int texture, int level);
-
- void glFramebufferTexture3D(@GLenum int target, @GLenum int attachment,
- @GLenum int textarget, @GLuint int texture,
- int level, int layer);
-
- void glFramebufferTextureLayer(@GLenum int target, @GLenum int attachment,
- @GLuint int texture, int level, int layer);
-
- void glFramebufferRenderbuffer(@GLenum int target, @GLenum int attachment,
- @GLenum int renderbuffertarget, @GLuint int renderbuffer);
-
- @StripPostfix("params")
- void glGetFramebufferAttachmentParameteriv(@GLenum int target, @GLenum int attachment,
- @GLenum int pname, @Check("4") @OutParameter IntBuffer params);
-
- @Alternate("glGetFramebufferAttachmentParameteriv")
- @GLreturn("params")
- @StripPostfix("params")
- void glGetFramebufferAttachmentParameteriv2(@GLenum int target, @GLenum int attachment,
- @GLenum int pname, @OutParameter IntBuffer params);
-
- void glBlitFramebuffer(int srcX0, int srcY0, int srcX1, int srcY1,
- int dstX0, int dstY0, int dstX1, int dstY1,
- @GLbitfield int mask, @GLenum int filter);
-
- void glGenerateMipmap(@GLenum int target);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.IntBuffer;
+
+ at Extension(postfix = "")
+public interface ARB_framebuffer_object {
+
+ /**
+ * Accepted by the <target> parameter of BindFramebuffer,
+ * CheckFramebufferStatus, FramebufferTexture{1D|2D|3D},
+ * FramebufferRenderbuffer, and
+ * GetFramebufferAttachmentParameteriv:
+ */
+ int GL_FRAMEBUFFER = 0x8D40;
+ int GL_READ_FRAMEBUFFER = 0x8CA8;
+ int GL_DRAW_FRAMEBUFFER = 0x8CA9;
+
+ /**
+ * Accepted by the <target> parameter of BindRenderbuffer,
+ * RenderbufferStorage, and GetRenderbufferParameteriv, and
+ * returned by GetFramebufferAttachmentParameteriv:
+ */
+ int GL_RENDERBUFFER = 0x8D41;
+
+ /**
+ * Accepted by the <internalformat> parameter of
+ * RenderbufferStorage:
+ */
+ int GL_STENCIL_INDEX1 = 0x8D46;
+ int GL_STENCIL_INDEX4 = 0x8D47;
+ int GL_STENCIL_INDEX8 = 0x8D48;
+ int GL_STENCIL_INDEX16 = 0x8D49;
+
+ /** Accepted by the <pname> parameter of GetRenderbufferParameteriv: */
+ int GL_RENDERBUFFER_WIDTH = 0x8D42;
+ int GL_RENDERBUFFER_HEIGHT = 0x8D43;
+ int GL_RENDERBUFFER_INTERNAL_FORMAT = 0x8D44;
+ int GL_RENDERBUFFER_RED_SIZE = 0x8D50;
+ int GL_RENDERBUFFER_GREEN_SIZE = 0x8D51;
+ int GL_RENDERBUFFER_BLUE_SIZE = 0x8D52;
+ int GL_RENDERBUFFER_ALPHA_SIZE = 0x8D53;
+ int GL_RENDERBUFFER_DEPTH_SIZE = 0x8D54;
+ int GL_RENDERBUFFER_STENCIL_SIZE = 0x8D55;
+ int GL_RENDERBUFFER_SAMPLES = 0x8CAB;
+
+ /**
+ * Accepted by the <pname> parameter of
+ * GetFramebufferAttachmentParameteriv:
+ */
+ int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0;
+ int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1;
+ int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2;
+ int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3;
+ int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 0x8CD4;
+ int GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 0x8210;
+ int GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 0x8211;
+ int GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE = 0x8212;
+ int GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 0x8213;
+ int GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 0x8214;
+ int GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 0x8215;
+ int GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 0x8216;
+ int GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 0x8217;
+
+ /** Returned in <params> by GetFramebufferAttachmentParameteriv: */
+ int GL_SRGB = 0x8C40;
+ int GL_UNSIGNED_NORMALIZED = 0x8C17;
+ int GL_FRAMEBUFFER_DEFAULT = 0x8218;
+ int GL_INDEX = 0x8222;
+
+ /**
+ * Accepted by the <attachment> parameter of
+ * FramebufferTexture{1D|2D|3D}, FramebufferRenderbuffer, and
+ * GetFramebufferAttachmentParameteriv
+ */
+ int GL_COLOR_ATTACHMENT0 = 0x8CE0;
+ int GL_COLOR_ATTACHMENT1 = 0x8CE1;
+ int GL_COLOR_ATTACHMENT2 = 0x8CE2;
+ int GL_COLOR_ATTACHMENT3 = 0x8CE3;
+ int GL_COLOR_ATTACHMENT4 = 0x8CE4;
+ int GL_COLOR_ATTACHMENT5 = 0x8CE5;
+ int GL_COLOR_ATTACHMENT6 = 0x8CE6;
+ int GL_COLOR_ATTACHMENT7 = 0x8CE7;
+ int GL_COLOR_ATTACHMENT8 = 0x8CE8;
+ int GL_COLOR_ATTACHMENT9 = 0x8CE9;
+ int GL_COLOR_ATTACHMENT10 = 0x8CEA;
+ int GL_COLOR_ATTACHMENT11 = 0x8CEB;
+ int GL_COLOR_ATTACHMENT12 = 0x8CEC;
+ int GL_COLOR_ATTACHMENT13 = 0x8CED;
+ int GL_COLOR_ATTACHMENT14 = 0x8CEE;
+ int GL_COLOR_ATTACHMENT15 = 0x8CEF;
+ int GL_DEPTH_ATTACHMENT = 0x8D00;
+ int GL_STENCIL_ATTACHMENT = 0x8D20;
+ int GL_DEPTH_STENCIL_ATTACHMENT = 0x821A;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, and GetDoublev:
+ */
+ int GL_MAX_SAMPLES = 0x8D57;
+
+ /** Returned by CheckFramebufferStatus(): */
+ int GL_FRAMEBUFFER_COMPLETE = 0x8CD5;
+ int GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6;
+ int GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7;
+ int GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER = 0x8CDB;
+ int GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER = 0x8CDC;
+ int GL_FRAMEBUFFER_UNSUPPORTED = 0x8CDD;
+ int GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0x8D56;
+ int GL_FRAMEBUFFER_UNDEFINED = 0x8219;
+
+ /**
+ * Accepted by the <pname> parameters of GetIntegerv, GetFloatv,
+ * and GetDoublev:
+ */
+ int GL_FRAMEBUFFER_BINDING = 0x8CA6; // alias DRAW_FRAMEBUFFER_BINDING
+ int GL_DRAW_FRAMEBUFFER_BINDING = 0x8CA6;
+ int GL_READ_FRAMEBUFFER_BINDING = 0x8CAA;
+ int GL_RENDERBUFFER_BINDING = 0x8CA7;
+ int GL_MAX_COLOR_ATTACHMENTS = 0x8CDF;
+ int GL_MAX_RENDERBUFFER_SIZE = 0x84E8;
+
+ /** Returned by GetError(): */
+ int GL_INVALID_FRAMEBUFFER_OPERATION = 0x0506;
+
+ /**
+ * Accepted by the <format> parameter of DrawPixels, ReadPixels,
+ * TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D,
+ * TexSubImage3D, and GetTexImage, by the <type> parameter of
+ * CopyPixels, by the <internalformat> parameter of TexImage1D,
+ * TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D, and
+ * RenderbufferStorage, and returned in the <data> parameter of
+ * GetTexLevelParameter and GetRenderbufferParameteriv:
+ */
+ int GL_DEPTH_STENCIL = 0x84F9;
+
+ /**
+ * Accepted by the <type> parameter of DrawPixels, ReadPixels,
+ * TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D,
+ * TexSubImage3D, and GetTexImage:
+ */
+ int GL_UNSIGNED_INT_24_8 = 0x84FA;
+
+ /**
+ * Accepted by the <internalformat> parameter of TexImage1D,
+ * TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D, and
+ * RenderbufferStorage, and returned in the <data> parameter of
+ * GetTexLevelParameter and GetRenderbufferParameteriv:
+ */
+ int GL_DEPTH24_STENCIL8 = 0x88F0;
+
+ /** Accepted by the <value> parameter of GetTexLevelParameter: */
+ int GL_TEXTURE_STENCIL_SIZE = 0x88F1;
+
+ boolean glIsRenderbuffer(@GLuint int renderbuffer);
+
+ void glBindRenderbuffer(@GLenum int target, @GLuint int renderbuffer);
+
+ void glDeleteRenderbuffers(@AutoSize("renderbuffers") @GLsizei int n, @Const @GLuint IntBuffer renderbuffers);
+
+ @Alternate("glDeleteRenderbuffers")
+ void glDeleteRenderbuffers(@Constant("1") @GLsizei int n, @Constant(value = "APIUtils.getBufferInt().put(0, renderbuffer), 0", keepParam = true) int renderbuffer);
+
+ void glGenRenderbuffers(@AutoSize("renderbuffers") @GLsizei int n, @OutParameter @GLuint IntBuffer renderbuffers);
+
+ @Alternate("glGenRenderbuffers")
+ @GLreturn("renderbuffers")
+ void glGenRenderbuffers2(@Constant("1") @GLsizei int n, @OutParameter @GLuint IntBuffer renderbuffers);
+
+ void glRenderbufferStorage(@GLenum int target, @GLenum int internalformat,
+ @GLsizei int width, @GLsizei int height);
+
+ void glRenderbufferStorageMultisample(@GLenum int target, @GLsizei int samples,
+ @GLenum int internalformat,
+ @GLsizei int width, @GLsizei int height);
+
+ @StripPostfix("params")
+ void glGetRenderbufferParameteriv(@GLenum int target, @GLenum int pname, @Check("4") @OutParameter IntBuffer params);
+
+ @Alternate("glGetRenderbufferParameteriv")
+ @GLreturn("params")
+ @StripPostfix("params")
+ void glGetRenderbufferParameteriv2(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params);
+
+ boolean glIsFramebuffer(@GLuint int framebuffer);
+
+ void glBindFramebuffer(@GLenum int target, @GLuint int framebuffer);
+
+ void glDeleteFramebuffers(@AutoSize("framebuffers") @GLsizei int n, @Const @GLuint IntBuffer framebuffers);
+
+ @Alternate("glDeleteFramebuffers")
+ void glDeleteFramebuffers(@Constant("1") @GLsizei int n, @Constant(value = "APIUtils.getBufferInt().put(0, framebuffer), 0", keepParam = true) int framebuffer);
+
+ void glGenFramebuffers(@AutoSize("framebuffers") @GLsizei int n, @OutParameter @GLuint IntBuffer framebuffers);
+
+ @Alternate("glGenFramebuffers")
+ @GLreturn("framebuffers")
+ void glGenFramebuffers2(@Constant("1") @GLsizei int n, @OutParameter @GLuint IntBuffer framebuffers);
+
+ @GLenum
+ int glCheckFramebufferStatus(@GLenum int target);
+
+ void glFramebufferTexture1D(@GLenum int target, @GLenum int attachment,
+ @GLenum int textarget, @GLuint int texture, int level);
+
+ void glFramebufferTexture2D(@GLenum int target, @GLenum int attachment,
+ @GLenum int textarget, @GLuint int texture, int level);
+
+ void glFramebufferTexture3D(@GLenum int target, @GLenum int attachment,
+ @GLenum int textarget, @GLuint int texture,
+ int level, int layer);
+
+ void glFramebufferTextureLayer(@GLenum int target, @GLenum int attachment,
+ @GLuint int texture, int level, int layer);
+
+ void glFramebufferRenderbuffer(@GLenum int target, @GLenum int attachment,
+ @GLenum int renderbuffertarget, @GLuint int renderbuffer);
+
+ @StripPostfix("params")
+ void glGetFramebufferAttachmentParameteriv(@GLenum int target, @GLenum int attachment,
+ @GLenum int pname, @Check("4") @OutParameter IntBuffer params);
+
+ @Alternate("glGetFramebufferAttachmentParameteriv")
+ @GLreturn("params")
+ @StripPostfix("params")
+ void glGetFramebufferAttachmentParameteriv2(@GLenum int target, @GLenum int attachment,
+ @GLenum int pname, @OutParameter IntBuffer params);
+
+ void glBlitFramebuffer(int srcX0, int srcY0, int srcX1, int srcY1,
+ int dstX0, int dstY0, int dstX1, int dstY1,
+ @GLbitfield int mask, @GLenum int filter);
+
+ void glGenerateMipmap(@GLenum int target);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_gpu_shader5.java b/src/templates/org/lwjgl/opengl/ARB_gpu_shader5.java
index 7f2a031..6bdc9fc 100644
--- a/src/templates/org/lwjgl/opengl/ARB_gpu_shader5.java
+++ b/src/templates/org/lwjgl/opengl/ARB_gpu_shader5.java
@@ -1,49 +1,49 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_gpu_shader5 {
-
- /** Accepted by the <pname> parameter of GetProgramiv: */
- int GL_GEOMETRY_SHADER_INVOCATIONS = 0x887F;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
- * GetDoublev, and GetInteger64v:
- */
- int GL_MAX_GEOMETRY_SHADER_INVOCATIONS = 0x8E5A;
- int GL_MIN_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5B;
- int GL_MAX_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5C;
- int GL_FRAGMENT_INTERPOLATION_OFFSET_BITS = 0x8E5D;
- int GL_MAX_VERTEX_STREAMS = 0x8E71;
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_gpu_shader5 {
+
+ /** Accepted by the <pname> parameter of GetProgramiv: */
+ int GL_GEOMETRY_SHADER_INVOCATIONS = 0x887F;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
+ * GetDoublev, and GetInteger64v:
+ */
+ int GL_MAX_GEOMETRY_SHADER_INVOCATIONS = 0x8E5A;
+ int GL_MIN_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5B;
+ int GL_MAX_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5C;
+ int GL_FRAGMENT_INTERPOLATION_OFFSET_BITS = 0x8E5D;
+ int GL_MAX_VERTEX_STREAMS = 0x8E71;
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_gpu_shader_fp64.java b/src/templates/org/lwjgl/opengl/ARB_gpu_shader_fp64.java
index 10557d4..8d6907a 100644
--- a/src/templates/org/lwjgl/opengl/ARB_gpu_shader_fp64.java
+++ b/src/templates/org/lwjgl/opengl/ARB_gpu_shader_fp64.java
@@ -1,176 +1,176 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
- at Dependent
- at Extension(postfix = "")
-public interface ARB_gpu_shader_fp64 {
-
- /**
- * Returned in the <type> parameter of GetActiveUniform, and
- * GetTransformFeedbackVarying:
- */
- int GL_DOUBLE = GL11.GL_DOUBLE;
- int GL_DOUBLE_VEC2 = 0x8FFC;
- int GL_DOUBLE_VEC3 = 0x8FFD;
- int GL_DOUBLE_VEC4 = 0x8FFE;
- int GL_DOUBLE_MAT2 = 0x8F46;
- int GL_DOUBLE_MAT3 = 0x8F47;
- int GL_DOUBLE_MAT4 = 0x8F48;
- int GL_DOUBLE_MAT2x3 = 0x8F49;
- int GL_DOUBLE_MAT2x4 = 0x8F4A;
- int GL_DOUBLE_MAT3x2 = 0x8F4B;
- int GL_DOUBLE_MAT3x4 = 0x8F4C;
- int GL_DOUBLE_MAT4x2 = 0x8F4D;
- int GL_DOUBLE_MAT4x3 = 0x8F4E;
-
- void glUniform1d(int location, double x);
-
- void glUniform2d(int location, double x, double y);
-
- void glUniform3d(int location, double x, double y, double z);
-
- void glUniform4d(int location, double x, double y, double z, double w);
-
- @StripPostfix("value")
- void glUniform1dv(int location, @AutoSize("value") @GLsizei int count, @Const DoubleBuffer value);
-
- @StripPostfix("value")
- void glUniform2dv(int location, @AutoSize(value = "value", expression = " >> 1") @GLsizei int count, @Const DoubleBuffer value);
-
- @StripPostfix("value")
- void glUniform3dv(int location, @AutoSize(value = "value", expression = " / 3") @GLsizei int count, @Const DoubleBuffer value);
-
- @StripPostfix("value")
- void glUniform4dv(int location, @AutoSize(value = "value", expression = " >> 2") @GLsizei int count, @Const DoubleBuffer value);
-
- @StripPostfix("value")
- void glUniformMatrix2dv(int location, @AutoSize(value = "value", expression = " >> 2") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
-
- @StripPostfix("value")
- void glUniformMatrix3dv(int location, @AutoSize(value = "value", expression = " / (3 * 3)") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
-
- @StripPostfix("value")
- void glUniformMatrix4dv(int location, @AutoSize(value = "value", expression = " >> 4") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
-
- @StripPostfix("value")
- void glUniformMatrix2x3dv(int location, @AutoSize(value = "value", expression = " / (2 * 3)") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
-
- @StripPostfix("value")
- void glUniformMatrix2x4dv(int location, @AutoSize(value = "value", expression = " >> 3") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
-
- @StripPostfix("value")
- void glUniformMatrix3x2dv(int location, @AutoSize(value = "value", expression = " / (3 * 2)") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
-
- @StripPostfix("value")
- void glUniformMatrix3x4dv(int location, @AutoSize(value = "value", expression = " / (3 * 4)") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
-
- @StripPostfix("value")
- void glUniformMatrix4x2dv(int location, @AutoSize(value = "value", expression = " >> 3") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
-
- @StripPostfix("value")
- void glUniformMatrix4x3dv(int location, @AutoSize(value = "value", expression = " / (4 * 3)") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
-
- @StripPostfix("params")
- void glGetUniformdv(@GLuint int program, int location, @OutParameter @Check DoubleBuffer params);
-
- // ----
-
- @Dependent("GL_EXT_direct_state_access")
- void glProgramUniform1dEXT(@GLuint int program, int location, double x);
-
- @Dependent("GL_EXT_direct_state_access")
- void glProgramUniform2dEXT(@GLuint int program, int location, double x, double y);
-
- @Dependent("GL_EXT_direct_state_access")
- void glProgramUniform3dEXT(@GLuint int program, int location, double x, double y, double z);
-
- @Dependent("GL_EXT_direct_state_access")
- void glProgramUniform4dEXT(@GLuint int program, int location, double x, double y, double z, double w);
-
- @Dependent("GL_EXT_direct_state_access")
- @StripPostfix(value="value", extension="EXT")
- void glProgramUniform1dvEXT(@GLuint int program, int location, @AutoSize(value = "value") @GLsizei int count, @Const DoubleBuffer value);
-
- @Dependent("GL_EXT_direct_state_access")
- @StripPostfix(value = "value", extension = "EXT")
- void glProgramUniform2dvEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " >> 1") @GLsizei int count, @Const DoubleBuffer value);
-
- @Dependent("GL_EXT_direct_state_access")
- @StripPostfix(value = "value", extension = "EXT")
- void glProgramUniform3dvEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " / 3") @GLsizei int count, @Const DoubleBuffer value);
-
- @Dependent("GL_EXT_direct_state_access")
- @StripPostfix(value = "value", extension = "EXT")
- void glProgramUniform4dvEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " >> 2") @GLsizei int count, @Const DoubleBuffer value);
-
- @Dependent("GL_EXT_direct_state_access")
- @StripPostfix(value = "value", extension = "EXT")
- void glProgramUniformMatrix2dvEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " >> 2") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
-
- @Dependent("GL_EXT_direct_state_access")
- @StripPostfix(value = "value", extension = "EXT")
- void glProgramUniformMatrix3dvEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " / (3 * 3)") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
-
- @Dependent("GL_EXT_direct_state_access")
- @StripPostfix(value = "value", extension = "EXT")
- void glProgramUniformMatrix4dvEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " >> 4") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
-
- @Dependent("GL_EXT_direct_state_access")
- @StripPostfix(value = "value", extension = "EXT")
- void glProgramUniformMatrix2x3dvEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " / (2 * 3)") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
-
- @Dependent("GL_EXT_direct_state_access")
- @StripPostfix(value = "value", extension = "EXT")
- void glProgramUniformMatrix2x4dvEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " >> 3") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
-
- @Dependent("GL_EXT_direct_state_access")
- @StripPostfix(value = "value", extension = "EXT")
- void glProgramUniformMatrix3x2dvEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " / (3 * 2)") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
-
- @Dependent("GL_EXT_direct_state_access")
- @StripPostfix(value = "value", extension = "EXT")
- void glProgramUniformMatrix3x4dvEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " / (3 * 4)") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
-
- @Dependent("GL_EXT_direct_state_access")
- @StripPostfix(value = "value", extension = "EXT")
- void glProgramUniformMatrix4x2dvEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " >> 3") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
-
- @Dependent("GL_EXT_direct_state_access")
- @StripPostfix(value = "value", extension = "EXT")
- void glProgramUniformMatrix4x3dvEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " / (4 * 3)") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+ at Dependent
+ at Extension(postfix = "")
+public interface ARB_gpu_shader_fp64 {
+
+ /**
+ * Returned in the <type> parameter of GetActiveUniform, and
+ * GetTransformFeedbackVarying:
+ */
+ int GL_DOUBLE = GL11.GL_DOUBLE;
+ int GL_DOUBLE_VEC2 = 0x8FFC;
+ int GL_DOUBLE_VEC3 = 0x8FFD;
+ int GL_DOUBLE_VEC4 = 0x8FFE;
+ int GL_DOUBLE_MAT2 = 0x8F46;
+ int GL_DOUBLE_MAT3 = 0x8F47;
+ int GL_DOUBLE_MAT4 = 0x8F48;
+ int GL_DOUBLE_MAT2x3 = 0x8F49;
+ int GL_DOUBLE_MAT2x4 = 0x8F4A;
+ int GL_DOUBLE_MAT3x2 = 0x8F4B;
+ int GL_DOUBLE_MAT3x4 = 0x8F4C;
+ int GL_DOUBLE_MAT4x2 = 0x8F4D;
+ int GL_DOUBLE_MAT4x3 = 0x8F4E;
+
+ void glUniform1d(int location, double x);
+
+ void glUniform2d(int location, double x, double y);
+
+ void glUniform3d(int location, double x, double y, double z);
+
+ void glUniform4d(int location, double x, double y, double z, double w);
+
+ @StripPostfix("value")
+ void glUniform1dv(int location, @AutoSize("value") @GLsizei int count, @Const DoubleBuffer value);
+
+ @StripPostfix("value")
+ void glUniform2dv(int location, @AutoSize(value = "value", expression = " >> 1") @GLsizei int count, @Const DoubleBuffer value);
+
+ @StripPostfix("value")
+ void glUniform3dv(int location, @AutoSize(value = "value", expression = " / 3") @GLsizei int count, @Const DoubleBuffer value);
+
+ @StripPostfix("value")
+ void glUniform4dv(int location, @AutoSize(value = "value", expression = " >> 2") @GLsizei int count, @Const DoubleBuffer value);
+
+ @StripPostfix("value")
+ void glUniformMatrix2dv(int location, @AutoSize(value = "value", expression = " >> 2") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
+
+ @StripPostfix("value")
+ void glUniformMatrix3dv(int location, @AutoSize(value = "value", expression = " / (3 * 3)") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
+
+ @StripPostfix("value")
+ void glUniformMatrix4dv(int location, @AutoSize(value = "value", expression = " >> 4") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
+
+ @StripPostfix("value")
+ void glUniformMatrix2x3dv(int location, @AutoSize(value = "value", expression = " / (2 * 3)") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
+
+ @StripPostfix("value")
+ void glUniformMatrix2x4dv(int location, @AutoSize(value = "value", expression = " >> 3") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
+
+ @StripPostfix("value")
+ void glUniformMatrix3x2dv(int location, @AutoSize(value = "value", expression = " / (3 * 2)") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
+
+ @StripPostfix("value")
+ void glUniformMatrix3x4dv(int location, @AutoSize(value = "value", expression = " / (3 * 4)") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
+
+ @StripPostfix("value")
+ void glUniformMatrix4x2dv(int location, @AutoSize(value = "value", expression = " >> 3") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
+
+ @StripPostfix("value")
+ void glUniformMatrix4x3dv(int location, @AutoSize(value = "value", expression = " / (4 * 3)") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
+
+ @StripPostfix("params")
+ void glGetUniformdv(@GLuint int program, int location, @OutParameter @Check DoubleBuffer params);
+
+ // ----
+
+ @Dependent("GL_EXT_direct_state_access")
+ void glProgramUniform1dEXT(@GLuint int program, int location, double x);
+
+ @Dependent("GL_EXT_direct_state_access")
+ void glProgramUniform2dEXT(@GLuint int program, int location, double x, double y);
+
+ @Dependent("GL_EXT_direct_state_access")
+ void glProgramUniform3dEXT(@GLuint int program, int location, double x, double y, double z);
+
+ @Dependent("GL_EXT_direct_state_access")
+ void glProgramUniform4dEXT(@GLuint int program, int location, double x, double y, double z, double w);
+
+ @Dependent("GL_EXT_direct_state_access")
+ @StripPostfix(value="value", extension="EXT")
+ void glProgramUniform1dvEXT(@GLuint int program, int location, @AutoSize(value = "value") @GLsizei int count, @Const DoubleBuffer value);
+
+ @Dependent("GL_EXT_direct_state_access")
+ @StripPostfix(value = "value", extension = "EXT")
+ void glProgramUniform2dvEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " >> 1") @GLsizei int count, @Const DoubleBuffer value);
+
+ @Dependent("GL_EXT_direct_state_access")
+ @StripPostfix(value = "value", extension = "EXT")
+ void glProgramUniform3dvEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " / 3") @GLsizei int count, @Const DoubleBuffer value);
+
+ @Dependent("GL_EXT_direct_state_access")
+ @StripPostfix(value = "value", extension = "EXT")
+ void glProgramUniform4dvEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " >> 2") @GLsizei int count, @Const DoubleBuffer value);
+
+ @Dependent("GL_EXT_direct_state_access")
+ @StripPostfix(value = "value", extension = "EXT")
+ void glProgramUniformMatrix2dvEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " >> 2") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
+
+ @Dependent("GL_EXT_direct_state_access")
+ @StripPostfix(value = "value", extension = "EXT")
+ void glProgramUniformMatrix3dvEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " / (3 * 3)") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
+
+ @Dependent("GL_EXT_direct_state_access")
+ @StripPostfix(value = "value", extension = "EXT")
+ void glProgramUniformMatrix4dvEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " >> 4") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
+
+ @Dependent("GL_EXT_direct_state_access")
+ @StripPostfix(value = "value", extension = "EXT")
+ void glProgramUniformMatrix2x3dvEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " / (2 * 3)") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
+
+ @Dependent("GL_EXT_direct_state_access")
+ @StripPostfix(value = "value", extension = "EXT")
+ void glProgramUniformMatrix2x4dvEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " >> 3") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
+
+ @Dependent("GL_EXT_direct_state_access")
+ @StripPostfix(value = "value", extension = "EXT")
+ void glProgramUniformMatrix3x2dvEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " / (3 * 2)") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
+
+ @Dependent("GL_EXT_direct_state_access")
+ @StripPostfix(value = "value", extension = "EXT")
+ void glProgramUniformMatrix3x4dvEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " / (3 * 4)") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
+
+ @Dependent("GL_EXT_direct_state_access")
+ @StripPostfix(value = "value", extension = "EXT")
+ void glProgramUniformMatrix4x2dvEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " >> 3") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
+
+ @Dependent("GL_EXT_direct_state_access")
+ @StripPostfix(value = "value", extension = "EXT")
+ void glProgramUniformMatrix4x3dvEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " / (4 * 3)") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_half_float_pixel.java b/src/templates/org/lwjgl/opengl/ARB_half_float_pixel.java
index 8aaca95..6a36d72 100644
--- a/src/templates/org/lwjgl/opengl/ARB_half_float_pixel.java
+++ b/src/templates/org/lwjgl/opengl/ARB_half_float_pixel.java
@@ -1,45 +1,45 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_half_float_pixel {
-
- /**
- * Accepted by the <type> parameter of DrawPixels, ReadPixels,
- * TexImage1D, TexImage2D, TexImage3D, GetTexImage, TexSubImage1D,
- * TexSubImage2D, TexSubImage3D, GetHistogram, GetMinmax,
- * ConvolutionFilter1D, ConvolutionFilter2D, GetConvolutionFilter,
- * SeparableFilter2D, GetSeparableFilter, ColorTable, ColorSubTable,
- * and GetColorTable:
- */
- int GL_HALF_FLOAT_ARB = 0x140B;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_half_float_pixel {
+
+ /**
+ * Accepted by the <type> parameter of DrawPixels, ReadPixels,
+ * TexImage1D, TexImage2D, TexImage3D, GetTexImage, TexSubImage1D,
+ * TexSubImage2D, TexSubImage3D, GetHistogram, GetMinmax,
+ * ConvolutionFilter1D, ConvolutionFilter2D, GetConvolutionFilter,
+ * SeparableFilter2D, GetSeparableFilter, ColorTable, ColorSubTable,
+ * and GetColorTable:
+ */
+ int GL_HALF_FLOAT_ARB = 0x140B;
+}
diff --git a/src/templates/org/lwjgl/opengl/ARB_half_float_vertex.java b/src/templates/org/lwjgl/opengl/ARB_half_float_vertex.java
index 9838535..d4da5d1 100644
--- a/src/templates/org/lwjgl/opengl/ARB_half_float_vertex.java
+++ b/src/templates/org/lwjgl/opengl/ARB_half_float_vertex.java
@@ -1,43 +1,43 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_half_float_vertex {
-
- /**
- * Accepted by the <type> argument of VertexPointer, NormalPointer,
- * ColorPointer, SecondaryColorPointer, FogCoordPointer, TexCoordPointer,
- * and VertexAttribPointer:
- */
- int GL_HALF_FLOAT = 0x140B;
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_half_float_vertex {
+
+ /**
+ * Accepted by the <type> argument of VertexPointer, NormalPointer,
+ * ColorPointer, SecondaryColorPointer, FogCoordPointer, TexCoordPointer,
+ * and VertexAttribPointer:
+ */
+ int GL_HALF_FLOAT = 0x140B;
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_imaging.java b/src/templates/org/lwjgl/opengl/ARB_imaging.java
index 1f0a3e8..59f0645 100644
--- a/src/templates/org/lwjgl/opengl/ARB_imaging.java
+++ b/src/templates/org/lwjgl/opengl/ARB_imaging.java
@@ -1,333 +1,333 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-/**
- * <p/>
- * The GL12 imaging subset extension.
- *
- * @author cix_foo <cix_foo at users.sourceforge.net>
- * @version $Revision: 3116 $
- * $Id: ARB_imaging.java 3116 2008-08-19 16:46:03Z spasi $
- */
-
- at Extension(postfix = "")
- at DeprecatedGL
-public interface ARB_imaging {
-
- int GL_CONSTANT_COLOR = 0x8001;
- int GL_ONE_MINUS_CONSTANT_COLOR = 0x8002;
- int GL_CONSTANT_ALPHA = 0x8003;
- int GL_ONE_MINUS_CONSTANT_ALPHA = 0x8004;
- int GL_BLEND_COLOR = 0x8005;
- int GL_FUNC_ADD = 0x8006;
- int GL_MIN = 0x8007;
- int GL_MAX = 0x8008;
- int GL_BLEND_EQUATION = 0x8009;
- int GL_FUNC_SUBTRACT = 0x800A;
- int GL_FUNC_REVERSE_SUBTRACT = 0x800B;
- int GL_COLOR_MATRIX = 0x80B1;
- int GL_COLOR_MATRIX_STACK_DEPTH = 0x80B2;
- int GL_MAX_COLOR_MATRIX_STACK_DEPTH = 0x80B3;
- int GL_POST_COLOR_MATRIX_RED_SCALE = 0x80B4;
- int GL_POST_COLOR_MATRIX_GREEN_SCALE = 0x80B5;
- int GL_POST_COLOR_MATRIX_BLUE_SCALE = 0x80B6;
- int GL_POST_COLOR_MATRIX_ALPHA_SCALE = 0x80B7;
- int GL_POST_COLOR_MATRIX_RED_BIAS = 0x80B8;
- int GL_POST_COLOR_MATRIX_GREEN_BIAS = 0x80B9;
- int GL_POST_COLOR_MATRIX_BLUE_BIAS = 0x80BA;
- int GL_POST_COLOR_MATRIX_ALPHA_BIAS = 0x80BB;
- int GL_COLOR_TABLE = 0x80D0;
- int GL_POST_CONVOLUTION_COLOR_TABLE = 0x80D1;
- int GL_POST_COLOR_MATRIX_COLOR_TABLE = 0x80D2;
- int GL_PROXY_COLOR_TABLE = 0x80D3;
- int GL_PROXY_POST_CONVOLUTION_COLOR_TABLE = 0x80D4;
- int GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE = 0x80D5;
- int GL_COLOR_TABLE_SCALE = 0x80D6;
- int GL_COLOR_TABLE_BIAS = 0x80D7;
- int GL_COLOR_TABLE_FORMAT = 0x80D8;
- int GL_COLOR_TABLE_WIDTH = 0x80D9;
- int GL_COLOR_TABLE_RED_SIZE = 0x80DA;
- int GL_COLOR_TABLE_GREEN_SIZE = 0x80DB;
- int GL_COLOR_TABLE_BLUE_SIZE = 0x80DC;
- int GL_COLOR_TABLE_ALPHA_SIZE = 0x80DD;
- int GL_COLOR_TABLE_LUMINANCE_SIZE = 0x80DE;
- int GL_COLOR_TABLE_INTENSITY_SIZE = 0x80DF;
- int GL_CONVOLUTION_1D = 0x8010;
- int GL_CONVOLUTION_2D = 0x8011;
- int GL_SEPARABLE_2D = 0x8012;
- int GL_CONVOLUTION_BORDER_MODE = 0x8013;
- int GL_CONVOLUTION_FILTER_SCALE = 0x8014;
- int GL_CONVOLUTION_FILTER_BIAS = 0x8015;
- int GL_REDUCE = 0x8016;
- int GL_CONVOLUTION_FORMAT = 0x8017;
- int GL_CONVOLUTION_WIDTH = 0x8018;
- int GL_CONVOLUTION_HEIGHT = 0x8019;
- int GL_MAX_CONVOLUTION_WIDTH = 0x801A;
- int GL_MAX_CONVOLUTION_HEIGHT = 0x801B;
- int GL_POST_CONVOLUTION_RED_SCALE = 0x801C;
- int GL_POST_CONVOLUTION_GREEN_SCALE = 0x801D;
- int GL_POST_CONVOLUTION_BLUE_SCALE = 0x801E;
- int GL_POST_CONVOLUTION_ALPHA_SCALE = 0x801F;
- int GL_POST_CONVOLUTION_RED_BIAS = 0x8020;
- int GL_POST_CONVOLUTION_GREEN_BIAS = 0x8021;
- int GL_POST_CONVOLUTION_BLUE_BIAS = 0x8022;
- int GL_POST_CONVOLUTION_ALPHA_BIAS = 0x8023;
- int GL_IGNORE_BORDER = 0x8150;
- int GL_CONSTANT_BORDER = 0x8151;
- int GL_REPLICATE_BORDER = 0x8153;
- int GL_CONVOLUTION_BORDER_COLOR = 0x8154;
- int GL_HISTOGRAM = 0x8024;
- int GL_PROXY_HISTOGRAM = 0x8025;
- int GL_HISTOGRAM_WIDTH = 0x8026;
- int GL_HISTOGRAM_FORMAT = 0x8027;
- int GL_HISTOGRAM_RED_SIZE = 0x8028;
- int GL_HISTOGRAM_GREEN_SIZE = 0x8029;
- int GL_HISTOGRAM_BLUE_SIZE = 0x802A;
- int GL_HISTOGRAM_ALPHA_SIZE = 0x802B;
- int GL_HISTOGRAM_LUMINANCE_SIZE = 0x802C;
- int GL_HISTOGRAM_SINK = 0x802D;
- int GL_MINMAX = 0x802E;
- int GL_MINMAX_FORMAT = 0x802F;
- int GL_MINMAX_SINK = 0x8030;
- int GL_TABLE_TOO_LARGE = 0x8031;
-
- @DeprecatedGL
- void glColorTable(@GLenum int target, @GLenum int internalFormat, @GLsizei int width, @GLenum int format, @GLenum int type,
- @BufferObject(BufferKind.UnpackPBO)
- @Check("256")
- @Const
- @GLbyte
- @GLfloat
- @GLdouble Buffer data);
-
- @DeprecatedGL
- void glColorSubTable(@GLenum int target, @GLsizei int start, @GLsizei int count, @GLenum int format, @GLenum int type,
- @BufferObject(BufferKind.UnpackPBO)
- @Check("256")
- @Const
- @GLbyte
- @GLfloat
- @GLdouble Buffer data);
-
- @StripPostfix("params")
- @DeprecatedGL
- void glColorTableParameteriv(@GLenum int target, @GLenum int pname, @Check("4") @Const IntBuffer params);
-
- @StripPostfix("params")
- @DeprecatedGL
- void glColorTableParameterfv(@GLenum int target, @GLenum int pname, @Check("4") @Const FloatBuffer params);
-
- @DeprecatedGL
- void glCopyColorSubTable(@GLenum int target, @GLsizei int start, int x, int y, @GLsizei int width);
-
- @DeprecatedGL
- void glCopyColorTable(@GLenum int target, @GLenum int internalformat, int x, int y, @GLsizei int width);
-
- @DeprecatedGL
- void glGetColorTable(@GLenum int target, @GLenum int format, @GLenum int type,
- @OutParameter
- @Check("256")
- @GLbyte
- @GLfloat
- @GLdouble Buffer data);
-
- @StripPostfix("params")
- @DeprecatedGL
- void glGetColorTableParameteriv(@GLenum int target, @GLenum int pname, @Check("4") IntBuffer params);
-
- @StripPostfix("params")
- @DeprecatedGL
- void glGetColorTableParameterfv(@GLenum int target, @GLenum int pname, @Check("4") FloatBuffer params);
-
- void glBlendEquation(@GLenum int mode);
-
- void glBlendColor(@GLclampf float red, @GLclampf float green, @GLclampf float blue, @GLclampf float alpha);
-
- @DeprecatedGL
- void glHistogram(@GLenum int target, @GLsizei int width, @GLenum int internalformat, boolean sink);
-
- @DeprecatedGL
- void glResetHistogram(@GLenum int target);
-
- @DeprecatedGL
- void glGetHistogram(@GLenum int target, boolean reset, @GLenum int format, @GLenum int type,
- @OutParameter
- @BufferObject(BufferKind.PackPBO)
- @Check("256")
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer values);
-
- @StripPostfix("params")
- @DeprecatedGL
- void glGetHistogramParameterfv(@GLenum int target, @GLenum int pname, @OutParameter @Check("256") FloatBuffer params);
-
- @StripPostfix("params")
- @DeprecatedGL
- void glGetHistogramParameteriv(@GLenum int target, @GLenum int pname, @OutParameter @Check("256") IntBuffer params);
-
- @DeprecatedGL
- void glMinmax(@GLenum int target, @GLenum int internalformat, boolean sink);
-
- @DeprecatedGL
- void glResetMinmax(@GLenum int target);
-
- @DeprecatedGL
- void glGetMinmax(@GLenum int target, boolean reset, @GLenum int format, @GLenum int types,
- @OutParameter
- @BufferObject(BufferKind.PackPBO)
- @Check("4")
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer values);
-
- @StripPostfix("params")
- @DeprecatedGL
- void glGetMinmaxParameterfv(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
-
- @StripPostfix("params")
- @DeprecatedGL
- void glGetMinmaxParameteriv(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
-
- @DeprecatedGL
- void glConvolutionFilter1D(@GLenum int target, @GLenum int internalformat, @GLsizei int width, @GLenum int format, @GLenum int type,
- @BufferObject(BufferKind.UnpackPBO)
- @Check("GLChecks.calculateImageStorage(image, format, type, width, 1, 1)")
- @Const
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer image);
-
- @DeprecatedGL
- void glConvolutionFilter2D(@GLenum int target, @GLenum int internalformat, @GLsizei int width, @GLsizei int height, @GLenum int format, @GLenum int type,
- @BufferObject(BufferKind.UnpackPBO)
- @Check("GLChecks.calculateImageStorage(image, format, type, width, height, 1)")
- @Const
- @GLbyte
- @GLshort
- @GLint Buffer image);
-
- @DeprecatedGL
- void glConvolutionParameterf(@GLenum int target, @GLenum int pname, float params);
-
- @StripPostfix("params")
- @DeprecatedGL
- void glConvolutionParameterfv(@GLenum int target, @GLenum int pname, @Check("4") @Const FloatBuffer params);
-
- @DeprecatedGL
- void glConvolutionParameteri(@GLenum int target, @GLenum int pname, int params);
-
- @StripPostfix("params")
- @DeprecatedGL
- void glConvolutionParameteriv(@GLenum int target, @GLenum int pname, @Check("4") @Const IntBuffer params);
-
- @DeprecatedGL
- void glCopyConvolutionFilter1D(@GLenum int target, @GLenum int internalformat, int x, int y, @GLsizei int width);
-
- @DeprecatedGL
- void glCopyConvolutionFilter2D(@GLenum int target, @GLenum int internalformat, int x, int y, @GLsizei int width, @GLsizei int height);
-
- // TODO: check buffer size valid
- @DeprecatedGL
- void glGetConvolutionFilter(@GLenum int target, @GLenum int format, @GLenum int type,
- @OutParameter
- @BufferObject(BufferKind.PackPBO)
- @Check
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer image);
-
- @StripPostfix("params")
- @DeprecatedGL
- void glGetConvolutionParameterfv(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
-
- @StripPostfix("params")
- @DeprecatedGL
- void glGetConvolutionParameteriv(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
-
- // TODO: check buffer size valid
- @DeprecatedGL
- void glSeparableFilter2D(@GLenum int target, @GLenum int internalformat, @GLsizei int width, @GLsizei int height, @GLenum int format, @GLenum int type,
- @BufferObject(BufferKind.UnpackPBO)
- @Check
- @Const
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer row,
- @BufferObject(BufferKind.UnpackPBO)
- @Check
- @Const
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer column);
-
- // TODO: check buffer size valid
- @DeprecatedGL
- void glGetSeparableFilter(@GLenum int target, @GLenum int format, @GLenum int type,
- @OutParameter
- @BufferObject(BufferKind.PackPBO)
- @Check
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer row,
- @BufferObject(BufferKind.PackPBO)
- @Check
- @GLbyte
- @GLshort
- @GLint
- @GLdouble Buffer column,
- @BufferObject(BufferKind.PackPBO)
- @Check
- @GLbyte
- @GLshort
- @GLint
- @GLdouble Buffer span);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+/**
+ * <p/>
+ * The GL12 imaging subset extension.
+ *
+ * @author cix_foo <cix_foo at users.sourceforge.net>
+ * @version $Revision: 3116 $
+ * $Id: ARB_imaging.java 3116 2008-08-19 16:46:03Z spasi $
+ */
+
+ at Extension(postfix = "")
+ at DeprecatedGL
+public interface ARB_imaging {
+
+ int GL_CONSTANT_COLOR = 0x8001;
+ int GL_ONE_MINUS_CONSTANT_COLOR = 0x8002;
+ int GL_CONSTANT_ALPHA = 0x8003;
+ int GL_ONE_MINUS_CONSTANT_ALPHA = 0x8004;
+ int GL_BLEND_COLOR = 0x8005;
+ int GL_FUNC_ADD = 0x8006;
+ int GL_MIN = 0x8007;
+ int GL_MAX = 0x8008;
+ int GL_BLEND_EQUATION = 0x8009;
+ int GL_FUNC_SUBTRACT = 0x800A;
+ int GL_FUNC_REVERSE_SUBTRACT = 0x800B;
+ int GL_COLOR_MATRIX = 0x80B1;
+ int GL_COLOR_MATRIX_STACK_DEPTH = 0x80B2;
+ int GL_MAX_COLOR_MATRIX_STACK_DEPTH = 0x80B3;
+ int GL_POST_COLOR_MATRIX_RED_SCALE = 0x80B4;
+ int GL_POST_COLOR_MATRIX_GREEN_SCALE = 0x80B5;
+ int GL_POST_COLOR_MATRIX_BLUE_SCALE = 0x80B6;
+ int GL_POST_COLOR_MATRIX_ALPHA_SCALE = 0x80B7;
+ int GL_POST_COLOR_MATRIX_RED_BIAS = 0x80B8;
+ int GL_POST_COLOR_MATRIX_GREEN_BIAS = 0x80B9;
+ int GL_POST_COLOR_MATRIX_BLUE_BIAS = 0x80BA;
+ int GL_POST_COLOR_MATRIX_ALPHA_BIAS = 0x80BB;
+ int GL_COLOR_TABLE = 0x80D0;
+ int GL_POST_CONVOLUTION_COLOR_TABLE = 0x80D1;
+ int GL_POST_COLOR_MATRIX_COLOR_TABLE = 0x80D2;
+ int GL_PROXY_COLOR_TABLE = 0x80D3;
+ int GL_PROXY_POST_CONVOLUTION_COLOR_TABLE = 0x80D4;
+ int GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE = 0x80D5;
+ int GL_COLOR_TABLE_SCALE = 0x80D6;
+ int GL_COLOR_TABLE_BIAS = 0x80D7;
+ int GL_COLOR_TABLE_FORMAT = 0x80D8;
+ int GL_COLOR_TABLE_WIDTH = 0x80D9;
+ int GL_COLOR_TABLE_RED_SIZE = 0x80DA;
+ int GL_COLOR_TABLE_GREEN_SIZE = 0x80DB;
+ int GL_COLOR_TABLE_BLUE_SIZE = 0x80DC;
+ int GL_COLOR_TABLE_ALPHA_SIZE = 0x80DD;
+ int GL_COLOR_TABLE_LUMINANCE_SIZE = 0x80DE;
+ int GL_COLOR_TABLE_INTENSITY_SIZE = 0x80DF;
+ int GL_CONVOLUTION_1D = 0x8010;
+ int GL_CONVOLUTION_2D = 0x8011;
+ int GL_SEPARABLE_2D = 0x8012;
+ int GL_CONVOLUTION_BORDER_MODE = 0x8013;
+ int GL_CONVOLUTION_FILTER_SCALE = 0x8014;
+ int GL_CONVOLUTION_FILTER_BIAS = 0x8015;
+ int GL_REDUCE = 0x8016;
+ int GL_CONVOLUTION_FORMAT = 0x8017;
+ int GL_CONVOLUTION_WIDTH = 0x8018;
+ int GL_CONVOLUTION_HEIGHT = 0x8019;
+ int GL_MAX_CONVOLUTION_WIDTH = 0x801A;
+ int GL_MAX_CONVOLUTION_HEIGHT = 0x801B;
+ int GL_POST_CONVOLUTION_RED_SCALE = 0x801C;
+ int GL_POST_CONVOLUTION_GREEN_SCALE = 0x801D;
+ int GL_POST_CONVOLUTION_BLUE_SCALE = 0x801E;
+ int GL_POST_CONVOLUTION_ALPHA_SCALE = 0x801F;
+ int GL_POST_CONVOLUTION_RED_BIAS = 0x8020;
+ int GL_POST_CONVOLUTION_GREEN_BIAS = 0x8021;
+ int GL_POST_CONVOLUTION_BLUE_BIAS = 0x8022;
+ int GL_POST_CONVOLUTION_ALPHA_BIAS = 0x8023;
+ int GL_IGNORE_BORDER = 0x8150;
+ int GL_CONSTANT_BORDER = 0x8151;
+ int GL_REPLICATE_BORDER = 0x8153;
+ int GL_CONVOLUTION_BORDER_COLOR = 0x8154;
+ int GL_HISTOGRAM = 0x8024;
+ int GL_PROXY_HISTOGRAM = 0x8025;
+ int GL_HISTOGRAM_WIDTH = 0x8026;
+ int GL_HISTOGRAM_FORMAT = 0x8027;
+ int GL_HISTOGRAM_RED_SIZE = 0x8028;
+ int GL_HISTOGRAM_GREEN_SIZE = 0x8029;
+ int GL_HISTOGRAM_BLUE_SIZE = 0x802A;
+ int GL_HISTOGRAM_ALPHA_SIZE = 0x802B;
+ int GL_HISTOGRAM_LUMINANCE_SIZE = 0x802C;
+ int GL_HISTOGRAM_SINK = 0x802D;
+ int GL_MINMAX = 0x802E;
+ int GL_MINMAX_FORMAT = 0x802F;
+ int GL_MINMAX_SINK = 0x8030;
+ int GL_TABLE_TOO_LARGE = 0x8031;
+
+ @DeprecatedGL
+ void glColorTable(@GLenum int target, @GLenum int internalFormat, @GLsizei int width, @GLenum int format, @GLenum int type,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check("256")
+ @Const
+ @GLbyte
+ @GLfloat
+ @GLdouble Buffer data);
+
+ @DeprecatedGL
+ void glColorSubTable(@GLenum int target, @GLsizei int start, @GLsizei int count, @GLenum int format, @GLenum int type,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check("256")
+ @Const
+ @GLbyte
+ @GLfloat
+ @GLdouble Buffer data);
+
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glColorTableParameteriv(@GLenum int target, @GLenum int pname, @Check("4") @Const IntBuffer params);
+
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glColorTableParameterfv(@GLenum int target, @GLenum int pname, @Check("4") @Const FloatBuffer params);
+
+ @DeprecatedGL
+ void glCopyColorSubTable(@GLenum int target, @GLsizei int start, int x, int y, @GLsizei int width);
+
+ @DeprecatedGL
+ void glCopyColorTable(@GLenum int target, @GLenum int internalformat, int x, int y, @GLsizei int width);
+
+ @DeprecatedGL
+ void glGetColorTable(@GLenum int target, @GLenum int format, @GLenum int type,
+ @OutParameter
+ @Check("256")
+ @GLbyte
+ @GLfloat
+ @GLdouble Buffer data);
+
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glGetColorTableParameteriv(@GLenum int target, @GLenum int pname, @Check("4") IntBuffer params);
+
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glGetColorTableParameterfv(@GLenum int target, @GLenum int pname, @Check("4") FloatBuffer params);
+
+ void glBlendEquation(@GLenum int mode);
+
+ void glBlendColor(@GLclampf float red, @GLclampf float green, @GLclampf float blue, @GLclampf float alpha);
+
+ @DeprecatedGL
+ void glHistogram(@GLenum int target, @GLsizei int width, @GLenum int internalformat, boolean sink);
+
+ @DeprecatedGL
+ void glResetHistogram(@GLenum int target);
+
+ @DeprecatedGL
+ void glGetHistogram(@GLenum int target, boolean reset, @GLenum int format, @GLenum int type,
+ @OutParameter
+ @BufferObject(BufferKind.PackPBO)
+ @Check("256")
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer values);
+
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glGetHistogramParameterfv(@GLenum int target, @GLenum int pname, @OutParameter @Check("256") FloatBuffer params);
+
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glGetHistogramParameteriv(@GLenum int target, @GLenum int pname, @OutParameter @Check("256") IntBuffer params);
+
+ @DeprecatedGL
+ void glMinmax(@GLenum int target, @GLenum int internalformat, boolean sink);
+
+ @DeprecatedGL
+ void glResetMinmax(@GLenum int target);
+
+ @DeprecatedGL
+ void glGetMinmax(@GLenum int target, boolean reset, @GLenum int format, @GLenum int types,
+ @OutParameter
+ @BufferObject(BufferKind.PackPBO)
+ @Check("4")
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer values);
+
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glGetMinmaxParameterfv(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
+
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glGetMinmaxParameteriv(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
+
+ @DeprecatedGL
+ void glConvolutionFilter1D(@GLenum int target, @GLenum int internalformat, @GLsizei int width, @GLenum int format, @GLenum int type,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check("GLChecks.calculateImageStorage(image, format, type, width, 1, 1)")
+ @Const
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer image);
+
+ @DeprecatedGL
+ void glConvolutionFilter2D(@GLenum int target, @GLenum int internalformat, @GLsizei int width, @GLsizei int height, @GLenum int format, @GLenum int type,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check("GLChecks.calculateImageStorage(image, format, type, width, height, 1)")
+ @Const
+ @GLbyte
+ @GLshort
+ @GLint Buffer image);
+
+ @DeprecatedGL
+ void glConvolutionParameterf(@GLenum int target, @GLenum int pname, float params);
+
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glConvolutionParameterfv(@GLenum int target, @GLenum int pname, @Check("4") @Const FloatBuffer params);
+
+ @DeprecatedGL
+ void glConvolutionParameteri(@GLenum int target, @GLenum int pname, int params);
+
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glConvolutionParameteriv(@GLenum int target, @GLenum int pname, @Check("4") @Const IntBuffer params);
+
+ @DeprecatedGL
+ void glCopyConvolutionFilter1D(@GLenum int target, @GLenum int internalformat, int x, int y, @GLsizei int width);
+
+ @DeprecatedGL
+ void glCopyConvolutionFilter2D(@GLenum int target, @GLenum int internalformat, int x, int y, @GLsizei int width, @GLsizei int height);
+
+ // TODO: check buffer size valid
+ @DeprecatedGL
+ void glGetConvolutionFilter(@GLenum int target, @GLenum int format, @GLenum int type,
+ @OutParameter
+ @BufferObject(BufferKind.PackPBO)
+ @Check
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer image);
+
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glGetConvolutionParameterfv(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
+
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glGetConvolutionParameteriv(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
+
+ // TODO: check buffer size valid
+ @DeprecatedGL
+ void glSeparableFilter2D(@GLenum int target, @GLenum int internalformat, @GLsizei int width, @GLsizei int height, @GLenum int format, @GLenum int type,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check
+ @Const
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer row,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check
+ @Const
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer column);
+
+ // TODO: check buffer size valid
+ @DeprecatedGL
+ void glGetSeparableFilter(@GLenum int target, @GLenum int format, @GLenum int type,
+ @OutParameter
+ @BufferObject(BufferKind.PackPBO)
+ @Check
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer row,
+ @BufferObject(BufferKind.PackPBO)
+ @Check
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLdouble Buffer column,
+ @BufferObject(BufferKind.PackPBO)
+ @Check
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLdouble Buffer span);
+}
diff --git a/src/templates/org/lwjgl/opengl/ARB_instanced_arrays.java b/src/templates/org/lwjgl/opengl/ARB_instanced_arrays.java
index 24912c6..ffec2bb 100644
--- a/src/templates/org/lwjgl/opengl/ARB_instanced_arrays.java
+++ b/src/templates/org/lwjgl/opengl/ARB_instanced_arrays.java
@@ -1,46 +1,46 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.GLuint;
-
-public interface ARB_instanced_arrays {
-
- /**
- * Accepted by the <pname> parameters of GetVertexAttribdv,
- * GetVertexAttribfv, and GetVertexAttribiv:
- */
- int GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB = 0x88FE;
-
- void glVertexAttribDivisorARB(@GLuint int index, @GLuint int divisor);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.GLuint;
+
+public interface ARB_instanced_arrays {
+
+ /**
+ * Accepted by the <pname> parameters of GetVertexAttribdv,
+ * GetVertexAttribfv, and GetVertexAttribiv:
+ */
+ int GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB = 0x88FE;
+
+ void glVertexAttribDivisorARB(@GLuint int index, @GLuint int divisor);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_matrix_palette.java b/src/templates/org/lwjgl/opengl/ARB_matrix_palette.java
index 8e76906..18a7a45 100644
--- a/src/templates/org/lwjgl/opengl/ARB_matrix_palette.java
+++ b/src/templates/org/lwjgl/opengl/ARB_matrix_palette.java
@@ -1,70 +1,70 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-public interface ARB_matrix_palette {
-
- int GL_MATRIX_PALETTE_ARB = 0x8840;
- int GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB = 0x8841;
- int GL_MAX_PALETTE_MATRICES_ARB = 0x8842;
- int GL_CURRENT_PALETTE_MATRIX_ARB = 0x8843;
- int GL_MATRIX_INDEX_ARRAY_ARB = 0x8844;
- int GL_CURRENT_MATRIX_INDEX_ARB = 0x8845;
- int GL_MATRIX_INDEX_ARRAY_SIZE_ARB = 0x8846;
- int GL_MATRIX_INDEX_ARRAY_TYPE_ARB = 0x8847;
- int GL_MATRIX_INDEX_ARRAY_STRIDE_ARB = 0x8848;
- int GL_MATRIX_INDEX_ARRAY_POINTER_ARB = 0x8849;
-
- void glCurrentPaletteMatrixARB(int index);
-
- void glMatrixIndexPointerARB(int size, @AutoType("pPointer") @GLenum int type, @GLsizei int stride,
- @CachedReference
- @BufferObject(BufferKind.ArrayVBO)
- @Check
- @Const
- @GLubyte
- @GLushort
- @GLuint Buffer pPointer);
-
- @StripPostfix("pIndices")
- void glMatrixIndexubvARB(@AutoSize("pIndices") int size, @GLubyte ByteBuffer pIndices);
-
- @StripPostfix("pIndices")
- void glMatrixIndexusvARB(@AutoSize("pIndices") int size, @GLushort ShortBuffer pIndices);
-
- @StripPostfix("pIndices")
- void glMatrixIndexuivARB(@AutoSize("pIndices") int size, @GLuint IntBuffer pIndices);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+public interface ARB_matrix_palette {
+
+ int GL_MATRIX_PALETTE_ARB = 0x8840;
+ int GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB = 0x8841;
+ int GL_MAX_PALETTE_MATRICES_ARB = 0x8842;
+ int GL_CURRENT_PALETTE_MATRIX_ARB = 0x8843;
+ int GL_MATRIX_INDEX_ARRAY_ARB = 0x8844;
+ int GL_CURRENT_MATRIX_INDEX_ARB = 0x8845;
+ int GL_MATRIX_INDEX_ARRAY_SIZE_ARB = 0x8846;
+ int GL_MATRIX_INDEX_ARRAY_TYPE_ARB = 0x8847;
+ int GL_MATRIX_INDEX_ARRAY_STRIDE_ARB = 0x8848;
+ int GL_MATRIX_INDEX_ARRAY_POINTER_ARB = 0x8849;
+
+ void glCurrentPaletteMatrixARB(int index);
+
+ void glMatrixIndexPointerARB(int size, @AutoType("pPointer") @GLenum int type, @GLsizei int stride,
+ @CachedReference
+ @BufferObject(BufferKind.ArrayVBO)
+ @Check
+ @Const
+ @GLubyte
+ @GLushort
+ @GLuint Buffer pPointer);
+
+ @StripPostfix("pIndices")
+ void glMatrixIndexubvARB(@AutoSize("pIndices") int size, @GLubyte ByteBuffer pIndices);
+
+ @StripPostfix("pIndices")
+ void glMatrixIndexusvARB(@AutoSize("pIndices") int size, @GLushort ShortBuffer pIndices);
+
+ @StripPostfix("pIndices")
+ void glMatrixIndexuivARB(@AutoSize("pIndices") int size, @GLuint IntBuffer pIndices);
+}
diff --git a/src/templates/org/lwjgl/opengl/ARB_multisample.java b/src/templates/org/lwjgl/opengl/ARB_multisample.java
index 12cfeb2..540580f 100644
--- a/src/templates/org/lwjgl/opengl/ARB_multisample.java
+++ b/src/templates/org/lwjgl/opengl/ARB_multisample.java
@@ -1,49 +1,49 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-public interface ARB_multisample {
-
- int GL_MULTISAMPLE_ARB = 0x809D;
- int GL_SAMPLE_ALPHA_TO_COVERAGE_ARB = 0x809E;
- int GL_SAMPLE_ALPHA_TO_ONE_ARB = 0x809F;
- int GL_SAMPLE_COVERAGE_ARB = 0x80A0;
- int GL_SAMPLE_BUFFERS_ARB = 0x80A8;
- int GL_SAMPLES_ARB = 0x80A9;
- int GL_SAMPLE_COVERAGE_VALUE_ARB = 0x80AA;
- int GL_SAMPLE_COVERAGE_INVERT_ARB = 0x80AB;
- int GL_MULTISAMPLE_BIT_ARB = 0x20000000;
-
- void glSampleCoverageARB(@GLclampf float value, boolean invert);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+public interface ARB_multisample {
+
+ int GL_MULTISAMPLE_ARB = 0x809D;
+ int GL_SAMPLE_ALPHA_TO_COVERAGE_ARB = 0x809E;
+ int GL_SAMPLE_ALPHA_TO_ONE_ARB = 0x809F;
+ int GL_SAMPLE_COVERAGE_ARB = 0x80A0;
+ int GL_SAMPLE_BUFFERS_ARB = 0x80A8;
+ int GL_SAMPLES_ARB = 0x80A9;
+ int GL_SAMPLE_COVERAGE_VALUE_ARB = 0x80AA;
+ int GL_SAMPLE_COVERAGE_INVERT_ARB = 0x80AB;
+ int GL_MULTISAMPLE_BIT_ARB = 0x20000000;
+
+ void glSampleCoverageARB(@GLclampf float value, boolean invert);
+}
diff --git a/src/templates/org/lwjgl/opengl/ARB_multitexture.java b/src/templates/org/lwjgl/opengl/ARB_multitexture.java
index 4aefdef..d34358c 100644
--- a/src/templates/org/lwjgl/opengl/ARB_multitexture.java
+++ b/src/templates/org/lwjgl/opengl/ARB_multitexture.java
@@ -1,125 +1,125 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-public interface ARB_multitexture {
-
- int GL_TEXTURE0_ARB = 0x84C0;
- int GL_TEXTURE1_ARB = 0x84C1;
- int GL_TEXTURE2_ARB = 0x84C2;
- int GL_TEXTURE3_ARB = 0x84C3;
- int GL_TEXTURE4_ARB = 0x84C4;
- int GL_TEXTURE5_ARB = 0x84C5;
- int GL_TEXTURE6_ARB = 0x84C6;
- int GL_TEXTURE7_ARB = 0x84C7;
- int GL_TEXTURE8_ARB = 0x84C8;
- int GL_TEXTURE9_ARB = 0x84C9;
- int GL_TEXTURE10_ARB = 0x84CA;
- int GL_TEXTURE11_ARB = 0x84CB;
- int GL_TEXTURE12_ARB = 0x84CC;
- int GL_TEXTURE13_ARB = 0x84CD;
- int GL_TEXTURE14_ARB = 0x84CE;
- int GL_TEXTURE15_ARB = 0x84CF;
- int GL_TEXTURE16_ARB = 0x84D0;
- int GL_TEXTURE17_ARB = 0x84D1;
- int GL_TEXTURE18_ARB = 0x84D2;
- int GL_TEXTURE19_ARB = 0x84D3;
- int GL_TEXTURE20_ARB = 0x84D4;
- int GL_TEXTURE21_ARB = 0x84D5;
- int GL_TEXTURE22_ARB = 0x84D6;
- int GL_TEXTURE23_ARB = 0x84D7;
- int GL_TEXTURE24_ARB = 0x84D8;
- int GL_TEXTURE25_ARB = 0x84D9;
- int GL_TEXTURE26_ARB = 0x84DA;
- int GL_TEXTURE27_ARB = 0x84DB;
- int GL_TEXTURE28_ARB = 0x84DC;
- int GL_TEXTURE29_ARB = 0x84DD;
- int GL_TEXTURE30_ARB = 0x84DE;
- int GL_TEXTURE31_ARB = 0x84DF;
- int GL_ACTIVE_TEXTURE_ARB = 0x84E0;
- int GL_CLIENT_ACTIVE_TEXTURE_ARB = 0x84E1;
- int GL_MAX_TEXTURE_UNITS_ARB = 0x84E2;
-
- void glClientActiveTextureARB(@GLenum int texture);
-
- void glActiveTextureARB(@GLenum int texture);
-
- @NoErrorCheck
- void glMultiTexCoord1fARB(@GLenum int target, float s);
-
- @NoErrorCheck
- void glMultiTexCoord1dARB(@GLenum int target, double s);
-
- @NoErrorCheck
- void glMultiTexCoord1iARB(@GLenum int target, int s);
-
- @NoErrorCheck
- void glMultiTexCoord1sARB(@GLenum int target, short s);
-
- @NoErrorCheck
- void glMultiTexCoord2fARB(@GLenum int target, float s, float t);
-
- @NoErrorCheck
- void glMultiTexCoord2dARB(@GLenum int target, double s, double t);
-
- @NoErrorCheck
- void glMultiTexCoord2iARB(@GLenum int target, int s, int t);
-
- @NoErrorCheck
- void glMultiTexCoord2sARB(@GLenum int target, short s, short t);
-
- @NoErrorCheck
- void glMultiTexCoord3fARB(@GLenum int target, float s, float t, float r);
-
- @NoErrorCheck
- void glMultiTexCoord3dARB(@GLenum int target, double s, double t, double r);
-
- @NoErrorCheck
- void glMultiTexCoord3iARB(@GLenum int target, int s, int t, int r);
-
- @NoErrorCheck
- void glMultiTexCoord3sARB(@GLenum int target, short s, short t, short r);
-
- @NoErrorCheck
- void glMultiTexCoord4fARB(@GLenum int target, float s, float t, float r, float q);
-
- @NoErrorCheck
- void glMultiTexCoord4dARB(@GLenum int target, double s, double t, double r, double q);
-
- @NoErrorCheck
- void glMultiTexCoord4iARB(@GLenum int target, int s, int t, int r, int q);
-
- @NoErrorCheck
- void glMultiTexCoord4sARB(@GLenum int target, short s, short t, short r, short q);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+public interface ARB_multitexture {
+
+ int GL_TEXTURE0_ARB = 0x84C0;
+ int GL_TEXTURE1_ARB = 0x84C1;
+ int GL_TEXTURE2_ARB = 0x84C2;
+ int GL_TEXTURE3_ARB = 0x84C3;
+ int GL_TEXTURE4_ARB = 0x84C4;
+ int GL_TEXTURE5_ARB = 0x84C5;
+ int GL_TEXTURE6_ARB = 0x84C6;
+ int GL_TEXTURE7_ARB = 0x84C7;
+ int GL_TEXTURE8_ARB = 0x84C8;
+ int GL_TEXTURE9_ARB = 0x84C9;
+ int GL_TEXTURE10_ARB = 0x84CA;
+ int GL_TEXTURE11_ARB = 0x84CB;
+ int GL_TEXTURE12_ARB = 0x84CC;
+ int GL_TEXTURE13_ARB = 0x84CD;
+ int GL_TEXTURE14_ARB = 0x84CE;
+ int GL_TEXTURE15_ARB = 0x84CF;
+ int GL_TEXTURE16_ARB = 0x84D0;
+ int GL_TEXTURE17_ARB = 0x84D1;
+ int GL_TEXTURE18_ARB = 0x84D2;
+ int GL_TEXTURE19_ARB = 0x84D3;
+ int GL_TEXTURE20_ARB = 0x84D4;
+ int GL_TEXTURE21_ARB = 0x84D5;
+ int GL_TEXTURE22_ARB = 0x84D6;
+ int GL_TEXTURE23_ARB = 0x84D7;
+ int GL_TEXTURE24_ARB = 0x84D8;
+ int GL_TEXTURE25_ARB = 0x84D9;
+ int GL_TEXTURE26_ARB = 0x84DA;
+ int GL_TEXTURE27_ARB = 0x84DB;
+ int GL_TEXTURE28_ARB = 0x84DC;
+ int GL_TEXTURE29_ARB = 0x84DD;
+ int GL_TEXTURE30_ARB = 0x84DE;
+ int GL_TEXTURE31_ARB = 0x84DF;
+ int GL_ACTIVE_TEXTURE_ARB = 0x84E0;
+ int GL_CLIENT_ACTIVE_TEXTURE_ARB = 0x84E1;
+ int GL_MAX_TEXTURE_UNITS_ARB = 0x84E2;
+
+ void glClientActiveTextureARB(@GLenum int texture);
+
+ void glActiveTextureARB(@GLenum int texture);
+
+ @NoErrorCheck
+ void glMultiTexCoord1fARB(@GLenum int target, float s);
+
+ @NoErrorCheck
+ void glMultiTexCoord1dARB(@GLenum int target, double s);
+
+ @NoErrorCheck
+ void glMultiTexCoord1iARB(@GLenum int target, int s);
+
+ @NoErrorCheck
+ void glMultiTexCoord1sARB(@GLenum int target, short s);
+
+ @NoErrorCheck
+ void glMultiTexCoord2fARB(@GLenum int target, float s, float t);
+
+ @NoErrorCheck
+ void glMultiTexCoord2dARB(@GLenum int target, double s, double t);
+
+ @NoErrorCheck
+ void glMultiTexCoord2iARB(@GLenum int target, int s, int t);
+
+ @NoErrorCheck
+ void glMultiTexCoord2sARB(@GLenum int target, short s, short t);
+
+ @NoErrorCheck
+ void glMultiTexCoord3fARB(@GLenum int target, float s, float t, float r);
+
+ @NoErrorCheck
+ void glMultiTexCoord3dARB(@GLenum int target, double s, double t, double r);
+
+ @NoErrorCheck
+ void glMultiTexCoord3iARB(@GLenum int target, int s, int t, int r);
+
+ @NoErrorCheck
+ void glMultiTexCoord3sARB(@GLenum int target, short s, short t, short r);
+
+ @NoErrorCheck
+ void glMultiTexCoord4fARB(@GLenum int target, float s, float t, float r, float q);
+
+ @NoErrorCheck
+ void glMultiTexCoord4dARB(@GLenum int target, double s, double t, double r, double q);
+
+ @NoErrorCheck
+ void glMultiTexCoord4iARB(@GLenum int target, int s, int t, int r, int q);
+
+ @NoErrorCheck
+ void glMultiTexCoord4sARB(@GLenum int target, short s, short t, short r, short q);
+}
diff --git a/src/templates/org/lwjgl/opengl/ARB_occlusion_query.java b/src/templates/org/lwjgl/opengl/ARB_occlusion_query.java
index 711ca2f..ac6031f 100644
--- a/src/templates/org/lwjgl/opengl/ARB_occlusion_query.java
+++ b/src/templates/org/lwjgl/opengl/ARB_occlusion_query.java
@@ -1,97 +1,97 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.IntBuffer;
-
-public interface ARB_occlusion_query {
-
- /**
- * Accepted by the <target> parameter of BeginQueryARB, EndQueryARB,
- * and GetQueryivARB:
- */
- int GL_SAMPLES_PASSED_ARB = 0x8914;
-
- /** Accepted by the <pname> parameter of GetQueryivARB: */
- int GL_QUERY_COUNTER_BITS_ARB = 0x8864;
- int GL_CURRENT_QUERY_ARB = 0x8865;
-
- /**
- * Accepted by the <pname> parameter of GetQueryObjectivARB and
- * GetQueryObjectuivARB:
- */
- int GL_QUERY_RESULT_ARB = 0x8866;
- int GL_QUERY_RESULT_AVAILABLE_ARB = 0x8867;
-
- void glGenQueriesARB(@AutoSize("ids") @GLsizei int n, @OutParameter @GLuint IntBuffer ids);
-
- @Alternate("glGenQueriesARB")
- @GLreturn("ids")
- void glGenQueriesARB2(@Constant("1") @GLsizei int n, @OutParameter @GLuint IntBuffer ids);
-
- void glDeleteQueriesARB(@AutoSize("ids") @GLsizei int n, @GLuint IntBuffer ids);
-
- @Alternate("glDeleteQueriesARB")
- void glDeleteQueriesARB(@Constant("1") @GLsizei int n, @Constant(value = "APIUtils.getBufferInt().put(0, id), 0", keepParam = true) int id);
-
- boolean glIsQueryARB(@GLuint int id);
-
- void glBeginQueryARB(@GLenum int target, @GLuint int id);
-
- void glEndQueryARB(@GLenum int target);
-
- @StripPostfix("params")
- void glGetQueryivARB(@GLenum int target, @GLenum int pname, @OutParameter @Check("1") IntBuffer params);
-
- @Alternate("glGetQueryivARB")
- @GLreturn("params")
- @StripPostfix("params")
- void glGetQueryivARB2(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params);
-
- @StripPostfix("params")
- void glGetQueryObjectivARB(@GLuint int id, @GLenum int pname, @OutParameter @Check("1") IntBuffer params);
-
- @Alternate("glGetQueryObjectivARB")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- void glGetQueryObjectivARB2(@GLuint int id, @GLenum int pname, @OutParameter IntBuffer params);
-
- @StripPostfix("params")
- void glGetQueryObjectuivARB(@GLuint int id, @GLenum int pname, @OutParameter @Check("1") IntBuffer params);
-
- @Alternate("glGetQueryObjectuivARB")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- void glGetQueryObjectuivARB2(@GLuint int id, @GLenum int pname, @OutParameter IntBuffer params);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.IntBuffer;
+
+public interface ARB_occlusion_query {
+
+ /**
+ * Accepted by the <target> parameter of BeginQueryARB, EndQueryARB,
+ * and GetQueryivARB:
+ */
+ int GL_SAMPLES_PASSED_ARB = 0x8914;
+
+ /** Accepted by the <pname> parameter of GetQueryivARB: */
+ int GL_QUERY_COUNTER_BITS_ARB = 0x8864;
+ int GL_CURRENT_QUERY_ARB = 0x8865;
+
+ /**
+ * Accepted by the <pname> parameter of GetQueryObjectivARB and
+ * GetQueryObjectuivARB:
+ */
+ int GL_QUERY_RESULT_ARB = 0x8866;
+ int GL_QUERY_RESULT_AVAILABLE_ARB = 0x8867;
+
+ void glGenQueriesARB(@AutoSize("ids") @GLsizei int n, @OutParameter @GLuint IntBuffer ids);
+
+ @Alternate("glGenQueriesARB")
+ @GLreturn("ids")
+ void glGenQueriesARB2(@Constant("1") @GLsizei int n, @OutParameter @GLuint IntBuffer ids);
+
+ void glDeleteQueriesARB(@AutoSize("ids") @GLsizei int n, @GLuint IntBuffer ids);
+
+ @Alternate("glDeleteQueriesARB")
+ void glDeleteQueriesARB(@Constant("1") @GLsizei int n, @Constant(value = "APIUtils.getBufferInt().put(0, id), 0", keepParam = true) int id);
+
+ boolean glIsQueryARB(@GLuint int id);
+
+ void glBeginQueryARB(@GLenum int target, @GLuint int id);
+
+ void glEndQueryARB(@GLenum int target);
+
+ @StripPostfix("params")
+ void glGetQueryivARB(@GLenum int target, @GLenum int pname, @OutParameter @Check("1") IntBuffer params);
+
+ @Alternate("glGetQueryivARB")
+ @GLreturn("params")
+ @StripPostfix("params")
+ void glGetQueryivARB2(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params);
+
+ @StripPostfix("params")
+ void glGetQueryObjectivARB(@GLuint int id, @GLenum int pname, @OutParameter @Check("1") IntBuffer params);
+
+ @Alternate("glGetQueryObjectivARB")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetQueryObjectivARB2(@GLuint int id, @GLenum int pname, @OutParameter IntBuffer params);
+
+ @StripPostfix("params")
+ void glGetQueryObjectuivARB(@GLuint int id, @GLenum int pname, @OutParameter @Check("1") IntBuffer params);
+
+ @Alternate("glGetQueryObjectuivARB")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetQueryObjectuivARB2(@GLuint int id, @GLenum int pname, @OutParameter IntBuffer params);
+}
diff --git a/src/templates/org/lwjgl/opengl/ARB_occlusion_query2.java b/src/templates/org/lwjgl/opengl/ARB_occlusion_query2.java
index fb53b5c..ee020fb 100644
--- a/src/templates/org/lwjgl/opengl/ARB_occlusion_query2.java
+++ b/src/templates/org/lwjgl/opengl/ARB_occlusion_query2.java
@@ -1,42 +1,42 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_occlusion_query2 {
-
- /**
- * Accepted by the <target> parameter of BeginQuery, EndQuery,
- * and GetQueryiv:
- */
- int GL_ANY_SAMPLES_PASSED = 0x8C2F;
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_occlusion_query2 {
+
+ /**
+ * Accepted by the <target> parameter of BeginQuery, EndQuery,
+ * and GetQueryiv:
+ */
+ int GL_ANY_SAMPLES_PASSED = 0x8C2F;
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_pixel_buffer_object.java b/src/templates/org/lwjgl/opengl/ARB_pixel_buffer_object.java
index 06d4596..4e29af6 100644
--- a/src/templates/org/lwjgl/opengl/ARB_pixel_buffer_object.java
+++ b/src/templates/org/lwjgl/opengl/ARB_pixel_buffer_object.java
@@ -1,50 +1,50 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_pixel_buffer_object extends ARB_buffer_object {
-
- /**
- * Accepted by the <target> parameters of BindBuffer, BufferData,
- * BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData,
- * GetBufferParameteriv, and GetBufferPointerv:
- */
- int GL_PIXEL_PACK_BUFFER_ARB = 0x88EB;
- int GL_PIXEL_UNPACK_BUFFER_ARB = 0x88EC;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv, and GetDoublev:
- */
- int GL_PIXEL_PACK_BUFFER_BINDING_ARB = 0x88ED;
- int GL_PIXEL_UNPACK_BUFFER_BINDING_ARB = 0x88EF;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_pixel_buffer_object extends ARB_buffer_object {
+
+ /**
+ * Accepted by the <target> parameters of BindBuffer, BufferData,
+ * BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData,
+ * GetBufferParameteriv, and GetBufferPointerv:
+ */
+ int GL_PIXEL_PACK_BUFFER_ARB = 0x88EB;
+ int GL_PIXEL_UNPACK_BUFFER_ARB = 0x88EC;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, and GetDoublev:
+ */
+ int GL_PIXEL_PACK_BUFFER_BINDING_ARB = 0x88ED;
+ int GL_PIXEL_UNPACK_BUFFER_BINDING_ARB = 0x88EF;
+}
diff --git a/src/templates/org/lwjgl/opengl/ARB_point_parameters.java b/src/templates/org/lwjgl/opengl/ARB_point_parameters.java
index 40d5155..5954775 100644
--- a/src/templates/org/lwjgl/opengl/ARB_point_parameters.java
+++ b/src/templates/org/lwjgl/opengl/ARB_point_parameters.java
@@ -1,50 +1,50 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-public interface ARB_point_parameters {
-
- int GL_POINT_SIZE_MIN_ARB = 0x8126;
- int GL_POINT_SIZE_MAX_ARB = 0x8127;
- int GL_POINT_FADE_THRESHOLD_SIZE_ARB = 0x8128;
- int GL_POINT_DISTANCE_ATTENUATION_ARB = 0x8129;
-
- void glPointParameterfARB(@GLenum int pname, float param);
-
- @StripPostfix("pfParams")
- void glPointParameterfvARB(@GLenum int pname, @Check("4") @Const FloatBuffer pfParams);
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+public interface ARB_point_parameters {
+
+ int GL_POINT_SIZE_MIN_ARB = 0x8126;
+ int GL_POINT_SIZE_MAX_ARB = 0x8127;
+ int GL_POINT_FADE_THRESHOLD_SIZE_ARB = 0x8128;
+ int GL_POINT_DISTANCE_ATTENUATION_ARB = 0x8129;
+
+ void glPointParameterfARB(@GLenum int pname, float param);
+
+ @StripPostfix("pfParams")
+ void glPointParameterfvARB(@GLenum int pname, @Check("4") @Const FloatBuffer pfParams);
+
+}
diff --git a/src/templates/org/lwjgl/opengl/ARB_point_sprite.java b/src/templates/org/lwjgl/opengl/ARB_point_sprite.java
index 3abb52f..05aa0fb 100644
--- a/src/templates/org/lwjgl/opengl/ARB_point_sprite.java
+++ b/src/templates/org/lwjgl/opengl/ARB_point_sprite.java
@@ -1,50 +1,50 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_point_sprite {
-
- /**
- * Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, by
- * the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
- * GetDoublev, and by the <target> parameter of TexEnvi, TexEnviv,
- * TexEnvf, TexEnvfv, GetTexEnviv, and GetTexEnvfv:
- */
- int GL_POINT_SPRITE_ARB = 0x8861;
-
- /**
- * When the <target> parameter of TexEnvf, TexEnvfv, TexEnvi, TexEnviv,
- * GetTexEnvfv, or GetTexEnviv is POINT_SPRITE_ARB, then the value of
- * <pname> may be:
- */
- int GL_COORD_REPLACE_ARB = 0x8862;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_point_sprite {
+
+ /**
+ * Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, by
+ * the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
+ * GetDoublev, and by the <target> parameter of TexEnvi, TexEnviv,
+ * TexEnvf, TexEnvfv, GetTexEnviv, and GetTexEnvfv:
+ */
+ int GL_POINT_SPRITE_ARB = 0x8861;
+
+ /**
+ * When the <target> parameter of TexEnvf, TexEnvfv, TexEnvi, TexEnviv,
+ * GetTexEnvfv, or GetTexEnviv is POINT_SPRITE_ARB, then the value of
+ * <pname> may be:
+ */
+ int GL_COORD_REPLACE_ARB = 0x8862;
+}
diff --git a/src/templates/org/lwjgl/opengl/ARB_program.java b/src/templates/org/lwjgl/opengl/ARB_program.java
index 8cc89a4..4480e46 100644
--- a/src/templates/org/lwjgl/opengl/ARB_program.java
+++ b/src/templates/org/lwjgl/opengl/ARB_program.java
@@ -1,185 +1,185 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
- at Extension(postfix = "ARB", isFinal = false)
-public interface ARB_program {
-
- /** Accepted by the <format> parameter of ProgramStringARB: */
- int GL_PROGRAM_FORMAT_ASCII_ARB = 0x8875;
-
- /** Accepted by the <pname> parameter of GetProgramivARB: */
- int GL_PROGRAM_LENGTH_ARB = 0x8627;
- int GL_PROGRAM_FORMAT_ARB = 0x8876;
- int GL_PROGRAM_BINDING_ARB = 0x8677;
- int GL_PROGRAM_INSTRUCTIONS_ARB = 0x88A0;
- int GL_MAX_PROGRAM_INSTRUCTIONS_ARB = 0x88A1;
- int GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB = 0x88A2;
- int GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB = 0x88A3;
- int GL_PROGRAM_TEMPORARIES_ARB = 0x88A4;
- int GL_MAX_PROGRAM_TEMPORARIES_ARB = 0x88A5;
- int GL_PROGRAM_NATIVE_TEMPORARIES_ARB = 0x88A6;
- int GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB = 0x88A7;
- int GL_PROGRAM_PARAMETERS_ARB = 0x88A8;
- int GL_MAX_PROGRAM_PARAMETERS_ARB = 0x88A9;
- int GL_PROGRAM_NATIVE_PARAMETERS_ARB = 0x88AA;
- int GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB = 0x88AB;
- int GL_PROGRAM_ATTRIBS_ARB = 0x88AC;
- int GL_MAX_PROGRAM_ATTRIBS_ARB = 0x88AD;
- int GL_PROGRAM_NATIVE_ATTRIBS_ARB = 0x88AE;
- int GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB = 0x88AF;
- int GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB = 0x88B4;
- int GL_MAX_PROGRAM_ENV_PARAMETERS_ARB = 0x88B5;
- int GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB = 0x88B6;
-
- /** Accepted by the <pname> parameter of GetProgramStringARB: */
- int GL_PROGRAM_STRING_ARB = 0x8628;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv, and GetDoublev:
- */
- int GL_PROGRAM_ERROR_POSITION_ARB = 0x864B;
- int GL_CURRENT_MATRIX_ARB = 0x8641;
- int GL_TRANSPOSE_CURRENT_MATRIX_ARB = 0x88B7;
- int GL_CURRENT_MATRIX_STACK_DEPTH_ARB = 0x8640;
- int GL_MAX_PROGRAM_MATRICES_ARB = 0x862F;
- int GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB = 0x862E;
-
- /** Accepted by the <name> parameter of GetString: */
- int GL_PROGRAM_ERROR_STRING_ARB = 0x8874;
-
- /** Accepted by the <mode> parameter of MatrixMode: */
- int GL_MATRIX0_ARB = 0x88C0;
- int GL_MATRIX1_ARB = 0x88C1;
- int GL_MATRIX2_ARB = 0x88C2;
- int GL_MATRIX3_ARB = 0x88C3;
- int GL_MATRIX4_ARB = 0x88C4;
- int GL_MATRIX5_ARB = 0x88C5;
- int GL_MATRIX6_ARB = 0x88C6;
- int GL_MATRIX7_ARB = 0x88C7;
- int GL_MATRIX8_ARB = 0x88C8;
- int GL_MATRIX9_ARB = 0x88C9;
- int GL_MATRIX10_ARB = 0x88CA;
- int GL_MATRIX11_ARB = 0x88CB;
- int GL_MATRIX12_ARB = 0x88CC;
- int GL_MATRIX13_ARB = 0x88CD;
- int GL_MATRIX14_ARB = 0x88CE;
- int GL_MATRIX15_ARB = 0x88CF;
- int GL_MATRIX16_ARB = 0x88D0;
- int GL_MATRIX17_ARB = 0x88D1;
- int GL_MATRIX18_ARB = 0x88D2;
- int GL_MATRIX19_ARB = 0x88D3;
- int GL_MATRIX20_ARB = 0x88D4;
- int GL_MATRIX21_ARB = 0x88D5;
- int GL_MATRIX22_ARB = 0x88D6;
- int GL_MATRIX23_ARB = 0x88D7;
- int GL_MATRIX24_ARB = 0x88D8;
- int GL_MATRIX25_ARB = 0x88D9;
- int GL_MATRIX26_ARB = 0x88DA;
- int GL_MATRIX27_ARB = 0x88DB;
- int GL_MATRIX28_ARB = 0x88DC;
- int GL_MATRIX29_ARB = 0x88DD;
- int GL_MATRIX30_ARB = 0x88DE;
- int GL_MATRIX31_ARB = 0x88DF;
-
- void glProgramStringARB(@GLenum int target, @GLenum int format, @AutoSize("string") @GLsizei int length, @Const @GLbyte Buffer string);
-
- @Alternate("glProgramStringARB")
- void glProgramStringARB(@GLenum int target, @GLenum int format, @Constant("string.length()") @GLsizei int length, CharSequence string);
-
- void glBindProgramARB(@GLenum int target, @GLuint int program);
-
- void glDeleteProgramsARB(@AutoSize("programs") @GLsizei int n, @Const @GLuint IntBuffer programs);
-
- @Alternate("glDeleteProgramsARB")
- void glDeleteProgramsARB(@Constant("1") @GLsizei int n, @Constant(value = "APIUtils.getBufferInt().put(0, program), 0", keepParam = true) int program);
-
- void glGenProgramsARB(@AutoSize("programs") @GLsizei int n, @OutParameter @GLuint IntBuffer programs);
-
- @Alternate("glGenProgramsARB")
- @GLreturn("programs")
- void glGenProgramsARB2(@Constant("1") @GLsizei int n, @OutParameter @GLuint IntBuffer programs);
-
- void glProgramEnvParameter4fARB(int target, int index, float x, float y, float z, float w);
-
- void glProgramEnvParameter4dARB(int target, int index, double x, double y, double z, double w);
-
- @StripPostfix("params")
- void glProgramEnvParameter4fvARB(@GLenum int target, @GLuint int index, @Check("4") @Const FloatBuffer params);
-
- @StripPostfix("params")
- void glProgramEnvParameter4dvARB(@GLenum int target, @GLuint int index, @Check("4") @Const DoubleBuffer params);
-
- void glProgramLocalParameter4fARB(@GLenum int target, @GLuint int index, float x, float y, float z, float w);
-
- void glProgramLocalParameter4dARB(@GLenum int target, @GLuint int index, double x, double y, double z, double w);
-
- @StripPostfix("params")
- void glProgramLocalParameter4fvARB(@GLenum int target, @GLuint int index, @Check("4") @Const FloatBuffer params);
-
- @StripPostfix("params")
- void glProgramLocalParameter4dvARB(@GLenum int target, @GLuint int index, @Check("4") @Const DoubleBuffer params);
-
- @StripPostfix("params")
- void glGetProgramEnvParameterfvARB(@GLenum int target, @GLuint int index, @OutParameter @Check("4") FloatBuffer params);
-
- @StripPostfix("params")
- void glGetProgramEnvParameterdvARB(@GLenum int target, @GLuint int index, @OutParameter @Check("4") DoubleBuffer params);
-
- @StripPostfix("params")
- void glGetProgramLocalParameterfvARB(@GLenum int target, @GLuint int index, @OutParameter @Check("4") FloatBuffer params);
-
- @StripPostfix("params")
- void glGetProgramLocalParameterdvARB(@GLenum int target, @GLuint int index, @OutParameter @Check("4") DoubleBuffer params);
-
- @StripPostfix("params")
- void glGetProgramivARB(@GLenum int target, @GLenum int parameterName, @OutParameter @Check("4") IntBuffer params);
-
- @Alternate("glGetProgramivARB")
- @GLreturn("params")
- @StripPostfix("params")
- void glGetProgramivARB2(@GLenum int target, @GLenum int parameterName, @OutParameter IntBuffer params);
-
- void glGetProgramStringARB(@GLenum int target, @GLenum int parameterName, @OutParameter @Check @GLbyte Buffer paramString);
-
- @Alternate("glGetProgramStringARB")
- @Code("\t\tint programLength = glGetProgramARB(target, GL_PROGRAM_LENGTH_ARB);")
- @GLreturn(value="paramString", maxLength = "programLength", forceMaxLength = true)
- void glGetProgramStringARB2(@GLenum int target, @GLenum int parameterName, @OutParameter @GLchar ByteBuffer paramString);
-
- boolean glIsProgramARB(@GLuint int program);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+ at Extension(postfix = "ARB", isFinal = false)
+public interface ARB_program {
+
+ /** Accepted by the <format> parameter of ProgramStringARB: */
+ int GL_PROGRAM_FORMAT_ASCII_ARB = 0x8875;
+
+ /** Accepted by the <pname> parameter of GetProgramivARB: */
+ int GL_PROGRAM_LENGTH_ARB = 0x8627;
+ int GL_PROGRAM_FORMAT_ARB = 0x8876;
+ int GL_PROGRAM_BINDING_ARB = 0x8677;
+ int GL_PROGRAM_INSTRUCTIONS_ARB = 0x88A0;
+ int GL_MAX_PROGRAM_INSTRUCTIONS_ARB = 0x88A1;
+ int GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB = 0x88A2;
+ int GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB = 0x88A3;
+ int GL_PROGRAM_TEMPORARIES_ARB = 0x88A4;
+ int GL_MAX_PROGRAM_TEMPORARIES_ARB = 0x88A5;
+ int GL_PROGRAM_NATIVE_TEMPORARIES_ARB = 0x88A6;
+ int GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB = 0x88A7;
+ int GL_PROGRAM_PARAMETERS_ARB = 0x88A8;
+ int GL_MAX_PROGRAM_PARAMETERS_ARB = 0x88A9;
+ int GL_PROGRAM_NATIVE_PARAMETERS_ARB = 0x88AA;
+ int GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB = 0x88AB;
+ int GL_PROGRAM_ATTRIBS_ARB = 0x88AC;
+ int GL_MAX_PROGRAM_ATTRIBS_ARB = 0x88AD;
+ int GL_PROGRAM_NATIVE_ATTRIBS_ARB = 0x88AE;
+ int GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB = 0x88AF;
+ int GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB = 0x88B4;
+ int GL_MAX_PROGRAM_ENV_PARAMETERS_ARB = 0x88B5;
+ int GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB = 0x88B6;
+
+ /** Accepted by the <pname> parameter of GetProgramStringARB: */
+ int GL_PROGRAM_STRING_ARB = 0x8628;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, and GetDoublev:
+ */
+ int GL_PROGRAM_ERROR_POSITION_ARB = 0x864B;
+ int GL_CURRENT_MATRIX_ARB = 0x8641;
+ int GL_TRANSPOSE_CURRENT_MATRIX_ARB = 0x88B7;
+ int GL_CURRENT_MATRIX_STACK_DEPTH_ARB = 0x8640;
+ int GL_MAX_PROGRAM_MATRICES_ARB = 0x862F;
+ int GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB = 0x862E;
+
+ /** Accepted by the <name> parameter of GetString: */
+ int GL_PROGRAM_ERROR_STRING_ARB = 0x8874;
+
+ /** Accepted by the <mode> parameter of MatrixMode: */
+ int GL_MATRIX0_ARB = 0x88C0;
+ int GL_MATRIX1_ARB = 0x88C1;
+ int GL_MATRIX2_ARB = 0x88C2;
+ int GL_MATRIX3_ARB = 0x88C3;
+ int GL_MATRIX4_ARB = 0x88C4;
+ int GL_MATRIX5_ARB = 0x88C5;
+ int GL_MATRIX6_ARB = 0x88C6;
+ int GL_MATRIX7_ARB = 0x88C7;
+ int GL_MATRIX8_ARB = 0x88C8;
+ int GL_MATRIX9_ARB = 0x88C9;
+ int GL_MATRIX10_ARB = 0x88CA;
+ int GL_MATRIX11_ARB = 0x88CB;
+ int GL_MATRIX12_ARB = 0x88CC;
+ int GL_MATRIX13_ARB = 0x88CD;
+ int GL_MATRIX14_ARB = 0x88CE;
+ int GL_MATRIX15_ARB = 0x88CF;
+ int GL_MATRIX16_ARB = 0x88D0;
+ int GL_MATRIX17_ARB = 0x88D1;
+ int GL_MATRIX18_ARB = 0x88D2;
+ int GL_MATRIX19_ARB = 0x88D3;
+ int GL_MATRIX20_ARB = 0x88D4;
+ int GL_MATRIX21_ARB = 0x88D5;
+ int GL_MATRIX22_ARB = 0x88D6;
+ int GL_MATRIX23_ARB = 0x88D7;
+ int GL_MATRIX24_ARB = 0x88D8;
+ int GL_MATRIX25_ARB = 0x88D9;
+ int GL_MATRIX26_ARB = 0x88DA;
+ int GL_MATRIX27_ARB = 0x88DB;
+ int GL_MATRIX28_ARB = 0x88DC;
+ int GL_MATRIX29_ARB = 0x88DD;
+ int GL_MATRIX30_ARB = 0x88DE;
+ int GL_MATRIX31_ARB = 0x88DF;
+
+ void glProgramStringARB(@GLenum int target, @GLenum int format, @AutoSize("string") @GLsizei int length, @Const @GLbyte Buffer string);
+
+ @Alternate("glProgramStringARB")
+ void glProgramStringARB(@GLenum int target, @GLenum int format, @Constant("string.length()") @GLsizei int length, CharSequence string);
+
+ void glBindProgramARB(@GLenum int target, @GLuint int program);
+
+ void glDeleteProgramsARB(@AutoSize("programs") @GLsizei int n, @Const @GLuint IntBuffer programs);
+
+ @Alternate("glDeleteProgramsARB")
+ void glDeleteProgramsARB(@Constant("1") @GLsizei int n, @Constant(value = "APIUtils.getBufferInt().put(0, program), 0", keepParam = true) int program);
+
+ void glGenProgramsARB(@AutoSize("programs") @GLsizei int n, @OutParameter @GLuint IntBuffer programs);
+
+ @Alternate("glGenProgramsARB")
+ @GLreturn("programs")
+ void glGenProgramsARB2(@Constant("1") @GLsizei int n, @OutParameter @GLuint IntBuffer programs);
+
+ void glProgramEnvParameter4fARB(int target, int index, float x, float y, float z, float w);
+
+ void glProgramEnvParameter4dARB(int target, int index, double x, double y, double z, double w);
+
+ @StripPostfix("params")
+ void glProgramEnvParameter4fvARB(@GLenum int target, @GLuint int index, @Check("4") @Const FloatBuffer params);
+
+ @StripPostfix("params")
+ void glProgramEnvParameter4dvARB(@GLenum int target, @GLuint int index, @Check("4") @Const DoubleBuffer params);
+
+ void glProgramLocalParameter4fARB(@GLenum int target, @GLuint int index, float x, float y, float z, float w);
+
+ void glProgramLocalParameter4dARB(@GLenum int target, @GLuint int index, double x, double y, double z, double w);
+
+ @StripPostfix("params")
+ void glProgramLocalParameter4fvARB(@GLenum int target, @GLuint int index, @Check("4") @Const FloatBuffer params);
+
+ @StripPostfix("params")
+ void glProgramLocalParameter4dvARB(@GLenum int target, @GLuint int index, @Check("4") @Const DoubleBuffer params);
+
+ @StripPostfix("params")
+ void glGetProgramEnvParameterfvARB(@GLenum int target, @GLuint int index, @OutParameter @Check("4") FloatBuffer params);
+
+ @StripPostfix("params")
+ void glGetProgramEnvParameterdvARB(@GLenum int target, @GLuint int index, @OutParameter @Check("4") DoubleBuffer params);
+
+ @StripPostfix("params")
+ void glGetProgramLocalParameterfvARB(@GLenum int target, @GLuint int index, @OutParameter @Check("4") FloatBuffer params);
+
+ @StripPostfix("params")
+ void glGetProgramLocalParameterdvARB(@GLenum int target, @GLuint int index, @OutParameter @Check("4") DoubleBuffer params);
+
+ @StripPostfix("params")
+ void glGetProgramivARB(@GLenum int target, @GLenum int parameterName, @OutParameter @Check("4") IntBuffer params);
+
+ @Alternate("glGetProgramivARB")
+ @GLreturn("params")
+ @StripPostfix("params")
+ void glGetProgramivARB2(@GLenum int target, @GLenum int parameterName, @OutParameter IntBuffer params);
+
+ void glGetProgramStringARB(@GLenum int target, @GLenum int parameterName, @OutParameter @Check @GLbyte Buffer paramString);
+
+ @Alternate("glGetProgramStringARB")
+ @Code("\t\tint programLength = glGetProgramARB(target, GL_PROGRAM_LENGTH_ARB);")
+ @GLreturn(value="paramString", maxLength = "programLength", forceMaxLength = true)
+ void glGetProgramStringARB2(@GLenum int target, @GLenum int parameterName, @OutParameter @GLchar ByteBuffer paramString);
+
+ boolean glIsProgramARB(@GLuint int program);
+}
diff --git a/src/templates/org/lwjgl/opengl/ARB_provoking_vertex.java b/src/templates/org/lwjgl/opengl/ARB_provoking_vertex.java
index 0bf26e7..192cfda 100644
--- a/src/templates/org/lwjgl/opengl/ARB_provoking_vertex.java
+++ b/src/templates/org/lwjgl/opengl/ARB_provoking_vertex.java
@@ -1,51 +1,51 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.GLenum;
-
-public interface ARB_provoking_vertex {
-
- /** Accepted by the <mode> parameter of ProvokingVertex: */
- int GL_FIRST_VERTEX_CONVENTION = 0x8E4D;
- int GL_LAST_VERTEX_CONVENTION = 0x8E4E;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv, and GetDoublev:
- */
- int GL_PROVOKING_VERTEX = 0x8E4F;
- int GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION = 0x8E4C;
-
- void glProvokingVertex(@GLenum int mode);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.GLenum;
+
+public interface ARB_provoking_vertex {
+
+ /** Accepted by the <mode> parameter of ProvokingVertex: */
+ int GL_FIRST_VERTEX_CONVENTION = 0x8E4D;
+ int GL_LAST_VERTEX_CONVENTION = 0x8E4E;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, and GetDoublev:
+ */
+ int GL_PROVOKING_VERTEX = 0x8E4F;
+ int GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION = 0x8E4C;
+
+ void glProvokingVertex(@GLenum int mode);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_sample_shading.java b/src/templates/org/lwjgl/opengl/ARB_sample_shading.java
index 543ef6c..23e3271 100644
--- a/src/templates/org/lwjgl/opengl/ARB_sample_shading.java
+++ b/src/templates/org/lwjgl/opengl/ARB_sample_shading.java
@@ -1,53 +1,53 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.GLclampf;
-
-public interface ARB_sample_shading {
-
- /**
- * Accepted by the <cap> parameter of Enable, Disable, and IsEnabled,
- * and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
- * and GetDoublev:
- */
- int GL_SAMPLE_SHADING_ARB = 0x8C36;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetDoublev,
- * GetIntegerv, and GetFloatv:
- */
- int GL_MIN_SAMPLE_SHADING_VALUE_ARB = 0x8C37;
-
- void glMinSampleShadingARB(@GLclampf float value);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.GLclampf;
+
+public interface ARB_sample_shading {
+
+ /**
+ * Accepted by the <cap> parameter of Enable, Disable, and IsEnabled,
+ * and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
+ * and GetDoublev:
+ */
+ int GL_SAMPLE_SHADING_ARB = 0x8C36;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetDoublev,
+ * GetIntegerv, and GetFloatv:
+ */
+ int GL_MIN_SAMPLE_SHADING_VALUE_ARB = 0x8C37;
+
+ void glMinSampleShadingARB(@GLclampf float value);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_sampler_objects.java b/src/templates/org/lwjgl/opengl/ARB_sampler_objects.java
index 2ca468c..27e30c2 100644
--- a/src/templates/org/lwjgl/opengl/ARB_sampler_objects.java
+++ b/src/templates/org/lwjgl/opengl/ARB_sampler_objects.java
@@ -1,111 +1,111 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.FloatBuffer;
-import java.nio.IntBuffer;
-
- at Extension(postfix = "")
-public interface ARB_sampler_objects {
-
- /**
- * Accepted by the <value> parameter of the GetBooleanv, GetIntegerv,
- * GetInteger64v, GetFloatv and GetDoublev functions:
- */
- int GL_SAMPLER_BINDING = 0x8919;
-
- void glGenSamplers(@AutoSize("samplers") @GLsizei int count, @OutParameter @GLuint IntBuffer samplers);
-
- @Alternate("glGenSamplers")
- @GLreturn("samplers")
- void glGenSamplers2(@Constant("1") @GLsizei int count, @OutParameter @GLuint IntBuffer samplers);
-
- void glDeleteSamplers(@AutoSize("samplers") @GLsizei int count, @Const @GLuint IntBuffer samplers);
-
- @Alternate("glDeleteSamplers")
- void glDeleteSamplers(@Constant("1") @GLsizei int count, @Constant(value = "APIUtils.getBufferInt().put(0, sampler), 0", keepParam = true) int sampler);
-
- boolean glIsSampler(@GLuint int sampler);
-
- void glBindSampler(@GLenum int unit, @GLuint int sampler);
-
- void glSamplerParameteri(@GLuint int sampler, @GLenum int pname, int param);
-
- void glSamplerParameterf(@GLuint int sampler, @GLenum int pname, float param);
-
- @StripPostfix("params")
- void glSamplerParameteriv(@GLuint int sampler, @GLenum int pname, @Check("4") @Const IntBuffer params);
-
- @StripPostfix("params")
- void glSamplerParameterfv(@GLuint int sampler, @GLenum int pname, @Check("4") @Const FloatBuffer params);
-
- @StripPostfix("params")
- void glSamplerParameterIiv(@GLuint int sampler, @GLenum int pname, @Check("4") @Const IntBuffer params);
-
- @StripPostfix("params")
- void glSamplerParameterIuiv(@GLuint int sampler, @GLenum int pname, @Check("4") @Const @GLuint IntBuffer params);
-
- @StripPostfix("params")
- void glGetSamplerParameteriv(@GLuint int sampler, @GLenum int pname, @Check("4") @OutParameter IntBuffer params);
-
- @Alternate("glGetSamplerParameteriv")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- void glGetSamplerParameteriv2(@GLuint int sampler, @GLenum int pname, @OutParameter IntBuffer params);
-
- @StripPostfix("params")
- void glGetSamplerParameterfv(@GLuint int sampler, @GLenum int pname, @Check("4") @OutParameter FloatBuffer params);
-
- @Alternate("glGetSamplerParameterfv")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- void glGetSamplerParameterfv2(@GLuint int sampler, @GLenum int pname, @OutParameter FloatBuffer params);
-
- @StripPostfix("params")
- void glGetSamplerParameterIiv(@GLuint int sampler, @GLenum int pname, @Check("4") @OutParameter IntBuffer params);
-
- @Alternate("glGetSamplerParameterIiv")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- void glGetSamplerParameterIiv2(@GLuint int sampler, @GLenum int pname, @OutParameter IntBuffer params);
-
- @StripPostfix("params")
- void glGetSamplerParameterIuiv(@GLuint int sampler, @GLenum int pname, @Check("4") @OutParameter IntBuffer params);
-
- @Alternate("glGetSamplerParameterIuiv")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- void glGetSamplerParameterIuiv2(@GLuint int sampler, @GLenum int pname, @OutParameter IntBuffer params);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.FloatBuffer;
+import java.nio.IntBuffer;
+
+ at Extension(postfix = "")
+public interface ARB_sampler_objects {
+
+ /**
+ * Accepted by the <value> parameter of the GetBooleanv, GetIntegerv,
+ * GetInteger64v, GetFloatv and GetDoublev functions:
+ */
+ int GL_SAMPLER_BINDING = 0x8919;
+
+ void glGenSamplers(@AutoSize("samplers") @GLsizei int count, @OutParameter @GLuint IntBuffer samplers);
+
+ @Alternate("glGenSamplers")
+ @GLreturn("samplers")
+ void glGenSamplers2(@Constant("1") @GLsizei int count, @OutParameter @GLuint IntBuffer samplers);
+
+ void glDeleteSamplers(@AutoSize("samplers") @GLsizei int count, @Const @GLuint IntBuffer samplers);
+
+ @Alternate("glDeleteSamplers")
+ void glDeleteSamplers(@Constant("1") @GLsizei int count, @Constant(value = "APIUtils.getBufferInt().put(0, sampler), 0", keepParam = true) int sampler);
+
+ boolean glIsSampler(@GLuint int sampler);
+
+ void glBindSampler(@GLenum int unit, @GLuint int sampler);
+
+ void glSamplerParameteri(@GLuint int sampler, @GLenum int pname, int param);
+
+ void glSamplerParameterf(@GLuint int sampler, @GLenum int pname, float param);
+
+ @StripPostfix("params")
+ void glSamplerParameteriv(@GLuint int sampler, @GLenum int pname, @Check("4") @Const IntBuffer params);
+
+ @StripPostfix("params")
+ void glSamplerParameterfv(@GLuint int sampler, @GLenum int pname, @Check("4") @Const FloatBuffer params);
+
+ @StripPostfix("params")
+ void glSamplerParameterIiv(@GLuint int sampler, @GLenum int pname, @Check("4") @Const IntBuffer params);
+
+ @StripPostfix("params")
+ void glSamplerParameterIuiv(@GLuint int sampler, @GLenum int pname, @Check("4") @Const @GLuint IntBuffer params);
+
+ @StripPostfix("params")
+ void glGetSamplerParameteriv(@GLuint int sampler, @GLenum int pname, @Check("4") @OutParameter IntBuffer params);
+
+ @Alternate("glGetSamplerParameteriv")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetSamplerParameteriv2(@GLuint int sampler, @GLenum int pname, @OutParameter IntBuffer params);
+
+ @StripPostfix("params")
+ void glGetSamplerParameterfv(@GLuint int sampler, @GLenum int pname, @Check("4") @OutParameter FloatBuffer params);
+
+ @Alternate("glGetSamplerParameterfv")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetSamplerParameterfv2(@GLuint int sampler, @GLenum int pname, @OutParameter FloatBuffer params);
+
+ @StripPostfix("params")
+ void glGetSamplerParameterIiv(@GLuint int sampler, @GLenum int pname, @Check("4") @OutParameter IntBuffer params);
+
+ @Alternate("glGetSamplerParameterIiv")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetSamplerParameterIiv2(@GLuint int sampler, @GLenum int pname, @OutParameter IntBuffer params);
+
+ @StripPostfix("params")
+ void glGetSamplerParameterIuiv(@GLuint int sampler, @GLenum int pname, @Check("4") @OutParameter IntBuffer params);
+
+ @Alternate("glGetSamplerParameterIuiv")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetSamplerParameterIuiv2(@GLuint int sampler, @GLenum int pname, @OutParameter IntBuffer params);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_seamless_cube_map.java b/src/templates/org/lwjgl/opengl/ARB_seamless_cube_map.java
index 0a58ffb..f2a8ce8 100644
--- a/src/templates/org/lwjgl/opengl/ARB_seamless_cube_map.java
+++ b/src/templates/org/lwjgl/opengl/ARB_seamless_cube_map.java
@@ -1,43 +1,43 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_seamless_cube_map {
-
- /**
- * Accepted by the <cap> parameter of Enable, Disable and IsEnabled,
- * and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv
- * and GetDoublev:
- */
- int GL_TEXTURE_CUBE_MAP_SEAMLESS = 0x884F;
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_seamless_cube_map {
+
+ /**
+ * Accepted by the <cap> parameter of Enable, Disable and IsEnabled,
+ * and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv
+ * and GetDoublev:
+ */
+ int GL_TEXTURE_CUBE_MAP_SEAMLESS = 0x884F;
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_shader_bit_encoding.java b/src/templates/org/lwjgl/opengl/ARB_shader_bit_encoding.java
index 0c7a561..5428bc4 100644
--- a/src/templates/org/lwjgl/opengl/ARB_shader_bit_encoding.java
+++ b/src/templates/org/lwjgl/opengl/ARB_shader_bit_encoding.java
@@ -1,35 +1,35 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_shader_bit_encoding {
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_shader_bit_encoding {
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_shader_objects.java b/src/templates/org/lwjgl/opengl/ARB_shader_objects.java
index d58a8b2..c774b03 100644
--- a/src/templates/org/lwjgl/opengl/ARB_shader_objects.java
+++ b/src/templates/org/lwjgl/opengl/ARB_shader_objects.java
@@ -1,272 +1,272 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.ByteBuffer;
-import java.nio.FloatBuffer;
-import java.nio.IntBuffer;
-
-public interface ARB_shader_objects {
-
- /** Accepted by the <pname> argument of GetHandleARB: */
- int GL_PROGRAM_OBJECT_ARB = 0x8B40;
-
- /** Accepted by the <pname> parameter of GetObjectParameter{fi}vARB: */
- int GL_OBJECT_TYPE_ARB = 0x8B4E;
- int GL_OBJECT_SUBTYPE_ARB = 0x8B4F;
- int GL_OBJECT_DELETE_STATUS_ARB = 0x8B80;
- int GL_OBJECT_COMPILE_STATUS_ARB = 0x8B81;
- int GL_OBJECT_LINK_STATUS_ARB = 0x8B82;
- int GL_OBJECT_VALIDATE_STATUS_ARB = 0x8B83;
- int GL_OBJECT_INFO_LOG_LENGTH_ARB = 0x8B84;
- int GL_OBJECT_ATTACHED_OBJECTS_ARB = 0x8B85;
- int GL_OBJECT_ACTIVE_UNIFORMS_ARB = 0x8B86;
- int GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB = 0x8B87;
- int GL_OBJECT_SHADER_SOURCE_LENGTH_ARB = 0x8B88;
-
- /** Returned by the <params> parameter of GetObjectParameter{fi}vARB: */
- int GL_SHADER_OBJECT_ARB = 0x8B48;
-
- /** Returned by the <type> parameter of GetActiveUniformARB: */
- int GL_FLOAT = 0x1406;
- int GL_FLOAT_VEC2_ARB = 0x8B50;
- int GL_FLOAT_VEC3_ARB = 0x8B51;
- int GL_FLOAT_VEC4_ARB = 0x8B52;
- int GL_INT = 0x1404;
- int GL_INT_VEC2_ARB = 0x8B53;
- int GL_INT_VEC3_ARB = 0x8B54;
- int GL_INT_VEC4_ARB = 0x8B55;
- int GL_BOOL_ARB = 0x8B56;
- int GL_BOOL_VEC2_ARB = 0x8B57;
- int GL_BOOL_VEC3_ARB = 0x8B58;
- int GL_BOOL_VEC4_ARB = 0x8B59;
- int GL_FLOAT_MAT2_ARB = 0x8B5A;
- int GL_FLOAT_MAT3_ARB = 0x8B5B;
- int GL_FLOAT_MAT4_ARB = 0x8B5C;
- int GL_SAMPLER_1D_ARB = 0x8B5D;
- int GL_SAMPLER_2D_ARB = 0x8B5E;
- int GL_SAMPLER_3D_ARB = 0x8B5F;
- int GL_SAMPLER_CUBE_ARB = 0x8B60;
- int GL_SAMPLER_1D_SHADOW_ARB = 0x8B61;
- int GL_SAMPLER_2D_SHADOW_ARB = 0x8B62;
- int GL_SAMPLER_2D_RECT_ARB = 0x8B63;
- int GL_SAMPLER_2D_RECT_SHADOW_ARB = 0x8B64;
-
- void glDeleteObjectARB(@GLhandleARB int obj);
-
- @GLhandleARB
- int glGetHandleARB(@GLenum int pname);
-
- void glDetachObjectARB(@GLhandleARB int containerObj, @GLhandleARB int attachedObj);
-
- @GLhandleARB
- int glCreateShaderObjectARB(@GLenum int shaderType);
-
- /**
- * The ARB_shader_objects extension allows multiple, optionally null-terminated, source strings to define a shader program.
- * <p/>
- * This method uses just a single string, that should NOT be null-terminated.
- */
- void glShaderSourceARB(@GLhandleARB int shader, @Constant("1") @GLsizei int count,
- @Indirect @Const @GLcharARB @Check ByteBuffer string,
- @AutoSize("string") @Indirect @Const @GLint int length);
-
- @Alternate("glShaderSourceARB")
- void glShaderSourceARB2(@GLhandleARB int shader, @Constant("1") @GLsizei int count, CharSequence string, @Constant("string.length()") @Indirect @Const int length);
-
- @Alternate(value = "glShaderSourceARB", nativeAlt = true)
- void glShaderSourceARB3(@GLhandleARB int shader, @Constant("strings.length") @GLsizei int count,
- @Const @StringList(value = "count", lengths = "length") CharSequence[] strings,
- @Constant("APIUtils.getLengths(strings), 0") @Const IntBuffer length);
-
- void glCompileShaderARB(@GLhandleARB int shaderObj);
-
- @GLhandleARB
- int glCreateProgramObjectARB();
-
- void glAttachObjectARB(@GLhandleARB int containerObj, @GLhandleARB int obj);
-
- void glLinkProgramARB(@GLhandleARB int programObj);
-
- void glUseProgramObjectARB(@GLhandleARB int programObj);
-
- void glValidateProgramARB(@GLhandleARB int programObj);
-
- void glUniform1fARB(int location, float v0);
-
- void glUniform2fARB(int location, float v0, float v1);
-
- void glUniform3fARB(int location, float v0, float v1, float v2);
-
- void glUniform4fARB(int location, float v0, float v1, float v2, float v3);
-
- void glUniform1iARB(int location, int v0);
-
- void glUniform2iARB(int location, int v0, int v1);
-
- void glUniform3iARB(int location, int v0, int v1, int v2);
-
- void glUniform4iARB(int location, int v0, int v1, int v2, int v3);
-
- @StripPostfix("values")
- void glUniform1fvARB(int location, @AutoSize("values") @GLsizei int count, @Const FloatBuffer values);
-
- @StripPostfix("values")
- void glUniform2fvARB(int location, @AutoSize(value = "values", expression = " >> 1") @GLsizei int count, @Const FloatBuffer values);
-
- @StripPostfix("values")
- void glUniform3fvARB(int location, @AutoSize(value = "values", expression = " / 3") @GLsizei int count, @Const FloatBuffer values);
-
- @StripPostfix("values")
- void glUniform4fvARB(int location, @AutoSize(value = "values", expression = " >> 2") @GLsizei int count, @Const FloatBuffer values);
-
- @StripPostfix("values")
- void glUniform1ivARB(int location, @AutoSize(value = "values") @GLsizei int count, @Const IntBuffer values);
-
- @StripPostfix("values")
- void glUniform2ivARB(int location, @AutoSize(value = "values", expression = " >> 1") @GLsizei int count, @Const IntBuffer values);
-
- @StripPostfix("values")
- void glUniform3ivARB(int location, @AutoSize(value = "values", expression = " / 3") @GLsizei int count, @Const IntBuffer values);
-
- @StripPostfix("values")
- void glUniform4ivARB(int location, @AutoSize(value = "values", expression = " >> 2") @GLsizei int count, @Const IntBuffer values);
-
- @StripPostfix("matrices")
- void glUniformMatrix2fvARB(int location, @AutoSize(value = "matrices", expression = " >> 2") @GLsizei int count, boolean transpose, @Const FloatBuffer matrices);
-
- @StripPostfix("matrices")
- void glUniformMatrix3fvARB(int location, @AutoSize(value = "matrices", expression = " / (3 * 3)") @GLsizei int count, boolean transpose, @Const FloatBuffer matrices);
-
- @StripPostfix("matrices")
- void glUniformMatrix4fvARB(int location, @AutoSize(value = "matrices", expression = " >> 4") @GLsizei int count, boolean transpose, @Const FloatBuffer matrices);
-
- @StripPostfix("params")
- void glGetObjectParameterfvARB(@GLhandleARB int obj, @GLenum int pname, @OutParameter @Check FloatBuffer params);
-
- @Alternate("glGetObjectParameterfvARB")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- void glGetObjectParameterfvARB2(@GLhandleARB int obj, @GLenum int pname, @OutParameter FloatBuffer params);
-
- @StripPostfix("params")
- void glGetObjectParameterivARB(@GLhandleARB int obj, @GLenum int pname, @OutParameter @Check IntBuffer params);
-
- @Alternate("glGetObjectParameterivARB")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- void glGetObjectParameterivARB2(@GLhandleARB int obj, @GLenum int pname, @OutParameter IntBuffer params);
-
- void glGetInfoLogARB(@GLhandleARB int obj, @AutoSize("infoLog") @GLsizei int maxLength,
- @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
- @OutParameter @GLcharARB ByteBuffer infoLog);
-
- @Alternate("glGetInfoLogARB")
- @GLreturn(value = "infoLog", maxLength = "maxLength")
- void glGetInfoLogARB2(@GLhandleARB int obj, @GLsizei int maxLength,
- @OutParameter @GLsizei @Constant("infoLog_length, 0") IntBuffer length,
- @OutParameter @GLcharARB ByteBuffer infoLog);
-
- void glGetAttachedObjectsARB(@GLhandleARB int containerObj, @AutoSize("obj") @GLsizei int maxCount,
- @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer count,
- @OutParameter @GLhandleARB IntBuffer obj);
-
- /**
- * Returns the location of the uniform with the specified name. The ByteBuffer should contain the uniform name as a <b>null-terminated</b> string.
- *
- * @param programObj
- * @param name
- */
- int glGetUniformLocationARB(@GLhandleARB int programObj, @NullTerminated @Const @GLcharARB ByteBuffer name);
-
- @Alternate("glGetUniformLocationARB")
- int glGetUniformLocationARB(@GLhandleARB int programObj, @NullTerminated CharSequence name);
-
- void glGetActiveUniformARB(@GLhandleARB int programObj, @GLuint int index, @AutoSize("name") @GLsizei int maxLength,
- @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
- @OutParameter @Check("1") IntBuffer size,
- @OutParameter @GLenum @Check("1") IntBuffer type,
- @OutParameter @GLcharARB ByteBuffer name);
-
- /** Overloads glGetActiveUniformARB. This version returns both size and type in the sizeType buffer (at .position() and .position() + 1). */
- @Alternate("glGetActiveUniformARB")
- @GLreturn(value = "name", maxLength = "maxLength")
- void glGetActiveUniformARB2(@GLhandleARB int programObj, @GLuint int index, @GLsizei int maxLength,
- @OutParameter @GLsizei @Constant("name_length, 0") IntBuffer length,
- @OutParameter @Check("2") IntBuffer sizeType,
- @OutParameter @GLenum @Constant("sizeType, sizeType.position() + 1") IntBuffer type,
- @OutParameter @GLcharARB ByteBuffer name);
-
- /** Overloads glGetActiveUniformARB. This version returns only the uniform name. */
- @Alternate(value = "glGetActiveUniformARB", javaAlt = true)
- @GLreturn(value = "name", maxLength = "maxLength")
- void glGetActiveUniformARB(@GLhandleARB int programObj, @GLuint int index, @GLsizei int maxLength,
- @OutParameter @GLsizei @Constant("name_length, 0, APIUtils.getBufferInt(), 0, APIUtils.getBufferInt(), 1") IntBuffer length,
- @OutParameter @GLcharARB ByteBuffer name);
-
- /** Overloads glGetActiveUniformARB. This version returns only the uniform size. */
- @Alternate(value = "glGetActiveUniformARB", javaAlt = true)
- @GLreturn(value = "size")
- void glGetActiveUniformSizeARB(@GLhandleARB int programObj, @GLuint int index, @Constant("0") @GLsizei int maxLength,
- @OutParameter @GLsizei @Constant("null, 0") IntBuffer length,
- @OutParameter IntBuffer size,
- @OutParameter @GLenum @Constant("size, 1") IntBuffer type, // Reuse size buffer and ignore
- @OutParameter @GLcharARB @Constant("APIUtils.getBufferByte(0), 0") ByteBuffer name);
-
- /** Overloads glGetActiveUniformARB. This version returns only the uniform type. */
- @Alternate(value = "glGetActiveUniformARB", javaAlt = true)
- @GLreturn(value = "type")
- void glGetActiveUniformTypeARB(@GLhandleARB int programObj, @GLuint int index, @Constant("0") @GLsizei int maxLength,
- @OutParameter @GLsizei @Constant("null, 0") IntBuffer length,
- @OutParameter @Constant("type, 1") IntBuffer size, // Reuse type buffer and ignore
- @OutParameter @GLenum IntBuffer type,
- @OutParameter @GLcharARB @Constant("APIUtils.getBufferByte(0), 0") ByteBuffer name);
-
- @StripPostfix("params")
- void glGetUniformfvARB(@GLhandleARB int programObj, int location, @OutParameter @Check FloatBuffer params);
-
- @StripPostfix("params")
- void glGetUniformivARB(@GLhandleARB int programObj, int location, @OutParameter @Check IntBuffer params);
-
- void glGetShaderSourceARB(@GLhandleARB int obj, @AutoSize("source") @GLsizei int maxLength,
- @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
- @OutParameter @GLcharARB ByteBuffer source);
-
- @Alternate("glGetShaderSourceARB")
- @GLreturn(value = "source", maxLength = "maxLength")
- void glGetShaderSourceARB2(@GLhandleARB int obj, @GLsizei int maxLength,
- @OutParameter @GLsizei @Constant("source_length, 0") IntBuffer length,
- @OutParameter @GLcharARB ByteBuffer source);
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.ByteBuffer;
+import java.nio.FloatBuffer;
+import java.nio.IntBuffer;
+
+public interface ARB_shader_objects {
+
+ /** Accepted by the <pname> argument of GetHandleARB: */
+ int GL_PROGRAM_OBJECT_ARB = 0x8B40;
+
+ /** Accepted by the <pname> parameter of GetObjectParameter{fi}vARB: */
+ int GL_OBJECT_TYPE_ARB = 0x8B4E;
+ int GL_OBJECT_SUBTYPE_ARB = 0x8B4F;
+ int GL_OBJECT_DELETE_STATUS_ARB = 0x8B80;
+ int GL_OBJECT_COMPILE_STATUS_ARB = 0x8B81;
+ int GL_OBJECT_LINK_STATUS_ARB = 0x8B82;
+ int GL_OBJECT_VALIDATE_STATUS_ARB = 0x8B83;
+ int GL_OBJECT_INFO_LOG_LENGTH_ARB = 0x8B84;
+ int GL_OBJECT_ATTACHED_OBJECTS_ARB = 0x8B85;
+ int GL_OBJECT_ACTIVE_UNIFORMS_ARB = 0x8B86;
+ int GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB = 0x8B87;
+ int GL_OBJECT_SHADER_SOURCE_LENGTH_ARB = 0x8B88;
+
+ /** Returned by the <params> parameter of GetObjectParameter{fi}vARB: */
+ int GL_SHADER_OBJECT_ARB = 0x8B48;
+
+ /** Returned by the <type> parameter of GetActiveUniformARB: */
+ int GL_FLOAT = 0x1406;
+ int GL_FLOAT_VEC2_ARB = 0x8B50;
+ int GL_FLOAT_VEC3_ARB = 0x8B51;
+ int GL_FLOAT_VEC4_ARB = 0x8B52;
+ int GL_INT = 0x1404;
+ int GL_INT_VEC2_ARB = 0x8B53;
+ int GL_INT_VEC3_ARB = 0x8B54;
+ int GL_INT_VEC4_ARB = 0x8B55;
+ int GL_BOOL_ARB = 0x8B56;
+ int GL_BOOL_VEC2_ARB = 0x8B57;
+ int GL_BOOL_VEC3_ARB = 0x8B58;
+ int GL_BOOL_VEC4_ARB = 0x8B59;
+ int GL_FLOAT_MAT2_ARB = 0x8B5A;
+ int GL_FLOAT_MAT3_ARB = 0x8B5B;
+ int GL_FLOAT_MAT4_ARB = 0x8B5C;
+ int GL_SAMPLER_1D_ARB = 0x8B5D;
+ int GL_SAMPLER_2D_ARB = 0x8B5E;
+ int GL_SAMPLER_3D_ARB = 0x8B5F;
+ int GL_SAMPLER_CUBE_ARB = 0x8B60;
+ int GL_SAMPLER_1D_SHADOW_ARB = 0x8B61;
+ int GL_SAMPLER_2D_SHADOW_ARB = 0x8B62;
+ int GL_SAMPLER_2D_RECT_ARB = 0x8B63;
+ int GL_SAMPLER_2D_RECT_SHADOW_ARB = 0x8B64;
+
+ void glDeleteObjectARB(@GLhandleARB int obj);
+
+ @GLhandleARB
+ int glGetHandleARB(@GLenum int pname);
+
+ void glDetachObjectARB(@GLhandleARB int containerObj, @GLhandleARB int attachedObj);
+
+ @GLhandleARB
+ int glCreateShaderObjectARB(@GLenum int shaderType);
+
+ /**
+ * The ARB_shader_objects extension allows multiple, optionally null-terminated, source strings to define a shader program.
+ * <p/>
+ * This method uses just a single string, that should NOT be null-terminated.
+ */
+ void glShaderSourceARB(@GLhandleARB int shader, @Constant("1") @GLsizei int count,
+ @Indirect @Const @GLcharARB @Check ByteBuffer string,
+ @AutoSize("string") @Indirect @Const @GLint int length);
+
+ @Alternate("glShaderSourceARB")
+ void glShaderSourceARB2(@GLhandleARB int shader, @Constant("1") @GLsizei int count, CharSequence string, @Constant("string.length()") @Indirect @Const int length);
+
+ @Alternate(value = "glShaderSourceARB", nativeAlt = true)
+ void glShaderSourceARB3(@GLhandleARB int shader, @Constant("strings.length") @GLsizei int count,
+ @Const @StringList(value = "count", lengths = "length") CharSequence[] strings,
+ @Constant("APIUtils.getLengths(strings), 0") @Const IntBuffer length);
+
+ void glCompileShaderARB(@GLhandleARB int shaderObj);
+
+ @GLhandleARB
+ int glCreateProgramObjectARB();
+
+ void glAttachObjectARB(@GLhandleARB int containerObj, @GLhandleARB int obj);
+
+ void glLinkProgramARB(@GLhandleARB int programObj);
+
+ void glUseProgramObjectARB(@GLhandleARB int programObj);
+
+ void glValidateProgramARB(@GLhandleARB int programObj);
+
+ void glUniform1fARB(int location, float v0);
+
+ void glUniform2fARB(int location, float v0, float v1);
+
+ void glUniform3fARB(int location, float v0, float v1, float v2);
+
+ void glUniform4fARB(int location, float v0, float v1, float v2, float v3);
+
+ void glUniform1iARB(int location, int v0);
+
+ void glUniform2iARB(int location, int v0, int v1);
+
+ void glUniform3iARB(int location, int v0, int v1, int v2);
+
+ void glUniform4iARB(int location, int v0, int v1, int v2, int v3);
+
+ @StripPostfix("values")
+ void glUniform1fvARB(int location, @AutoSize("values") @GLsizei int count, @Const FloatBuffer values);
+
+ @StripPostfix("values")
+ void glUniform2fvARB(int location, @AutoSize(value = "values", expression = " >> 1") @GLsizei int count, @Const FloatBuffer values);
+
+ @StripPostfix("values")
+ void glUniform3fvARB(int location, @AutoSize(value = "values", expression = " / 3") @GLsizei int count, @Const FloatBuffer values);
+
+ @StripPostfix("values")
+ void glUniform4fvARB(int location, @AutoSize(value = "values", expression = " >> 2") @GLsizei int count, @Const FloatBuffer values);
+
+ @StripPostfix("values")
+ void glUniform1ivARB(int location, @AutoSize(value = "values") @GLsizei int count, @Const IntBuffer values);
+
+ @StripPostfix("values")
+ void glUniform2ivARB(int location, @AutoSize(value = "values", expression = " >> 1") @GLsizei int count, @Const IntBuffer values);
+
+ @StripPostfix("values")
+ void glUniform3ivARB(int location, @AutoSize(value = "values", expression = " / 3") @GLsizei int count, @Const IntBuffer values);
+
+ @StripPostfix("values")
+ void glUniform4ivARB(int location, @AutoSize(value = "values", expression = " >> 2") @GLsizei int count, @Const IntBuffer values);
+
+ @StripPostfix("matrices")
+ void glUniformMatrix2fvARB(int location, @AutoSize(value = "matrices", expression = " >> 2") @GLsizei int count, boolean transpose, @Const FloatBuffer matrices);
+
+ @StripPostfix("matrices")
+ void glUniformMatrix3fvARB(int location, @AutoSize(value = "matrices", expression = " / (3 * 3)") @GLsizei int count, boolean transpose, @Const FloatBuffer matrices);
+
+ @StripPostfix("matrices")
+ void glUniformMatrix4fvARB(int location, @AutoSize(value = "matrices", expression = " >> 4") @GLsizei int count, boolean transpose, @Const FloatBuffer matrices);
+
+ @StripPostfix("params")
+ void glGetObjectParameterfvARB(@GLhandleARB int obj, @GLenum int pname, @OutParameter @Check FloatBuffer params);
+
+ @Alternate("glGetObjectParameterfvARB")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetObjectParameterfvARB2(@GLhandleARB int obj, @GLenum int pname, @OutParameter FloatBuffer params);
+
+ @StripPostfix("params")
+ void glGetObjectParameterivARB(@GLhandleARB int obj, @GLenum int pname, @OutParameter @Check IntBuffer params);
+
+ @Alternate("glGetObjectParameterivARB")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetObjectParameterivARB2(@GLhandleARB int obj, @GLenum int pname, @OutParameter IntBuffer params);
+
+ void glGetInfoLogARB(@GLhandleARB int obj, @AutoSize("infoLog") @GLsizei int maxLength,
+ @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
+ @OutParameter @GLcharARB ByteBuffer infoLog);
+
+ @Alternate("glGetInfoLogARB")
+ @GLreturn(value = "infoLog", maxLength = "maxLength")
+ void glGetInfoLogARB2(@GLhandleARB int obj, @GLsizei int maxLength,
+ @OutParameter @GLsizei @Constant("infoLog_length, 0") IntBuffer length,
+ @OutParameter @GLcharARB ByteBuffer infoLog);
+
+ void glGetAttachedObjectsARB(@GLhandleARB int containerObj, @AutoSize("obj") @GLsizei int maxCount,
+ @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer count,
+ @OutParameter @GLhandleARB IntBuffer obj);
+
+ /**
+ * Returns the location of the uniform with the specified name. The ByteBuffer should contain the uniform name as a <b>null-terminated</b> string.
+ *
+ * @param programObj
+ * @param name
+ */
+ int glGetUniformLocationARB(@GLhandleARB int programObj, @NullTerminated @Const @GLcharARB ByteBuffer name);
+
+ @Alternate("glGetUniformLocationARB")
+ int glGetUniformLocationARB(@GLhandleARB int programObj, @NullTerminated CharSequence name);
+
+ void glGetActiveUniformARB(@GLhandleARB int programObj, @GLuint int index, @AutoSize("name") @GLsizei int maxLength,
+ @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
+ @OutParameter @Check("1") IntBuffer size,
+ @OutParameter @GLenum @Check("1") IntBuffer type,
+ @OutParameter @GLcharARB ByteBuffer name);
+
+ /** Overloads glGetActiveUniformARB. This version returns both size and type in the sizeType buffer (at .position() and .position() + 1). */
+ @Alternate("glGetActiveUniformARB")
+ @GLreturn(value = "name", maxLength = "maxLength")
+ void glGetActiveUniformARB2(@GLhandleARB int programObj, @GLuint int index, @GLsizei int maxLength,
+ @OutParameter @GLsizei @Constant("name_length, 0") IntBuffer length,
+ @OutParameter @Check("2") IntBuffer sizeType,
+ @OutParameter @GLenum @Constant("sizeType, sizeType.position() + 1") IntBuffer type,
+ @OutParameter @GLcharARB ByteBuffer name);
+
+ /** Overloads glGetActiveUniformARB. This version returns only the uniform name. */
+ @Alternate(value = "glGetActiveUniformARB", javaAlt = true)
+ @GLreturn(value = "name", maxLength = "maxLength")
+ void glGetActiveUniformARB(@GLhandleARB int programObj, @GLuint int index, @GLsizei int maxLength,
+ @OutParameter @GLsizei @Constant("name_length, 0, APIUtils.getBufferInt(), 0, APIUtils.getBufferInt(), 1") IntBuffer length,
+ @OutParameter @GLcharARB ByteBuffer name);
+
+ /** Overloads glGetActiveUniformARB. This version returns only the uniform size. */
+ @Alternate(value = "glGetActiveUniformARB", javaAlt = true)
+ @GLreturn(value = "size")
+ void glGetActiveUniformSizeARB(@GLhandleARB int programObj, @GLuint int index, @Constant("0") @GLsizei int maxLength,
+ @OutParameter @GLsizei @Constant("null, 0") IntBuffer length,
+ @OutParameter IntBuffer size,
+ @OutParameter @GLenum @Constant("size, 1") IntBuffer type, // Reuse size buffer and ignore
+ @OutParameter @GLcharARB @Constant("APIUtils.getBufferByte(0), 0") ByteBuffer name);
+
+ /** Overloads glGetActiveUniformARB. This version returns only the uniform type. */
+ @Alternate(value = "glGetActiveUniformARB", javaAlt = true)
+ @GLreturn(value = "type")
+ void glGetActiveUniformTypeARB(@GLhandleARB int programObj, @GLuint int index, @Constant("0") @GLsizei int maxLength,
+ @OutParameter @GLsizei @Constant("null, 0") IntBuffer length,
+ @OutParameter @Constant("type, 1") IntBuffer size, // Reuse type buffer and ignore
+ @OutParameter @GLenum IntBuffer type,
+ @OutParameter @GLcharARB @Constant("APIUtils.getBufferByte(0), 0") ByteBuffer name);
+
+ @StripPostfix("params")
+ void glGetUniformfvARB(@GLhandleARB int programObj, int location, @OutParameter @Check FloatBuffer params);
+
+ @StripPostfix("params")
+ void glGetUniformivARB(@GLhandleARB int programObj, int location, @OutParameter @Check IntBuffer params);
+
+ void glGetShaderSourceARB(@GLhandleARB int obj, @AutoSize("source") @GLsizei int maxLength,
+ @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
+ @OutParameter @GLcharARB ByteBuffer source);
+
+ @Alternate("glGetShaderSourceARB")
+ @GLreturn(value = "source", maxLength = "maxLength")
+ void glGetShaderSourceARB2(@GLhandleARB int obj, @GLsizei int maxLength,
+ @OutParameter @GLsizei @Constant("source_length, 0") IntBuffer length,
+ @OutParameter @GLcharARB ByteBuffer source);
+
+}
diff --git a/src/templates/org/lwjgl/opengl/ARB_shader_subroutine.java b/src/templates/org/lwjgl/opengl/ARB_shader_subroutine.java
index 51d1b6b..4bfa3c7 100644
--- a/src/templates/org/lwjgl/opengl/ARB_shader_subroutine.java
+++ b/src/templates/org/lwjgl/opengl/ARB_shader_subroutine.java
@@ -1,116 +1,116 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.ByteBuffer;
-import java.nio.IntBuffer;
-
- at Extension(postfix = "")
-public interface ARB_shader_subroutine {
-
- /** Accepted by the <pname> parameter of GetProgramStageiv: */
- int GL_ACTIVE_SUBROUTINES = 0x8DE5;
- int GL_ACTIVE_SUBROUTINE_UNIFORMS = 0x8DE6;
- int GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS = 0x8E47;
- int GL_ACTIVE_SUBROUTINE_MAX_LENGTH = 0x8E48;
- int GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH = 0x8E49;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv, GetDoublev, and GetInteger64v:
- */
- int GL_MAX_SUBROUTINES = 0x8DE7;
- int GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS = 0x8DE8;
-
- /** Accepted by the <pname> parameter of GetActiveSubroutineUniformiv: */
- int GL_NUM_COMPATIBLE_SUBROUTINES = 0x8E4A;
- int GL_COMPATIBLE_SUBROUTINES = 0x8E4B;
- int GL_UNIFORM_SIZE = GL31.GL_UNIFORM_SIZE;
- int GL_UNIFORM_NAME_LENGTH = GL31.GL_UNIFORM_NAME_LENGTH;
-
- int glGetSubroutineUniformLocation(@GLuint int program, @GLenum int shadertype, @Const @NullTerminated ByteBuffer name);
-
- @GLuint
- int glGetSubroutineIndex(@GLuint int program, @GLenum int shadertype, @Const @NullTerminated ByteBuffer name);
-
- @StripPostfix("values")
- void glGetActiveSubroutineUniformiv(@GLuint int program, @GLenum int shadertype, @GLuint int index, @GLenum int pname,
- @Check("1") @OutParameter IntBuffer values);
-
- @Alternate("glGetActiveSubroutineUniformiv")
- @GLreturn("values")
- @StripPostfix("values")
- void glGetActiveSubroutineUniformiv2(@GLuint int program, @GLenum int shadertype, @GLuint int index, @GLenum int pname,
- @OutParameter IntBuffer values);
-
- void glGetActiveSubroutineUniformName(@GLuint int program, @GLenum int shadertype, @GLuint int index, @AutoSize("name") @GLsizei int bufsize,
- @OutParameter @Check(value = "1", canBeNull = true) @GLsizei IntBuffer length,
- @OutParameter ByteBuffer name);
-
- @Alternate("glGetActiveSubroutineUniformName")
- @GLreturn(value = "name", maxLength = "bufsize")
- void glGetActiveSubroutineUniformName2(@GLuint int program, @GLenum int shadertype, @GLuint int index, @GLsizei int bufsize,
- @OutParameter @Constant("name_length, 0") @GLsizei IntBuffer length,
- @OutParameter @GLchar ByteBuffer name);
-
- void glGetActiveSubroutineName(@GLuint int program, @GLenum int shadertype, @GLuint int index, @AutoSize("name") @GLsizei int bufsize,
- @OutParameter @Check(value = "1", canBeNull = true) @GLsizei IntBuffer length,
- @OutParameter ByteBuffer name);
-
- @Alternate("glGetActiveSubroutineName")
- @GLreturn(value = "name", maxLength = "bufsize")
- void glGetActiveSubroutineName2(@GLuint int program, @GLenum int shadertype, @GLuint int index, @GLsizei int bufsize,
- @OutParameter @Constant("name_length, 0") @GLsizei IntBuffer length,
- @OutParameter @GLchar ByteBuffer name);
-
- @StripPostfix("indices")
- void glUniformSubroutinesuiv(@GLenum int shadertype, @AutoSize("indices") @GLsizei int count, @Const @GLuint IntBuffer indices);
-
- @StripPostfix("params")
- void glGetUniformSubroutineuiv(@GLenum int shadertype, int location, @Check("1") @OutParameter @GLuint IntBuffer params);
-
- @Alternate("glGetUniformSubroutineuiv")
- @GLreturn("params")
- @StripPostfix("params")
- void glGetUniformSubroutineuiv2(@GLenum int shadertype, int location, @OutParameter @GLuint IntBuffer params);
-
- @StripPostfix("values")
- void glGetProgramStageiv(@GLuint int program, @GLenum int shadertype, @GLenum int pname, @Check("1") @OutParameter IntBuffer values);
-
- @Alternate("glGetProgramStageiv")
- @GLreturn("values")
- @StripPostfix("values")
- void glGetProgramStageiv2(@GLuint int program, @GLenum int shadertype, @GLenum int pname, @OutParameter IntBuffer values);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.ByteBuffer;
+import java.nio.IntBuffer;
+
+ at Extension(postfix = "")
+public interface ARB_shader_subroutine {
+
+ /** Accepted by the <pname> parameter of GetProgramStageiv: */
+ int GL_ACTIVE_SUBROUTINES = 0x8DE5;
+ int GL_ACTIVE_SUBROUTINE_UNIFORMS = 0x8DE6;
+ int GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS = 0x8E47;
+ int GL_ACTIVE_SUBROUTINE_MAX_LENGTH = 0x8E48;
+ int GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH = 0x8E49;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, GetDoublev, and GetInteger64v:
+ */
+ int GL_MAX_SUBROUTINES = 0x8DE7;
+ int GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS = 0x8DE8;
+
+ /** Accepted by the <pname> parameter of GetActiveSubroutineUniformiv: */
+ int GL_NUM_COMPATIBLE_SUBROUTINES = 0x8E4A;
+ int GL_COMPATIBLE_SUBROUTINES = 0x8E4B;
+ int GL_UNIFORM_SIZE = GL31.GL_UNIFORM_SIZE;
+ int GL_UNIFORM_NAME_LENGTH = GL31.GL_UNIFORM_NAME_LENGTH;
+
+ int glGetSubroutineUniformLocation(@GLuint int program, @GLenum int shadertype, @Const @NullTerminated ByteBuffer name);
+
+ @GLuint
+ int glGetSubroutineIndex(@GLuint int program, @GLenum int shadertype, @Const @NullTerminated ByteBuffer name);
+
+ @StripPostfix("values")
+ void glGetActiveSubroutineUniformiv(@GLuint int program, @GLenum int shadertype, @GLuint int index, @GLenum int pname,
+ @Check("1") @OutParameter IntBuffer values);
+
+ @Alternate("glGetActiveSubroutineUniformiv")
+ @GLreturn("values")
+ @StripPostfix("values")
+ void glGetActiveSubroutineUniformiv2(@GLuint int program, @GLenum int shadertype, @GLuint int index, @GLenum int pname,
+ @OutParameter IntBuffer values);
+
+ void glGetActiveSubroutineUniformName(@GLuint int program, @GLenum int shadertype, @GLuint int index, @AutoSize("name") @GLsizei int bufsize,
+ @OutParameter @Check(value = "1", canBeNull = true) @GLsizei IntBuffer length,
+ @OutParameter ByteBuffer name);
+
+ @Alternate("glGetActiveSubroutineUniformName")
+ @GLreturn(value = "name", maxLength = "bufsize")
+ void glGetActiveSubroutineUniformName2(@GLuint int program, @GLenum int shadertype, @GLuint int index, @GLsizei int bufsize,
+ @OutParameter @Constant("name_length, 0") @GLsizei IntBuffer length,
+ @OutParameter @GLchar ByteBuffer name);
+
+ void glGetActiveSubroutineName(@GLuint int program, @GLenum int shadertype, @GLuint int index, @AutoSize("name") @GLsizei int bufsize,
+ @OutParameter @Check(value = "1", canBeNull = true) @GLsizei IntBuffer length,
+ @OutParameter ByteBuffer name);
+
+ @Alternate("glGetActiveSubroutineName")
+ @GLreturn(value = "name", maxLength = "bufsize")
+ void glGetActiveSubroutineName2(@GLuint int program, @GLenum int shadertype, @GLuint int index, @GLsizei int bufsize,
+ @OutParameter @Constant("name_length, 0") @GLsizei IntBuffer length,
+ @OutParameter @GLchar ByteBuffer name);
+
+ @StripPostfix("indices")
+ void glUniformSubroutinesuiv(@GLenum int shadertype, @AutoSize("indices") @GLsizei int count, @Const @GLuint IntBuffer indices);
+
+ @StripPostfix("params")
+ void glGetUniformSubroutineuiv(@GLenum int shadertype, int location, @Check("1") @OutParameter @GLuint IntBuffer params);
+
+ @Alternate("glGetUniformSubroutineuiv")
+ @GLreturn("params")
+ @StripPostfix("params")
+ void glGetUniformSubroutineuiv2(@GLenum int shadertype, int location, @OutParameter @GLuint IntBuffer params);
+
+ @StripPostfix("values")
+ void glGetProgramStageiv(@GLuint int program, @GLenum int shadertype, @GLenum int pname, @Check("1") @OutParameter IntBuffer values);
+
+ @Alternate("glGetProgramStageiv")
+ @GLreturn("values")
+ @StripPostfix("values")
+ void glGetProgramStageiv2(@GLuint int program, @GLenum int shadertype, @GLenum int pname, @OutParameter IntBuffer values);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_shader_texture_lod.java b/src/templates/org/lwjgl/opengl/ARB_shader_texture_lod.java
index e646dea..58b6142 100644
--- a/src/templates/org/lwjgl/opengl/ARB_shader_texture_lod.java
+++ b/src/templates/org/lwjgl/opengl/ARB_shader_texture_lod.java
@@ -1,35 +1,35 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_shader_texture_lod {
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_shader_texture_lod {
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_shading_language_100.java b/src/templates/org/lwjgl/opengl/ARB_shading_language_100.java
index a9b9865..a6f4bfa 100644
--- a/src/templates/org/lwjgl/opengl/ARB_shading_language_100.java
+++ b/src/templates/org/lwjgl/opengl/ARB_shading_language_100.java
@@ -1,40 +1,40 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_shading_language_100 {
-
- /**
- * Accepted by the <name> parameter of GetString:
- */
- int GL_SHADING_LANGUAGE_VERSION_ARB = 0x8B8C;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_shading_language_100 {
+
+ /**
+ * Accepted by the <name> parameter of GetString:
+ */
+ int GL_SHADING_LANGUAGE_VERSION_ARB = 0x8B8C;
+}
diff --git a/src/templates/org/lwjgl/opengl/ARB_shading_language_include.java b/src/templates/org/lwjgl/opengl/ARB_shading_language_include.java
index 482411a..35eaadf 100644
--- a/src/templates/org/lwjgl/opengl/ARB_shading_language_include.java
+++ b/src/templates/org/lwjgl/opengl/ARB_shading_language_include.java
@@ -1,106 +1,106 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.ByteBuffer;
-import java.nio.IntBuffer;
-
-public interface ARB_shading_language_include {
-
- /** Accepted by the <type> parameter of NamedStringARB: */
- int GL_SHADER_INCLUDE_ARB = 0x8DAE;
-
- /** Accepted by the <pname> parameter of GetNamedStringivARB: */
- int GL_NAMED_STRING_LENGTH_ARB = 0x8DE9;
- int GL_NAMED_STRING_TYPE_ARB = 0x8DEA;
-
- void glNamedStringARB(@GLenum int type,
- @AutoSize("name") int namelen, @Const @GLchar ByteBuffer name,
- @AutoSize("string") int stringlen, @Const @GLchar ByteBuffer string);
-
- @Alternate("glNamedStringARB")
- void glNamedStringARB(@GLenum int type,
- @Constant("name.length()") int namelen, CharSequence name,
- @Constant("string.length()") int stringlen, CharSequence string);
-
- void glDeleteNamedStringARB(@AutoSize("name") int namelen, @Const @GLchar ByteBuffer name);
-
- @Alternate("glDeleteNamedStringARB")
- void glDeleteNamedStringARB(@Constant("name.length()") int namelen, CharSequence name);
-
- void glCompileShaderIncludeARB(@GLuint int shader, @GLsizei int count,
- @Const @NullTerminated("count") @StringList("count") @GLchar ByteBuffer path,
- @Constant("null, 0") @Const IntBuffer length);
-
- @Alternate(value = "glCompileShaderIncludeARB", nativeAlt = true)
- void glCompileShaderIncludeARB2(@GLuint int shader, @Constant("path.length") @GLsizei int count,
- @Const @StringList(value = "count", lengths = "length") CharSequence[] path,
- @Constant("APIUtils.getLengths(path), 0") @Const IntBuffer length);
-
- boolean glIsNamedStringARB(@AutoSize("name") int namelen, @Const @GLchar ByteBuffer name);
-
- @Alternate("glIsNamedStringARB")
- boolean glIsNamedStringARB(@Constant("name.length()") int namelen, CharSequence name);
-
- void glGetNamedStringARB(@AutoSize("name") int namelen, @Const @GLchar ByteBuffer name,
- @AutoSize("string") @GLsizei int bufSize,
- @OutParameter @Check(value = "1", canBeNull = true) IntBuffer stringlen,
- @OutParameter @GLchar ByteBuffer string);
-
- @Alternate("glGetNamedStringARB")
- void glGetNamedStringARB(@Constant("name.length()") int namelen, CharSequence name,
- @AutoSize("string") @GLsizei int bufSize,
- @OutParameter @Check(value = "1", canBeNull = true) IntBuffer stringlen,
- @OutParameter @GLchar ByteBuffer string);
-
- @Alternate("glGetNamedStringARB")
- @GLreturn(value = "string", maxLength = "bufSize")
- void glGetNamedStringARB2(@Constant("name.length()") int namelen, CharSequence name,
- @GLsizei int bufSize,
- @OutParameter @Constant("string_length, 0") IntBuffer stringlen,
- @OutParameter @GLchar ByteBuffer string);
-
- @StripPostfix("params")
- void glGetNamedStringivARB(@AutoSize("name") int namelen, @Const @GLchar ByteBuffer name, @GLenum int pname, @OutParameter @Check("1") IntBuffer params);
-
- @Alternate("glGetNamedStringivARB")
- @StripPostfix(value = "params", postfix = "v")
- void glGetNamedStringivARB(@Constant("name.length()") int namelen, CharSequence name, @GLenum int pname, @OutParameter @Check("1") IntBuffer params);
-
- @Alternate("glGetNamedStringivARB")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- void glGetNamedStringivARB2(@Constant("name.length()") int namelen, CharSequence name, @GLenum int pname, @OutParameter IntBuffer params);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.ByteBuffer;
+import java.nio.IntBuffer;
+
+public interface ARB_shading_language_include {
+
+ /** Accepted by the <type> parameter of NamedStringARB: */
+ int GL_SHADER_INCLUDE_ARB = 0x8DAE;
+
+ /** Accepted by the <pname> parameter of GetNamedStringivARB: */
+ int GL_NAMED_STRING_LENGTH_ARB = 0x8DE9;
+ int GL_NAMED_STRING_TYPE_ARB = 0x8DEA;
+
+ void glNamedStringARB(@GLenum int type,
+ @AutoSize("name") int namelen, @Const @GLchar ByteBuffer name,
+ @AutoSize("string") int stringlen, @Const @GLchar ByteBuffer string);
+
+ @Alternate("glNamedStringARB")
+ void glNamedStringARB(@GLenum int type,
+ @Constant("name.length()") int namelen, CharSequence name,
+ @Constant("string.length()") int stringlen, CharSequence string);
+
+ void glDeleteNamedStringARB(@AutoSize("name") int namelen, @Const @GLchar ByteBuffer name);
+
+ @Alternate("glDeleteNamedStringARB")
+ void glDeleteNamedStringARB(@Constant("name.length()") int namelen, CharSequence name);
+
+ void glCompileShaderIncludeARB(@GLuint int shader, @GLsizei int count,
+ @Const @NullTerminated("count") @StringList("count") @GLchar ByteBuffer path,
+ @Constant("null, 0") @Const IntBuffer length);
+
+ @Alternate(value = "glCompileShaderIncludeARB", nativeAlt = true)
+ void glCompileShaderIncludeARB2(@GLuint int shader, @Constant("path.length") @GLsizei int count,
+ @Const @StringList(value = "count", lengths = "length") CharSequence[] path,
+ @Constant("APIUtils.getLengths(path), 0") @Const IntBuffer length);
+
+ boolean glIsNamedStringARB(@AutoSize("name") int namelen, @Const @GLchar ByteBuffer name);
+
+ @Alternate("glIsNamedStringARB")
+ boolean glIsNamedStringARB(@Constant("name.length()") int namelen, CharSequence name);
+
+ void glGetNamedStringARB(@AutoSize("name") int namelen, @Const @GLchar ByteBuffer name,
+ @AutoSize("string") @GLsizei int bufSize,
+ @OutParameter @Check(value = "1", canBeNull = true) IntBuffer stringlen,
+ @OutParameter @GLchar ByteBuffer string);
+
+ @Alternate("glGetNamedStringARB")
+ void glGetNamedStringARB(@Constant("name.length()") int namelen, CharSequence name,
+ @AutoSize("string") @GLsizei int bufSize,
+ @OutParameter @Check(value = "1", canBeNull = true) IntBuffer stringlen,
+ @OutParameter @GLchar ByteBuffer string);
+
+ @Alternate("glGetNamedStringARB")
+ @GLreturn(value = "string", maxLength = "bufSize")
+ void glGetNamedStringARB2(@Constant("name.length()") int namelen, CharSequence name,
+ @GLsizei int bufSize,
+ @OutParameter @Constant("string_length, 0") IntBuffer stringlen,
+ @OutParameter @GLchar ByteBuffer string);
+
+ @StripPostfix("params")
+ void glGetNamedStringivARB(@AutoSize("name") int namelen, @Const @GLchar ByteBuffer name, @GLenum int pname, @OutParameter @Check("1") IntBuffer params);
+
+ @Alternate("glGetNamedStringivARB")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetNamedStringivARB(@Constant("name.length()") int namelen, CharSequence name, @GLenum int pname, @OutParameter @Check("1") IntBuffer params);
+
+ @Alternate("glGetNamedStringivARB")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetNamedStringivARB2(@Constant("name.length()") int namelen, CharSequence name, @GLenum int pname, @OutParameter IntBuffer params);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_shadow.java b/src/templates/org/lwjgl/opengl/ARB_shadow.java
index c3d9c36..70bba3a 100644
--- a/src/templates/org/lwjgl/opengl/ARB_shadow.java
+++ b/src/templates/org/lwjgl/opengl/ARB_shadow.java
@@ -1,38 +1,38 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_shadow {
- int GL_TEXTURE_COMPARE_MODE_ARB = 0x884C;
- int GL_TEXTURE_COMPARE_FUNC_ARB = 0x884D;
- int GL_COMPARE_R_TO_TEXTURE_ARB = 0x884E;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_shadow {
+ int GL_TEXTURE_COMPARE_MODE_ARB = 0x884C;
+ int GL_TEXTURE_COMPARE_FUNC_ARB = 0x884D;
+ int GL_COMPARE_R_TO_TEXTURE_ARB = 0x884E;
+}
diff --git a/src/templates/org/lwjgl/opengl/ARB_shadow_ambient.java b/src/templates/org/lwjgl/opengl/ARB_shadow_ambient.java
index e2cea05..9236708 100644
--- a/src/templates/org/lwjgl/opengl/ARB_shadow_ambient.java
+++ b/src/templates/org/lwjgl/opengl/ARB_shadow_ambient.java
@@ -1,36 +1,36 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_shadow_ambient {
- int GL_TEXTURE_COMPARE_FAIL_VALUE_ARB = 0x80BF;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_shadow_ambient {
+ int GL_TEXTURE_COMPARE_FAIL_VALUE_ARB = 0x80BF;
+}
diff --git a/src/templates/org/lwjgl/opengl/ARB_sync.java b/src/templates/org/lwjgl/opengl/ARB_sync.java
index eb78879..929110c 100644
--- a/src/templates/org/lwjgl/opengl/ARB_sync.java
+++ b/src/templates/org/lwjgl/opengl/ARB_sync.java
@@ -1,104 +1,104 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.IntBuffer;
-import java.nio.LongBuffer;
-
- at Extension(postfix = "")
-public interface ARB_sync {
-
- /** Accepted as the <pname> parameter of GetInteger64v: */
- int GL_MAX_SERVER_WAIT_TIMEOUT = 0x9111;
-
- /** Accepted as the <pname> parameter of GetSynciv: */
- int GL_OBJECT_TYPE = 0x9112;
- int GL_SYNC_CONDITION = 0x9113;
- int GL_SYNC_STATUS = 0x9114;
- int GL_SYNC_FLAGS = 0x9115;
-
- /** Returned in <values> for GetSynciv <pname> OBJECT_TYPE: */
- int GL_SYNC_FENCE = 0x9116;
-
- /** Returned in <values> for GetSynciv <pname> SYNC_CONDITION: */
- int GL_SYNC_GPU_COMMANDS_COMPLETE = 0x9117;
-
- /** Returned in <values> for GetSynciv <pname> SYNC_STATUS: */
- int GL_UNSIGNALED = 0x9118;
- int GL_SIGNALED = 0x9119;
-
- /** Accepted in the <flags> parameter of ClientWaitSync: */
- int GL_SYNC_FLUSH_COMMANDS_BIT = 0x00000001;
-
- /** Accepted in the <timeout> parameter of WaitSync: */
- long GL_TIMEOUT_IGNORED = 0xFFFFFFFFFFFFFFFFl;
-
- /** Returned by ClientWaitSync: */
- int GL_ALREADY_SIGNALED = 0x911A;
- int GL_TIMEOUT_EXPIRED = 0x911B;
- int GL_CONDITION_SATISFIED = 0x911C;
- int GL_WAIT_FAILED = 0x911D;
-
- @GLpointer("GLsync")
- GLSync glFenceSync(@GLenum int condition, @GLbitfield int flags);
-
- boolean glIsSync(@GLpointer("GLsync") GLSync sync);
-
- void glDeleteSync(@GLpointer("GLsync") GLSync sync);
-
- @GLenum
- int glClientWaitSync(@GLpointer("GLsync") GLSync sync, @GLbitfield int flags, @GLuint64 long timeout);
-
- void glWaitSync(@GLpointer("GLsync") GLSync sync, @GLbitfield int flags, @GLuint64 long timeout);
-
- @StripPostfix(value = "params", postfix = "64")
- void glGetInteger64v(@GLenum int pname, @OutParameter @Check("1") @GLint64 LongBuffer params);
-
- @Alternate("glGetInteger64v")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "64")
- void glGetInteger64v2(@GLenum int pname, @OutParameter @GLint64 LongBuffer params);
-
- @StripPostfix("values")
- void glGetSynciv(@GLpointer("GLsync") GLSync sync, @GLenum int pname, @AutoSize("values") @GLsizei int bufSize,
- @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
- @OutParameter IntBuffer values);
-
- @Alternate("glGetSynciv")
- @GLreturn("values")
- @StripPostfix("values")
- void glGetSynciv2(@GLpointer("GLsync") GLSync sync, @GLenum int pname, @Constant("1") @GLsizei int bufSize,
- @OutParameter @GLsizei @Constant("null, 0") IntBuffer length,
- @OutParameter IntBuffer values);
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.IntBuffer;
+import java.nio.LongBuffer;
+
+ at Extension(postfix = "")
+public interface ARB_sync {
+
+ /** Accepted as the <pname> parameter of GetInteger64v: */
+ int GL_MAX_SERVER_WAIT_TIMEOUT = 0x9111;
+
+ /** Accepted as the <pname> parameter of GetSynciv: */
+ int GL_OBJECT_TYPE = 0x9112;
+ int GL_SYNC_CONDITION = 0x9113;
+ int GL_SYNC_STATUS = 0x9114;
+ int GL_SYNC_FLAGS = 0x9115;
+
+ /** Returned in <values> for GetSynciv <pname> OBJECT_TYPE: */
+ int GL_SYNC_FENCE = 0x9116;
+
+ /** Returned in <values> for GetSynciv <pname> SYNC_CONDITION: */
+ int GL_SYNC_GPU_COMMANDS_COMPLETE = 0x9117;
+
+ /** Returned in <values> for GetSynciv <pname> SYNC_STATUS: */
+ int GL_UNSIGNALED = 0x9118;
+ int GL_SIGNALED = 0x9119;
+
+ /** Accepted in the <flags> parameter of ClientWaitSync: */
+ int GL_SYNC_FLUSH_COMMANDS_BIT = 0x00000001;
+
+ /** Accepted in the <timeout> parameter of WaitSync: */
+ long GL_TIMEOUT_IGNORED = 0xFFFFFFFFFFFFFFFFl;
+
+ /** Returned by ClientWaitSync: */
+ int GL_ALREADY_SIGNALED = 0x911A;
+ int GL_TIMEOUT_EXPIRED = 0x911B;
+ int GL_CONDITION_SATISFIED = 0x911C;
+ int GL_WAIT_FAILED = 0x911D;
+
+ @GLpointer("GLsync")
+ GLSync glFenceSync(@GLenum int condition, @GLbitfield int flags);
+
+ boolean glIsSync(@GLpointer("GLsync") GLSync sync);
+
+ void glDeleteSync(@GLpointer("GLsync") GLSync sync);
+
+ @GLenum
+ int glClientWaitSync(@GLpointer("GLsync") GLSync sync, @GLbitfield int flags, @GLuint64 long timeout);
+
+ void glWaitSync(@GLpointer("GLsync") GLSync sync, @GLbitfield int flags, @GLuint64 long timeout);
+
+ @StripPostfix(value = "params", postfix = "64")
+ void glGetInteger64v(@GLenum int pname, @OutParameter @Check("1") @GLint64 LongBuffer params);
+
+ @Alternate("glGetInteger64v")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "64")
+ void glGetInteger64v2(@GLenum int pname, @OutParameter @GLint64 LongBuffer params);
+
+ @StripPostfix("values")
+ void glGetSynciv(@GLpointer("GLsync") GLSync sync, @GLenum int pname, @AutoSize("values") @GLsizei int bufSize,
+ @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
+ @OutParameter IntBuffer values);
+
+ @Alternate("glGetSynciv")
+ @GLreturn("values")
+ @StripPostfix("values")
+ void glGetSynciv2(@GLpointer("GLsync") GLSync sync, @GLenum int pname, @Constant("1") @GLsizei int bufSize,
+ @OutParameter @GLsizei @Constant("null, 0") IntBuffer length,
+ @OutParameter IntBuffer values);
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_tessellation_shader.java b/src/templates/org/lwjgl/opengl/ARB_tessellation_shader.java
index c599c2b..c9c084e 100644
--- a/src/templates/org/lwjgl/opengl/ARB_tessellation_shader.java
+++ b/src/templates/org/lwjgl/opengl/ARB_tessellation_shader.java
@@ -1,122 +1,122 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.FloatBuffer;
-
- at Extension(postfix = "")
-public interface ARB_tessellation_shader {
-
- /**
- * Accepted by the <mode> parameter of Begin and all vertex array functions
- * that implicitly call Begin:
- */
- int GL_PATCHES = 0xE;
-
- /**
- * Accepted by the <pname> parameter of PatchParameteri, GetBooleanv,
- * GetDoublev, GetFloatv, GetIntegerv, and GetInteger64v:
- */
- int GL_PATCH_VERTICES = 0x8E72;
-
- /**
- * Accepted by the <pname> parameter of PatchParameterfv, GetBooleanv,
- * GetDoublev, GetFloatv, and GetIntegerv, and GetInteger64v:
- */
- int GL_PATCH_DEFAULT_INNER_LEVEL = 0x8E73;
- int GL_PATCH_DEFAULT_OUTER_LEVEL = 0x8E74;
-
- /** Accepted by the <pname> parameter of GetProgramiv: */
- int GL_TESS_CONTROL_OUTPUT_VERTICES = 0x8E75;
- int GL_TESS_GEN_MODE = 0x8E76;
- int GL_TESS_GEN_SPACING = 0x8E77;
- int GL_TESS_GEN_VERTEX_ORDER = 0x8E78;
- int GL_TESS_GEN_POINT_MODE = 0x8E79;
-
- /** Returned by GetProgramiv when <pname> is TESS_GEN_MODE: */
- int GL_TRIANGLES = GL11.GL_TRIANGLES;
- int GL_QUADS = GL11.GL_QUADS;
- int GL_ISOLINES = 0x8E7A;
-
- /** Returned by GetProgramiv when <pname> is TESS_GEN_SPACING: */
- int GL_EQUAL = GL11.GL_EQUAL;
- int GL_FRACTIONAL_ODD = 0x8E7B;
- int GL_FRACTIONAL_EVEN = 0x8E7C;
-
- /** Returned by GetProgramiv when <pname> is TESS_GEN_VERTEX_ORDER: */
- int GL_CCW = GL11.GL_CCW;
- int GL_CW = GL11.GL_CW;
-
- /** Returned by GetProgramiv when <pname> is TESS_GEN_POINT_MODE: */
- int GL_FALSE = GL11.GL_FALSE;
- int GL_TRUE = GL11.GL_TRUE;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetDoublev, GetFloatv,
- * GetIntegerv, and GetInteger64v:
- */
- int GL_MAX_PATCH_VERTICES = 0x8E7D;
- int GL_MAX_TESS_GEN_LEVEL = 0x8E7E;
- int GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E7F;
- int GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E80;
- int GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS = 0x8E81;
- int GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS = 0x8E82;
- int GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS = 0x8E83;
- int GL_MAX_TESS_PATCH_COMPONENTS = 0x8E84;
- int GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS = 0x8E85;
- int GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS = 0x8E86;
- int GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS = 0x8E89;
- int GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS = 0x8E8A;
- int GL_MAX_TESS_CONTROL_INPUT_COMPONENTS = 0x886C;
- int GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS = 0x886D;
- int GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E1E;
- int GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E1F;
-
- /** Accepted by the <pname> parameter of GetActiveUniformBlockiv: */
- int GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER = 0x84F0;
- int GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x84F1;
-
- /**
- * Accepted by the <type> parameter of CreateShader and returned by the
- * <params> parameter of GetShaderiv:
- */
- int GL_TESS_EVALUATION_SHADER = 0x8E87;
- int GL_TESS_CONTROL_SHADER = 0x8E88;
-
- void glPatchParameteri(@GLenum int pname, int value);
-
- @StripPostfix("values")
- void glPatchParameterfv(@GLenum int pname, @Check("4") @Const FloatBuffer values);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.FloatBuffer;
+
+ at Extension(postfix = "")
+public interface ARB_tessellation_shader {
+
+ /**
+ * Accepted by the <mode> parameter of Begin and all vertex array functions
+ * that implicitly call Begin:
+ */
+ int GL_PATCHES = 0xE;
+
+ /**
+ * Accepted by the <pname> parameter of PatchParameteri, GetBooleanv,
+ * GetDoublev, GetFloatv, GetIntegerv, and GetInteger64v:
+ */
+ int GL_PATCH_VERTICES = 0x8E72;
+
+ /**
+ * Accepted by the <pname> parameter of PatchParameterfv, GetBooleanv,
+ * GetDoublev, GetFloatv, and GetIntegerv, and GetInteger64v:
+ */
+ int GL_PATCH_DEFAULT_INNER_LEVEL = 0x8E73;
+ int GL_PATCH_DEFAULT_OUTER_LEVEL = 0x8E74;
+
+ /** Accepted by the <pname> parameter of GetProgramiv: */
+ int GL_TESS_CONTROL_OUTPUT_VERTICES = 0x8E75;
+ int GL_TESS_GEN_MODE = 0x8E76;
+ int GL_TESS_GEN_SPACING = 0x8E77;
+ int GL_TESS_GEN_VERTEX_ORDER = 0x8E78;
+ int GL_TESS_GEN_POINT_MODE = 0x8E79;
+
+ /** Returned by GetProgramiv when <pname> is TESS_GEN_MODE: */
+ int GL_TRIANGLES = GL11.GL_TRIANGLES;
+ int GL_QUADS = GL11.GL_QUADS;
+ int GL_ISOLINES = 0x8E7A;
+
+ /** Returned by GetProgramiv when <pname> is TESS_GEN_SPACING: */
+ int GL_EQUAL = GL11.GL_EQUAL;
+ int GL_FRACTIONAL_ODD = 0x8E7B;
+ int GL_FRACTIONAL_EVEN = 0x8E7C;
+
+ /** Returned by GetProgramiv when <pname> is TESS_GEN_VERTEX_ORDER: */
+ int GL_CCW = GL11.GL_CCW;
+ int GL_CW = GL11.GL_CW;
+
+ /** Returned by GetProgramiv when <pname> is TESS_GEN_POINT_MODE: */
+ int GL_FALSE = GL11.GL_FALSE;
+ int GL_TRUE = GL11.GL_TRUE;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetDoublev, GetFloatv,
+ * GetIntegerv, and GetInteger64v:
+ */
+ int GL_MAX_PATCH_VERTICES = 0x8E7D;
+ int GL_MAX_TESS_GEN_LEVEL = 0x8E7E;
+ int GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E7F;
+ int GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E80;
+ int GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS = 0x8E81;
+ int GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS = 0x8E82;
+ int GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS = 0x8E83;
+ int GL_MAX_TESS_PATCH_COMPONENTS = 0x8E84;
+ int GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS = 0x8E85;
+ int GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS = 0x8E86;
+ int GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS = 0x8E89;
+ int GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS = 0x8E8A;
+ int GL_MAX_TESS_CONTROL_INPUT_COMPONENTS = 0x886C;
+ int GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS = 0x886D;
+ int GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E1E;
+ int GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E1F;
+
+ /** Accepted by the <pname> parameter of GetActiveUniformBlockiv: */
+ int GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER = 0x84F0;
+ int GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x84F1;
+
+ /**
+ * Accepted by the <type> parameter of CreateShader and returned by the
+ * <params> parameter of GetShaderiv:
+ */
+ int GL_TESS_EVALUATION_SHADER = 0x8E87;
+ int GL_TESS_CONTROL_SHADER = 0x8E88;
+
+ void glPatchParameteri(@GLenum int pname, int value);
+
+ @StripPostfix("values")
+ void glPatchParameterfv(@GLenum int pname, @Check("4") @Const FloatBuffer values);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_texture_border_clamp.java b/src/templates/org/lwjgl/opengl/ARB_texture_border_clamp.java
index 3530b1f..bdfff4b 100644
--- a/src/templates/org/lwjgl/opengl/ARB_texture_border_clamp.java
+++ b/src/templates/org/lwjgl/opengl/ARB_texture_border_clamp.java
@@ -1,36 +1,36 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_texture_border_clamp {
- int GL_CLAMP_TO_BORDER_ARB = 0x812D;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_texture_border_clamp {
+ int GL_CLAMP_TO_BORDER_ARB = 0x812D;
+}
diff --git a/src/templates/org/lwjgl/opengl/ARB_texture_buffer_object.java b/src/templates/org/lwjgl/opengl/ARB_texture_buffer_object.java
index 3949912..0c3956e 100644
--- a/src/templates/org/lwjgl/opengl/ARB_texture_buffer_object.java
+++ b/src/templates/org/lwjgl/opengl/ARB_texture_buffer_object.java
@@ -1,58 +1,58 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.GLenum;
-import org.lwjgl.util.generator.GLuint;
-
-public interface ARB_texture_buffer_object {
-
- /**
- * Accepted by the <target> parameter of BindBuffer, BufferData,
- * BufferSubData, MapBuffer, MapBufferRangeARB, BindTexture, UnmapBuffer,
- * GetBufferSubData, GetBufferParameteriv, GetBufferPointerv, and TexBufferARB,
- * and the <pname> parameter of GetBooleanv, GetDoublev, GetFloatv, and
- * GetIntegerv:
- */
- int GL_TEXTURE_BUFFER_ARB = 0x8C2A;
-
- /**
- * Accepted by the <pname> parameters of GetBooleanv, GetDoublev,
- * GetFloatv, and GetIntegerv:
- */
- int GL_MAX_TEXTURE_BUFFER_SIZE_ARB = 0x8C2B;
- int GL_TEXTURE_BINDING_BUFFER_ARB = 0x8C2C;
- int GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB = 0x8C2D;
- int GL_TEXTURE_BUFFER_FORMAT_ARB = 0x8C2E;
-
- void glTexBufferARB(@GLenum int target, @GLenum int internalformat, @GLuint int buffer);
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.GLenum;
+import org.lwjgl.util.generator.GLuint;
+
+public interface ARB_texture_buffer_object {
+
+ /**
+ * Accepted by the <target> parameter of BindBuffer, BufferData,
+ * BufferSubData, MapBuffer, MapBufferRangeARB, BindTexture, UnmapBuffer,
+ * GetBufferSubData, GetBufferParameteriv, GetBufferPointerv, and TexBufferARB,
+ * and the <pname> parameter of GetBooleanv, GetDoublev, GetFloatv, and
+ * GetIntegerv:
+ */
+ int GL_TEXTURE_BUFFER_ARB = 0x8C2A;
+
+ /**
+ * Accepted by the <pname> parameters of GetBooleanv, GetDoublev,
+ * GetFloatv, and GetIntegerv:
+ */
+ int GL_MAX_TEXTURE_BUFFER_SIZE_ARB = 0x8C2B;
+ int GL_TEXTURE_BINDING_BUFFER_ARB = 0x8C2C;
+ int GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB = 0x8C2D;
+ int GL_TEXTURE_BUFFER_FORMAT_ARB = 0x8C2E;
+
+ void glTexBufferARB(@GLenum int target, @GLenum int internalformat, @GLuint int buffer);
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_texture_buffer_object_rgb32.java b/src/templates/org/lwjgl/opengl/ARB_texture_buffer_object_rgb32.java
index 45ed2f3..3a0a868 100644
--- a/src/templates/org/lwjgl/opengl/ARB_texture_buffer_object_rgb32.java
+++ b/src/templates/org/lwjgl/opengl/ARB_texture_buffer_object_rgb32.java
@@ -1,35 +1,35 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_texture_buffer_object_rgb32 {
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_texture_buffer_object_rgb32 {
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_texture_compression.java b/src/templates/org/lwjgl/opengl/ARB_texture_compression.java
index 7aef7e7..542d4fe 100644
--- a/src/templates/org/lwjgl/opengl/ARB_texture_compression.java
+++ b/src/templates/org/lwjgl/opengl/ARB_texture_compression.java
@@ -1,99 +1,99 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-public interface ARB_texture_compression {
- int GL_COMPRESSED_ALPHA_ARB = 0x84E9;
- int GL_COMPRESSED_LUMINANCE_ARB = 0x84EA;
- int GL_COMPRESSED_LUMINANCE_ALPHA_ARB = 0x84EB;
- int GL_COMPRESSED_INTENSITY_ARB = 0x84EC;
- int GL_COMPRESSED_RGB_ARB = 0x84ED;
- int GL_COMPRESSED_RGBA_ARB = 0x84EE;
- int GL_TEXTURE_COMPRESSION_HINT_ARB = 0x84EF;
- int GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB = 0x86A0;
- int GL_TEXTURE_COMPRESSED_ARB = 0x86A1;
- int GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB = 0x86A2;
- int GL_COMPRESSED_TEXTURE_FORMATS_ARB = 0x86A3;
-
- void glCompressedTexImage1DARB(@GLenum int target, int level, @GLenum int internalformat, @GLsizei int width, int border, @AutoSize("pData") @GLsizei int imageSize,
- @BufferObject(BufferKind.UnpackPBO)
- @Check
- @Const
- @GLvoid
- ByteBuffer pData);
-
- void glCompressedTexImage2DARB(@GLenum int target, int level, @GLenum int internalformat, @GLsizei int width, @GLsizei int height, int border, @AutoSize("pData") @GLsizei int imageSize,
- @BufferObject(BufferKind.UnpackPBO)
- @Check
- @Const
- @GLvoid
- ByteBuffer pData);
-
- void glCompressedTexImage3DARB(@GLenum int target, int level, @GLenum int internalformat, @GLsizei int width, @GLsizei int height, @GLsizei int depth, int border, @AutoSize("pData") @GLsizei int imageSize,
- @BufferObject(BufferKind.UnpackPBO)
- @Check
- @Const
- @GLvoid
- ByteBuffer pData);
-
- void glCompressedTexSubImage1DARB(@GLenum int target, int level, int xoffset, @GLsizei int width, @GLenum int format, @AutoSize("pData") @GLsizei int imageSize,
- @BufferObject(BufferKind.UnpackPBO)
- @Check
- @Const
- @GLvoid
- ByteBuffer pData);
-
- void glCompressedTexSubImage2DARB(@GLenum int target, int level, int xoffset, int yoffset, @GLsizei int width, @GLsizei int height, @GLenum int format, @AutoSize("pData") @GLsizei int imageSize,
- @BufferObject(BufferKind.UnpackPBO)
- @Check
- @Const
- @GLvoid
- ByteBuffer pData);
-
- void glCompressedTexSubImage3DARB(@GLenum int target, int level, int xoffset, int yoffset, int zoffset, @GLsizei int width, @GLsizei int height, @GLsizei int depth, @GLenum int format, @AutoSize("pData") @GLsizei int imageSize,
- @BufferObject(BufferKind.UnpackPBO)
- @Check
- @Const
- @GLvoid
- ByteBuffer pData);
-
- void glGetCompressedTexImageARB(@GLenum int target, int lod,
- @OutParameter
- @BufferObject(BufferKind.PackPBO)
- @Check
- @GLvoid
- ByteBuffer pImg);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+public interface ARB_texture_compression {
+ int GL_COMPRESSED_ALPHA_ARB = 0x84E9;
+ int GL_COMPRESSED_LUMINANCE_ARB = 0x84EA;
+ int GL_COMPRESSED_LUMINANCE_ALPHA_ARB = 0x84EB;
+ int GL_COMPRESSED_INTENSITY_ARB = 0x84EC;
+ int GL_COMPRESSED_RGB_ARB = 0x84ED;
+ int GL_COMPRESSED_RGBA_ARB = 0x84EE;
+ int GL_TEXTURE_COMPRESSION_HINT_ARB = 0x84EF;
+ int GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB = 0x86A0;
+ int GL_TEXTURE_COMPRESSED_ARB = 0x86A1;
+ int GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB = 0x86A2;
+ int GL_COMPRESSED_TEXTURE_FORMATS_ARB = 0x86A3;
+
+ void glCompressedTexImage1DARB(@GLenum int target, int level, @GLenum int internalformat, @GLsizei int width, int border, @AutoSize("pData") @GLsizei int imageSize,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check
+ @Const
+ @GLvoid
+ ByteBuffer pData);
+
+ void glCompressedTexImage2DARB(@GLenum int target, int level, @GLenum int internalformat, @GLsizei int width, @GLsizei int height, int border, @AutoSize("pData") @GLsizei int imageSize,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check
+ @Const
+ @GLvoid
+ ByteBuffer pData);
+
+ void glCompressedTexImage3DARB(@GLenum int target, int level, @GLenum int internalformat, @GLsizei int width, @GLsizei int height, @GLsizei int depth, int border, @AutoSize("pData") @GLsizei int imageSize,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check
+ @Const
+ @GLvoid
+ ByteBuffer pData);
+
+ void glCompressedTexSubImage1DARB(@GLenum int target, int level, int xoffset, @GLsizei int width, @GLenum int format, @AutoSize("pData") @GLsizei int imageSize,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check
+ @Const
+ @GLvoid
+ ByteBuffer pData);
+
+ void glCompressedTexSubImage2DARB(@GLenum int target, int level, int xoffset, int yoffset, @GLsizei int width, @GLsizei int height, @GLenum int format, @AutoSize("pData") @GLsizei int imageSize,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check
+ @Const
+ @GLvoid
+ ByteBuffer pData);
+
+ void glCompressedTexSubImage3DARB(@GLenum int target, int level, int xoffset, int yoffset, int zoffset, @GLsizei int width, @GLsizei int height, @GLsizei int depth, @GLenum int format, @AutoSize("pData") @GLsizei int imageSize,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check
+ @Const
+ @GLvoid
+ ByteBuffer pData);
+
+ void glGetCompressedTexImageARB(@GLenum int target, int lod,
+ @OutParameter
+ @BufferObject(BufferKind.PackPBO)
+ @Check
+ @GLvoid
+ ByteBuffer pImg);
+}
diff --git a/src/templates/org/lwjgl/opengl/ARB_texture_cube_map.java b/src/templates/org/lwjgl/opengl/ARB_texture_cube_map.java
index eb41182..5f03c3a 100644
--- a/src/templates/org/lwjgl/opengl/ARB_texture_cube_map.java
+++ b/src/templates/org/lwjgl/opengl/ARB_texture_cube_map.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_texture_cube_map {
- int GL_NORMAL_MAP_ARB = 0x8511;
- int GL_REFLECTION_MAP_ARB = 0x8512;
- int GL_TEXTURE_CUBE_MAP_ARB = 0x8513;
- int GL_TEXTURE_BINDING_CUBE_MAP_ARB = 0x8514;
- int GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB = 0x8515;
- int GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB = 0x8516;
- int GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB = 0x8517;
- int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB = 0x8518;
- int GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB = 0x8519;
- int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB = 0x851A;
- int GL_PROXY_TEXTURE_CUBE_MAP_ARB = 0x851B;
- int GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB = 0x851C;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_texture_cube_map {
+ int GL_NORMAL_MAP_ARB = 0x8511;
+ int GL_REFLECTION_MAP_ARB = 0x8512;
+ int GL_TEXTURE_CUBE_MAP_ARB = 0x8513;
+ int GL_TEXTURE_BINDING_CUBE_MAP_ARB = 0x8514;
+ int GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB = 0x8515;
+ int GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB = 0x8516;
+ int GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB = 0x8517;
+ int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB = 0x8518;
+ int GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB = 0x8519;
+ int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB = 0x851A;
+ int GL_PROXY_TEXTURE_CUBE_MAP_ARB = 0x851B;
+ int GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB = 0x851C;
+}
diff --git a/src/templates/org/lwjgl/opengl/ARB_texture_cube_map_array.java b/src/templates/org/lwjgl/opengl/ARB_texture_cube_map_array.java
index dd5d95e..1e0fcc0 100644
--- a/src/templates/org/lwjgl/opengl/ARB_texture_cube_map_array.java
+++ b/src/templates/org/lwjgl/opengl/ARB_texture_cube_map_array.java
@@ -1,65 +1,65 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_texture_cube_map_array {
-
- /**
- * Accepted by the <target> parameter of TexParameteri, TexParameteriv,
- * TexParameterf, TexParameterfv, BindTexture, and GenerateMipmap:
- * <p/>
- * Accepted by the <target> parameter of TexImage3D, TexSubImage3D,
- * CompressedTeximage3D, CompressedTexSubImage3D and CopyTexSubImage3D:
- * <p/>
- * Accepted by the <tex> parameter of GetTexImage:
- */
- int GL_TEXTURE_CUBE_MAP_ARRAY_ARB = 0x9009;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetDoublev,
- * GetIntegerv and GetFloatv:
- */
- int GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB = 0x900A;
-
- /**
- * Accepted by the <target> parameter of TexImage3D, TexSubImage3D,
- * CompressedTeximage3D, CompressedTexSubImage3D and CopyTexSubImage3D:
- */
- int GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB = 0x900B;
-
- /** Returned by the <type> parameter of GetActiveUniform: */
- int GL_SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900C;
- int GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB = 0x900D;
- int GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900E;
- int GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900F;
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_texture_cube_map_array {
+
+ /**
+ * Accepted by the <target> parameter of TexParameteri, TexParameteriv,
+ * TexParameterf, TexParameterfv, BindTexture, and GenerateMipmap:
+ * <p/>
+ * Accepted by the <target> parameter of TexImage3D, TexSubImage3D,
+ * CompressedTeximage3D, CompressedTexSubImage3D and CopyTexSubImage3D:
+ * <p/>
+ * Accepted by the <tex> parameter of GetTexImage:
+ */
+ int GL_TEXTURE_CUBE_MAP_ARRAY_ARB = 0x9009;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetDoublev,
+ * GetIntegerv and GetFloatv:
+ */
+ int GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB = 0x900A;
+
+ /**
+ * Accepted by the <target> parameter of TexImage3D, TexSubImage3D,
+ * CompressedTeximage3D, CompressedTexSubImage3D and CopyTexSubImage3D:
+ */
+ int GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB = 0x900B;
+
+ /** Returned by the <type> parameter of GetActiveUniform: */
+ int GL_SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900C;
+ int GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB = 0x900D;
+ int GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900E;
+ int GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900F;
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_texture_env_add.java b/src/templates/org/lwjgl/opengl/ARB_texture_env_add.java
index 5b3f0e6..5e12cf8 100644
--- a/src/templates/org/lwjgl/opengl/ARB_texture_env_add.java
+++ b/src/templates/org/lwjgl/opengl/ARB_texture_env_add.java
@@ -1,35 +1,35 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_texture_env_add {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_texture_env_add {
+}
diff --git a/src/templates/org/lwjgl/opengl/ARB_texture_env_combine.java b/src/templates/org/lwjgl/opengl/ARB_texture_env_combine.java
index c733fcc..1aceb45 100644
--- a/src/templates/org/lwjgl/opengl/ARB_texture_env_combine.java
+++ b/src/templates/org/lwjgl/opengl/ARB_texture_env_combine.java
@@ -1,63 +1,63 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_texture_env_combine {
- int GL_COMBINE_ARB = 0x8570;
-
- int GL_COMBINE_RGB_ARB = 0x8571;
- int GL_COMBINE_ALPHA_ARB = 0x8572;
-
- int GL_SOURCE0_RGB_ARB = 0x8580;
- int GL_SOURCE1_RGB_ARB = 0x8581;
- int GL_SOURCE2_RGB_ARB = 0x8582;
- int GL_SOURCE0_ALPHA_ARB = 0x8588;
- int GL_SOURCE1_ALPHA_ARB = 0x8589;
- int GL_SOURCE2_ALPHA_ARB = 0x858A;
-
- int GL_OPERAND0_RGB_ARB = 0x8590;
- int GL_OPERAND1_RGB_ARB = 0x8591;
- int GL_OPERAND2_RGB_ARB = 0x8592;
- int GL_OPERAND0_ALPHA_ARB = 0x8598;
- int GL_OPERAND1_ALPHA_ARB = 0x8599;
- int GL_OPERAND2_ALPHA_ARB = 0x859A;
-
- int GL_RGB_SCALE_ARB = 0x8573;
-
- int GL_ADD_SIGNED_ARB = 0x8574;
- int GL_INTERPOLATE_ARB = 0x8575;
- int GL_SUBTRACT_ARB = 0x84E7;
-
- int GL_CONSTANT_ARB = 0x8576;
- int GL_PRIMARY_COLOR_ARB = 0x8577;
- int GL_PREVIOUS_ARB = 0x8578;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_texture_env_combine {
+ int GL_COMBINE_ARB = 0x8570;
+
+ int GL_COMBINE_RGB_ARB = 0x8571;
+ int GL_COMBINE_ALPHA_ARB = 0x8572;
+
+ int GL_SOURCE0_RGB_ARB = 0x8580;
+ int GL_SOURCE1_RGB_ARB = 0x8581;
+ int GL_SOURCE2_RGB_ARB = 0x8582;
+ int GL_SOURCE0_ALPHA_ARB = 0x8588;
+ int GL_SOURCE1_ALPHA_ARB = 0x8589;
+ int GL_SOURCE2_ALPHA_ARB = 0x858A;
+
+ int GL_OPERAND0_RGB_ARB = 0x8590;
+ int GL_OPERAND1_RGB_ARB = 0x8591;
+ int GL_OPERAND2_RGB_ARB = 0x8592;
+ int GL_OPERAND0_ALPHA_ARB = 0x8598;
+ int GL_OPERAND1_ALPHA_ARB = 0x8599;
+ int GL_OPERAND2_ALPHA_ARB = 0x859A;
+
+ int GL_RGB_SCALE_ARB = 0x8573;
+
+ int GL_ADD_SIGNED_ARB = 0x8574;
+ int GL_INTERPOLATE_ARB = 0x8575;
+ int GL_SUBTRACT_ARB = 0x84E7;
+
+ int GL_CONSTANT_ARB = 0x8576;
+ int GL_PRIMARY_COLOR_ARB = 0x8577;
+ int GL_PREVIOUS_ARB = 0x8578;
+}
diff --git a/src/templates/org/lwjgl/opengl/ARB_texture_env_crossbar.java b/src/templates/org/lwjgl/opengl/ARB_texture_env_crossbar.java
index da2e481..b7b34e7 100644
--- a/src/templates/org/lwjgl/opengl/ARB_texture_env_crossbar.java
+++ b/src/templates/org/lwjgl/opengl/ARB_texture_env_crossbar.java
@@ -1,35 +1,35 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_texture_env_crossbar {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_texture_env_crossbar {
+}
diff --git a/src/templates/org/lwjgl/opengl/ARB_texture_env_dot3.java b/src/templates/org/lwjgl/opengl/ARB_texture_env_dot3.java
index 7bcf541..ad5fba3 100644
--- a/src/templates/org/lwjgl/opengl/ARB_texture_env_dot3.java
+++ b/src/templates/org/lwjgl/opengl/ARB_texture_env_dot3.java
@@ -1,37 +1,37 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_texture_env_dot3 {
- int GL_DOT3_RGB_ARB = 0x86AE;
- int GL_DOT3_RGBA_ARB = 0x86AF;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_texture_env_dot3 {
+ int GL_DOT3_RGB_ARB = 0x86AE;
+ int GL_DOT3_RGBA_ARB = 0x86AF;
+}
diff --git a/src/templates/org/lwjgl/opengl/ARB_texture_float.java b/src/templates/org/lwjgl/opengl/ARB_texture_float.java
index 652eb9d..f940071 100644
--- a/src/templates/org/lwjgl/opengl/ARB_texture_float.java
+++ b/src/templates/org/lwjgl/opengl/ARB_texture_float.java
@@ -1,68 +1,68 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_texture_float {
-
- /**
- * Accepted by the <value> parameter of GetTexLevelParameter:
- */
- int GL_TEXTURE_RED_TYPE_ARB = 0x8C10;
- int GL_TEXTURE_GREEN_TYPE_ARB = 0x8C11;
- int GL_TEXTURE_BLUE_TYPE_ARB = 0x8C12;
- int GL_TEXTURE_ALPHA_TYPE_ARB = 0x8C13;
- int GL_TEXTURE_LUMINANCE_TYPE_ARB = 0x8C14;
- int GL_TEXTURE_INTENSITY_TYPE_ARB = 0x8C15;
- int GL_TEXTURE_DEPTH_TYPE_ARB = 0x8C16;
-
- /**
- * Returned by the <params> parameter of GetTexLevelParameter:
- */
- int GL_UNSIGNED_NORMALIZED_ARB = 0x8C17;
-
- /**
- * Accepted by the <internalFormat> parameter of TexImage1D,
- * TexImage2D, and TexImage3D:
- */
- int GL_RGBA32F_ARB = 0x8814;
- int GL_RGB32F_ARB = 0x8815;
- int GL_ALPHA32F_ARB = 0x8816;
- int GL_INTENSITY32F_ARB = 0x8817;
- int GL_LUMINANCE32F_ARB = 0x8818;
- int GL_LUMINANCE_ALPHA32F_ARB = 0x8819;
- int GL_RGBA16F_ARB = 0x881A;
- int GL_RGB16F_ARB = 0x881B;
- int GL_ALPHA16F_ARB = 0x881C;
- int GL_INTENSITY16F_ARB = 0x881D;
- int GL_LUMINANCE16F_ARB = 0x881E;
- int GL_LUMINANCE_ALPHA16F_ARB = 0x881F;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_texture_float {
+
+ /**
+ * Accepted by the <value> parameter of GetTexLevelParameter:
+ */
+ int GL_TEXTURE_RED_TYPE_ARB = 0x8C10;
+ int GL_TEXTURE_GREEN_TYPE_ARB = 0x8C11;
+ int GL_TEXTURE_BLUE_TYPE_ARB = 0x8C12;
+ int GL_TEXTURE_ALPHA_TYPE_ARB = 0x8C13;
+ int GL_TEXTURE_LUMINANCE_TYPE_ARB = 0x8C14;
+ int GL_TEXTURE_INTENSITY_TYPE_ARB = 0x8C15;
+ int GL_TEXTURE_DEPTH_TYPE_ARB = 0x8C16;
+
+ /**
+ * Returned by the <params> parameter of GetTexLevelParameter:
+ */
+ int GL_UNSIGNED_NORMALIZED_ARB = 0x8C17;
+
+ /**
+ * Accepted by the <internalFormat> parameter of TexImage1D,
+ * TexImage2D, and TexImage3D:
+ */
+ int GL_RGBA32F_ARB = 0x8814;
+ int GL_RGB32F_ARB = 0x8815;
+ int GL_ALPHA32F_ARB = 0x8816;
+ int GL_INTENSITY32F_ARB = 0x8817;
+ int GL_LUMINANCE32F_ARB = 0x8818;
+ int GL_LUMINANCE_ALPHA32F_ARB = 0x8819;
+ int GL_RGBA16F_ARB = 0x881A;
+ int GL_RGB16F_ARB = 0x881B;
+ int GL_ALPHA16F_ARB = 0x881C;
+ int GL_INTENSITY16F_ARB = 0x881D;
+ int GL_LUMINANCE16F_ARB = 0x881E;
+ int GL_LUMINANCE_ALPHA16F_ARB = 0x881F;
+}
diff --git a/src/templates/org/lwjgl/opengl/ARB_texture_gather.java b/src/templates/org/lwjgl/opengl/ARB_texture_gather.java
index bc1af49..8e35d8c 100644
--- a/src/templates/org/lwjgl/opengl/ARB_texture_gather.java
+++ b/src/templates/org/lwjgl/opengl/ARB_texture_gather.java
@@ -1,44 +1,44 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_texture_gather {
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv, and GetDoublev:
- */
- int GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB = 0x8E5E;
- int GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB = 0x8E5F;
- int GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB = 0x8F9F;
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_texture_gather {
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, and GetDoublev:
+ */
+ int GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB = 0x8E5E;
+ int GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB = 0x8E5F;
+ int GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB = 0x8F9F;
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_texture_mirrored_repeat.java b/src/templates/org/lwjgl/opengl/ARB_texture_mirrored_repeat.java
index e952210..14ac7bf 100644
--- a/src/templates/org/lwjgl/opengl/ARB_texture_mirrored_repeat.java
+++ b/src/templates/org/lwjgl/opengl/ARB_texture_mirrored_repeat.java
@@ -1,36 +1,36 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_texture_mirrored_repeat {
- int GL_MIRRORED_REPEAT_ARB = 0x8370;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_texture_mirrored_repeat {
+ int GL_MIRRORED_REPEAT_ARB = 0x8370;
+}
diff --git a/src/templates/org/lwjgl/opengl/ARB_texture_multisample.java b/src/templates/org/lwjgl/opengl/ARB_texture_multisample.java
index fe586bf..6ea55d9 100644
--- a/src/templates/org/lwjgl/opengl/ARB_texture_multisample.java
+++ b/src/templates/org/lwjgl/opengl/ARB_texture_multisample.java
@@ -1,111 +1,111 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.FloatBuffer;
-
- at Extension(postfix = "")
-public interface ARB_texture_multisample {
-
- /** Accepted by the <pname> parameter of GetMultisamplefv: */
- int GL_SAMPLE_POSITION = 0x8E50;
-
- /**
- * Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, and by
- * the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
- * GetDoublev:
- */
- int GL_SAMPLE_MASK = 0x8E51;
-
- /**
- * Accepted by the <target> parameter of GetBooleani_v and
- * GetIntegeri_v:
- */
- int GL_SAMPLE_MASK_VALUE = 0x8E52;
-
- /**
- * Accepted by the <target> parameter of BindTexture and
- * TexImage2DMultisample:
- */
- int GL_TEXTURE_2D_MULTISAMPLE = 0x9100;
-
- /** Accepted by the <target> parameter of TexImage2DMultisample: */
- int GL_PROXY_TEXTURE_2D_MULTISAMPLE = 0x9101;
-
- /**
- * Accepted by the <target> parameter of BindTexture and
- * TexImage3DMultisample:
- */
- int GL_TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9102;
-
- /** Accepted by the <target> parameter of TexImage3DMultisample: */
- int GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9103;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetDoublev, GetIntegerv,
- * and GetFloatv:
- */
- int GL_MAX_SAMPLE_MASK_WORDS = 0x8E59;
- int GL_MAX_COLOR_TEXTURE_SAMPLES = 0x910E;
- int GL_MAX_DEPTH_TEXTURE_SAMPLES = 0x910F;
- int GL_MAX_INTEGER_SAMPLES = 0x9110;
- int GL_TEXTURE_BINDING_2D_MULTISAMPLE = 0x9104;
- int GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY = 0x9105;
-
- /** Accepted by the <pname> parameter of GetTexLevelParameter */
- int GL_TEXTURE_SAMPLES = 0x9106;
- int GL_TEXTURE_FIXED_SAMPLE_LOCATIONS = 0x9107;
-
- /** Returned by the <type> parameter of GetActiveUniform: */
- int GL_SAMPLER_2D_MULTISAMPLE = 0x9108;
- int GL_INT_SAMPLER_2D_MULTISAMPLE = 0x9109;
- int GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE = 0x910A;
- int GL_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910B;
- int GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910C;
- int GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910D;
-
- void glTexImage2DMultisample(@GLenum int target, @GLsizei int samples, int internalformat,
- @GLsizei int width, @GLsizei int height,
- boolean fixedsamplelocations);
-
- void glTexImage3DMultisample(@GLenum int target, @GLsizei int samples, int internalformat,
- @GLsizei int width, @GLsizei int height, @GLsizei int depth,
- boolean fixedsamplelocations);
-
- @StripPostfix("val")
- void glGetMultisamplefv(@GLenum int pname, @GLuint int index, @OutParameter @Check("2") FloatBuffer val);
-
- void glSampleMaski(@GLuint int index, @GLbitfield int mask);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.FloatBuffer;
+
+ at Extension(postfix = "")
+public interface ARB_texture_multisample {
+
+ /** Accepted by the <pname> parameter of GetMultisamplefv: */
+ int GL_SAMPLE_POSITION = 0x8E50;
+
+ /**
+ * Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, and by
+ * the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
+ * GetDoublev:
+ */
+ int GL_SAMPLE_MASK = 0x8E51;
+
+ /**
+ * Accepted by the <target> parameter of GetBooleani_v and
+ * GetIntegeri_v:
+ */
+ int GL_SAMPLE_MASK_VALUE = 0x8E52;
+
+ /**
+ * Accepted by the <target> parameter of BindTexture and
+ * TexImage2DMultisample:
+ */
+ int GL_TEXTURE_2D_MULTISAMPLE = 0x9100;
+
+ /** Accepted by the <target> parameter of TexImage2DMultisample: */
+ int GL_PROXY_TEXTURE_2D_MULTISAMPLE = 0x9101;
+
+ /**
+ * Accepted by the <target> parameter of BindTexture and
+ * TexImage3DMultisample:
+ */
+ int GL_TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9102;
+
+ /** Accepted by the <target> parameter of TexImage3DMultisample: */
+ int GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9103;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetDoublev, GetIntegerv,
+ * and GetFloatv:
+ */
+ int GL_MAX_SAMPLE_MASK_WORDS = 0x8E59;
+ int GL_MAX_COLOR_TEXTURE_SAMPLES = 0x910E;
+ int GL_MAX_DEPTH_TEXTURE_SAMPLES = 0x910F;
+ int GL_MAX_INTEGER_SAMPLES = 0x9110;
+ int GL_TEXTURE_BINDING_2D_MULTISAMPLE = 0x9104;
+ int GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY = 0x9105;
+
+ /** Accepted by the <pname> parameter of GetTexLevelParameter */
+ int GL_TEXTURE_SAMPLES = 0x9106;
+ int GL_TEXTURE_FIXED_SAMPLE_LOCATIONS = 0x9107;
+
+ /** Returned by the <type> parameter of GetActiveUniform: */
+ int GL_SAMPLER_2D_MULTISAMPLE = 0x9108;
+ int GL_INT_SAMPLER_2D_MULTISAMPLE = 0x9109;
+ int GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE = 0x910A;
+ int GL_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910B;
+ int GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910C;
+ int GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910D;
+
+ void glTexImage2DMultisample(@GLenum int target, @GLsizei int samples, int internalformat,
+ @GLsizei int width, @GLsizei int height,
+ boolean fixedsamplelocations);
+
+ void glTexImage3DMultisample(@GLenum int target, @GLsizei int samples, int internalformat,
+ @GLsizei int width, @GLsizei int height, @GLsizei int depth,
+ boolean fixedsamplelocations);
+
+ @StripPostfix("val")
+ void glGetMultisamplefv(@GLenum int pname, @GLuint int index, @OutParameter @Check("2") FloatBuffer val);
+
+ void glSampleMaski(@GLuint int index, @GLbitfield int mask);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_texture_non_power_of_two.java b/src/templates/org/lwjgl/opengl/ARB_texture_non_power_of_two.java
index ece2a36..432b79c 100644
--- a/src/templates/org/lwjgl/opengl/ARB_texture_non_power_of_two.java
+++ b/src/templates/org/lwjgl/opengl/ARB_texture_non_power_of_two.java
@@ -1,35 +1,35 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_texture_non_power_of_two {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_texture_non_power_of_two {
+}
diff --git a/src/templates/org/lwjgl/opengl/ARB_texture_query_lod.java b/src/templates/org/lwjgl/opengl/ARB_texture_query_lod.java
index d54023a..aa7ed7b 100644
--- a/src/templates/org/lwjgl/opengl/ARB_texture_query_lod.java
+++ b/src/templates/org/lwjgl/opengl/ARB_texture_query_lod.java
@@ -1,35 +1,35 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_texture_query_lod {
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_texture_query_lod {
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_texture_rectangle.java b/src/templates/org/lwjgl/opengl/ARB_texture_rectangle.java
index 87e1d48..a958eae 100644
--- a/src/templates/org/lwjgl/opengl/ARB_texture_rectangle.java
+++ b/src/templates/org/lwjgl/opengl/ARB_texture_rectangle.java
@@ -1,78 +1,78 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_texture_rectangle {
-
- /**
- Accepted by the <cap> parameter of Enable, Disable and IsEnabled;
- by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv
- and GetDoublev; and by the <target> parameter of BindTexture,
- GetTexParameterfv, GetTexParameteriv, TexParameterf, TexParameteri,
- TexParameterfv and TexParameteriv:
- Accepted by the <target> parameter of GetTexImage,
- GetTexLevelParameteriv, GetTexLevelParameterfv, TexImage2D,
- CopyTexImage2D, TexSubImage2D and CopySubTexImage2D:
- */
- int GL_TEXTURE_RECTANGLE_ARB = 0x84F5;
-
- /**
- Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- GetFloatv and GetDoublev:
- */
- int GL_TEXTURE_BINDING_RECTANGLE_ARB = 0x84F6;
-
- /**
- Accepted by the <target> parameter of GetTexLevelParameteriv,
- GetTexLevelParameterfv, GetTexParameteriv and TexImage2D:
- */
- int GL_PROXY_TEXTURE_RECTANGLE_ARB = 0x84F7;
-
- /**
- Accepted by the <pname> parameter of GetBooleanv, GetDoublev,
- GetIntegerv and GetFloatv:
- */
- int GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB = 0x84F8;
-
- /**
- Returned by <type> parameter of GetActiveUniform when the location
- <index> for program object <program> is of type sampler2DRect:
- */
- int GL_SAMPLER_2D_RECT_ARB = 0x8B63;
-
- /**
- Returned by <type> parameter of GetActiveUniform when the location
- <index> for program object <program> is of type sampler2DRectShadow:
- */
- int GL_SAMPLER_2D_RECT_SHADOW_ARB = 0x8B64;
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_texture_rectangle {
+
+ /**
+ Accepted by the <cap> parameter of Enable, Disable and IsEnabled;
+ by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv
+ and GetDoublev; and by the <target> parameter of BindTexture,
+ GetTexParameterfv, GetTexParameteriv, TexParameterf, TexParameteri,
+ TexParameterfv and TexParameteriv:
+ Accepted by the <target> parameter of GetTexImage,
+ GetTexLevelParameteriv, GetTexLevelParameterfv, TexImage2D,
+ CopyTexImage2D, TexSubImage2D and CopySubTexImage2D:
+ */
+ int GL_TEXTURE_RECTANGLE_ARB = 0x84F5;
+
+ /**
+ Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ GetFloatv and GetDoublev:
+ */
+ int GL_TEXTURE_BINDING_RECTANGLE_ARB = 0x84F6;
+
+ /**
+ Accepted by the <target> parameter of GetTexLevelParameteriv,
+ GetTexLevelParameterfv, GetTexParameteriv and TexImage2D:
+ */
+ int GL_PROXY_TEXTURE_RECTANGLE_ARB = 0x84F7;
+
+ /**
+ Accepted by the <pname> parameter of GetBooleanv, GetDoublev,
+ GetIntegerv and GetFloatv:
+ */
+ int GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB = 0x84F8;
+
+ /**
+ Returned by <type> parameter of GetActiveUniform when the location
+ <index> for program object <program> is of type sampler2DRect:
+ */
+ int GL_SAMPLER_2D_RECT_ARB = 0x8B63;
+
+ /**
+ Returned by <type> parameter of GetActiveUniform when the location
+ <index> for program object <program> is of type sampler2DRectShadow:
+ */
+ int GL_SAMPLER_2D_RECT_SHADOW_ARB = 0x8B64;
+
+}
diff --git a/src/templates/org/lwjgl/opengl/ARB_texture_rg.java b/src/templates/org/lwjgl/opengl/ARB_texture_rg.java
index 1c6eb0b..f5f2f8b 100644
--- a/src/templates/org/lwjgl/opengl/ARB_texture_rg.java
+++ b/src/templates/org/lwjgl/opengl/ARB_texture_rg.java
@@ -1,80 +1,80 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_texture_rg {
-
- /**
- * Accepted by the <internalFormat> parameter of TexImage1D, TexImage2D,
- * TexImage3D, CopyTexImage1D, and CopyTexImage2D:
- */
- int GL_R8 = 0x8229;
- int GL_R16 = 0x822A;
-
- int GL_RG8 = 0x822B;
- int GL_RG16 = 0x822C;
-
- int GL_R16F = 0x822D;
- int GL_R32F = 0x822E;
-
- int GL_RG16F = 0x822F;
- int GL_RG32F = 0x8230;
-
- int GL_R8I = 0x8231;
- int GL_R8UI = 0x8232;
- int GL_R16I = 0x8233;
- int GL_R16UI = 0x8234;
- int GL_R32I = 0x8235;
- int GL_R32UI = 0x8236;
-
- int GL_RG8I = 0x8237;
- int GL_RG8UI = 0x8238;
- int GL_RG16I = 0x8239;
- int GL_RG16UI = 0x823A;
- int GL_RG32I = 0x823B;
- int GL_RG32UI = 0x823C;
-
- /**
- * Accepted by the <format> parameter of TexImage3D, TexImage2D,
- * TexImage3D, TexSubImage1D, TexSubImage2D, TexSubImage3D,
- * DrawPixels and ReadPixels:
- */
- int GL_RG = 0x8227;
- int GL_RG_INTEGER = 0x8228;
-
- /**
- * Accepted by the <param> parameter of the TexParameter{if}*
- * functions when <pname> is DEPTH_TEXTURE_MODE:
- */
- int GL_RED = 0x1903;
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_texture_rg {
+
+ /**
+ * Accepted by the <internalFormat> parameter of TexImage1D, TexImage2D,
+ * TexImage3D, CopyTexImage1D, and CopyTexImage2D:
+ */
+ int GL_R8 = 0x8229;
+ int GL_R16 = 0x822A;
+
+ int GL_RG8 = 0x822B;
+ int GL_RG16 = 0x822C;
+
+ int GL_R16F = 0x822D;
+ int GL_R32F = 0x822E;
+
+ int GL_RG16F = 0x822F;
+ int GL_RG32F = 0x8230;
+
+ int GL_R8I = 0x8231;
+ int GL_R8UI = 0x8232;
+ int GL_R16I = 0x8233;
+ int GL_R16UI = 0x8234;
+ int GL_R32I = 0x8235;
+ int GL_R32UI = 0x8236;
+
+ int GL_RG8I = 0x8237;
+ int GL_RG8UI = 0x8238;
+ int GL_RG16I = 0x8239;
+ int GL_RG16UI = 0x823A;
+ int GL_RG32I = 0x823B;
+ int GL_RG32UI = 0x823C;
+
+ /**
+ * Accepted by the <format> parameter of TexImage3D, TexImage2D,
+ * TexImage3D, TexSubImage1D, TexSubImage2D, TexSubImage3D,
+ * DrawPixels and ReadPixels:
+ */
+ int GL_RG = 0x8227;
+ int GL_RG_INTEGER = 0x8228;
+
+ /**
+ * Accepted by the <param> parameter of the TexParameter{if}*
+ * functions when <pname> is DEPTH_TEXTURE_MODE:
+ */
+ int GL_RED = 0x1903;
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_timer_query.java b/src/templates/org/lwjgl/opengl/ARB_timer_query.java
index 52ded87..59b479f 100644
--- a/src/templates/org/lwjgl/opengl/ARB_timer_query.java
+++ b/src/templates/org/lwjgl/opengl/ARB_timer_query.java
@@ -1,72 +1,72 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.LongBuffer;
-
- at Extension(postfix = "")
-public interface ARB_timer_query {
-
- /**
- * Accepted by the <target> parameter of BeginQuery, EndQuery, and
- * GetQueryiv:
- */
- int GL_TIME_ELAPSED = 0x88BF;
-
- /**
- * Accepted by the <target> parameter of GetQueryiv and QueryCounter.
- * Accepted by the <value> parameter of GetBooleanv, GetIntegerv,
- * GetInteger64v, GetFloatv, and GetDoublev:
- */
- int GL_TIMESTAMP = 0x8E28;
-
- void glQueryCounter(@GLuint int id, @GLenum int target);
-
- @StripPostfix("params")
- void glGetQueryObjecti64v(@GLuint int id, @GLenum int pname, @OutParameter @Check("1") @GLint64 LongBuffer params);
-
- @Alternate("glGetQueryObjecti64v")
- @GLreturn("params")
- @StripPostfix("params")
- void glGetQueryObjecti64v2(@GLuint int id, @GLenum int pname, @OutParameter @GLint64 LongBuffer params);
-
- @StripPostfix("params")
- void glGetQueryObjectui64v(@GLuint int id, @GLenum int pname, @OutParameter @Check("1") @GLuint64 LongBuffer params);
-
- @Alternate("glGetQueryObjectui64v")
- @GLreturn("params")
- @StripPostfix("params")
- void glGetQueryObjectui64v2(@GLuint int id, @GLenum int pname, @OutParameter @GLuint64 LongBuffer params);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.LongBuffer;
+
+ at Extension(postfix = "")
+public interface ARB_timer_query {
+
+ /**
+ * Accepted by the <target> parameter of BeginQuery, EndQuery, and
+ * GetQueryiv:
+ */
+ int GL_TIME_ELAPSED = 0x88BF;
+
+ /**
+ * Accepted by the <target> parameter of GetQueryiv and QueryCounter.
+ * Accepted by the <value> parameter of GetBooleanv, GetIntegerv,
+ * GetInteger64v, GetFloatv, and GetDoublev:
+ */
+ int GL_TIMESTAMP = 0x8E28;
+
+ void glQueryCounter(@GLuint int id, @GLenum int target);
+
+ @StripPostfix("params")
+ void glGetQueryObjecti64v(@GLuint int id, @GLenum int pname, @OutParameter @Check("1") @GLint64 LongBuffer params);
+
+ @Alternate("glGetQueryObjecti64v")
+ @GLreturn("params")
+ @StripPostfix("params")
+ void glGetQueryObjecti64v2(@GLuint int id, @GLenum int pname, @OutParameter @GLint64 LongBuffer params);
+
+ @StripPostfix("params")
+ void glGetQueryObjectui64v(@GLuint int id, @GLenum int pname, @OutParameter @Check("1") @GLuint64 LongBuffer params);
+
+ @Alternate("glGetQueryObjectui64v")
+ @GLreturn("params")
+ @StripPostfix("params")
+ void glGetQueryObjectui64v2(@GLuint int id, @GLenum int pname, @OutParameter @GLuint64 LongBuffer params);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_transpose_matrix.java b/src/templates/org/lwjgl/opengl/ARB_transpose_matrix.java
index e160b51..e0a848b 100644
--- a/src/templates/org/lwjgl/opengl/ARB_transpose_matrix.java
+++ b/src/templates/org/lwjgl/opengl/ARB_transpose_matrix.java
@@ -1,49 +1,49 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-public interface ARB_transpose_matrix {
- int GL_TRANSPOSE_MODELVIEW_MATRIX_ARB = 0x84E3;
- int GL_TRANSPOSE_PROJECTION_MATRIX_ARB = 0x84E4;
- int GL_TRANSPOSE_TEXTURE_MATRIX_ARB = 0x84E5;
- int GL_TRANSPOSE_COLOR_MATRIX_ARB = 0x84E6;
-
- @StripPostfix("pfMtx")
- void glLoadTransposeMatrixfARB(@Check("16") @Const FloatBuffer pfMtx);
-
- @StripPostfix("pfMtx")
- void glMultTransposeMatrixfARB(@Check("16") @Const FloatBuffer pfMtx);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+public interface ARB_transpose_matrix {
+ int GL_TRANSPOSE_MODELVIEW_MATRIX_ARB = 0x84E3;
+ int GL_TRANSPOSE_PROJECTION_MATRIX_ARB = 0x84E4;
+ int GL_TRANSPOSE_TEXTURE_MATRIX_ARB = 0x84E5;
+ int GL_TRANSPOSE_COLOR_MATRIX_ARB = 0x84E6;
+
+ @StripPostfix("pfMtx")
+ void glLoadTransposeMatrixfARB(@Check("16") @Const FloatBuffer pfMtx);
+
+ @StripPostfix("pfMtx")
+ void glMultTransposeMatrixfARB(@Check("16") @Const FloatBuffer pfMtx);
+}
diff --git a/src/templates/org/lwjgl/opengl/ARB_uniform_buffer_object.java b/src/templates/org/lwjgl/opengl/ARB_uniform_buffer_object.java
index 9ee11c9..4810cc4 100644
--- a/src/templates/org/lwjgl/opengl/ARB_uniform_buffer_object.java
+++ b/src/templates/org/lwjgl/opengl/ARB_uniform_buffer_object.java
@@ -1,175 +1,175 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.ByteBuffer;
-import java.nio.IntBuffer;
-
- at Extension(postfix = "")
-public interface ARB_uniform_buffer_object {
-
- /**
- * Accepted by the <target> parameters of BindBuffer, BufferData,
- * BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, and
- * GetBufferPointerv:
- */
- int GL_UNIFORM_BUFFER = 0x8A11;
-
- /**
- * Accepted by the <pname> parameter of GetIntegeri_v, GetBooleanv,
- * GetIntegerv, GetFloatv, and GetDoublev:
- */
- int GL_UNIFORM_BUFFER_BINDING = 0x8A28;
-
- /** Accepted by the <pname> parameter of GetIntegeri_v: */
- int GL_UNIFORM_BUFFER_START = 0x8A29;
- int GL_UNIFORM_BUFFER_SIZE = 0x8A2A;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv, and GetDoublev:
- */
- int GL_MAX_VERTEX_UNIFORM_BLOCKS = 0x8A2B;
- int GL_MAX_GEOMETRY_UNIFORM_BLOCKS = 0x8A2C;
- int GL_MAX_FRAGMENT_UNIFORM_BLOCKS = 0x8A2D;
- int GL_MAX_COMBINED_UNIFORM_BLOCKS = 0x8A2E;
- int GL_MAX_UNIFORM_BUFFER_BINDINGS = 0x8A2F;
- int GL_MAX_UNIFORM_BLOCK_SIZE = 0x8A30;
- int GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 0x8A31;
- int GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS = 0x8A32;
- int GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 0x8A33;
- int GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT = 0x8A34;
-
- /** Accepted by the <pname> parameter of GetProgramiv: */
- int GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH = 0x8A35;
- int GL_ACTIVE_UNIFORM_BLOCKS = 0x8A36;
-
- /** Accepted by the <pname> parameter of GetActiveUniformsivARB: */
- int GL_UNIFORM_TYPE = 0x8A37;
- int GL_UNIFORM_SIZE = 0x8A38;
- int GL_UNIFORM_NAME_LENGTH = 0x8A39;
- int GL_UNIFORM_BLOCK_INDEX = 0x8A3A;
- int GL_UNIFORM_OFFSET = 0x8A3B;
- int GL_UNIFORM_ARRAY_STRIDE = 0x8A3C;
- int GL_UNIFORM_MATRIX_STRIDE = 0x8A3D;
- int GL_UNIFORM_IS_ROW_MAJOR = 0x8A3E;
-
- /** Accepted by the <pname> parameter of GetActiveUniformBlockivARB: */
- int GL_UNIFORM_BLOCK_BINDING = 0x8A3F;
- int GL_UNIFORM_BLOCK_DATA_SIZE = 0x8A40;
- int GL_UNIFORM_BLOCK_NAME_LENGTH = 0x8A41;
- int GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS = 0x8A42;
- int GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 0x8A43;
- int GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 0x8A44;
- int GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER = 0x8A45;
- int GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 0x8A46;
-
- /** Returned by GetActiveUniformsivARB and GetUniformBlockIndexARB */
- int GL_INVALID_INDEX = 0xFFFFFFFF;
-
- void glGetUniformIndices(@GLuint int program, @AutoSize("uniformIndices") @GLsizei int uniformCount,
- @Const @NullTerminated("uniformIndices.remaining()") @GLchar @StringList("uniformCount") ByteBuffer uniformNames,
- @OutParameter @GLuint IntBuffer uniformIndices);
-
- @Alternate(value = "glGetUniformIndices")
- void glGetUniformIndices(@GLuint int program, @Constant("uniformNames.length") @GLsizei int uniformCount,
- @Const @NullTerminated @StringList("uniformCount") CharSequence[] uniformNames,
- @OutParameter @Check("uniformNames.length") @GLuint IntBuffer uniformIndices);
-
- @StripPostfix("params")
- void glGetActiveUniformsiv(@GLuint int program, @AutoSize("uniformIndices") @GLsizei int uniformCount,
- @Const @GLuint IntBuffer uniformIndices,
- @GLenum int pname,
- @OutParameter @Check("uniformIndices.remaining()") @GLint IntBuffer params);
-
- @Alternate("glGetActiveUniformsiv")
- @GLreturn("params")
- @StripPostfix("params")
- void glGetActiveUniformsiv(@GLuint int program, @Constant("1") @GLsizei int uniformCount,
- @Constant(value = "params.put(1, uniformIndex), 1", keepParam = true) int uniformIndex, // Reuse params buffer
- @GLenum int pname,
- @OutParameter @GLint IntBuffer params);
-
- void glGetActiveUniformName(@GLuint int program, @GLuint int uniformIndex, @AutoSize("uniformName") @GLsizei int bufSize,
- @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
- @OutParameter @GLchar ByteBuffer uniformName);
-
- @Alternate("glGetActiveUniformName")
- @GLreturn(value = "uniformName", maxLength = "bufSize")
- void glGetActiveUniformName2(@GLuint int program, @GLuint int uniformIndex, @GLsizei int bufSize,
- @OutParameter @GLsizei @Constant("uniformName_length, 0") IntBuffer length,
- @OutParameter @GLchar ByteBuffer uniformName);
-
- @GLuint
- int glGetUniformBlockIndex(@GLuint int program, @Const @NullTerminated @GLchar ByteBuffer uniformBlockName);
-
- @Alternate("glGetUniformBlockIndex")
- @GLuint
- int glGetUniformBlockIndex(@GLuint int program, @NullTerminated CharSequence uniformBlockName);
-
- @StripPostfix("params")
- void glGetActiveUniformBlockiv(@GLuint int program, @GLuint int uniformBlockIndex, @GLenum int pname,
- @OutParameter @Check(value = "16") @GLint IntBuffer params);
-
- @Alternate("glGetActiveUniformBlockiv")
- @GLreturn("params")
- @StripPostfix("params")
- void glGetActiveUniformBlockiv2(@GLuint int program, @GLuint int uniformBlockIndex, @GLenum int pname,
- @OutParameter @GLint IntBuffer params);
-
- void glGetActiveUniformBlockName(@GLuint int program, @GLuint int uniformBlockIndex, @AutoSize("uniformBlockName") @GLsizei int bufSize,
- @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
- @OutParameter @GLchar ByteBuffer uniformBlockName);
-
- @Alternate("glGetActiveUniformBlockName")
- @GLreturn(value = "uniformBlockName", maxLength = "bufSize")
- void glGetActiveUniformBlockName2(@GLuint int program, @GLuint int uniformBlockIndex, @GLsizei int bufSize,
- @OutParameter @GLsizei @Constant("uniformBlockName_length, 0") IntBuffer length,
- @OutParameter @GLchar ByteBuffer uniformBlockName);
-
- void glBindBufferRange(@GLenum int target, @GLuint int index, @GLuint int buffer, @GLintptr long offset, @GLsizeiptr long size);
-
- void glBindBufferBase(@GLenum int target, @GLuint int index, @GLuint int buffer);
-
- @StripPostfix(value = "data", extension = "")
- void glGetIntegeri_v(@GLenum int value, @GLuint int index, @OutParameter @Check("4") IntBuffer data);
-
- @Alternate("glGetIntegeri_v")
- @GLreturn("data")
- @StripPostfix("data")
- void glGetIntegeri_v2(@GLenum int value, @GLuint int index, @OutParameter IntBuffer data);
-
- void glUniformBlockBinding(@GLuint int program, @GLuint int uniformBlockIndex, @GLuint int uniformBlockBinding);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.ByteBuffer;
+import java.nio.IntBuffer;
+
+ at Extension(postfix = "")
+public interface ARB_uniform_buffer_object {
+
+ /**
+ * Accepted by the <target> parameters of BindBuffer, BufferData,
+ * BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, and
+ * GetBufferPointerv:
+ */
+ int GL_UNIFORM_BUFFER = 0x8A11;
+
+ /**
+ * Accepted by the <pname> parameter of GetIntegeri_v, GetBooleanv,
+ * GetIntegerv, GetFloatv, and GetDoublev:
+ */
+ int GL_UNIFORM_BUFFER_BINDING = 0x8A28;
+
+ /** Accepted by the <pname> parameter of GetIntegeri_v: */
+ int GL_UNIFORM_BUFFER_START = 0x8A29;
+ int GL_UNIFORM_BUFFER_SIZE = 0x8A2A;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, and GetDoublev:
+ */
+ int GL_MAX_VERTEX_UNIFORM_BLOCKS = 0x8A2B;
+ int GL_MAX_GEOMETRY_UNIFORM_BLOCKS = 0x8A2C;
+ int GL_MAX_FRAGMENT_UNIFORM_BLOCKS = 0x8A2D;
+ int GL_MAX_COMBINED_UNIFORM_BLOCKS = 0x8A2E;
+ int GL_MAX_UNIFORM_BUFFER_BINDINGS = 0x8A2F;
+ int GL_MAX_UNIFORM_BLOCK_SIZE = 0x8A30;
+ int GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 0x8A31;
+ int GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS = 0x8A32;
+ int GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 0x8A33;
+ int GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT = 0x8A34;
+
+ /** Accepted by the <pname> parameter of GetProgramiv: */
+ int GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH = 0x8A35;
+ int GL_ACTIVE_UNIFORM_BLOCKS = 0x8A36;
+
+ /** Accepted by the <pname> parameter of GetActiveUniformsivARB: */
+ int GL_UNIFORM_TYPE = 0x8A37;
+ int GL_UNIFORM_SIZE = 0x8A38;
+ int GL_UNIFORM_NAME_LENGTH = 0x8A39;
+ int GL_UNIFORM_BLOCK_INDEX = 0x8A3A;
+ int GL_UNIFORM_OFFSET = 0x8A3B;
+ int GL_UNIFORM_ARRAY_STRIDE = 0x8A3C;
+ int GL_UNIFORM_MATRIX_STRIDE = 0x8A3D;
+ int GL_UNIFORM_IS_ROW_MAJOR = 0x8A3E;
+
+ /** Accepted by the <pname> parameter of GetActiveUniformBlockivARB: */
+ int GL_UNIFORM_BLOCK_BINDING = 0x8A3F;
+ int GL_UNIFORM_BLOCK_DATA_SIZE = 0x8A40;
+ int GL_UNIFORM_BLOCK_NAME_LENGTH = 0x8A41;
+ int GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS = 0x8A42;
+ int GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 0x8A43;
+ int GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 0x8A44;
+ int GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER = 0x8A45;
+ int GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 0x8A46;
+
+ /** Returned by GetActiveUniformsivARB and GetUniformBlockIndexARB */
+ int GL_INVALID_INDEX = 0xFFFFFFFF;
+
+ void glGetUniformIndices(@GLuint int program, @AutoSize("uniformIndices") @GLsizei int uniformCount,
+ @Const @NullTerminated("uniformIndices.remaining()") @GLchar @StringList("uniformCount") ByteBuffer uniformNames,
+ @OutParameter @GLuint IntBuffer uniformIndices);
+
+ @Alternate(value = "glGetUniformIndices")
+ void glGetUniformIndices(@GLuint int program, @Constant("uniformNames.length") @GLsizei int uniformCount,
+ @Const @NullTerminated @StringList("uniformCount") CharSequence[] uniformNames,
+ @OutParameter @Check("uniformNames.length") @GLuint IntBuffer uniformIndices);
+
+ @StripPostfix("params")
+ void glGetActiveUniformsiv(@GLuint int program, @AutoSize("uniformIndices") @GLsizei int uniformCount,
+ @Const @GLuint IntBuffer uniformIndices,
+ @GLenum int pname,
+ @OutParameter @Check("uniformIndices.remaining()") @GLint IntBuffer params);
+
+ @Alternate("glGetActiveUniformsiv")
+ @GLreturn("params")
+ @StripPostfix("params")
+ void glGetActiveUniformsiv(@GLuint int program, @Constant("1") @GLsizei int uniformCount,
+ @Constant(value = "params.put(1, uniformIndex), 1", keepParam = true) int uniformIndex, // Reuse params buffer
+ @GLenum int pname,
+ @OutParameter @GLint IntBuffer params);
+
+ void glGetActiveUniformName(@GLuint int program, @GLuint int uniformIndex, @AutoSize("uniformName") @GLsizei int bufSize,
+ @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
+ @OutParameter @GLchar ByteBuffer uniformName);
+
+ @Alternate("glGetActiveUniformName")
+ @GLreturn(value = "uniformName", maxLength = "bufSize")
+ void glGetActiveUniformName2(@GLuint int program, @GLuint int uniformIndex, @GLsizei int bufSize,
+ @OutParameter @GLsizei @Constant("uniformName_length, 0") IntBuffer length,
+ @OutParameter @GLchar ByteBuffer uniformName);
+
+ @GLuint
+ int glGetUniformBlockIndex(@GLuint int program, @Const @NullTerminated @GLchar ByteBuffer uniformBlockName);
+
+ @Alternate("glGetUniformBlockIndex")
+ @GLuint
+ int glGetUniformBlockIndex(@GLuint int program, @NullTerminated CharSequence uniformBlockName);
+
+ @StripPostfix("params")
+ void glGetActiveUniformBlockiv(@GLuint int program, @GLuint int uniformBlockIndex, @GLenum int pname,
+ @OutParameter @Check(value = "16") @GLint IntBuffer params);
+
+ @Alternate("glGetActiveUniformBlockiv")
+ @GLreturn("params")
+ @StripPostfix("params")
+ void glGetActiveUniformBlockiv2(@GLuint int program, @GLuint int uniformBlockIndex, @GLenum int pname,
+ @OutParameter @GLint IntBuffer params);
+
+ void glGetActiveUniformBlockName(@GLuint int program, @GLuint int uniformBlockIndex, @AutoSize("uniformBlockName") @GLsizei int bufSize,
+ @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
+ @OutParameter @GLchar ByteBuffer uniformBlockName);
+
+ @Alternate("glGetActiveUniformBlockName")
+ @GLreturn(value = "uniformBlockName", maxLength = "bufSize")
+ void glGetActiveUniformBlockName2(@GLuint int program, @GLuint int uniformBlockIndex, @GLsizei int bufSize,
+ @OutParameter @GLsizei @Constant("uniformBlockName_length, 0") IntBuffer length,
+ @OutParameter @GLchar ByteBuffer uniformBlockName);
+
+ void glBindBufferRange(@GLenum int target, @GLuint int index, @GLuint int buffer, @GLintptr long offset, @GLsizeiptr long size);
+
+ void glBindBufferBase(@GLenum int target, @GLuint int index, @GLuint int buffer);
+
+ @StripPostfix(value = "data", extension = "")
+ void glGetIntegeri_v(@GLenum int value, @GLuint int index, @OutParameter @Check("4") IntBuffer data);
+
+ @Alternate("glGetIntegeri_v")
+ @GLreturn("data")
+ @StripPostfix("data")
+ void glGetIntegeri_v2(@GLenum int value, @GLuint int index, @OutParameter IntBuffer data);
+
+ void glUniformBlockBinding(@GLuint int program, @GLuint int uniformBlockIndex, @GLuint int uniformBlockBinding);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_vertex_array_object.java b/src/templates/org/lwjgl/opengl/ARB_vertex_array_object.java
index 4baa92b..0530f53 100644
--- a/src/templates/org/lwjgl/opengl/ARB_vertex_array_object.java
+++ b/src/templates/org/lwjgl/opengl/ARB_vertex_array_object.java
@@ -1,61 +1,61 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.IntBuffer;
-
-public interface ARB_vertex_array_object {
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv, and GetDoublev:
- */
- int GL_VERTEX_ARRAY_BINDING = 0x85B5;
-
- void glBindVertexArray(@GLuint int array);
-
- void glDeleteVertexArrays(@AutoSize("arrays") @GLsizei int n, @Const @GLuint IntBuffer arrays);
-
- @Alternate("glDeleteVertexArrays")
- void glDeleteVertexArrays(@Constant("1") @GLsizei int n, @Constant(value = "APIUtils.getBufferInt().put(0, array), 0", keepParam = true) int array);
-
- void glGenVertexArrays(@AutoSize("arrays") @GLsizei int n, @OutParameter @GLuint IntBuffer arrays);
-
- @Alternate("glGenVertexArrays")
- @GLreturn("arrays")
- void glGenVertexArrays2(@Constant("1") @GLsizei int n, @OutParameter @GLuint IntBuffer arrays);
-
- boolean glIsVertexArray(@GLuint int array);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.IntBuffer;
+
+public interface ARB_vertex_array_object {
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, and GetDoublev:
+ */
+ int GL_VERTEX_ARRAY_BINDING = 0x85B5;
+
+ void glBindVertexArray(@GLuint int array);
+
+ void glDeleteVertexArrays(@AutoSize("arrays") @GLsizei int n, @Const @GLuint IntBuffer arrays);
+
+ @Alternate("glDeleteVertexArrays")
+ void glDeleteVertexArrays(@Constant("1") @GLsizei int n, @Constant(value = "APIUtils.getBufferInt().put(0, array), 0", keepParam = true) int array);
+
+ void glGenVertexArrays(@AutoSize("arrays") @GLsizei int n, @OutParameter @GLuint IntBuffer arrays);
+
+ @Alternate("glGenVertexArrays")
+ @GLreturn("arrays")
+ void glGenVertexArrays2(@Constant("1") @GLsizei int n, @OutParameter @GLuint IntBuffer arrays);
+
+ boolean glIsVertexArray(@GLuint int array);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_vertex_blend.java b/src/templates/org/lwjgl/opengl/ARB_vertex_blend.java
index 80bcf1d..22b0d06 100644
--- a/src/templates/org/lwjgl/opengl/ARB_vertex_blend.java
+++ b/src/templates/org/lwjgl/opengl/ARB_vertex_blend.java
@@ -1,122 +1,122 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-public interface ARB_vertex_blend {
-
- int GL_MAX_VERTEX_UNITS_ARB = 0x86A4;
- int GL_ACTIVE_VERTEX_UNITS_ARB = 0x86A5;
- int GL_WEIGHT_SUM_UNITY_ARB = 0x86A6;
- int GL_VERTEX_BLEND_ARB = 0x86A7;
- int GL_CURRENT_WEIGHT_ARB = 0x86A8;
- int GL_WEIGHT_ARRAY_TYPE_ARB = 0x86A9;
- int GL_WEIGHT_ARRAY_STRIDE_ARB = 0x86AA;
- int GL_WEIGHT_ARRAY_SIZE_ARB = 0x86AB;
- int GL_WEIGHT_ARRAY_POINTER_ARB = 0x86AC;
- int GL_WEIGHT_ARRAY_ARB = 0x86AD;
- int GL_MODELVIEW0_ARB = 0x1700;
- int GL_MODELVIEW1_ARB = 0x850a;
- int GL_MODELVIEW2_ARB = 0x8722;
- int GL_MODELVIEW3_ARB = 0x8723;
- int GL_MODELVIEW4_ARB = 0x8724;
- int GL_MODELVIEW5_ARB = 0x8725;
- int GL_MODELVIEW6_ARB = 0x8726;
- int GL_MODELVIEW7_ARB = 0x8727;
- int GL_MODELVIEW8_ARB = 0x8728;
- int GL_MODELVIEW9_ARB = 0x8729;
- int GL_MODELVIEW10_ARB = 0x872A;
- int GL_MODELVIEW11_ARB = 0x872B;
- int GL_MODELVIEW12_ARB = 0x872C;
- int GL_MODELVIEW13_ARB = 0x872D;
- int GL_MODELVIEW14_ARB = 0x872E;
- int GL_MODELVIEW15_ARB = 0x872F;
- int GL_MODELVIEW16_ARB = 0x8730;
- int GL_MODELVIEW17_ARB = 0x8731;
- int GL_MODELVIEW18_ARB = 0x8732;
- int GL_MODELVIEW19_ARB = 0x8733;
- int GL_MODELVIEW20_ARB = 0x8734;
- int GL_MODELVIEW21_ARB = 0x8735;
- int GL_MODELVIEW22_ARB = 0x8736;
- int GL_MODELVIEW23_ARB = 0x8737;
- int GL_MODELVIEW24_ARB = 0x8738;
- int GL_MODELVIEW25_ARB = 0x8739;
- int GL_MODELVIEW26_ARB = 0x873A;
- int GL_MODELVIEW27_ARB = 0x873B;
- int GL_MODELVIEW28_ARB = 0x873C;
- int GL_MODELVIEW29_ARB = 0x873D;
- int GL_MODELVIEW30_ARB = 0x873E;
- int GL_MODELVIEW31_ARB = 0x873F;
-
- @StripPostfix("pWeights")
- void glWeightbvARB(@AutoSize("pWeights") int size, ByteBuffer pWeights);
-
- @StripPostfix("pWeights")
- void glWeightsvARB(@AutoSize("pWeights") int size, ShortBuffer pWeights);
-
- @StripPostfix("pWeights")
- void glWeightivARB(@AutoSize("pWeights") int size, IntBuffer pWeights);
-
- @StripPostfix("pWeights")
- void glWeightfvARB(@AutoSize("pWeights") int size, FloatBuffer pWeights);
-
- @StripPostfix("pWeights")
- void glWeightdvARB(@AutoSize("pWeights") int size, DoubleBuffer pWeights);
-
- @StripPostfix("pWeights")
- void glWeightubvARB(@AutoSize("pWeights") int size, @GLubyte ByteBuffer pWeights);
-
- @StripPostfix("pWeights")
- void glWeightusvARB(@AutoSize("pWeights") int size, @GLushort ShortBuffer pWeights);
-
- @StripPostfix("pWeights")
- void glWeightuivARB(@AutoSize("pWeights") int size, @GLuint IntBuffer pWeights);
-
- void glWeightPointerARB(int size, @AutoType("pPointer") @GLenum int type, @GLsizei int stride,
- @CachedReference
- @BufferObject(BufferKind.ArrayVBO)
- @Check
- @Const
- @GLbyte
- @GLubyte
- @GLshort
- @GLushort
- @GLint
- @GLuint
- @GLfloat
- @GLdouble Buffer pPointer);
-
- void glVertexBlendARB(int count);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+public interface ARB_vertex_blend {
+
+ int GL_MAX_VERTEX_UNITS_ARB = 0x86A4;
+ int GL_ACTIVE_VERTEX_UNITS_ARB = 0x86A5;
+ int GL_WEIGHT_SUM_UNITY_ARB = 0x86A6;
+ int GL_VERTEX_BLEND_ARB = 0x86A7;
+ int GL_CURRENT_WEIGHT_ARB = 0x86A8;
+ int GL_WEIGHT_ARRAY_TYPE_ARB = 0x86A9;
+ int GL_WEIGHT_ARRAY_STRIDE_ARB = 0x86AA;
+ int GL_WEIGHT_ARRAY_SIZE_ARB = 0x86AB;
+ int GL_WEIGHT_ARRAY_POINTER_ARB = 0x86AC;
+ int GL_WEIGHT_ARRAY_ARB = 0x86AD;
+ int GL_MODELVIEW0_ARB = 0x1700;
+ int GL_MODELVIEW1_ARB = 0x850a;
+ int GL_MODELVIEW2_ARB = 0x8722;
+ int GL_MODELVIEW3_ARB = 0x8723;
+ int GL_MODELVIEW4_ARB = 0x8724;
+ int GL_MODELVIEW5_ARB = 0x8725;
+ int GL_MODELVIEW6_ARB = 0x8726;
+ int GL_MODELVIEW7_ARB = 0x8727;
+ int GL_MODELVIEW8_ARB = 0x8728;
+ int GL_MODELVIEW9_ARB = 0x8729;
+ int GL_MODELVIEW10_ARB = 0x872A;
+ int GL_MODELVIEW11_ARB = 0x872B;
+ int GL_MODELVIEW12_ARB = 0x872C;
+ int GL_MODELVIEW13_ARB = 0x872D;
+ int GL_MODELVIEW14_ARB = 0x872E;
+ int GL_MODELVIEW15_ARB = 0x872F;
+ int GL_MODELVIEW16_ARB = 0x8730;
+ int GL_MODELVIEW17_ARB = 0x8731;
+ int GL_MODELVIEW18_ARB = 0x8732;
+ int GL_MODELVIEW19_ARB = 0x8733;
+ int GL_MODELVIEW20_ARB = 0x8734;
+ int GL_MODELVIEW21_ARB = 0x8735;
+ int GL_MODELVIEW22_ARB = 0x8736;
+ int GL_MODELVIEW23_ARB = 0x8737;
+ int GL_MODELVIEW24_ARB = 0x8738;
+ int GL_MODELVIEW25_ARB = 0x8739;
+ int GL_MODELVIEW26_ARB = 0x873A;
+ int GL_MODELVIEW27_ARB = 0x873B;
+ int GL_MODELVIEW28_ARB = 0x873C;
+ int GL_MODELVIEW29_ARB = 0x873D;
+ int GL_MODELVIEW30_ARB = 0x873E;
+ int GL_MODELVIEW31_ARB = 0x873F;
+
+ @StripPostfix("pWeights")
+ void glWeightbvARB(@AutoSize("pWeights") int size, ByteBuffer pWeights);
+
+ @StripPostfix("pWeights")
+ void glWeightsvARB(@AutoSize("pWeights") int size, ShortBuffer pWeights);
+
+ @StripPostfix("pWeights")
+ void glWeightivARB(@AutoSize("pWeights") int size, IntBuffer pWeights);
+
+ @StripPostfix("pWeights")
+ void glWeightfvARB(@AutoSize("pWeights") int size, FloatBuffer pWeights);
+
+ @StripPostfix("pWeights")
+ void glWeightdvARB(@AutoSize("pWeights") int size, DoubleBuffer pWeights);
+
+ @StripPostfix("pWeights")
+ void glWeightubvARB(@AutoSize("pWeights") int size, @GLubyte ByteBuffer pWeights);
+
+ @StripPostfix("pWeights")
+ void glWeightusvARB(@AutoSize("pWeights") int size, @GLushort ShortBuffer pWeights);
+
+ @StripPostfix("pWeights")
+ void glWeightuivARB(@AutoSize("pWeights") int size, @GLuint IntBuffer pWeights);
+
+ void glWeightPointerARB(int size, @AutoType("pPointer") @GLenum int type, @GLsizei int stride,
+ @CachedReference
+ @BufferObject(BufferKind.ArrayVBO)
+ @Check
+ @Const
+ @GLbyte
+ @GLubyte
+ @GLshort
+ @GLushort
+ @GLint
+ @GLuint
+ @GLfloat
+ @GLdouble Buffer pPointer);
+
+ void glVertexBlendARB(int count);
+}
diff --git a/src/templates/org/lwjgl/opengl/ARB_vertex_buffer_object.java b/src/templates/org/lwjgl/opengl/ARB_vertex_buffer_object.java
index 913c8bd..64b4ef8 100644
--- a/src/templates/org/lwjgl/opengl/ARB_vertex_buffer_object.java
+++ b/src/templates/org/lwjgl/opengl/ARB_vertex_buffer_object.java
@@ -1,65 +1,65 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ARB_vertex_buffer_object extends ARB_buffer_object {
-
- /**
- * Accepted by the <target> parameters of BindBufferARB, BufferDataARB,
- * BufferSubDataARB, MapBufferARB, UnmapBufferARB,
- * GetBufferSubDataARB, GetBufferParameterivARB, and
- * GetBufferPointervARB:
- */
- int GL_ARRAY_BUFFER_ARB = 0x8892;
- int GL_ELEMENT_ARRAY_BUFFER_ARB = 0x8893;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv, and GetDoublev:
- */
- int GL_ARRAY_BUFFER_BINDING_ARB = 0x8894;
- int GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB = 0x8895;
- int GL_VERTEX_ARRAY_BUFFER_BINDING_ARB = 0x8896;
- int GL_NORMAL_ARRAY_BUFFER_BINDING_ARB = 0x8897;
- int GL_COLOR_ARRAY_BUFFER_BINDING_ARB = 0x8898;
- int GL_INDEX_ARRAY_BUFFER_BINDING_ARB = 0x8899;
- int GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB = 0x889A;
- int GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB = 0x889B;
- int GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB = 0x889C;
- int GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB = 0x889D;
- int GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB = 0x889E;
-
- /**
- * Accepted by the <pname> parameter of GetVertexAttribivARB:
- */
- int GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB = 0x889F;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ARB_vertex_buffer_object extends ARB_buffer_object {
+
+ /**
+ * Accepted by the <target> parameters of BindBufferARB, BufferDataARB,
+ * BufferSubDataARB, MapBufferARB, UnmapBufferARB,
+ * GetBufferSubDataARB, GetBufferParameterivARB, and
+ * GetBufferPointervARB:
+ */
+ int GL_ARRAY_BUFFER_ARB = 0x8892;
+ int GL_ELEMENT_ARRAY_BUFFER_ARB = 0x8893;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, and GetDoublev:
+ */
+ int GL_ARRAY_BUFFER_BINDING_ARB = 0x8894;
+ int GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB = 0x8895;
+ int GL_VERTEX_ARRAY_BUFFER_BINDING_ARB = 0x8896;
+ int GL_NORMAL_ARRAY_BUFFER_BINDING_ARB = 0x8897;
+ int GL_COLOR_ARRAY_BUFFER_BINDING_ARB = 0x8898;
+ int GL_INDEX_ARRAY_BUFFER_BINDING_ARB = 0x8899;
+ int GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB = 0x889A;
+ int GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB = 0x889B;
+ int GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB = 0x889C;
+ int GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB = 0x889D;
+ int GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB = 0x889E;
+
+ /**
+ * Accepted by the <pname> parameter of GetVertexAttribivARB:
+ */
+ int GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB = 0x889F;
+}
diff --git a/src/templates/org/lwjgl/opengl/ARB_vertex_program.java b/src/templates/org/lwjgl/opengl/ARB_vertex_program.java
index 0e50fe5..1f63624 100644
--- a/src/templates/org/lwjgl/opengl/ARB_vertex_program.java
+++ b/src/templates/org/lwjgl/opengl/ARB_vertex_program.java
@@ -1,150 +1,150 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-public interface ARB_vertex_program extends ARB_program {
-
- /**
- * Accepted by the <cap> parameter of Disable, Enable, and IsEnabled, by the
- * <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev,
- * and by the <target> parameter of ProgramStringARB, BindProgramARB,
- * ProgramEnvParameter4[df][v]ARB, ProgramLocalParameter4[df][v]ARB,
- * GetProgramEnvParameter[df]vARB, GetProgramLocalParameter[df]vARB,
- * GetProgramivARB, and GetProgramStringARB.
- */
- int GL_VERTEX_PROGRAM_ARB = 0x8620;
-
- /**
- * Accepted by the <cap> parameter of Disable, Enable, and IsEnabled, and by
- * the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
- * GetDoublev:
- */
- int GL_VERTEX_PROGRAM_POINT_SIZE_ARB = 0x8642;
- int GL_VERTEX_PROGRAM_TWO_SIDE_ARB = 0x8643;
- int GL_COLOR_SUM_ARB = 0x8458;
-
- /** Accepted by the <pname> parameter of GetVertexAttrib[dfi]vARB: */
- int GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB = 0x8622;
- int GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB = 0x8623;
- int GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB = 0x8624;
- int GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB = 0x8625;
- int GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB = 0x886A;
- int GL_CURRENT_VERTEX_ATTRIB_ARB = 0x8626;
-
- /** Accepted by the <pname> parameter of GetVertexAttribPointervARB: */
- int GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB = 0x8645;
-
- /** Accepted by the <pname> parameter of GetProgramivARB: */
- int GL_PROGRAM_ADDRESS_REGISTERS_ARB = 0x88B0;
- int GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB = 0x88B1;
- int GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB = 0x88B2;
- int GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB = 0x88B3;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv, and GetDoublev:
- */
- int GL_MAX_VERTEX_ATTRIBS_ARB = 0x8869;
-
- @NoErrorCheck
- void glVertexAttrib1sARB(@GLuint int index, short x);
-
- @NoErrorCheck
- void glVertexAttrib1fARB(@GLuint int index, float x);
-
- @NoErrorCheck
- void glVertexAttrib1dARB(@GLuint int index, double x);
-
- @NoErrorCheck
- void glVertexAttrib2sARB(@GLuint int index, short x, short y);
-
- @NoErrorCheck
- void glVertexAttrib2fARB(@GLuint int index, float x, float y);
-
- @NoErrorCheck
- void glVertexAttrib2dARB(@GLuint int index, double x, double y);
-
- @NoErrorCheck
- void glVertexAttrib3sARB(@GLuint int index, short x, short y, short z);
-
- @NoErrorCheck
- void glVertexAttrib3fARB(@GLuint int index, float x, float y, float z);
-
- @NoErrorCheck
- void glVertexAttrib3dARB(@GLuint int index, double x, double y, double z);
-
- @NoErrorCheck
- void glVertexAttrib4sARB(@GLuint int index, short x, short y, short z, short w);
-
- @NoErrorCheck
- void glVertexAttrib4fARB(@GLuint int index, float x, float y, float z, float w);
-
- @NoErrorCheck
- void glVertexAttrib4dARB(@GLuint int index, double x, double y, double z, double w);
-
- @NoErrorCheck
- void glVertexAttrib4NubARB(@GLuint int index, @GLubyte byte x, @GLubyte byte y, @GLubyte byte z, @GLubyte byte w);
-
- void glVertexAttribPointerARB(@GLuint int index, int size, @AutoType("buffer") @GLenum int type, boolean normalized, @GLsizei int stride,
- @CachedReference(index = "index", name = "glVertexAttribPointer_buffer")
- @BufferObject(BufferKind.ArrayVBO)
- @Check
- @Const
- @GLbyte
- @GLubyte
- @GLshort
- @GLushort
- @GLint
- @GLuint
- @GLfloat
- @GLdouble Buffer buffer);
-
- void glEnableVertexAttribArrayARB(@GLuint int index);
-
- void glDisableVertexAttribArrayARB(@GLuint int index);
-
- @StripPostfix("params")
- void glGetVertexAttribfvARB(@GLuint int index, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
-
- @StripPostfix("params")
- void glGetVertexAttribdvARB(@GLuint int index, @GLenum int pname, @OutParameter @Check("4") DoubleBuffer params);
-
- @StripPostfix("params")
- void glGetVertexAttribivARB(@GLuint int index, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
-
- @StripPostfix("result")
- void glGetVertexAttribPointervARB(@GLuint int index, @GLenum int pname, @Result @GLvoid ByteBuffer result);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+public interface ARB_vertex_program extends ARB_program {
+
+ /**
+ * Accepted by the <cap> parameter of Disable, Enable, and IsEnabled, by the
+ * <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev,
+ * and by the <target> parameter of ProgramStringARB, BindProgramARB,
+ * ProgramEnvParameter4[df][v]ARB, ProgramLocalParameter4[df][v]ARB,
+ * GetProgramEnvParameter[df]vARB, GetProgramLocalParameter[df]vARB,
+ * GetProgramivARB, and GetProgramStringARB.
+ */
+ int GL_VERTEX_PROGRAM_ARB = 0x8620;
+
+ /**
+ * Accepted by the <cap> parameter of Disable, Enable, and IsEnabled, and by
+ * the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
+ * GetDoublev:
+ */
+ int GL_VERTEX_PROGRAM_POINT_SIZE_ARB = 0x8642;
+ int GL_VERTEX_PROGRAM_TWO_SIDE_ARB = 0x8643;
+ int GL_COLOR_SUM_ARB = 0x8458;
+
+ /** Accepted by the <pname> parameter of GetVertexAttrib[dfi]vARB: */
+ int GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB = 0x8622;
+ int GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB = 0x8623;
+ int GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB = 0x8624;
+ int GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB = 0x8625;
+ int GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB = 0x886A;
+ int GL_CURRENT_VERTEX_ATTRIB_ARB = 0x8626;
+
+ /** Accepted by the <pname> parameter of GetVertexAttribPointervARB: */
+ int GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB = 0x8645;
+
+ /** Accepted by the <pname> parameter of GetProgramivARB: */
+ int GL_PROGRAM_ADDRESS_REGISTERS_ARB = 0x88B0;
+ int GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB = 0x88B1;
+ int GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB = 0x88B2;
+ int GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB = 0x88B3;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, and GetDoublev:
+ */
+ int GL_MAX_VERTEX_ATTRIBS_ARB = 0x8869;
+
+ @NoErrorCheck
+ void glVertexAttrib1sARB(@GLuint int index, short x);
+
+ @NoErrorCheck
+ void glVertexAttrib1fARB(@GLuint int index, float x);
+
+ @NoErrorCheck
+ void glVertexAttrib1dARB(@GLuint int index, double x);
+
+ @NoErrorCheck
+ void glVertexAttrib2sARB(@GLuint int index, short x, short y);
+
+ @NoErrorCheck
+ void glVertexAttrib2fARB(@GLuint int index, float x, float y);
+
+ @NoErrorCheck
+ void glVertexAttrib2dARB(@GLuint int index, double x, double y);
+
+ @NoErrorCheck
+ void glVertexAttrib3sARB(@GLuint int index, short x, short y, short z);
+
+ @NoErrorCheck
+ void glVertexAttrib3fARB(@GLuint int index, float x, float y, float z);
+
+ @NoErrorCheck
+ void glVertexAttrib3dARB(@GLuint int index, double x, double y, double z);
+
+ @NoErrorCheck
+ void glVertexAttrib4sARB(@GLuint int index, short x, short y, short z, short w);
+
+ @NoErrorCheck
+ void glVertexAttrib4fARB(@GLuint int index, float x, float y, float z, float w);
+
+ @NoErrorCheck
+ void glVertexAttrib4dARB(@GLuint int index, double x, double y, double z, double w);
+
+ @NoErrorCheck
+ void glVertexAttrib4NubARB(@GLuint int index, @GLubyte byte x, @GLubyte byte y, @GLubyte byte z, @GLubyte byte w);
+
+ void glVertexAttribPointerARB(@GLuint int index, int size, @AutoType("buffer") @GLenum int type, boolean normalized, @GLsizei int stride,
+ @CachedReference(index = "index", name = "glVertexAttribPointer_buffer")
+ @BufferObject(BufferKind.ArrayVBO)
+ @Check
+ @Const
+ @GLbyte
+ @GLubyte
+ @GLshort
+ @GLushort
+ @GLint
+ @GLuint
+ @GLfloat
+ @GLdouble Buffer buffer);
+
+ void glEnableVertexAttribArrayARB(@GLuint int index);
+
+ void glDisableVertexAttribArrayARB(@GLuint int index);
+
+ @StripPostfix("params")
+ void glGetVertexAttribfvARB(@GLuint int index, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
+
+ @StripPostfix("params")
+ void glGetVertexAttribdvARB(@GLuint int index, @GLenum int pname, @OutParameter @Check("4") DoubleBuffer params);
+
+ @StripPostfix("params")
+ void glGetVertexAttribivARB(@GLuint int index, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
+
+ @StripPostfix("result")
+ void glGetVertexAttribPointervARB(@GLuint int index, @GLenum int pname, @Result @GLvoid ByteBuffer result);
+}
diff --git a/src/templates/org/lwjgl/opengl/ARB_vertex_shader.java b/src/templates/org/lwjgl/opengl/ARB_vertex_shader.java
index d8b31ec..d5221e8 100644
--- a/src/templates/org/lwjgl/opengl/ARB_vertex_shader.java
+++ b/src/templates/org/lwjgl/opengl/ARB_vertex_shader.java
@@ -1,209 +1,209 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-public interface ARB_vertex_shader {
-
- /**
- * Accepted by the <shaderType> argument of CreateShaderObjectARB and
- * returned by the <params> parameter of GetObjectParameter{if}vARB:
- */
- int GL_VERTEX_SHADER_ARB = 0x8B31;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv, and GetDoublev:
- */
- int GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB = 0x8B4A;
- int GL_MAX_VARYING_FLOATS_ARB = 0x8B4B;
- int GL_MAX_VERTEX_ATTRIBS_ARB = 0x8869;
- int GL_MAX_TEXTURE_IMAGE_UNITS_ARB = 0x8872;
- int GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB = 0x8B4C;
- int GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB = 0x8B4D;
- int GL_MAX_TEXTURE_COORDS_ARB = 0x8871;
-
- /**
- * Accepted by the <cap> parameter of Disable, Enable, and IsEnabled, and
- * by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
- * GetDoublev:
- */
- int GL_VERTEX_PROGRAM_POINT_SIZE_ARB = 0x8642;
- int GL_VERTEX_PROGRAM_TWO_SIDE_ARB = 0x8643;
-
- /** Accepted by the <pname> parameter GetObjectParameter{if}vARB: */
- int GL_OBJECT_ACTIVE_ATTRIBUTES_ARB = 0x8B89;
- int GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB = 0x8B8A;
-
- /** Accepted by the <pname> parameter of GetVertexAttrib{dfi}vARB: */
- int GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB = 0x8622;
- int GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB = 0x8623;
- int GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB = 0x8624;
- int GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB = 0x8625;
- int GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB = 0x886A;
- int GL_CURRENT_VERTEX_ATTRIB_ARB = 0x8626;
-
- /** Accepted by the <pname> parameter of GetVertexAttribPointervARB: */
- int GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB = 0x8645;
-
- /** Returned by the <type> parameter of GetActiveAttribARB: */
- int GL_FLOAT = 0x1406;
- int GL_FLOAT_VEC2_ARB = 0x8B50;
- int GL_FLOAT_VEC3_ARB = 0x8B51;
- int GL_FLOAT_VEC4_ARB = 0x8B52;
- int GL_FLOAT_MAT2_ARB = 0x8B5A;
- int GL_FLOAT_MAT3_ARB = 0x8B5B;
- int GL_FLOAT_MAT4_ARB = 0x8B5C;
-
- @NoErrorCheck
- void glVertexAttrib1sARB(@GLuint int index, short v0);
-
- @NoErrorCheck
- void glVertexAttrib1fARB(@GLuint int index, float v0);
-
- @NoErrorCheck
- void glVertexAttrib1dARB(@GLuint int index, double v0);
-
- @NoErrorCheck
- void glVertexAttrib2sARB(@GLuint int index, short v0, short v1);
-
- @NoErrorCheck
- void glVertexAttrib2fARB(@GLuint int index, float v0, float v1);
-
- @NoErrorCheck
- void glVertexAttrib2dARB(@GLuint int index, double v0, double v1);
-
- @NoErrorCheck
- void glVertexAttrib3sARB(@GLuint int index, short v0, short v1, short v2);
-
- @NoErrorCheck
- void glVertexAttrib3fARB(@GLuint int index, float v0, float v1, float v2);
-
- @NoErrorCheck
- void glVertexAttrib3dARB(@GLuint int index, double v0, double v1, double v2);
-
- @NoErrorCheck
- void glVertexAttrib4sARB(@GLuint int index, short v0, short v1, short v2, short v3);
-
- @NoErrorCheck
- void glVertexAttrib4fARB(@GLuint int index, float v0, float v1, float v2, float v3);
-
- @NoErrorCheck
- void glVertexAttrib4dARB(@GLuint int index, double v0, double v1, double v2, double v3);
-
- @NoErrorCheck
- void glVertexAttrib4NubARB(@GLuint int index, @GLubyte byte x, @GLubyte byte y, @GLubyte byte z, @GLubyte byte w);
-
- void glVertexAttribPointerARB(@GLuint int index, int size, @AutoType("buffer") @GLenum int type, boolean normalized, @GLsizei int stride,
- @CachedReference(index = "index", name = "glVertexAttribPointer_buffer")
- @BufferObject(BufferKind.ArrayVBO)
- @Check
- @Const
- @GLbyte
- @GLubyte
- @GLshort
- @GLushort
- @GLint
- @GLuint
- @GLfloat
- @GLdouble Buffer buffer);
-
- void glEnableVertexAttribArrayARB(@GLuint int index);
-
- void glDisableVertexAttribArrayARB(@GLuint int index);
-
- void glBindAttribLocationARB(@GLhandleARB int programObj, @GLuint int index, @NullTerminated @Const @GLcharARB ByteBuffer name);
-
- @Alternate("glBindAttribLocationARB")
- void glBindAttribLocationARB(@GLhandleARB int programObj, @GLuint int index, @NullTerminated CharSequence name);
-
- void glGetActiveAttribARB(@GLhandleARB int programObj, @GLuint int index, @AutoSize("name") @GLsizei int maxLength,
- @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
- @OutParameter @Check("1") IntBuffer size,
- @OutParameter @GLenum @Check("1") IntBuffer type,
- @OutParameter @GLcharARB ByteBuffer name);
-
- /** Overloads glGetActiveAttribARB. This version returns both size and type in the sizeType buffer (at .position() and .position() + 1). */
- @Alternate("glGetActiveAttribARB")
- @GLreturn(value = "name", maxLength = "maxLength")
- void glGetActiveAttribARB2(@GLhandleARB int programObj, @GLuint int index, @GLsizei int maxLength,
- @OutParameter @GLsizei @Constant("name_length, 0") IntBuffer length,
- @OutParameter @Check("2") IntBuffer sizeType,
- @OutParameter @GLenum @Constant("sizeType, sizeType.position() + 1") IntBuffer type,
- @OutParameter @GLcharARB ByteBuffer name);
-
- /** Overloads glGetActiveAttribARB. This version returns only the attrib name. */
- @Alternate(value = "glGetActiveAttribARB", javaAlt = true)
- @GLreturn(value = "name", maxLength = "maxLength")
- void glGetActiveAttribARB(@GLhandleARB int programObj, @GLuint int index, @GLsizei int maxLength,
- @OutParameter @GLsizei @Constant("name_length, 0, APIUtils.getBufferInt(), 0, APIUtils.getBufferInt(), 1") IntBuffer length,
- @OutParameter @GLcharARB ByteBuffer name);
-
- /** Overloads glGetActiveAttribARB. This version returns only the attrib size. */
- @Alternate(value = "glGetActiveAttribARB", javaAlt = true)
- @GLreturn(value = "size")
- void glGetActiveAttribSizeARB(@GLhandleARB int programObj, @GLuint int index, @Constant("0") @GLsizei int maxLength,
- @OutParameter @GLsizei @Constant("null, 0") IntBuffer length,
- @OutParameter IntBuffer size,
- @OutParameter @GLenum @Constant("size, 1") IntBuffer type, // Reuse size buffer and ignore
- @OutParameter @GLcharARB @Constant("APIUtils.getBufferByte(0), 0") ByteBuffer name);
-
- /** Overloads glGetActiveAttribARB. This version returns only the attrib type. */
- @Alternate(value = "glGetActiveAttribARB", javaAlt = true)
- @GLreturn(value = "type")
- void glGetActiveAttribTypeARB(@GLhandleARB int programObj, @GLuint int index, @Constant("0") @GLsizei int maxLength,
- @OutParameter @GLsizei @Constant("null, 0") IntBuffer length,
- @OutParameter @Constant("type, 1") IntBuffer size, // Reuse type buffer and ignore
- @OutParameter @GLenum IntBuffer type,
- @OutParameter @GLcharARB @Constant("APIUtils.getBufferByte(0), 0") ByteBuffer name);
-
- int glGetAttribLocationARB(@GLhandleARB int programObj, @NullTerminated @Const @GLcharARB ByteBuffer name);
-
- @Alternate("glGetAttribLocationARB")
- int glGetAttribLocationARB(@GLhandleARB int programObj, @NullTerminated CharSequence name);
-
- @StripPostfix("params")
- void glGetVertexAttribfvARB(@GLuint int index, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
-
- @StripPostfix("params")
- void glGetVertexAttribdvARB(@GLuint int index, @GLenum int pname, @OutParameter @Check("4") DoubleBuffer params);
-
- @StripPostfix("params")
- void glGetVertexAttribivARB(@GLuint int index, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
-
- @StripPostfix("result")
- void glGetVertexAttribPointervARB(@GLuint int index, @GLenum int pname, @Result @GLvoid ByteBuffer result);
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+public interface ARB_vertex_shader {
+
+ /**
+ * Accepted by the <shaderType> argument of CreateShaderObjectARB and
+ * returned by the <params> parameter of GetObjectParameter{if}vARB:
+ */
+ int GL_VERTEX_SHADER_ARB = 0x8B31;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, and GetDoublev:
+ */
+ int GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB = 0x8B4A;
+ int GL_MAX_VARYING_FLOATS_ARB = 0x8B4B;
+ int GL_MAX_VERTEX_ATTRIBS_ARB = 0x8869;
+ int GL_MAX_TEXTURE_IMAGE_UNITS_ARB = 0x8872;
+ int GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB = 0x8B4C;
+ int GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB = 0x8B4D;
+ int GL_MAX_TEXTURE_COORDS_ARB = 0x8871;
+
+ /**
+ * Accepted by the <cap> parameter of Disable, Enable, and IsEnabled, and
+ * by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
+ * GetDoublev:
+ */
+ int GL_VERTEX_PROGRAM_POINT_SIZE_ARB = 0x8642;
+ int GL_VERTEX_PROGRAM_TWO_SIDE_ARB = 0x8643;
+
+ /** Accepted by the <pname> parameter GetObjectParameter{if}vARB: */
+ int GL_OBJECT_ACTIVE_ATTRIBUTES_ARB = 0x8B89;
+ int GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB = 0x8B8A;
+
+ /** Accepted by the <pname> parameter of GetVertexAttrib{dfi}vARB: */
+ int GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB = 0x8622;
+ int GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB = 0x8623;
+ int GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB = 0x8624;
+ int GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB = 0x8625;
+ int GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB = 0x886A;
+ int GL_CURRENT_VERTEX_ATTRIB_ARB = 0x8626;
+
+ /** Accepted by the <pname> parameter of GetVertexAttribPointervARB: */
+ int GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB = 0x8645;
+
+ /** Returned by the <type> parameter of GetActiveAttribARB: */
+ int GL_FLOAT = 0x1406;
+ int GL_FLOAT_VEC2_ARB = 0x8B50;
+ int GL_FLOAT_VEC3_ARB = 0x8B51;
+ int GL_FLOAT_VEC4_ARB = 0x8B52;
+ int GL_FLOAT_MAT2_ARB = 0x8B5A;
+ int GL_FLOAT_MAT3_ARB = 0x8B5B;
+ int GL_FLOAT_MAT4_ARB = 0x8B5C;
+
+ @NoErrorCheck
+ void glVertexAttrib1sARB(@GLuint int index, short v0);
+
+ @NoErrorCheck
+ void glVertexAttrib1fARB(@GLuint int index, float v0);
+
+ @NoErrorCheck
+ void glVertexAttrib1dARB(@GLuint int index, double v0);
+
+ @NoErrorCheck
+ void glVertexAttrib2sARB(@GLuint int index, short v0, short v1);
+
+ @NoErrorCheck
+ void glVertexAttrib2fARB(@GLuint int index, float v0, float v1);
+
+ @NoErrorCheck
+ void glVertexAttrib2dARB(@GLuint int index, double v0, double v1);
+
+ @NoErrorCheck
+ void glVertexAttrib3sARB(@GLuint int index, short v0, short v1, short v2);
+
+ @NoErrorCheck
+ void glVertexAttrib3fARB(@GLuint int index, float v0, float v1, float v2);
+
+ @NoErrorCheck
+ void glVertexAttrib3dARB(@GLuint int index, double v0, double v1, double v2);
+
+ @NoErrorCheck
+ void glVertexAttrib4sARB(@GLuint int index, short v0, short v1, short v2, short v3);
+
+ @NoErrorCheck
+ void glVertexAttrib4fARB(@GLuint int index, float v0, float v1, float v2, float v3);
+
+ @NoErrorCheck
+ void glVertexAttrib4dARB(@GLuint int index, double v0, double v1, double v2, double v3);
+
+ @NoErrorCheck
+ void glVertexAttrib4NubARB(@GLuint int index, @GLubyte byte x, @GLubyte byte y, @GLubyte byte z, @GLubyte byte w);
+
+ void glVertexAttribPointerARB(@GLuint int index, int size, @AutoType("buffer") @GLenum int type, boolean normalized, @GLsizei int stride,
+ @CachedReference(index = "index", name = "glVertexAttribPointer_buffer")
+ @BufferObject(BufferKind.ArrayVBO)
+ @Check
+ @Const
+ @GLbyte
+ @GLubyte
+ @GLshort
+ @GLushort
+ @GLint
+ @GLuint
+ @GLfloat
+ @GLdouble Buffer buffer);
+
+ void glEnableVertexAttribArrayARB(@GLuint int index);
+
+ void glDisableVertexAttribArrayARB(@GLuint int index);
+
+ void glBindAttribLocationARB(@GLhandleARB int programObj, @GLuint int index, @NullTerminated @Const @GLcharARB ByteBuffer name);
+
+ @Alternate("glBindAttribLocationARB")
+ void glBindAttribLocationARB(@GLhandleARB int programObj, @GLuint int index, @NullTerminated CharSequence name);
+
+ void glGetActiveAttribARB(@GLhandleARB int programObj, @GLuint int index, @AutoSize("name") @GLsizei int maxLength,
+ @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
+ @OutParameter @Check("1") IntBuffer size,
+ @OutParameter @GLenum @Check("1") IntBuffer type,
+ @OutParameter @GLcharARB ByteBuffer name);
+
+ /** Overloads glGetActiveAttribARB. This version returns both size and type in the sizeType buffer (at .position() and .position() + 1). */
+ @Alternate("glGetActiveAttribARB")
+ @GLreturn(value = "name", maxLength = "maxLength")
+ void glGetActiveAttribARB2(@GLhandleARB int programObj, @GLuint int index, @GLsizei int maxLength,
+ @OutParameter @GLsizei @Constant("name_length, 0") IntBuffer length,
+ @OutParameter @Check("2") IntBuffer sizeType,
+ @OutParameter @GLenum @Constant("sizeType, sizeType.position() + 1") IntBuffer type,
+ @OutParameter @GLcharARB ByteBuffer name);
+
+ /** Overloads glGetActiveAttribARB. This version returns only the attrib name. */
+ @Alternate(value = "glGetActiveAttribARB", javaAlt = true)
+ @GLreturn(value = "name", maxLength = "maxLength")
+ void glGetActiveAttribARB(@GLhandleARB int programObj, @GLuint int index, @GLsizei int maxLength,
+ @OutParameter @GLsizei @Constant("name_length, 0, APIUtils.getBufferInt(), 0, APIUtils.getBufferInt(), 1") IntBuffer length,
+ @OutParameter @GLcharARB ByteBuffer name);
+
+ /** Overloads glGetActiveAttribARB. This version returns only the attrib size. */
+ @Alternate(value = "glGetActiveAttribARB", javaAlt = true)
+ @GLreturn(value = "size")
+ void glGetActiveAttribSizeARB(@GLhandleARB int programObj, @GLuint int index, @Constant("0") @GLsizei int maxLength,
+ @OutParameter @GLsizei @Constant("null, 0") IntBuffer length,
+ @OutParameter IntBuffer size,
+ @OutParameter @GLenum @Constant("size, 1") IntBuffer type, // Reuse size buffer and ignore
+ @OutParameter @GLcharARB @Constant("APIUtils.getBufferByte(0), 0") ByteBuffer name);
+
+ /** Overloads glGetActiveAttribARB. This version returns only the attrib type. */
+ @Alternate(value = "glGetActiveAttribARB", javaAlt = true)
+ @GLreturn(value = "type")
+ void glGetActiveAttribTypeARB(@GLhandleARB int programObj, @GLuint int index, @Constant("0") @GLsizei int maxLength,
+ @OutParameter @GLsizei @Constant("null, 0") IntBuffer length,
+ @OutParameter @Constant("type, 1") IntBuffer size, // Reuse type buffer and ignore
+ @OutParameter @GLenum IntBuffer type,
+ @OutParameter @GLcharARB @Constant("APIUtils.getBufferByte(0), 0") ByteBuffer name);
+
+ int glGetAttribLocationARB(@GLhandleARB int programObj, @NullTerminated @Const @GLcharARB ByteBuffer name);
+
+ @Alternate("glGetAttribLocationARB")
+ int glGetAttribLocationARB(@GLhandleARB int programObj, @NullTerminated CharSequence name);
+
+ @StripPostfix("params")
+ void glGetVertexAttribfvARB(@GLuint int index, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
+
+ @StripPostfix("params")
+ void glGetVertexAttribdvARB(@GLuint int index, @GLenum int pname, @OutParameter @Check("4") DoubleBuffer params);
+
+ @StripPostfix("params")
+ void glGetVertexAttribivARB(@GLuint int index, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
+
+ @StripPostfix("result")
+ void glGetVertexAttribPointervARB(@GLuint int index, @GLenum int pname, @Result @GLvoid ByteBuffer result);
+
+}
diff --git a/src/templates/org/lwjgl/opengl/ARB_vertex_type_2_10_10_10_rev.java b/src/templates/org/lwjgl/opengl/ARB_vertex_type_2_10_10_10_rev.java
index 9912e8d..ff97ca8 100644
--- a/src/templates/org/lwjgl/opengl/ARB_vertex_type_2_10_10_10_rev.java
+++ b/src/templates/org/lwjgl/opengl/ARB_vertex_type_2_10_10_10_rev.java
@@ -1,183 +1,183 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.IntBuffer;
-
- at Extension(postfix = "", className = "ARBVertexType2_10_10_10_REV")
-public interface ARB_vertex_type_2_10_10_10_rev {
-
- /**
- * Accepted by the <type> parameter of VertexAttribPointer, VertexPointer,
- * NormalPointer, ColorPointer, SecondaryColorPointer, TexCoordPointer,
- * VertexAttribP{1234}ui, VertexP*, TexCoordP*, MultiTexCoordP*, NormalP3ui,
- * ColorP*, SecondaryColorP* and VertexAttribP*
- */
- int GL_UNSIGNED_INT_2_10_10_10_REV = GL12.GL_UNSIGNED_INT_2_10_10_10_REV;
- int GL_INT_2_10_10_10_REV = 0x8D9F;
-
- @NoErrorCheck
- void glVertexP2ui(@GLenum int type, @GLuint int value);
-
- @NoErrorCheck
- void glVertexP3ui(@GLenum int type, @GLuint int value);
-
- @NoErrorCheck
- void glVertexP4ui(@GLenum int type, @GLuint int value);
-
- @NoErrorCheck
- @StripPostfix("value")
- void glVertexP2uiv(@GLenum int type, @Check("2") @Const @GLuint IntBuffer value);
-
- @NoErrorCheck
- @StripPostfix("value")
- void glVertexP3uiv(@GLenum int type, @Check("3") @Const @GLuint IntBuffer value);
-
- @NoErrorCheck
- @StripPostfix("value")
- void glVertexP4uiv(@GLenum int type, @Check("4") @Const @GLuint IntBuffer value);
-
- @NoErrorCheck
- void glTexCoordP1ui(@GLenum int type, @GLuint int coords);
-
- @NoErrorCheck
- void glTexCoordP2ui(@GLenum int type, @GLuint int coords);
-
- @NoErrorCheck
- void glTexCoordP3ui(@GLenum int type, @GLuint int coords);
-
- @NoErrorCheck
- void glTexCoordP4ui(@GLenum int type, @GLuint int coords);
-
- @NoErrorCheck
- @StripPostfix("coords")
- void glTexCoordP1uiv(@GLenum int type, @Check("1") @Const @GLuint IntBuffer coords);
-
- @NoErrorCheck
- @StripPostfix("coords")
- void glTexCoordP2uiv(@GLenum int type, @Check("2") @Const @GLuint IntBuffer coords);
-
- @NoErrorCheck
- @StripPostfix("coords")
- void glTexCoordP3uiv(@GLenum int type, @Check("3") @Const @GLuint IntBuffer coords);
-
- @NoErrorCheck
- @StripPostfix("coords")
- void glTexCoordP4uiv(@GLenum int type, @Check("4") @Const @GLuint IntBuffer coords);
-
- @NoErrorCheck
- void glMultiTexCoordP1ui(@GLenum int texture, @GLenum int type, @GLuint int coords);
-
- @NoErrorCheck
- void glMultiTexCoordP2ui(@GLenum int texture, @GLenum int type, @GLuint int coords);
-
- @NoErrorCheck
- void glMultiTexCoordP3ui(@GLenum int texture, @GLenum int type, @GLuint int coords);
-
- @NoErrorCheck
- void glMultiTexCoordP4ui(@GLenum int texture, @GLenum int type, @GLuint int coords);
-
- @NoErrorCheck
- @StripPostfix("coords")
- void glMultiTexCoordP1uiv(@GLenum int texture, @GLenum int type, @Check("1") @Const @GLuint IntBuffer coords);
-
- @NoErrorCheck
- @StripPostfix("coords")
- void glMultiTexCoordP2uiv(@GLenum int texture, @GLenum int type, @Check("2") @Const @GLuint IntBuffer coords);
-
- @NoErrorCheck
- @StripPostfix("coords")
- void glMultiTexCoordP3uiv(@GLenum int texture, @GLenum int type, @Check("3") @Const @GLuint IntBuffer coords);
-
- @NoErrorCheck
- @StripPostfix("coords")
- void glMultiTexCoordP4uiv(@GLenum int texture, @GLenum int type, @Check("4") @Const @GLuint IntBuffer coords);
-
- @NoErrorCheck
- void glNormalP3ui(@GLenum int type, @GLuint int coords);
-
- @NoErrorCheck
- @StripPostfix("coords")
- void glNormalP3uiv(@GLenum int type, @Check("3") @Const @GLuint IntBuffer coords);
-
- @NoErrorCheck
- void glColorP3ui(@GLenum int type, @GLuint int color);
-
- @NoErrorCheck
- void glColorP4ui(@GLenum int type, @GLuint int color);
-
- @NoErrorCheck
- @StripPostfix("color")
- void glColorP3uiv(@GLenum int type, @Check("3") @Const @GLuint IntBuffer color);
-
- @NoErrorCheck
- @StripPostfix("color")
- void glColorP4uiv(@GLenum int type, @Check("4") @Const @GLuint IntBuffer color);
-
- @NoErrorCheck
- void glSecondaryColorP3ui(@GLenum int type, @GLuint int color);
-
- @NoErrorCheck
- @StripPostfix("color")
- void glSecondaryColorP3uiv(@GLenum int type, @Check("3") @Const @GLuint IntBuffer color);
-
- @NoErrorCheck
- void glVertexAttribP1ui(@GLuint int index, @GLenum int type, boolean normalized, @GLuint int value);
-
- @NoErrorCheck
- void glVertexAttribP2ui(@GLuint int index, @GLenum int type, boolean normalized, @GLuint int value);
-
- @NoErrorCheck
- void glVertexAttribP3ui(@GLuint int index, @GLenum int type, boolean normalized, @GLuint int value);
-
- @NoErrorCheck
- void glVertexAttribP4ui(@GLuint int index, @GLenum int type, boolean normalized, @GLuint int value);
-
- @NoErrorCheck
- @StripPostfix("value")
- void glVertexAttribP1uiv(@GLuint int index, @GLenum int type, boolean normalized, @Check("1") @Const @GLuint IntBuffer value);
-
- @NoErrorCheck
- @StripPostfix("value")
- void glVertexAttribP2uiv(@GLuint int index, @GLenum int type, boolean normalized, @Check("2") @Const @GLuint IntBuffer value);
-
- @NoErrorCheck
- @StripPostfix("value")
- void glVertexAttribP3uiv(@GLuint int index, @GLenum int type, boolean normalized, @Check("3") @Const @GLuint IntBuffer value);
-
- @NoErrorCheck
- @StripPostfix("value")
- void glVertexAttribP4uiv(@GLuint int index, @GLenum int type, boolean normalized, @Check("4") @Const @GLuint IntBuffer value);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.IntBuffer;
+
+ at Extension(postfix = "", className = "ARBVertexType2_10_10_10_REV")
+public interface ARB_vertex_type_2_10_10_10_rev {
+
+ /**
+ * Accepted by the <type> parameter of VertexAttribPointer, VertexPointer,
+ * NormalPointer, ColorPointer, SecondaryColorPointer, TexCoordPointer,
+ * VertexAttribP{1234}ui, VertexP*, TexCoordP*, MultiTexCoordP*, NormalP3ui,
+ * ColorP*, SecondaryColorP* and VertexAttribP*
+ */
+ int GL_UNSIGNED_INT_2_10_10_10_REV = GL12.GL_UNSIGNED_INT_2_10_10_10_REV;
+ int GL_INT_2_10_10_10_REV = 0x8D9F;
+
+ @NoErrorCheck
+ void glVertexP2ui(@GLenum int type, @GLuint int value);
+
+ @NoErrorCheck
+ void glVertexP3ui(@GLenum int type, @GLuint int value);
+
+ @NoErrorCheck
+ void glVertexP4ui(@GLenum int type, @GLuint int value);
+
+ @NoErrorCheck
+ @StripPostfix("value")
+ void glVertexP2uiv(@GLenum int type, @Check("2") @Const @GLuint IntBuffer value);
+
+ @NoErrorCheck
+ @StripPostfix("value")
+ void glVertexP3uiv(@GLenum int type, @Check("3") @Const @GLuint IntBuffer value);
+
+ @NoErrorCheck
+ @StripPostfix("value")
+ void glVertexP4uiv(@GLenum int type, @Check("4") @Const @GLuint IntBuffer value);
+
+ @NoErrorCheck
+ void glTexCoordP1ui(@GLenum int type, @GLuint int coords);
+
+ @NoErrorCheck
+ void glTexCoordP2ui(@GLenum int type, @GLuint int coords);
+
+ @NoErrorCheck
+ void glTexCoordP3ui(@GLenum int type, @GLuint int coords);
+
+ @NoErrorCheck
+ void glTexCoordP4ui(@GLenum int type, @GLuint int coords);
+
+ @NoErrorCheck
+ @StripPostfix("coords")
+ void glTexCoordP1uiv(@GLenum int type, @Check("1") @Const @GLuint IntBuffer coords);
+
+ @NoErrorCheck
+ @StripPostfix("coords")
+ void glTexCoordP2uiv(@GLenum int type, @Check("2") @Const @GLuint IntBuffer coords);
+
+ @NoErrorCheck
+ @StripPostfix("coords")
+ void glTexCoordP3uiv(@GLenum int type, @Check("3") @Const @GLuint IntBuffer coords);
+
+ @NoErrorCheck
+ @StripPostfix("coords")
+ void glTexCoordP4uiv(@GLenum int type, @Check("4") @Const @GLuint IntBuffer coords);
+
+ @NoErrorCheck
+ void glMultiTexCoordP1ui(@GLenum int texture, @GLenum int type, @GLuint int coords);
+
+ @NoErrorCheck
+ void glMultiTexCoordP2ui(@GLenum int texture, @GLenum int type, @GLuint int coords);
+
+ @NoErrorCheck
+ void glMultiTexCoordP3ui(@GLenum int texture, @GLenum int type, @GLuint int coords);
+
+ @NoErrorCheck
+ void glMultiTexCoordP4ui(@GLenum int texture, @GLenum int type, @GLuint int coords);
+
+ @NoErrorCheck
+ @StripPostfix("coords")
+ void glMultiTexCoordP1uiv(@GLenum int texture, @GLenum int type, @Check("1") @Const @GLuint IntBuffer coords);
+
+ @NoErrorCheck
+ @StripPostfix("coords")
+ void glMultiTexCoordP2uiv(@GLenum int texture, @GLenum int type, @Check("2") @Const @GLuint IntBuffer coords);
+
+ @NoErrorCheck
+ @StripPostfix("coords")
+ void glMultiTexCoordP3uiv(@GLenum int texture, @GLenum int type, @Check("3") @Const @GLuint IntBuffer coords);
+
+ @NoErrorCheck
+ @StripPostfix("coords")
+ void glMultiTexCoordP4uiv(@GLenum int texture, @GLenum int type, @Check("4") @Const @GLuint IntBuffer coords);
+
+ @NoErrorCheck
+ void glNormalP3ui(@GLenum int type, @GLuint int coords);
+
+ @NoErrorCheck
+ @StripPostfix("coords")
+ void glNormalP3uiv(@GLenum int type, @Check("3") @Const @GLuint IntBuffer coords);
+
+ @NoErrorCheck
+ void glColorP3ui(@GLenum int type, @GLuint int color);
+
+ @NoErrorCheck
+ void glColorP4ui(@GLenum int type, @GLuint int color);
+
+ @NoErrorCheck
+ @StripPostfix("color")
+ void glColorP3uiv(@GLenum int type, @Check("3") @Const @GLuint IntBuffer color);
+
+ @NoErrorCheck
+ @StripPostfix("color")
+ void glColorP4uiv(@GLenum int type, @Check("4") @Const @GLuint IntBuffer color);
+
+ @NoErrorCheck
+ void glSecondaryColorP3ui(@GLenum int type, @GLuint int color);
+
+ @NoErrorCheck
+ @StripPostfix("color")
+ void glSecondaryColorP3uiv(@GLenum int type, @Check("3") @Const @GLuint IntBuffer color);
+
+ @NoErrorCheck
+ void glVertexAttribP1ui(@GLuint int index, @GLenum int type, boolean normalized, @GLuint int value);
+
+ @NoErrorCheck
+ void glVertexAttribP2ui(@GLuint int index, @GLenum int type, boolean normalized, @GLuint int value);
+
+ @NoErrorCheck
+ void glVertexAttribP3ui(@GLuint int index, @GLenum int type, boolean normalized, @GLuint int value);
+
+ @NoErrorCheck
+ void glVertexAttribP4ui(@GLuint int index, @GLenum int type, boolean normalized, @GLuint int value);
+
+ @NoErrorCheck
+ @StripPostfix("value")
+ void glVertexAttribP1uiv(@GLuint int index, @GLenum int type, boolean normalized, @Check("1") @Const @GLuint IntBuffer value);
+
+ @NoErrorCheck
+ @StripPostfix("value")
+ void glVertexAttribP2uiv(@GLuint int index, @GLenum int type, boolean normalized, @Check("2") @Const @GLuint IntBuffer value);
+
+ @NoErrorCheck
+ @StripPostfix("value")
+ void glVertexAttribP3uiv(@GLuint int index, @GLenum int type, boolean normalized, @Check("3") @Const @GLuint IntBuffer value);
+
+ @NoErrorCheck
+ @StripPostfix("value")
+ void glVertexAttribP4uiv(@GLuint int index, @GLenum int type, boolean normalized, @Check("4") @Const @GLuint IntBuffer value);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ARB_window_pos.java b/src/templates/org/lwjgl/opengl/ARB_window_pos.java
index e8cf8dd..5527c39 100644
--- a/src/templates/org/lwjgl/opengl/ARB_window_pos.java
+++ b/src/templates/org/lwjgl/opengl/ARB_window_pos.java
@@ -1,62 +1,62 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.DeprecatedGL;
-
- at DeprecatedGL
-public interface ARB_window_pos {
-
- @DeprecatedGL
- void glWindowPos2fARB(float x, float y);
-
- @DeprecatedGL
- void glWindowPos2dARB(double x, double y);
-
- @DeprecatedGL
- void glWindowPos2iARB(int x, int y);
-
- @DeprecatedGL
- void glWindowPos2sARB(short x, short y);
-
- @DeprecatedGL
- void glWindowPos3fARB(float x, float y, float z);
-
- @DeprecatedGL
- void glWindowPos3dARB(double x, double y, double z);
-
- @DeprecatedGL
- void glWindowPos3iARB(int x, int y, int z);
-
- @DeprecatedGL
- void glWindowPos3sARB(short x, short y, short z);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.DeprecatedGL;
+
+ at DeprecatedGL
+public interface ARB_window_pos {
+
+ @DeprecatedGL
+ void glWindowPos2fARB(float x, float y);
+
+ @DeprecatedGL
+ void glWindowPos2dARB(double x, double y);
+
+ @DeprecatedGL
+ void glWindowPos2iARB(int x, int y);
+
+ @DeprecatedGL
+ void glWindowPos2sARB(short x, short y);
+
+ @DeprecatedGL
+ void glWindowPos3fARB(float x, float y, float z);
+
+ @DeprecatedGL
+ void glWindowPos3dARB(double x, double y, double z);
+
+ @DeprecatedGL
+ void glWindowPos3iARB(int x, int y, int z);
+
+ @DeprecatedGL
+ void glWindowPos3sARB(short x, short y, short z);
+}
diff --git a/src/templates/org/lwjgl/opengl/ATI_draw_buffers.java b/src/templates/org/lwjgl/opengl/ATI_draw_buffers.java
index 23495bf..300f99a 100644
--- a/src/templates/org/lwjgl/opengl/ATI_draw_buffers.java
+++ b/src/templates/org/lwjgl/opengl/ATI_draw_buffers.java
@@ -1,66 +1,66 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-public interface ATI_draw_buffers {
-
- /**
- * Accepted by the <pname> parameters of GetIntegerv, GetFloatv,
- * and GetDoublev:
- */
- int GL_MAX_DRAW_BUFFERS_ATI = 0x8824;
- int GL_DRAW_BUFFER0_ATI = 0x8825;
- int GL_DRAW_BUFFER1_ATI = 0x8826;
- int GL_DRAW_BUFFER2_ATI = 0x8827;
- int GL_DRAW_BUFFER3_ATI = 0x8828;
- int GL_DRAW_BUFFER4_ATI = 0x8829;
- int GL_DRAW_BUFFER5_ATI = 0x882A;
- int GL_DRAW_BUFFER6_ATI = 0x882B;
- int GL_DRAW_BUFFER7_ATI = 0x882C;
- int GL_DRAW_BUFFER8_ATI = 0x882D;
- int GL_DRAW_BUFFER9_ATI = 0x882E;
- int GL_DRAW_BUFFER10_ATI = 0x882F;
- int GL_DRAW_BUFFER11_ATI = 0x8830;
- int GL_DRAW_BUFFER12_ATI = 0x8831;
- int GL_DRAW_BUFFER13_ATI = 0x8832;
- int GL_DRAW_BUFFER14_ATI = 0x8833;
- int GL_DRAW_BUFFER15_ATI = 0x8834;
-
- void glDrawBuffersATI(@AutoSize("buffers") @GLsizei int size, @Const @GLenum IntBuffer buffers);
-
- @Alternate("glDrawBuffersATI")
- void glDrawBuffersATI(@Constant("1") @GLsizei int size, @Constant(value = "APIUtils.getBufferInt().put(0, buffer), 0", keepParam = true) int buffer);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+public interface ATI_draw_buffers {
+
+ /**
+ * Accepted by the <pname> parameters of GetIntegerv, GetFloatv,
+ * and GetDoublev:
+ */
+ int GL_MAX_DRAW_BUFFERS_ATI = 0x8824;
+ int GL_DRAW_BUFFER0_ATI = 0x8825;
+ int GL_DRAW_BUFFER1_ATI = 0x8826;
+ int GL_DRAW_BUFFER2_ATI = 0x8827;
+ int GL_DRAW_BUFFER3_ATI = 0x8828;
+ int GL_DRAW_BUFFER4_ATI = 0x8829;
+ int GL_DRAW_BUFFER5_ATI = 0x882A;
+ int GL_DRAW_BUFFER6_ATI = 0x882B;
+ int GL_DRAW_BUFFER7_ATI = 0x882C;
+ int GL_DRAW_BUFFER8_ATI = 0x882D;
+ int GL_DRAW_BUFFER9_ATI = 0x882E;
+ int GL_DRAW_BUFFER10_ATI = 0x882F;
+ int GL_DRAW_BUFFER11_ATI = 0x8830;
+ int GL_DRAW_BUFFER12_ATI = 0x8831;
+ int GL_DRAW_BUFFER13_ATI = 0x8832;
+ int GL_DRAW_BUFFER14_ATI = 0x8833;
+ int GL_DRAW_BUFFER15_ATI = 0x8834;
+
+ void glDrawBuffersATI(@AutoSize("buffers") @GLsizei int size, @Const @GLenum IntBuffer buffers);
+
+ @Alternate("glDrawBuffersATI")
+ void glDrawBuffersATI(@Constant("1") @GLsizei int size, @Constant(value = "APIUtils.getBufferInt().put(0, buffer), 0", keepParam = true) int buffer);
+}
diff --git a/src/templates/org/lwjgl/opengl/ATI_element_array.java b/src/templates/org/lwjgl/opengl/ATI_element_array.java
index e850d03..b56207e 100644
--- a/src/templates/org/lwjgl/opengl/ATI_element_array.java
+++ b/src/templates/org/lwjgl/opengl/ATI_element_array.java
@@ -1,53 +1,53 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-public interface ATI_element_array {
- int GL_ELEMENT_ARRAY_ATI = 0x8768;
- int GL_ELEMENT_ARRAY_TYPE_ATI = 0x8769;
- int GL_ELEMENT_ARRAY_POINTER_ATI = 0x876A;
-
- void glElementPointerATI(@AutoType("pPointer") @GLenum int type,
- @Check
- @Const
- @GLubyte
- @GLushort
- @GLuint Buffer pPointer);
-
- void glDrawElementArrayATI(@GLenum int mode, @GLsizei int count);
-
- void glDrawRangeElementArrayATI(@GLenum int mode, @GLuint int start, @GLuint int end, @GLsizei int count);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+public interface ATI_element_array {
+ int GL_ELEMENT_ARRAY_ATI = 0x8768;
+ int GL_ELEMENT_ARRAY_TYPE_ATI = 0x8769;
+ int GL_ELEMENT_ARRAY_POINTER_ATI = 0x876A;
+
+ void glElementPointerATI(@AutoType("pPointer") @GLenum int type,
+ @Check
+ @Const
+ @GLubyte
+ @GLushort
+ @GLuint Buffer pPointer);
+
+ void glDrawElementArrayATI(@GLenum int mode, @GLsizei int count);
+
+ void glDrawRangeElementArrayATI(@GLenum int mode, @GLuint int start, @GLuint int end, @GLsizei int count);
+}
diff --git a/src/templates/org/lwjgl/opengl/ATI_envmap_bumpmap.java b/src/templates/org/lwjgl/opengl/ATI_envmap_bumpmap.java
index 1d5d523..4e3a381 100644
--- a/src/templates/org/lwjgl/opengl/ATI_envmap_bumpmap.java
+++ b/src/templates/org/lwjgl/opengl/ATI_envmap_bumpmap.java
@@ -1,59 +1,59 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-public interface ATI_envmap_bumpmap {
- int GL_BUMP_ROT_MATRIX_ATI = 0x8775;
- int GL_BUMP_ROT_MATRIX_SIZE_ATI = 0x8776;
- int GL_BUMP_NUM_TEX_UNITS_ATI = 0x8777;
- int GL_BUMP_TEX_UNITS_ATI = 0x8778;
- int GL_DUDV_ATI = 0x8779;
- int GL_DU8DV8_ATI = 0x877A;
- int GL_BUMP_ENVMAP_ATI = 0x877B;
- int GL_BUMP_TARGET_ATI = 0x877C;
-
- @StripPostfix("param")
- void glTexBumpParameterfvATI(@GLenum int pname, @Check("4") @Const FloatBuffer param);
-
- @StripPostfix("param")
- void glTexBumpParameterivATI(@GLenum int pname, @Check("4") @Const IntBuffer param);
-
- @StripPostfix("param")
- void glGetTexBumpParameterfvATI(@GLenum int pname, @OutParameter @Check("4") FloatBuffer param);
-
- @StripPostfix("param")
- void glGetTexBumpParameterivATI(@GLenum int pname, @OutParameter @Check("4") IntBuffer param);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+public interface ATI_envmap_bumpmap {
+ int GL_BUMP_ROT_MATRIX_ATI = 0x8775;
+ int GL_BUMP_ROT_MATRIX_SIZE_ATI = 0x8776;
+ int GL_BUMP_NUM_TEX_UNITS_ATI = 0x8777;
+ int GL_BUMP_TEX_UNITS_ATI = 0x8778;
+ int GL_DUDV_ATI = 0x8779;
+ int GL_DU8DV8_ATI = 0x877A;
+ int GL_BUMP_ENVMAP_ATI = 0x877B;
+ int GL_BUMP_TARGET_ATI = 0x877C;
+
+ @StripPostfix("param")
+ void glTexBumpParameterfvATI(@GLenum int pname, @Check("4") @Const FloatBuffer param);
+
+ @StripPostfix("param")
+ void glTexBumpParameterivATI(@GLenum int pname, @Check("4") @Const IntBuffer param);
+
+ @StripPostfix("param")
+ void glGetTexBumpParameterfvATI(@GLenum int pname, @OutParameter @Check("4") FloatBuffer param);
+
+ @StripPostfix("param")
+ void glGetTexBumpParameterivATI(@GLenum int pname, @OutParameter @Check("4") IntBuffer param);
+}
diff --git a/src/templates/org/lwjgl/opengl/ATI_fragment_shader.java b/src/templates/org/lwjgl/opengl/ATI_fragment_shader.java
index b60f35a..14d937e 100644
--- a/src/templates/org/lwjgl/opengl/ATI_fragment_shader.java
+++ b/src/templates/org/lwjgl/opengl/ATI_fragment_shader.java
@@ -1,174 +1,174 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-public interface ATI_fragment_shader {
-
- int GL_FRAGMENT_SHADER_ATI = 0x8920;
- int GL_REG_0_ATI = 0x8921;
- int GL_REG_1_ATI = 0x8922;
- int GL_REG_2_ATI = 0x8923;
- int GL_REG_3_ATI = 0x8924;
- int GL_REG_4_ATI = 0x8925;
- int GL_REG_5_ATI = 0x8926;
- int GL_REG_6_ATI = 0x8927;
- int GL_REG_7_ATI = 0x8928;
- int GL_REG_8_ATI = 0x8929;
- int GL_REG_9_ATI = 0x892A;
- int GL_REG_10_ATI = 0x892B;
- int GL_REG_11_ATI = 0x892C;
- int GL_REG_12_ATI = 0x892D;
- int GL_REG_13_ATI = 0x892E;
- int GL_REG_14_ATI = 0x892F;
- int GL_REG_15_ATI = 0x8930;
- int GL_REG_16_ATI = 0x8931;
- int GL_REG_17_ATI = 0x8932;
- int GL_REG_18_ATI = 0x8933;
- int GL_REG_19_ATI = 0x8934;
- int GL_REG_20_ATI = 0x8935;
- int GL_REG_21_ATI = 0x8936;
- int GL_REG_22_ATI = 0x8937;
- int GL_REG_23_ATI = 0x8938;
- int GL_REG_24_ATI = 0x8939;
- int GL_REG_25_ATI = 0x893A;
- int GL_REG_26_ATI = 0x893B;
- int GL_REG_27_ATI = 0x893C;
- int GL_REG_28_ATI = 0x893D;
- int GL_REG_29_ATI = 0x893E;
- int GL_REG_30_ATI = 0x893F;
- int GL_REG_31_ATI = 0x8940;
- int GL_CON_0_ATI = 0x8941;
- int GL_CON_1_ATI = 0x8942;
- int GL_CON_2_ATI = 0x8943;
- int GL_CON_3_ATI = 0x8944;
- int GL_CON_4_ATI = 0x8945;
- int GL_CON_5_ATI = 0x8946;
- int GL_CON_6_ATI = 0x8947;
- int GL_CON_7_ATI = 0x8948;
- int GL_CON_8_ATI = 0x8949;
- int GL_CON_9_ATI = 0x894A;
- int GL_CON_10_ATI = 0x894B;
- int GL_CON_11_ATI = 0x894C;
- int GL_CON_12_ATI = 0x894D;
- int GL_CON_13_ATI = 0x894E;
- int GL_CON_14_ATI = 0x894F;
- int GL_CON_15_ATI = 0x8950;
- int GL_CON_16_ATI = 0x8951;
- int GL_CON_17_ATI = 0x8952;
- int GL_CON_18_ATI = 0x8953;
- int GL_CON_19_ATI = 0x8954;
- int GL_CON_20_ATI = 0x8955;
- int GL_CON_21_ATI = 0x8956;
- int GL_CON_22_ATI = 0x8957;
- int GL_CON_23_ATI = 0x8958;
- int GL_CON_24_ATI = 0x8959;
- int GL_CON_25_ATI = 0x895A;
- int GL_CON_26_ATI = 0x895B;
- int GL_CON_27_ATI = 0x895C;
- int GL_CON_28_ATI = 0x895D;
- int GL_CON_29_ATI = 0x895E;
- int GL_CON_30_ATI = 0x895F;
- int GL_CON_31_ATI = 0x8960;
- int GL_MOV_ATI = 0x8961;
- int GL_ADD_ATI = 0x8963;
- int GL_MUL_ATI = 0x8964;
- int GL_SUB_ATI = 0x8965;
- int GL_DOT3_ATI = 0x8966;
- int GL_DOT4_ATI = 0x8967;
- int GL_MAD_ATI = 0x8968;
- int GL_LERP_ATI = 0x8969;
- int GL_CND_ATI = 0x896A;
- int GL_CND0_ATI = 0x896B;
- int GL_DOT2_ADD_ATI = 0x896C;
- int GL_SECONDARY_INTERPOLATOR_ATI = 0x896D;
- int GL_NUM_FRAGMENT_REGISTERS_ATI = 0x896E;
- int GL_NUM_FRAGMENT_CONSTANTS_ATI = 0x896F;
- int GL_NUM_PASSES_ATI = 0x8970;
- int GL_NUM_INSTRUCTIONS_PER_PASS_ATI = 0x8971;
- int GL_NUM_INSTRUCTIONS_TOTAL_ATI = 0x8972;
- int GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI = 0x8973;
- int GL_NUM_LOOPBACK_COMPONENTS_ATI = 0x8974;
- int GL_COLOR_ALPHA_PAIRING_ATI = 0x8975;
- int GL_SWIZZLE_STR_ATI = 0x8976;
- int GL_SWIZZLE_STQ_ATI = 0x8977;
- int GL_SWIZZLE_STR_DR_ATI = 0x8978;
- int GL_SWIZZLE_STQ_DQ_ATI = 0x8979;
- int GL_SWIZZLE_STRQ_ATI = 0x897A;
- int GL_SWIZZLE_STRQ_DQ_ATI = 0x897B;
- int GL_RED_BIT_ATI = 0x00000001;
- int GL_GREEN_BIT_ATI = 0x00000002;
- int GL_BLUE_BIT_ATI = 0x00000004;
- int GL_2X_BIT_ATI = 0x00000001;
- int GL_4X_BIT_ATI = 0x00000002;
- int GL_8X_BIT_ATI = 0x00000004;
- int GL_HALF_BIT_ATI = 0x00000008;
- int GL_QUARTER_BIT_ATI = 0x00000010;
- int GL_EIGHTH_BIT_ATI = 0x00000020;
- int GL_SATURATE_BIT_ATI = 0x00000040;
- int GL_COMP_BIT_ATI = 0x00000002;
- int GL_NEGATE_BIT_ATI = 0x00000004;
- int GL_BIAS_BIT_ATI = 0x00000008;
-
- @GLuint
- int glGenFragmentShadersATI(@GLuint int range);
-
- void glBindFragmentShaderATI(@GLuint int id);
-
- void glDeleteFragmentShaderATI(@GLuint int id);
-
- void glBeginFragmentShaderATI();
-
- void glEndFragmentShaderATI();
-
- void glPassTexCoordATI(@GLuint int dst, @GLuint int coord, @GLenum int swizzle);
-
- void glSampleMapATI(@GLuint int dst, @GLuint int interp, @GLenum int swizzle);
-
- void glColorFragmentOp1ATI(@GLenum int op, @GLuint int dst, @GLuint int dstMask, @GLuint int dstMod, @GLuint int arg1, @GLuint int arg1Rep, @GLuint int arg1Mod);
-
- void glColorFragmentOp2ATI(@GLenum int op, @GLuint int dst, @GLuint int dstMask, @GLuint int dstMod, @GLuint int arg1, @GLuint int arg1Rep, @GLuint int arg1Mod, @GLuint int arg2, @GLuint int arg2Rep, @GLuint int arg2Mod);
-
- void glColorFragmentOp3ATI(@GLenum int op, @GLuint int dst, @GLuint int dstMask, @GLuint int dstMod, @GLuint int arg1, @GLuint int arg1Rep, @GLuint int arg1Mod, @GLuint int arg2, @GLuint int arg2Rep, @GLuint int arg2Mod, @GLuint int arg3, @GLuint int arg3Rep, @GLuint int arg3Mod);
-
- void glAlphaFragmentOp1ATI(@GLenum int op, @GLuint int dst, @GLuint int dstMod, @GLuint int arg1, @GLuint int arg1Rep, @GLuint int arg1Mod);
-
- void glAlphaFragmentOp2ATI(@GLenum int op, @GLuint int dst, @GLuint int dstMod, @GLuint int arg1, @GLuint int arg1Rep, @GLuint int arg1Mod, @GLuint int arg2, @GLuint int arg2Rep, @GLuint int arg2Mod);
-
- void glAlphaFragmentOp3ATI(@GLenum int op, @GLuint int dst, @GLuint int dstMod, @GLuint int arg1, @GLuint int arg1Rep, @GLuint int arg1Mod, @GLuint int arg2, @GLuint int arg2Rep, @GLuint int arg2Mod, @GLuint int arg3, @GLuint int arg3Rep, @GLuint int arg3Mod);
-
- // TODO:is the @Check correct?
- void glSetFragmentShaderConstantATI(@GLuint int dst, @Check("4") @Const FloatBuffer pfValue);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+public interface ATI_fragment_shader {
+
+ int GL_FRAGMENT_SHADER_ATI = 0x8920;
+ int GL_REG_0_ATI = 0x8921;
+ int GL_REG_1_ATI = 0x8922;
+ int GL_REG_2_ATI = 0x8923;
+ int GL_REG_3_ATI = 0x8924;
+ int GL_REG_4_ATI = 0x8925;
+ int GL_REG_5_ATI = 0x8926;
+ int GL_REG_6_ATI = 0x8927;
+ int GL_REG_7_ATI = 0x8928;
+ int GL_REG_8_ATI = 0x8929;
+ int GL_REG_9_ATI = 0x892A;
+ int GL_REG_10_ATI = 0x892B;
+ int GL_REG_11_ATI = 0x892C;
+ int GL_REG_12_ATI = 0x892D;
+ int GL_REG_13_ATI = 0x892E;
+ int GL_REG_14_ATI = 0x892F;
+ int GL_REG_15_ATI = 0x8930;
+ int GL_REG_16_ATI = 0x8931;
+ int GL_REG_17_ATI = 0x8932;
+ int GL_REG_18_ATI = 0x8933;
+ int GL_REG_19_ATI = 0x8934;
+ int GL_REG_20_ATI = 0x8935;
+ int GL_REG_21_ATI = 0x8936;
+ int GL_REG_22_ATI = 0x8937;
+ int GL_REG_23_ATI = 0x8938;
+ int GL_REG_24_ATI = 0x8939;
+ int GL_REG_25_ATI = 0x893A;
+ int GL_REG_26_ATI = 0x893B;
+ int GL_REG_27_ATI = 0x893C;
+ int GL_REG_28_ATI = 0x893D;
+ int GL_REG_29_ATI = 0x893E;
+ int GL_REG_30_ATI = 0x893F;
+ int GL_REG_31_ATI = 0x8940;
+ int GL_CON_0_ATI = 0x8941;
+ int GL_CON_1_ATI = 0x8942;
+ int GL_CON_2_ATI = 0x8943;
+ int GL_CON_3_ATI = 0x8944;
+ int GL_CON_4_ATI = 0x8945;
+ int GL_CON_5_ATI = 0x8946;
+ int GL_CON_6_ATI = 0x8947;
+ int GL_CON_7_ATI = 0x8948;
+ int GL_CON_8_ATI = 0x8949;
+ int GL_CON_9_ATI = 0x894A;
+ int GL_CON_10_ATI = 0x894B;
+ int GL_CON_11_ATI = 0x894C;
+ int GL_CON_12_ATI = 0x894D;
+ int GL_CON_13_ATI = 0x894E;
+ int GL_CON_14_ATI = 0x894F;
+ int GL_CON_15_ATI = 0x8950;
+ int GL_CON_16_ATI = 0x8951;
+ int GL_CON_17_ATI = 0x8952;
+ int GL_CON_18_ATI = 0x8953;
+ int GL_CON_19_ATI = 0x8954;
+ int GL_CON_20_ATI = 0x8955;
+ int GL_CON_21_ATI = 0x8956;
+ int GL_CON_22_ATI = 0x8957;
+ int GL_CON_23_ATI = 0x8958;
+ int GL_CON_24_ATI = 0x8959;
+ int GL_CON_25_ATI = 0x895A;
+ int GL_CON_26_ATI = 0x895B;
+ int GL_CON_27_ATI = 0x895C;
+ int GL_CON_28_ATI = 0x895D;
+ int GL_CON_29_ATI = 0x895E;
+ int GL_CON_30_ATI = 0x895F;
+ int GL_CON_31_ATI = 0x8960;
+ int GL_MOV_ATI = 0x8961;
+ int GL_ADD_ATI = 0x8963;
+ int GL_MUL_ATI = 0x8964;
+ int GL_SUB_ATI = 0x8965;
+ int GL_DOT3_ATI = 0x8966;
+ int GL_DOT4_ATI = 0x8967;
+ int GL_MAD_ATI = 0x8968;
+ int GL_LERP_ATI = 0x8969;
+ int GL_CND_ATI = 0x896A;
+ int GL_CND0_ATI = 0x896B;
+ int GL_DOT2_ADD_ATI = 0x896C;
+ int GL_SECONDARY_INTERPOLATOR_ATI = 0x896D;
+ int GL_NUM_FRAGMENT_REGISTERS_ATI = 0x896E;
+ int GL_NUM_FRAGMENT_CONSTANTS_ATI = 0x896F;
+ int GL_NUM_PASSES_ATI = 0x8970;
+ int GL_NUM_INSTRUCTIONS_PER_PASS_ATI = 0x8971;
+ int GL_NUM_INSTRUCTIONS_TOTAL_ATI = 0x8972;
+ int GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI = 0x8973;
+ int GL_NUM_LOOPBACK_COMPONENTS_ATI = 0x8974;
+ int GL_COLOR_ALPHA_PAIRING_ATI = 0x8975;
+ int GL_SWIZZLE_STR_ATI = 0x8976;
+ int GL_SWIZZLE_STQ_ATI = 0x8977;
+ int GL_SWIZZLE_STR_DR_ATI = 0x8978;
+ int GL_SWIZZLE_STQ_DQ_ATI = 0x8979;
+ int GL_SWIZZLE_STRQ_ATI = 0x897A;
+ int GL_SWIZZLE_STRQ_DQ_ATI = 0x897B;
+ int GL_RED_BIT_ATI = 0x00000001;
+ int GL_GREEN_BIT_ATI = 0x00000002;
+ int GL_BLUE_BIT_ATI = 0x00000004;
+ int GL_2X_BIT_ATI = 0x00000001;
+ int GL_4X_BIT_ATI = 0x00000002;
+ int GL_8X_BIT_ATI = 0x00000004;
+ int GL_HALF_BIT_ATI = 0x00000008;
+ int GL_QUARTER_BIT_ATI = 0x00000010;
+ int GL_EIGHTH_BIT_ATI = 0x00000020;
+ int GL_SATURATE_BIT_ATI = 0x00000040;
+ int GL_COMP_BIT_ATI = 0x00000002;
+ int GL_NEGATE_BIT_ATI = 0x00000004;
+ int GL_BIAS_BIT_ATI = 0x00000008;
+
+ @GLuint
+ int glGenFragmentShadersATI(@GLuint int range);
+
+ void glBindFragmentShaderATI(@GLuint int id);
+
+ void glDeleteFragmentShaderATI(@GLuint int id);
+
+ void glBeginFragmentShaderATI();
+
+ void glEndFragmentShaderATI();
+
+ void glPassTexCoordATI(@GLuint int dst, @GLuint int coord, @GLenum int swizzle);
+
+ void glSampleMapATI(@GLuint int dst, @GLuint int interp, @GLenum int swizzle);
+
+ void glColorFragmentOp1ATI(@GLenum int op, @GLuint int dst, @GLuint int dstMask, @GLuint int dstMod, @GLuint int arg1, @GLuint int arg1Rep, @GLuint int arg1Mod);
+
+ void glColorFragmentOp2ATI(@GLenum int op, @GLuint int dst, @GLuint int dstMask, @GLuint int dstMod, @GLuint int arg1, @GLuint int arg1Rep, @GLuint int arg1Mod, @GLuint int arg2, @GLuint int arg2Rep, @GLuint int arg2Mod);
+
+ void glColorFragmentOp3ATI(@GLenum int op, @GLuint int dst, @GLuint int dstMask, @GLuint int dstMod, @GLuint int arg1, @GLuint int arg1Rep, @GLuint int arg1Mod, @GLuint int arg2, @GLuint int arg2Rep, @GLuint int arg2Mod, @GLuint int arg3, @GLuint int arg3Rep, @GLuint int arg3Mod);
+
+ void glAlphaFragmentOp1ATI(@GLenum int op, @GLuint int dst, @GLuint int dstMod, @GLuint int arg1, @GLuint int arg1Rep, @GLuint int arg1Mod);
+
+ void glAlphaFragmentOp2ATI(@GLenum int op, @GLuint int dst, @GLuint int dstMod, @GLuint int arg1, @GLuint int arg1Rep, @GLuint int arg1Mod, @GLuint int arg2, @GLuint int arg2Rep, @GLuint int arg2Mod);
+
+ void glAlphaFragmentOp3ATI(@GLenum int op, @GLuint int dst, @GLuint int dstMod, @GLuint int arg1, @GLuint int arg1Rep, @GLuint int arg1Mod, @GLuint int arg2, @GLuint int arg2Rep, @GLuint int arg2Mod, @GLuint int arg3, @GLuint int arg3Rep, @GLuint int arg3Mod);
+
+ // TODO:is the @Check correct?
+ void glSetFragmentShaderConstantATI(@GLuint int dst, @Check("4") @Const FloatBuffer pfValue);
+}
diff --git a/src/templates/org/lwjgl/opengl/ATI_map_object_buffer.java b/src/templates/org/lwjgl/opengl/ATI_map_object_buffer.java
index 2de7846..c762c9d 100644
--- a/src/templates/org/lwjgl/opengl/ATI_map_object_buffer.java
+++ b/src/templates/org/lwjgl/opengl/ATI_map_object_buffer.java
@@ -1,70 +1,70 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-public interface ATI_map_object_buffer {
-
- /**
- * glMapObjectBufferATI maps an ATI vertex array object to a ByteBuffer. The old_buffer argument can be null,
- * in which case a new ByteBuffer will be created, pointing to the returned memory. If old_buffer is non-null,
- * it will be returned if it points to the same mapped memory and has the same capacity as the vertex array object,
- * otherwise a new ByteBuffer is created. That way, an application will normally use glMapObjectBufferATI like this:
- * <p/>
- * ByteBuffer mapped_buffer; mapped_buffer = glMapObjectBufferATI(..., null); ... // Another map on the same buffer mapped_buffer = glMapObjectBufferATI(..., mapped_buffer);
- * <p/>
- * Only ByteBuffers returned from this method are to be passed as the old_buffer argument. User-created ByteBuffers cannot be reused.
- * <p/>
- * The version of this method without an explicit length argument calls glGetObjectBufferATI internally to
- * retrieve the current vertex array object size, which may cause a pipeline flush and reduce application performance.
- * <p/>
- * The version of this method with an explicit length argument is a fast alternative to the one without. No GL call
- * is made to retrieve the vertex array object size, so the user is responsible for tracking and using the appropriate length.<br>
- * Security warning: The length argument should match the vertex array object size. Reading from or writing to outside
- * the memory region that corresponds to the mapped vertex array object will cause native crashes.
- *
- * @param length the length of the mapped memory in bytes.
- * @param old_buffer A ByteBuffer. If this argument points to the same address and has the same capacity as the new mapping, it will be returned and no new buffer will be created.
- *
- * @return A ByteBuffer representing the mapped buffer memory.
- */
- @CachedResult
- @GLvoid
- @AutoResultSize("GLChecks.getBufferObjectSizeATI(caps, buffer)")
- ByteBuffer glMapObjectBufferATI(@GLuint int buffer);
-
- void glUnmapObjectBufferATI(@GLuint int buffer);
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+public interface ATI_map_object_buffer {
+
+ /**
+ * glMapObjectBufferATI maps an ATI vertex array object to a ByteBuffer. The old_buffer argument can be null,
+ * in which case a new ByteBuffer will be created, pointing to the returned memory. If old_buffer is non-null,
+ * it will be returned if it points to the same mapped memory and has the same capacity as the vertex array object,
+ * otherwise a new ByteBuffer is created. That way, an application will normally use glMapObjectBufferATI like this:
+ * <p/>
+ * ByteBuffer mapped_buffer; mapped_buffer = glMapObjectBufferATI(..., null); ... // Another map on the same buffer mapped_buffer = glMapObjectBufferATI(..., mapped_buffer);
+ * <p/>
+ * Only ByteBuffers returned from this method are to be passed as the old_buffer argument. User-created ByteBuffers cannot be reused.
+ * <p/>
+ * The version of this method without an explicit length argument calls glGetObjectBufferATI internally to
+ * retrieve the current vertex array object size, which may cause a pipeline flush and reduce application performance.
+ * <p/>
+ * The version of this method with an explicit length argument is a fast alternative to the one without. No GL call
+ * is made to retrieve the vertex array object size, so the user is responsible for tracking and using the appropriate length.<br>
+ * Security warning: The length argument should match the vertex array object size. Reading from or writing to outside
+ * the memory region that corresponds to the mapped vertex array object will cause native crashes.
+ *
+ * @param length the length of the mapped memory in bytes.
+ * @param old_buffer A ByteBuffer. If this argument points to the same address and has the same capacity as the new mapping, it will be returned and no new buffer will be created.
+ *
+ * @return A ByteBuffer representing the mapped buffer memory.
+ */
+ @CachedResult
+ @GLvoid
+ @AutoResultSize("GLChecks.getBufferObjectSizeATI(caps, buffer)")
+ ByteBuffer glMapObjectBufferATI(@GLuint int buffer);
+
+ void glUnmapObjectBufferATI(@GLuint int buffer);
+
+}
diff --git a/src/templates/org/lwjgl/opengl/ATI_meminfo.java b/src/templates/org/lwjgl/opengl/ATI_meminfo.java
index 27c8351..5d5ac06 100644
--- a/src/templates/org/lwjgl/opengl/ATI_meminfo.java
+++ b/src/templates/org/lwjgl/opengl/ATI_meminfo.java
@@ -1,41 +1,41 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ATI_meminfo {
-
- /** Accepted by the <value> parameter of GetIntegerv: */
- int GL_VBO_FREE_MEMORY_ATI = 0x87FB;
- int GL_TEXTURE_FREE_MEMORY_ATI = 0x87FC;
- int GL_RENDERBUFFER_FREE_MEMORY_ATI = 0x87FD;
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ATI_meminfo {
+
+ /** Accepted by the <value> parameter of GetIntegerv: */
+ int GL_VBO_FREE_MEMORY_ATI = 0x87FB;
+ int GL_TEXTURE_FREE_MEMORY_ATI = 0x87FC;
+ int GL_RENDERBUFFER_FREE_MEMORY_ATI = 0x87FD;
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ATI_pn_triangles.java b/src/templates/org/lwjgl/opengl/ATI_pn_triangles.java
index 5d7dbc7..8b2cf9f 100644
--- a/src/templates/org/lwjgl/opengl/ATI_pn_triangles.java
+++ b/src/templates/org/lwjgl/opengl/ATI_pn_triangles.java
@@ -1,50 +1,50 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-public interface ATI_pn_triangles {
- int GL_PN_TRIANGLES_ATI = 0x87F0;
- int GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI = 0x87F1;
- int GL_PN_TRIANGLES_POINT_MODE_ATI = 0x87F2;
- int GL_PN_TRIANGLES_NORMAL_MODE_ATI = 0x87F3;
- int GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI = 0x87F4;
- int GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI = 0x87F5;
- int GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI = 0x87F6;
- int GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI = 0x87F7;
- int GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI = 0x87F8;
-
- void glPNTrianglesfATI(@GLenum int pname, float param);
-
- void glPNTrianglesiATI(@GLenum int pname, int param);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+public interface ATI_pn_triangles {
+ int GL_PN_TRIANGLES_ATI = 0x87F0;
+ int GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI = 0x87F1;
+ int GL_PN_TRIANGLES_POINT_MODE_ATI = 0x87F2;
+ int GL_PN_TRIANGLES_NORMAL_MODE_ATI = 0x87F3;
+ int GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI = 0x87F4;
+ int GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI = 0x87F5;
+ int GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI = 0x87F6;
+ int GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI = 0x87F7;
+ int GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI = 0x87F8;
+
+ void glPNTrianglesfATI(@GLenum int pname, float param);
+
+ void glPNTrianglesiATI(@GLenum int pname, int param);
+}
diff --git a/src/templates/org/lwjgl/opengl/ATI_separate_stencil.java b/src/templates/org/lwjgl/opengl/ATI_separate_stencil.java
index 1079192..ac5e913 100644
--- a/src/templates/org/lwjgl/opengl/ATI_separate_stencil.java
+++ b/src/templates/org/lwjgl/opengl/ATI_separate_stencil.java
@@ -1,45 +1,45 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-public interface ATI_separate_stencil {
- int GL_STENCIL_BACK_FUNC_ATI = 0x8800;
- int GL_STENCIL_BACK_FAIL_ATI = 0x8801;
- int GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI = 0x8802;
- int GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI = 0x8803;
-
- void glStencilOpSeparateATI(@GLenum int face, @GLenum int sfail, @GLenum int dpfail, @GLenum int dppass);
-
- void glStencilFuncSeparateATI(@GLenum int frontfunc, @GLenum int backfunc, int ref, @GLuint int mask);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+public interface ATI_separate_stencil {
+ int GL_STENCIL_BACK_FUNC_ATI = 0x8800;
+ int GL_STENCIL_BACK_FAIL_ATI = 0x8801;
+ int GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI = 0x8802;
+ int GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI = 0x8803;
+
+ void glStencilOpSeparateATI(@GLenum int face, @GLenum int sfail, @GLenum int dpfail, @GLenum int dppass);
+
+ void glStencilFuncSeparateATI(@GLenum int frontfunc, @GLenum int backfunc, int ref, @GLuint int mask);
+}
diff --git a/src/templates/org/lwjgl/opengl/ATI_shader_texture_lod.java b/src/templates/org/lwjgl/opengl/ATI_shader_texture_lod.java
index ee7ac0d..878822e 100644
--- a/src/templates/org/lwjgl/opengl/ATI_shader_texture_lod.java
+++ b/src/templates/org/lwjgl/opengl/ATI_shader_texture_lod.java
@@ -1,35 +1,35 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ATI_shader_texture_lod {
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ATI_shader_texture_lod {
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ATI_text_fragment_shader.java b/src/templates/org/lwjgl/opengl/ATI_text_fragment_shader.java
index 795cb3d..7f65846 100644
--- a/src/templates/org/lwjgl/opengl/ATI_text_fragment_shader.java
+++ b/src/templates/org/lwjgl/opengl/ATI_text_fragment_shader.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ATI_text_fragment_shader {
-
- /**
- * Accepted by the <cap> parameter of Disable, Enable, and IsEnabled,
- * and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
- * and GetDoublev, and by the <target> parameter of ProgramStringARB,
- * BindProgramARB, ProgramEnvParameter4{d,dv,f,fv}ARB,
- * ProgramLocalParameter4{d,dv,f,fv}ARB,
- * GetProgramEnvParameter{dv,fv}ARB, GetProgramLocalParameter{dv,fv}ARB,
- * GetProgramivARB, GetProgramfvATI, and GetProgramStringARB.
- */
- int GL_TEXT_FRAGMENT_SHADER_ATI = 0x8200;
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ATI_text_fragment_shader {
+
+ /**
+ * Accepted by the <cap> parameter of Disable, Enable, and IsEnabled,
+ * and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
+ * and GetDoublev, and by the <target> parameter of ProgramStringARB,
+ * BindProgramARB, ProgramEnvParameter4{d,dv,f,fv}ARB,
+ * ProgramLocalParameter4{d,dv,f,fv}ARB,
+ * GetProgramEnvParameter{dv,fv}ARB, GetProgramLocalParameter{dv,fv}ARB,
+ * GetProgramivARB, GetProgramfvATI, and GetProgramStringARB.
+ */
+ int GL_TEXT_FRAGMENT_SHADER_ATI = 0x8200;
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/ATI_texture_compression_3dc.java b/src/templates/org/lwjgl/opengl/ATI_texture_compression_3dc.java
index 1fe4a40..b1c1e5a 100644
--- a/src/templates/org/lwjgl/opengl/ATI_texture_compression_3dc.java
+++ b/src/templates/org/lwjgl/opengl/ATI_texture_compression_3dc.java
@@ -1,39 +1,39 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
- at Extension(postfix = "ATI", className = "ATITextureCompression3DC")
-public interface ATI_texture_compression_3dc {
- int GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI = 0x8837;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+ at Extension(postfix = "ATI", className = "ATITextureCompression3DC")
+public interface ATI_texture_compression_3dc {
+ int GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI = 0x8837;
+}
diff --git a/src/templates/org/lwjgl/opengl/ATI_texture_float.java b/src/templates/org/lwjgl/opengl/ATI_texture_float.java
index d8405fc..44f2e01 100644
--- a/src/templates/org/lwjgl/opengl/ATI_texture_float.java
+++ b/src/templates/org/lwjgl/opengl/ATI_texture_float.java
@@ -1,52 +1,52 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ATI_texture_float {
-
- /**
- * Accepted by the <internalFormat> parameter of TexImage1D,
- * TexImage2D, and TexImage3D:
- */
- int GL_RGBA_FLOAT32_ATI = 0x8814;
- int GL_RGB_FLOAT32_ATI = 0x8815;
- int GL_ALPHA_FLOAT32_ATI = 0x8816;
- int GL_INTENSITY_FLOAT32_ATI = 0x8817;
- int GL_LUMINANCE_FLOAT32_ATI = 0x8818;
- int GL_LUMINANCE_ALPHA_FLOAT32_ATI = 0x8819;
- int GL_RGBA_FLOAT16_ATI = 0x881A;
- int GL_RGB_FLOAT16_ATI = 0x881B;
- int GL_ALPHA_FLOAT16_ATI = 0x881C;
- int GL_INTENSITY_FLOAT16_ATI = 0x881D;
- int GL_LUMINANCE_FLOAT16_ATI = 0x881E;
- int GL_LUMINANCE_ALPHA_FLOAT16_ATI = 0x881F;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ATI_texture_float {
+
+ /**
+ * Accepted by the <internalFormat> parameter of TexImage1D,
+ * TexImage2D, and TexImage3D:
+ */
+ int GL_RGBA_FLOAT32_ATI = 0x8814;
+ int GL_RGB_FLOAT32_ATI = 0x8815;
+ int GL_ALPHA_FLOAT32_ATI = 0x8816;
+ int GL_INTENSITY_FLOAT32_ATI = 0x8817;
+ int GL_LUMINANCE_FLOAT32_ATI = 0x8818;
+ int GL_LUMINANCE_ALPHA_FLOAT32_ATI = 0x8819;
+ int GL_RGBA_FLOAT16_ATI = 0x881A;
+ int GL_RGB_FLOAT16_ATI = 0x881B;
+ int GL_ALPHA_FLOAT16_ATI = 0x881C;
+ int GL_INTENSITY_FLOAT16_ATI = 0x881D;
+ int GL_LUMINANCE_FLOAT16_ATI = 0x881E;
+ int GL_LUMINANCE_ALPHA_FLOAT16_ATI = 0x881F;
+}
diff --git a/src/templates/org/lwjgl/opengl/ATI_texture_mirror_once.java b/src/templates/org/lwjgl/opengl/ATI_texture_mirror_once.java
index e6692df..65bf748 100644
--- a/src/templates/org/lwjgl/opengl/ATI_texture_mirror_once.java
+++ b/src/templates/org/lwjgl/opengl/ATI_texture_mirror_once.java
@@ -1,37 +1,37 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface ATI_texture_mirror_once {
- int GL_MIRROR_CLAMP_ATI = 0x8742;
- int GL_MIRROR_CLAMP_TO_EDGE_ATI = 0x8743;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface ATI_texture_mirror_once {
+ int GL_MIRROR_CLAMP_ATI = 0x8742;
+ int GL_MIRROR_CLAMP_TO_EDGE_ATI = 0x8743;
+}
diff --git a/src/templates/org/lwjgl/opengl/ATI_vertex_array_object.java b/src/templates/org/lwjgl/opengl/ATI_vertex_array_object.java
index 016b613..3b387cc 100644
--- a/src/templates/org/lwjgl/opengl/ATI_vertex_array_object.java
+++ b/src/templates/org/lwjgl/opengl/ATI_vertex_array_object.java
@@ -1,91 +1,91 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-public interface ATI_vertex_array_object {
- int GL_STATIC_ATI = 0x8760;
- int GL_DYNAMIC_ATI = 0x8761;
- int GL_PRESERVE_ATI = 0x8762;
- int GL_DISCARD_ATI = 0x8763;
- int GL_OBJECT_BUFFER_SIZE_ATI = 0x8764;
- int GL_OBJECT_BUFFER_USAGE_ATI = 0x8765;
- int GL_ARRAY_OBJECT_BUFFER_ATI = 0x8766;
- int GL_ARRAY_OBJECT_OFFSET_ATI = 0x8767;
-
- @GenerateAutos
- @GLuint
- int glNewObjectBufferATI(@AutoSize("pPointer") @GLsizei int size,
- @Const
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer pPointer, @GLenum int usage);
-
- boolean glIsObjectBufferATI(@GLuint int buffer);
-
- void glUpdateObjectBufferATI(@GLuint int buffer, @GLuint int offset, @AutoSize("pPointer") @GLsizei int size,
- @Const
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer pPointer, @GLenum int preserve);
-
- @StripPostfix("params")
- void glGetObjectBufferfvATI(@GLuint int buffer, @GLenum int pname, @OutParameter @Check FloatBuffer params);
-
- @StripPostfix("params")
- void glGetObjectBufferivATI(@GLuint int buffer, @GLenum int pname, @OutParameter @Check IntBuffer params);
-
- void glFreeObjectBufferATI(@GLuint int buffer);
-
- void glArrayObjectATI(@GLenum int array, int size, @GLenum int type, @GLsizei int stride, @GLuint int buffer, @GLuint int offset);
-
- @StripPostfix("params")
- void glGetArrayObjectfvATI(@GLenum int array, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
-
- @StripPostfix("params")
- void glGetArrayObjectivATI(@GLenum int array, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
-
- void glVariantArrayObjectATI(@GLuint int id, @GLenum int type, @GLsizei int stride, @GLuint int buffer, @GLuint int offset);
-
- @StripPostfix("params")
- void glGetVariantArrayObjectfvATI(@GLuint int id, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
-
- @StripPostfix("params")
- void glGetVariantArrayObjectivATI(@GLuint int id, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+public interface ATI_vertex_array_object {
+ int GL_STATIC_ATI = 0x8760;
+ int GL_DYNAMIC_ATI = 0x8761;
+ int GL_PRESERVE_ATI = 0x8762;
+ int GL_DISCARD_ATI = 0x8763;
+ int GL_OBJECT_BUFFER_SIZE_ATI = 0x8764;
+ int GL_OBJECT_BUFFER_USAGE_ATI = 0x8765;
+ int GL_ARRAY_OBJECT_BUFFER_ATI = 0x8766;
+ int GL_ARRAY_OBJECT_OFFSET_ATI = 0x8767;
+
+ @GenerateAutos
+ @GLuint
+ int glNewObjectBufferATI(@AutoSize("pPointer") @GLsizei int size,
+ @Const
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer pPointer, @GLenum int usage);
+
+ boolean glIsObjectBufferATI(@GLuint int buffer);
+
+ void glUpdateObjectBufferATI(@GLuint int buffer, @GLuint int offset, @AutoSize("pPointer") @GLsizei int size,
+ @Const
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer pPointer, @GLenum int preserve);
+
+ @StripPostfix("params")
+ void glGetObjectBufferfvATI(@GLuint int buffer, @GLenum int pname, @OutParameter @Check FloatBuffer params);
+
+ @StripPostfix("params")
+ void glGetObjectBufferivATI(@GLuint int buffer, @GLenum int pname, @OutParameter @Check IntBuffer params);
+
+ void glFreeObjectBufferATI(@GLuint int buffer);
+
+ void glArrayObjectATI(@GLenum int array, int size, @GLenum int type, @GLsizei int stride, @GLuint int buffer, @GLuint int offset);
+
+ @StripPostfix("params")
+ void glGetArrayObjectfvATI(@GLenum int array, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
+
+ @StripPostfix("params")
+ void glGetArrayObjectivATI(@GLenum int array, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
+
+ void glVariantArrayObjectATI(@GLuint int id, @GLenum int type, @GLsizei int stride, @GLuint int buffer, @GLuint int offset);
+
+ @StripPostfix("params")
+ void glGetVariantArrayObjectfvATI(@GLuint int id, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
+
+ @StripPostfix("params")
+ void glGetVariantArrayObjectivATI(@GLuint int id, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
+}
diff --git a/src/templates/org/lwjgl/opengl/ATI_vertex_attrib_array_object.java b/src/templates/org/lwjgl/opengl/ATI_vertex_attrib_array_object.java
index e515521..a32ecdf 100644
--- a/src/templates/org/lwjgl/opengl/ATI_vertex_attrib_array_object.java
+++ b/src/templates/org/lwjgl/opengl/ATI_vertex_attrib_array_object.java
@@ -1,46 +1,46 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-public interface ATI_vertex_attrib_array_object {
- void glVertexAttribArrayObjectATI(@GLuint int index, int size, @GLenum int type, boolean normalized, @GLsizei int stride, @GLuint int buffer, @GLuint int offset);
-
- @StripPostfix("params")
- void glGetVertexAttribArrayObjectfvATI(@GLuint int index, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
-
- @StripPostfix("params")
- void glGetVertexAttribArrayObjectivATI(@GLuint int index, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+public interface ATI_vertex_attrib_array_object {
+ void glVertexAttribArrayObjectATI(@GLuint int index, int size, @GLenum int type, boolean normalized, @GLsizei int stride, @GLuint int buffer, @GLuint int offset);
+
+ @StripPostfix("params")
+ void glGetVertexAttribArrayObjectfvATI(@GLuint int index, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
+
+ @StripPostfix("params")
+ void glGetVertexAttribArrayObjectivATI(@GLuint int index, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
+}
diff --git a/src/templates/org/lwjgl/opengl/ATI_vertex_streams.java b/src/templates/org/lwjgl/opengl/ATI_vertex_streams.java
index 7242ee7..cb585d1 100644
--- a/src/templates/org/lwjgl/opengl/ATI_vertex_streams.java
+++ b/src/templates/org/lwjgl/opengl/ATI_vertex_streams.java
@@ -1,104 +1,104 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-public interface ATI_vertex_streams {
- int GL_MAX_VERTEX_STREAMS_ATI = 0x876B;
- int GL_VERTEX_SOURCE_ATI = 0x876C;
- int GL_VERTEX_STREAM0_ATI = 0x876D;
- int GL_VERTEX_STREAM1_ATI = 0x876E;
- int GL_VERTEX_STREAM2_ATI = 0x876F;
- int GL_VERTEX_STREAM3_ATI = 0x8770;
- int GL_VERTEX_STREAM4_ATI = 0x8771;
- int GL_VERTEX_STREAM5_ATI = 0x8772;
- int GL_VERTEX_STREAM6_ATI = 0x8773;
- int GL_VERTEX_STREAM7_ATI = 0x8774;
-
- @NoErrorCheck
- void glVertexStream2fATI(@GLenum int stream, float x, float y);
-
- @NoErrorCheck
- void glVertexStream2dATI(@GLenum int stream, double x, double y);
-
- @NoErrorCheck
- void glVertexStream2iATI(@GLenum int stream, int x, int y);
-
- @NoErrorCheck
- void glVertexStream2sATI(@GLenum int stream, short x, short y);
-
- @NoErrorCheck
- void glVertexStream3fATI(@GLenum int stream, float x, float y, float z);
-
- @NoErrorCheck
- void glVertexStream3dATI(@GLenum int stream, double x, double y, double z);
-
- @NoErrorCheck
- void glVertexStream3iATI(@GLenum int stream, int x, int y, int z);
-
- @NoErrorCheck
- void glVertexStream3sATI(@GLenum int stream, short x, short y, short z);
-
- @NoErrorCheck
- void glVertexStream4fATI(@GLenum int stream, float x, float y, float z, float w);
-
- @NoErrorCheck
- void glVertexStream4dATI(@GLenum int stream, double x, double y, double z, double w);
-
- @NoErrorCheck
- void glVertexStream4iATI(@GLenum int stream, int x, int y, int z, int w);
-
- @NoErrorCheck
- void glVertexStream4sATI(@GLenum int stream, short x, short y, short z, short w);
-
- @NoErrorCheck
- void glNormalStream3bATI(@GLenum int stream, byte x, byte y, byte z);
-
- @NoErrorCheck
- void glNormalStream3fATI(@GLenum int stream, float x, float y, float z);
-
- @NoErrorCheck
- void glNormalStream3dATI(@GLenum int stream, double x, double y, double z);
-
- @NoErrorCheck
- void glNormalStream3iATI(@GLenum int stream, int x, int y, int z);
-
- @NoErrorCheck
- void glNormalStream3sATI(@GLenum int stream, short x, short y, short z);
-
- void glClientActiveVertexStreamATI(@GLenum int stream);
-
- void glVertexBlendEnvfATI(@GLenum int pname, float param);
-
- void glVertexBlendEnviATI(@GLenum int pname, int param);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+public interface ATI_vertex_streams {
+ int GL_MAX_VERTEX_STREAMS_ATI = 0x876B;
+ int GL_VERTEX_SOURCE_ATI = 0x876C;
+ int GL_VERTEX_STREAM0_ATI = 0x876D;
+ int GL_VERTEX_STREAM1_ATI = 0x876E;
+ int GL_VERTEX_STREAM2_ATI = 0x876F;
+ int GL_VERTEX_STREAM3_ATI = 0x8770;
+ int GL_VERTEX_STREAM4_ATI = 0x8771;
+ int GL_VERTEX_STREAM5_ATI = 0x8772;
+ int GL_VERTEX_STREAM6_ATI = 0x8773;
+ int GL_VERTEX_STREAM7_ATI = 0x8774;
+
+ @NoErrorCheck
+ void glVertexStream2fATI(@GLenum int stream, float x, float y);
+
+ @NoErrorCheck
+ void glVertexStream2dATI(@GLenum int stream, double x, double y);
+
+ @NoErrorCheck
+ void glVertexStream2iATI(@GLenum int stream, int x, int y);
+
+ @NoErrorCheck
+ void glVertexStream2sATI(@GLenum int stream, short x, short y);
+
+ @NoErrorCheck
+ void glVertexStream3fATI(@GLenum int stream, float x, float y, float z);
+
+ @NoErrorCheck
+ void glVertexStream3dATI(@GLenum int stream, double x, double y, double z);
+
+ @NoErrorCheck
+ void glVertexStream3iATI(@GLenum int stream, int x, int y, int z);
+
+ @NoErrorCheck
+ void glVertexStream3sATI(@GLenum int stream, short x, short y, short z);
+
+ @NoErrorCheck
+ void glVertexStream4fATI(@GLenum int stream, float x, float y, float z, float w);
+
+ @NoErrorCheck
+ void glVertexStream4dATI(@GLenum int stream, double x, double y, double z, double w);
+
+ @NoErrorCheck
+ void glVertexStream4iATI(@GLenum int stream, int x, int y, int z, int w);
+
+ @NoErrorCheck
+ void glVertexStream4sATI(@GLenum int stream, short x, short y, short z, short w);
+
+ @NoErrorCheck
+ void glNormalStream3bATI(@GLenum int stream, byte x, byte y, byte z);
+
+ @NoErrorCheck
+ void glNormalStream3fATI(@GLenum int stream, float x, float y, float z);
+
+ @NoErrorCheck
+ void glNormalStream3dATI(@GLenum int stream, double x, double y, double z);
+
+ @NoErrorCheck
+ void glNormalStream3iATI(@GLenum int stream, int x, int y, int z);
+
+ @NoErrorCheck
+ void glNormalStream3sATI(@GLenum int stream, short x, short y, short z);
+
+ void glClientActiveVertexStreamATI(@GLenum int stream);
+
+ void glVertexBlendEnvfATI(@GLenum int pname, float param);
+
+ void glVertexBlendEnviATI(@GLenum int pname, int param);
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_abgr.java b/src/templates/org/lwjgl/opengl/EXT_abgr.java
index 09c9615..74e4608 100644
--- a/src/templates/org/lwjgl/opengl/EXT_abgr.java
+++ b/src/templates/org/lwjgl/opengl/EXT_abgr.java
@@ -1,36 +1,36 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface EXT_abgr {
- int GL_ABGR_EXT = 0x8000;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface EXT_abgr {
+ int GL_ABGR_EXT = 0x8000;
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_bgra.java b/src/templates/org/lwjgl/opengl/EXT_bgra.java
index 36e9d65..6b1df31 100644
--- a/src/templates/org/lwjgl/opengl/EXT_bgra.java
+++ b/src/templates/org/lwjgl/opengl/EXT_bgra.java
@@ -1,37 +1,37 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface EXT_bgra {
- int GL_BGR_EXT = 0x80E0;
- int GL_BGRA_EXT = 0x80E1;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface EXT_bgra {
+ int GL_BGR_EXT = 0x80E0;
+ int GL_BGRA_EXT = 0x80E1;
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_blend_equation_separate.java b/src/templates/org/lwjgl/opengl/EXT_blend_equation_separate.java
index f7ff6a6..bc5a19b 100644
--- a/src/templates/org/lwjgl/opengl/EXT_blend_equation_separate.java
+++ b/src/templates/org/lwjgl/opengl/EXT_blend_equation_separate.java
@@ -1,46 +1,46 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-public interface EXT_blend_equation_separate {
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv, and GetDoublev:
- */
- int GL_BLEND_EQUATION_RGB_EXT = 0x8009;
- int GL_BLEND_EQUATION_ALPHA_EXT = 0x883D;
-
- void glBlendEquationSeparateEXT(@GLenum int modeRGB, @GLenum int modeAlpha);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+public interface EXT_blend_equation_separate {
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, and GetDoublev:
+ */
+ int GL_BLEND_EQUATION_RGB_EXT = 0x8009;
+ int GL_BLEND_EQUATION_ALPHA_EXT = 0x883D;
+
+ void glBlendEquationSeparateEXT(@GLenum int modeRGB, @GLenum int modeAlpha);
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_blend_func_separate.java b/src/templates/org/lwjgl/opengl/EXT_blend_func_separate.java
index 9d0b54b..266c955 100644
--- a/src/templates/org/lwjgl/opengl/EXT_blend_func_separate.java
+++ b/src/templates/org/lwjgl/opengl/EXT_blend_func_separate.java
@@ -1,43 +1,43 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-public interface EXT_blend_func_separate {
- int GL_BLEND_DST_RGB_EXT = 0x80C8;
- int GL_BLEND_SRC_RGB_EXT = 0x80C9;
- int GL_BLEND_DST_ALPHA_EXT = 0x80CA;
- int GL_BLEND_SRC_ALPHA_EXT = 0x80CB;
-
- void glBlendFuncSeparateEXT(@GLenum int sfactorRGB, @GLenum int dfactorRGB, @GLenum int sfactorAlpha, @GLenum int dfactorAlpha);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+public interface EXT_blend_func_separate {
+ int GL_BLEND_DST_RGB_EXT = 0x80C8;
+ int GL_BLEND_SRC_RGB_EXT = 0x80C9;
+ int GL_BLEND_DST_ALPHA_EXT = 0x80CA;
+ int GL_BLEND_SRC_ALPHA_EXT = 0x80CB;
+
+ void glBlendFuncSeparateEXT(@GLenum int sfactorRGB, @GLenum int dfactorRGB, @GLenum int sfactorAlpha, @GLenum int dfactorAlpha);
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_blend_minmax.java b/src/templates/org/lwjgl/opengl/EXT_blend_minmax.java
index 058adcf..465eca8 100644
--- a/src/templates/org/lwjgl/opengl/EXT_blend_minmax.java
+++ b/src/templates/org/lwjgl/opengl/EXT_blend_minmax.java
@@ -1,51 +1,51 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-public interface EXT_blend_minmax {
-
- /** Accepted by the <mode> parameter of BlendEquationEXT. */
- int GL_FUNC_ADD_EXT = 0x8006;
- int GL_MIN_EXT = 0x8007;
- int GL_MAX_EXT = 0x8008;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv, and GetDoublev.
- */
- int GL_BLEND_EQUATION_EXT = 0x8009;
-
- void glBlendEquationEXT(@GLenum int mode);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+public interface EXT_blend_minmax {
+
+ /** Accepted by the <mode> parameter of BlendEquationEXT. */
+ int GL_FUNC_ADD_EXT = 0x8006;
+ int GL_MIN_EXT = 0x8007;
+ int GL_MAX_EXT = 0x8008;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, and GetDoublev.
+ */
+ int GL_BLEND_EQUATION_EXT = 0x8009;
+
+ void glBlendEquationEXT(@GLenum int mode);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/EXT_blend_subtract.java b/src/templates/org/lwjgl/opengl/EXT_blend_subtract.java
index df164cf..0548ffd 100644
--- a/src/templates/org/lwjgl/opengl/EXT_blend_subtract.java
+++ b/src/templates/org/lwjgl/opengl/EXT_blend_subtract.java
@@ -1,37 +1,37 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface EXT_blend_subtract {
- int GL_FUNC_SUBTRACT_EXT = 0x800A;
- int GL_FUNC_REVERSE_SUBTRACT_EXT = 0x800B;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface EXT_blend_subtract {
+ int GL_FUNC_SUBTRACT_EXT = 0x800A;
+ int GL_FUNC_REVERSE_SUBTRACT_EXT = 0x800B;
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_cg_shader.java b/src/templates/org/lwjgl/opengl/EXT_cg_shader.java
index d253c11..d90b4ed 100644
--- a/src/templates/org/lwjgl/opengl/EXT_cg_shader.java
+++ b/src/templates/org/lwjgl/opengl/EXT_cg_shader.java
@@ -1,44 +1,44 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface EXT_Cg_shader {
-
- /**
- * You can pass GL_CG_VERTEX_SHADER_EXT to glCreateShaderARB instead of GL_VERTEX_SHADER_ARB to create a vertex shader object
- * that will parse and compile its shader source with the Cg compiler front-end rather than the GLSL front-end. Likewise, you
- * can pass GL_CG_FRAGMENT_SHADER_EXT to glCreateShaderARB instead of GL_FRAGMENT_SHADER_ARB to create a fragment shader object
- * that will parse and compile its shader source with the Cg front-end rather than the GLSL front-end.
- */
- int GL_CG_VERTEX_SHADER_EXT = 0x890E;
- int GL_CG_FRAGMENT_SHADER_EXT = 0x890F;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface EXT_Cg_shader {
+
+ /**
+ * You can pass GL_CG_VERTEX_SHADER_EXT to glCreateShaderARB instead of GL_VERTEX_SHADER_ARB to create a vertex shader object
+ * that will parse and compile its shader source with the Cg compiler front-end rather than the GLSL front-end. Likewise, you
+ * can pass GL_CG_FRAGMENT_SHADER_EXT to glCreateShaderARB instead of GL_FRAGMENT_SHADER_ARB to create a fragment shader object
+ * that will parse and compile its shader source with the Cg front-end rather than the GLSL front-end.
+ */
+ int GL_CG_VERTEX_SHADER_EXT = 0x890E;
+ int GL_CG_FRAGMENT_SHADER_EXT = 0x890F;
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_compiled_vertex_array.java b/src/templates/org/lwjgl/opengl/EXT_compiled_vertex_array.java
index 0d0ab27..b9b3aeb 100644
--- a/src/templates/org/lwjgl/opengl/EXT_compiled_vertex_array.java
+++ b/src/templates/org/lwjgl/opengl/EXT_compiled_vertex_array.java
@@ -1,43 +1,43 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-public interface EXT_compiled_vertex_array {
- int GL_ARRAY_ELEMENT_LOCK_FIRST_EXT = 0x81A8;
- int GL_ARRAY_ELEMENT_LOCK_COUNT_EXT = 0x81A9;
-
- void glLockArraysEXT(int first, @GLsizei int count);
-
- void glUnlockArraysEXT();
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+public interface EXT_compiled_vertex_array {
+ int GL_ARRAY_ELEMENT_LOCK_FIRST_EXT = 0x81A8;
+ int GL_ARRAY_ELEMENT_LOCK_COUNT_EXT = 0x81A9;
+
+ void glLockArraysEXT(int first, @GLsizei int count);
+
+ void glUnlockArraysEXT();
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_depth_bounds_test.java b/src/templates/org/lwjgl/opengl/EXT_depth_bounds_test.java
index 923474a..c35bc31 100644
--- a/src/templates/org/lwjgl/opengl/EXT_depth_bounds_test.java
+++ b/src/templates/org/lwjgl/opengl/EXT_depth_bounds_test.java
@@ -1,52 +1,52 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-public interface EXT_depth_bounds_test {
-
- /**
- Accepted by the <cap> parameter of Enable, Disable, and IsEnabled,
- and by the <pname> parameter of GetBooleanv, GetIntegerv,
- GetFloatv, and GetDoublev:
- */
- int GL_DEPTH_BOUNDS_TEST_EXT = 0x8890;
-
- /**
- Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- GetFloatv, and GetDoublev:
- */
- int GL_DEPTH_BOUNDS_EXT = 0x8891;
-
- void glDepthBoundsEXT(@GLclampd double zmin, @GLclampd double zmax);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+public interface EXT_depth_bounds_test {
+
+ /**
+ Accepted by the <cap> parameter of Enable, Disable, and IsEnabled,
+ and by the <pname> parameter of GetBooleanv, GetIntegerv,
+ GetFloatv, and GetDoublev:
+ */
+ int GL_DEPTH_BOUNDS_TEST_EXT = 0x8890;
+
+ /**
+ Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ GetFloatv, and GetDoublev:
+ */
+ int GL_DEPTH_BOUNDS_EXT = 0x8891;
+
+ void glDepthBoundsEXT(@GLclampd double zmin, @GLclampd double zmax);
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_direct_state_access.java b/src/templates/org/lwjgl/opengl/EXT_direct_state_access.java
index 676e298..baf8d98 100644
--- a/src/templates/org/lwjgl/opengl/EXT_direct_state_access.java
+++ b/src/templates/org/lwjgl/opengl/EXT_direct_state_access.java
@@ -1,1514 +1,1514 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
- at ForceInit
- at Dependent
- at DeprecatedGL
-public interface EXT_direct_state_access {
-
- /**
- * Accepted by the <pname> parameter of GetBooleanIndexedvEXT,
- * GetIntegerIndexedvEXT, GetFloatIndexedvEXT, GetDoubleIndexedvEXT:
- * GetBooleani_v, GetIntegeri_v, GetFloati_vEXT, GetDoublei_vEXT:
- */
- int GL_PROGRAM_MATRIX_EXT = 0x8E2D;
- int GL_TRANSPOSE_PROGRAM_MATRIX_EXT = 0x8E2E;
- int GL_PROGRAM_MATRIX_STACK_DEPTH_EXT = 0x8E2F;
-
- /*
- OpenGL 1.1: New client commands
- */
-
- @DeprecatedGL
- void glClientAttribDefaultEXT(@GLbitfield int mask);
-
- @DeprecatedGL
- void glPushClientAttribDefaultEXT(@GLbitfield int mask);
-
- /*
- OpenGL 1.0: New matrix commands add "Matrix" prefix to name,
- drops "Matrix" suffix from name, and add initial "enum matrixMode"
- parameter
- */
-
- @StripPostfix("m")
- @DeprecatedGL
- void glMatrixLoadfEXT(@GLenum int matrixMode, @Check("16") @Const FloatBuffer m);
-
- @StripPostfix("m")
- @DeprecatedGL
- void glMatrixLoaddEXT(@GLenum int matrixMode, @Check("16") @Const DoubleBuffer m);
-
- @StripPostfix("m")
- @DeprecatedGL
- void glMatrixMultfEXT(@GLenum int matrixMode, @Check("16") @Const FloatBuffer m);
-
- @StripPostfix("m")
- @DeprecatedGL
- void glMatrixMultdEXT(@GLenum int matrixMode, @Check("16") @Const DoubleBuffer m);
-
- @DeprecatedGL
- void glMatrixLoadIdentityEXT(@GLenum int matrixMode);
-
- @DeprecatedGL
- void glMatrixRotatefEXT(@GLenum int matrixMode, float angle, float x, float y, float z);
-
- @DeprecatedGL
- void glMatrixRotatedEXT(@GLenum int matrixMode, double angle, double x, double y, double z);
-
- @DeprecatedGL
- void glMatrixScalefEXT(@GLenum int matrixMode, float x, float y, float z);
-
- @DeprecatedGL
- void glMatrixScaledEXT(@GLenum int matrixMode, double x, double y, double z);
-
- @DeprecatedGL
- void glMatrixTranslatefEXT(@GLenum int matrixMode, float x, float y, float z);
-
- @DeprecatedGL
- void glMatrixTranslatedEXT(@GLenum int matrixMode, double x, double y, double z);
-
- @DeprecatedGL
- void glMatrixOrthoEXT(@GLenum int matrixMode, double l, double r, double b, double t, double n, double f);
-
- @DeprecatedGL
- void glMatrixFrustumEXT(@GLenum int matrixMode, double l, double r, double b, double t, double n, double f);
-
- @DeprecatedGL
- void glMatrixPushEXT(@GLenum int matrixMode);
-
- @DeprecatedGL
- void glMatrixPopEXT(@GLenum int matrixMode);
-
- /*
- OpenGL 1.1: New texture object commands and queries replace "Tex"
- in name with "Texture" and add initial "uint texture" parameter
- */
-
- void glTextureParameteriEXT(@GLuint int texture, @GLenum int target, @GLenum int pname, int param);
-
- @StripPostfix("param")
- void glTextureParameterivEXT(@GLuint int texture, @GLenum int target, @GLenum int pname, @Check("4") @Const IntBuffer param);
-
- void glTextureParameterfEXT(@GLuint int texture, @GLenum int target, @GLenum int pname, float param);
-
- @StripPostfix("param")
- void glTextureParameterfvEXT(@GLuint int texture, @GLenum int target, @GLenum int pname, @Check("4") @Const FloatBuffer param);
-
- void glTextureImage1DEXT(@GLuint int texture, @GLenum int target, int level,
- int internalformat, @GLsizei int width, int border, @GLenum int format, @GLenum int type,
- @BufferObject(BufferKind.UnpackPBO)
- @Check(value = "GLChecks.calculateTexImage1DStorage(pixels, format, type, width)", canBeNull = true)
- @Const
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer pixels);
-
- void glTextureImage2DEXT(@GLuint int texture, @GLenum int target, int level,
- int internalformat, @GLsizei int width, @GLsizei int height, int border, @GLenum int format, @GLenum int type,
- @BufferObject(BufferKind.UnpackPBO)
- @Check(value = "GLChecks.calculateTexImage2DStorage(pixels, format, type, width, height)", canBeNull = true)
- @Const
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer pixels);
-
- void glTextureSubImage1DEXT(@GLuint int texture, @GLenum int target, int level,
- int xoffset, @GLsizei int width, @GLenum int format, @GLenum int type,
- @BufferObject(BufferKind.UnpackPBO)
- @Check("GLChecks.calculateImageStorage(pixels, format, type, width, 1, 1)")
- @Const
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer pixels);
-
- void glTextureSubImage2DEXT(@GLuint int texture, @GLenum int target, int level,
- int xoffset, int yoffset, @GLsizei int width, @GLsizei int height, @GLenum int format, @GLenum int type,
- @BufferObject(BufferKind.UnpackPBO)
- @Check("GLChecks.calculateImageStorage(pixels, format, type, width, height, 1)")
- @Const
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer pixels);
-
- void glCopyTextureImage1DEXT(@GLuint int texture, @GLenum int target, int level, @GLenum int internalformat, int x, int y, @GLsizei int width, int border);
-
- void glCopyTextureImage2DEXT(@GLuint int texture, @GLenum int target, int level, @GLenum int internalformat, int x, int y, @GLsizei int width, @GLsizei int height, int border);
-
- void glCopyTextureSubImage1DEXT(@GLuint int texture, @GLenum int target, int level, int xoffset, int x, int y, @GLsizei int width);
-
- void glCopyTextureSubImage2DEXT(@GLuint int texture, @GLenum int target, int level, int xoffset, int yoffset, int x, int y, @GLsizei int width, @GLsizei int height);
-
- void glGetTextureImageEXT(@GLuint int texture, @GLenum int target, int level,
- @GLenum int format, @GLenum int type,
- @OutParameter
- @BufferObject(BufferKind.PackPBO)
- @Check("GLChecks.calculateImageStorage(pixels, format, type, 1, 1, 1)")
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer pixels);
-
- @StripPostfix("params")
- void glGetTextureParameterfvEXT(@GLuint int texture, @GLenum int target, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
-
- @Alternate("glGetTextureParameterfvEXT")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- void glGetTextureParameterfvEXT2(@GLuint int texture, @GLenum int target, @GLenum int pname, @OutParameter FloatBuffer params);
-
- @StripPostfix("params")
- void glGetTextureParameterivEXT(@GLuint int texture, @GLenum int target, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
-
- @Alternate("glGetTextureParameterivEXT")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- void glGetTextureParameterivEXT2(@GLuint int texture, @GLenum int target, @GLenum int pname, @OutParameter IntBuffer params);
-
- @StripPostfix("params")
- void glGetTextureLevelParameterfvEXT(@GLuint int texture, @GLenum int target, int level, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
-
- @Alternate("glGetTextureLevelParameterfvEXT")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- void glGetTextureLevelParameterfvEXT2(@GLuint int texture, @GLenum int target, int level, @GLenum int pname, @OutParameter FloatBuffer params);
-
- @StripPostfix("params")
- void glGetTextureLevelParameterivEXT(@GLuint int texture, @GLenum int target, int level, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
-
- @Alternate("glGetTextureLevelParameterivEXT")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- void glGetTextureLevelParameterivEXT2(@GLuint int texture, @GLenum int target, int level, @GLenum int pname, @OutParameter IntBuffer params);
-
- /*
- OpenGL 1.2: New 3D texture object commands replace "Tex" in name with
- "Texture" and adds initial "uint texture" parameter
- */
-
- @Dependent("OpenGL12")
- void glTextureImage3DEXT(@GLuint int texture, @GLenum int target, int level,
- int internalformat, @GLsizei int width, @GLsizei int height, @GLsizei int depth, int border, @GLenum int format, @GLenum int type,
- @BufferObject(BufferKind.UnpackPBO)
- @Check(value = "GLChecks.calculateTexImage3DStorage(pixels, format, type, width, height, depth)", canBeNull = true)
- @Const
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer pixels);
-
- @Dependent("OpenGL12")
- void glTextureSubImage3DEXT(@GLuint int texture, @GLenum int target, int level,
- int xoffset, int yoffset, int zoffset, @GLsizei int width, @GLsizei int height, @GLsizei int depth, @GLenum int format, @GLenum int type,
- @BufferObject(BufferKind.UnpackPBO)
- @Check("GLChecks.calculateImageStorage(pixels, format, type, width, height, depth)")
- @Const
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer pixels);
-
- @Dependent("OpenGL12")
- void glCopyTextureSubImage3DEXT(@GLuint int texture, @GLenum int target, int level,
- int xoffset, int yoffset, int zoffset, int x, int y, @GLsizei int width, @GLsizei int height);
-
- /*
- OpenGL 1.2.1: New multitexture commands and queries prefix "Multi"
- before "Tex" and add an initial "enum texunit" parameter (to identify
- the texture unit
- */
-
- @Dependent("OpenGL13")
- void glBindMultiTextureEXT(@GLenum int texunit, @GLenum int target, @GLuint int texture);
-
- @Dependent("OpenGL13")
- @DeprecatedGL
- void glMultiTexCoordPointerEXT(@GLenum int texunit, int size, @AutoType("pointer") @GLenum int type, @GLsizei int stride,
- @BufferObject(BufferKind.ArrayVBO)
- @Check
- @Const
- @GLfloat
- @GLdouble
- Buffer pointer);
-
- @Dependent("OpenGL13")
- @DeprecatedGL
- void glMultiTexEnvfEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, float param);
-
- @Dependent("OpenGL13")
- @StripPostfix("params")
- @DeprecatedGL
- void glMultiTexEnvfvEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, @Check("4") @Const FloatBuffer params);
-
- @Dependent("OpenGL13")
- @DeprecatedGL
- void glMultiTexEnviEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, int param);
-
- @Dependent("OpenGL13")
- @StripPostfix("params")
- @DeprecatedGL
- void glMultiTexEnvivEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, @Check("4") @Const IntBuffer params);
-
- @Dependent("OpenGL13")
- @DeprecatedGL
- void glMultiTexGendEXT(@GLenum int texunit, @GLenum int coord, @GLenum int pname, double param);
-
- @Dependent("OpenGL13")
- @StripPostfix("params")
- @DeprecatedGL
- void glMultiTexGendvEXT(@GLenum int texunit, @GLenum int coord, @GLenum int pname, @Check("4") @Const DoubleBuffer params);
-
- @Dependent("OpenGL13")
- @DeprecatedGL
- void glMultiTexGenfEXT(@GLenum int texunit, @GLenum int coord, @GLenum int pname, float param);
-
- @Dependent("OpenGL13")
- @StripPostfix("params")
- @DeprecatedGL
- void glMultiTexGenfvEXT(@GLenum int texunit, @GLenum int coord, @GLenum int pname, @Check("4") @Const FloatBuffer params);
-
- @Dependent("OpenGL13")
- @DeprecatedGL
- void glMultiTexGeniEXT(@GLenum int texunit, @GLenum int coord, @GLenum int pname, int param);
-
- @Dependent("OpenGL13")
- @StripPostfix("params")
- @DeprecatedGL
- void glMultiTexGenivEXT(@GLenum int texunit, @GLenum int coord, @GLenum int pname, @Check("4") @Const IntBuffer params);
-
- @Dependent("OpenGL13")
- @StripPostfix("params")
- @DeprecatedGL
- void glGetMultiTexEnvfvEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, @Check("4") @OutParameter FloatBuffer params);
-
- @Dependent("OpenGL13")
- @StripPostfix("params")
- @DeprecatedGL
- void glGetMultiTexEnvivEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, @Check("4") @OutParameter IntBuffer params);
-
- @Dependent("OpenGL13")
- @StripPostfix("params")
- @DeprecatedGL
- void glGetMultiTexGendvEXT(@GLenum int texunit, @GLenum int coord, @GLenum int pname, @Check("4") @OutParameter DoubleBuffer params);
-
- @Dependent("OpenGL13")
- @StripPostfix("params")
- @DeprecatedGL
- void glGetMultiTexGenfvEXT(@GLenum int texunit, @GLenum int coord, @GLenum int pname, @Check("4") @OutParameter FloatBuffer params);
-
- @Dependent("OpenGL13")
- @StripPostfix("params")
- @DeprecatedGL
- void glGetMultiTexGenivEXT(@GLenum int texunit, @GLenum int coord, @GLenum int pname, @Check("4") @OutParameter IntBuffer params);
-
- @Dependent("OpenGL13")
- void glMultiTexParameteriEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, int param);
-
- @Dependent("OpenGL13")
- @StripPostfix("param")
- void glMultiTexParameterivEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, @Check("4") @Const IntBuffer param);
-
- @Dependent("OpenGL13")
- void glMultiTexParameterfEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, float param);
-
- @Dependent("OpenGL13")
- @StripPostfix("param")
- void glMultiTexParameterfvEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, @Check("4") @Const FloatBuffer param);
-
- @Dependent("OpenGL13")
- void glMultiTexImage1DEXT(@GLenum int texunit, @GLenum int target, int level,
- int internalformat, @GLsizei int width, int border, @GLenum int format, @GLenum int type,
- @BufferObject(BufferKind.UnpackPBO)
- @Check(value = "GLChecks.calculateTexImage1DStorage(pixels, format, type, width)", canBeNull = true)
- @Const
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer pixels);
-
- @Dependent("OpenGL13")
- void glMultiTexImage2DEXT(@GLenum int texunit, @GLenum int target, int level,
- int internalformat, @GLsizei int width, @GLsizei int height, int border, @GLenum int format, @GLenum int type,
- @BufferObject(BufferKind.UnpackPBO)
- @Check(value = "GLChecks.calculateTexImage2DStorage(pixels, format, type, width, height)", canBeNull = true)
- @Const
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer pixels);
-
- @Dependent("OpenGL13")
- void glMultiTexSubImage1DEXT(@GLenum int texunit, @GLenum int target, int level,
- int xoffset, @GLsizei int width, @GLenum int format, @GLenum int type,
- @BufferObject(BufferKind.UnpackPBO)
- @Check("GLChecks.calculateImageStorage(pixels, format, type, width, 1, 1)")
- @Const
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer pixels);
-
- @Dependent("OpenGL13")
- void glMultiTexSubImage2DEXT(@GLenum int texunit, @GLenum int target, int level,
- int xoffset, int yoffset, @GLsizei int width, @GLsizei int height, @GLenum int format, @GLenum int type,
- @BufferObject(BufferKind.UnpackPBO)
- @Check("GLChecks.calculateImageStorage(pixels, format, type, width, height, 1)")
- @Const
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer pixels);
-
- @Dependent("OpenGL13")
- void glCopyMultiTexImage1DEXT(@GLenum int texunit, @GLenum int target, int level, @GLenum int internalformat, int x, int y, @GLsizei int width, int border);
-
- @Dependent("OpenGL13")
- void glCopyMultiTexImage2DEXT(@GLenum int texunit, @GLenum int target, int level, @GLenum int internalformat, int x, int y, @GLsizei int width, @GLsizei int height, int border);
-
- @Dependent("OpenGL13")
- void glCopyMultiTexSubImage1DEXT(@GLenum int texunit, @GLenum int target, int level, int xoffset, int x, int y, @GLsizei int width);
-
- @Dependent("OpenGL13")
- void glCopyMultiTexSubImage2DEXT(@GLenum int texunit, @GLenum int target, int level, int xoffset, int yoffset, int x, int y, @GLsizei int width, @GLsizei int height);
-
- @Dependent("OpenGL13")
- void glGetMultiTexImageEXT(@GLenum int texunit, @GLenum int target, int level, @GLenum int format, @GLenum int type,
- @OutParameter
- @BufferObject(BufferKind.PackPBO)
- @Check("GLChecks.calculateImageStorage(pixels, format, type, 1, 1, 1)")
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer pixels);
-
- @Dependent("OpenGL13")
- @StripPostfix("params")
- void glGetMultiTexParameterfvEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, @Check("4") @OutParameter FloatBuffer params);
-
- @Alternate("glGetMultiTexParameterfvEXT")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- void glGetMultiTexParameterfvEXT2(@GLenum int texunit, @GLenum int target, @GLenum int pname, @OutParameter FloatBuffer params);
-
- @Dependent("OpenGL13")
- @StripPostfix("params")
- void glGetMultiTexParameterivEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, @Check("4") @OutParameter IntBuffer params);
-
- @Alternate("glGetMultiTexParameterivEXT")
- @GLreturn("params")
- @Dependent("OpenGL13")
- @StripPostfix(value = "params", postfix = "v")
- void glGetMultiTexParameterivEXT2(@GLenum int texunit, @GLenum int target, @GLenum int pname, @OutParameter IntBuffer params);
-
- @Dependent("OpenGL13")
- @StripPostfix("params")
- void glGetMultiTexLevelParameterfvEXT(@GLenum int texunit, @GLenum int target, int level, @GLenum int pname, @Check("4") @OutParameter FloatBuffer params);
-
- @Alternate("glGetMultiTexLevelParameterfvEXT")
- @GLreturn("params")
- @Dependent("OpenGL13")
- @StripPostfix(value = "params", postfix = "v")
- void glGetMultiTexLevelParameterfvEXT2(@GLenum int texunit, @GLenum int target, int level, @GLenum int pname, @OutParameter FloatBuffer params);
-
- @Dependent("OpenGL13")
- @StripPostfix("params")
- void glGetMultiTexLevelParameterivEXT(@GLenum int texunit, @GLenum int target, int level, @GLenum int pname, @Check("4") @OutParameter IntBuffer params);
-
- @Alternate("glGetMultiTexLevelParameterivEXT")
- @GLreturn("params")
- @Dependent("OpenGL13")
- @StripPostfix(value = "params", postfix = "v")
- void glGetMultiTexLevelParameterivEXT2(@GLenum int texunit, @GLenum int target, int level, @GLenum int pname, @OutParameter IntBuffer params);
-
- @Dependent("OpenGL13")
- void glMultiTexImage3DEXT(@GLenum int texunit, @GLenum int target, int level,
- int internalformat, @GLsizei int width, @GLsizei int height, @GLsizei int depth, int border, @GLenum int format, @GLenum int type,
- @BufferObject(BufferKind.UnpackPBO)
- @Check(value = "GLChecks.calculateTexImage3DStorage(pixels, format, type, width, height, depth)", canBeNull = true)
- @Const
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer pixels);
-
- @Dependent("OpenGL13")
- void glMultiTexSubImage3DEXT(@GLenum int texunit, @GLenum int target, int level,
- int xoffset, int yoffset, int zoffset, @GLsizei int width, @GLsizei int height, @GLsizei int depth, @GLenum int format, @GLenum int type,
- @BufferObject(BufferKind.UnpackPBO)
- @Check("GLChecks.calculateImageStorage(pixels, format, type, width, height, depth)")
- @Const
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer pixels);
-
- @Dependent("OpenGL13")
- void glCopyMultiTexSubImage3DEXT(@GLenum int texunit, @GLenum int target, int level, int xoffset, int yoffset, int zoffset, int x, int y, @GLsizei int width, @GLsizei int height);
-
- /*
- OpenGL 1.2.1: New indexed texture commands and queries append
- "Indexed" to name and add "uint index" parameter (to identify the
- texture unit index) after state name parameters (if any) and before
- state value parameters
- */
-
- @Dependent("OpenGL13")
- @DeprecatedGL
- void glEnableClientStateIndexedEXT(@GLenum int array, @GLuint int index);
-
- @Dependent("OpenGL13")
- @DeprecatedGL
- void glDisableClientStateIndexedEXT(@GLenum int array, @GLuint int index);
-
- /*
- OpenGL 3.0: New indexed texture commands and queries append "i"
- to name and add "uint index" parameter (to identify the texture
- unit index) after state name parameters (if any) and before state
- value parameters
- */
-
- @Optional(reason = "AMD does not expose this (last driver checked: 10.3)")
- @Dependent("OpenGL30")
- void glEnableClientStateiEXT(@GLenum int array, @GLuint int index);
-
- @Optional(reason = "AMD does not expose this (last driver checked: 10.3)")
- @Dependent("OpenGL30")
- void glDisableClientStateiEXT(@GLenum int array, @GLuint int index);
-
- /*
- OpenGL 1.2.1: New indexed generic queries (added for indexed texture
- state) append "Indexed" to name and add "uint index" parameter
- (to identify the texture unit) after state name parameters (if any)
- and before state value parameters
- */
-
- @Dependent("OpenGL13")
- @StripPostfix("params")
- void glGetFloatIndexedvEXT(@GLenum int pname, @GLuint int index, @OutParameter @Check("16") FloatBuffer params);
-
- @Alternate("glGetFloatIndexedvEXT")
- @GLreturn("params")
- @Dependent("OpenGL13")
- @StripPostfix("params")
- void glGetFloatIndexedvEXT2(@GLenum int pname, @GLuint int index, @OutParameter FloatBuffer params);
-
- @Dependent("OpenGL13")
- @StripPostfix(value = "params", hasPostfix = false)
- void glGetDoubleIndexedvEXT(@GLenum int pname, @GLuint int index, @OutParameter @Check("16") DoubleBuffer params);
-
- @Alternate("glGetDoubleIndexedvEXT")
- @GLreturn("params")
- @Dependent("OpenGL13")
- @StripPostfix(value = "params", hasPostfix = false)
- void glGetDoubleIndexedvEXT2(@GLenum int pname, @GLuint int index, @OutParameter DoubleBuffer params);
-
- @Dependent("OpenGL13")
- @StripPostfix("params")
- void glGetPointerIndexedvEXT(@GLenum int pname, @GLuint int index, @Result @GLvoid ByteBuffer params);
-
- /*
- OpenGL 3.0: New indexed generic queries (added for indexed texture
- state) replace "v" for "i_v" to name and add "uint index" parameter
- (to identify the texture unit) after state name parameters (if any)
- and before state value parameters
- */
-
- @Optional(reason = "AMD does not expose this (last driver checked: 10.3)")
- @Dependent("OpenGL30")
- @StripPostfix("params")
- void glGetFloati_vEXT(@GLenum int pname, @GLuint int index, @OutParameter @Check("16") FloatBuffer params);
-
- @Alternate("glGetFloati_vEXT")
- @GLreturn("params")
- @Dependent("OpenGL30")
- @StripPostfix("params")
- void glGetFloati_vEXT2(@GLenum int pname, @GLuint int index, @OutParameter FloatBuffer params);
-
- @Optional(reason = "AMD does not expose this (last driver checked: 10.3)")
- @Dependent("OpenGL30")
- @StripPostfix("params")
- void glGetDoublei_vEXT(@GLenum int pname, @GLuint int index, @OutParameter @Check("16") DoubleBuffer params);
-
- @Alternate("glGetDoublei_vEXT")
- @GLreturn("params")
- @Dependent("OpenGL30")
- @StripPostfix("params")
- void glGetDoublei_vEXT2(@GLenum int pname, @GLuint int index, @OutParameter DoubleBuffer params);
-
- @Optional(reason = "AMD does not expose this (last driver checked: 10.3)")
- @Dependent("OpenGL30")
- @StripPostfix(value = "params", hasPostfix = false)
- void glGetPointeri_vEXT(@GLenum int pname, @GLuint int index, @Result @GLvoid ByteBuffer params);
-
- /*
- OpenGL 1.2.1: Extend the functionality of these EXT_draw_buffers2
- commands and queries for multitexture
- TODO: Why 1.2.1 and not EXT_draw_buffers2?
- */
-
- @Dependent("GL_EXT_draw_buffers2")
- void glEnableIndexedEXT(@GLenum int cap, @GLuint int index);
-
- @Dependent("GL_EXT_draw_buffers2")
- void glDisableIndexedEXT(@GLenum int cap, @GLuint int index);
-
- @Dependent("GL_EXT_draw_buffers2")
- boolean glIsEnabledIndexedEXT(@GLenum int cap, @GLuint int index);
-
- @Dependent("GL_EXT_draw_buffers2")
- @StripPostfix("params")
- void glGetIntegerIndexedvEXT(@GLenum int pname, @GLuint int index, @OutParameter @Check("16") IntBuffer params);
-
- @Alternate("glGetIntegerIndexedvEXT")
- @GLreturn("params")
- @Dependent("GL_EXT_draw_buffers2")
- @StripPostfix("params")
- void glGetIntegerIndexedvEXT2(@GLenum int pname, @GLuint int index, @OutParameter IntBuffer params);
-
- @Dependent("GL_EXT_draw_buffers2")
- @StripPostfix("params")
- void glGetBooleanIndexedvEXT(@GLenum int pname, @GLuint int index, @OutParameter @Check("16") @GLboolean ByteBuffer params);
-
- @Alternate("glGetBooleanIndexedvEXT")
- @GLreturn("params")
- @Dependent("GL_EXT_draw_buffers2")
- @StripPostfix("params")
- void glGetBooleanIndexedvEXT2(@GLenum int pname, @GLuint int index, @OutParameter @GLboolean ByteBuffer params);
-
- /*
- ARB_vertex_program: New program commands and queries add "Named"
- prefix to name and adds initial "uint program" parameter
- */
-
- @Dependent("GL_ARB_vertex_program")
- void glNamedProgramStringEXT(@GLuint int program, @GLenum int target, @GLenum int format, @AutoSize("string") @GLsizei int len, @Const @GLvoid Buffer string);
-
- @Alternate("glNamedProgramStringEXT")
- @Dependent("GL_ARB_vertex_program")
- void glNamedProgramStringEXT(@GLuint int program, @GLenum int target, @GLenum int format, @Constant("string.length()") @GLsizei int length, CharSequence string);
-
- @Dependent("GL_ARB_vertex_program")
- void glNamedProgramLocalParameter4dEXT(@GLuint int program, @GLenum int target, @GLuint int index, double x, double y, double z, double w);
-
- @Dependent("GL_ARB_vertex_program")
- @StripPostfix("params")
- void glNamedProgramLocalParameter4dvEXT(@GLuint int program, @GLenum int target, @GLuint int index, @Const @Check("4") DoubleBuffer params);
-
- @Dependent("GL_ARB_vertex_program")
- void glNamedProgramLocalParameter4fEXT(@GLuint int program, @GLenum int target, @GLuint int index, float x, float y, float z, float w);
-
- @Dependent("GL_ARB_vertex_program")
- @StripPostfix("params")
- void glNamedProgramLocalParameter4fvEXT(@GLuint int program, @GLenum int target, @GLuint int index, @Const @Check("4") FloatBuffer params);
-
- @Dependent("GL_ARB_vertex_program")
- @StripPostfix("params")
- void glGetNamedProgramLocalParameterdvEXT(@GLuint int program, @GLenum int target, @GLuint int index, @OutParameter @Check("4") DoubleBuffer params);
-
- @Dependent("GL_ARB_vertex_program")
- @StripPostfix("params")
- void glGetNamedProgramLocalParameterfvEXT(@GLuint int program, @GLenum int target, @GLuint int index, @OutParameter @Check("4") FloatBuffer params);
-
- @Dependent("GL_ARB_vertex_program")
- @StripPostfix("params")
- void glGetNamedProgramivEXT(@GLuint int program, @GLenum int target, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
-
- @Alternate("glGetNamedProgramivEXT")
- @GLreturn("params")
- @Dependent("GL_ARB_vertex_program")
- @StripPostfix("params")
- void glGetNamedProgramivEXT2(@GLuint int program, @GLenum int target, @GLenum int pname, @OutParameter IntBuffer params);
-
- @Dependent("GL_ARB_vertex_program")
- void glGetNamedProgramStringEXT(@GLuint int program, @GLenum int target, @GLenum int pname, @OutParameter @Check @GLvoid ByteBuffer string);
-
- @Alternate("glGetNamedProgramStringEXT")
- @Code("\t\tint programLength = glGetNamedProgramEXT(program, target, ARBProgram.GL_PROGRAM_LENGTH_ARB);")
- @GLreturn(value = "paramString", maxLength = "programLength", forceMaxLength = true)
- void glGetNamedProgramStringEXT2(@GLuint int program, @GLenum int target, @GLenum int pname, @OutParameter @GLchar ByteBuffer paramString);
-
- /*
- OpenGL 1.3: New compressed texture object commands replace "Tex"
- in name with "Texture" and add initial "uint texture" parameter
- */
-
- @Dependent("OpenGL13")
- void glCompressedTextureImage3DEXT(@GLuint int texture, @GLenum int target, int level,
- @GLenum int internalformat, @GLsizei int width, @GLsizei int height, @GLsizei int depth, int border, @AutoSize("data") @GLsizei int imageSize,
- @BufferObject(BufferKind.UnpackPBO)
- @Check
- @Const
- @GLvoid
- ByteBuffer data);
-
- @Dependent("OpenGL13")
- void glCompressedTextureImage2DEXT(@GLuint int texture, @GLenum int target, int level,
- @GLenum int internalformat, @GLsizei int width, @GLsizei int height, int border, @AutoSize("data") @GLsizei int imageSize,
- @BufferObject(BufferKind.UnpackPBO)
- @Check
- @Const
- @GLvoid
- ByteBuffer data);
-
- @Dependent("OpenGL13")
- void glCompressedTextureImage1DEXT(@GLuint int texture, @GLenum int target, int level,
- @GLenum int internalformat, @GLsizei int width, int border, @AutoSize("data") @GLsizei int imageSize,
- @BufferObject(BufferKind.UnpackPBO)
- @Check
- @Const
- @GLvoid
- ByteBuffer data);
-
- @Dependent("OpenGL13")
- void glCompressedTextureSubImage3DEXT(@GLuint int texture, @GLenum int target, int level,
- int xoffset, int yoffset, int zoffset, @GLsizei int width, @GLsizei int height, @GLsizei int depth,
- @GLenum int format, @AutoSize("data") @GLsizei int imageSize,
- @BufferObject(BufferKind.UnpackPBO)
- @Check
- @Const
- @GLvoid
- ByteBuffer data);
-
- @Dependent("OpenGL13")
- void glCompressedTextureSubImage2DEXT(@GLuint int texture, @GLenum int target, int level,
- int xoffset, int yoffset, @GLsizei int width, @GLsizei int height, @GLenum int format, @AutoSize("data") @GLsizei int imageSize,
- @BufferObject(BufferKind.UnpackPBO)
- @Check
- @Const
- @GLvoid
- ByteBuffer data);
-
- @Dependent("OpenGL13")
- void glCompressedTextureSubImage1DEXT(@GLuint int texture, @GLenum int target, int level,
- int xoffset, @GLsizei int width, @GLenum int format, @AutoSize("data") @GLsizei int imageSize,
- @BufferObject(BufferKind.UnpackPBO)
- @Check
- @Const
- @GLvoid
- ByteBuffer data);
-
- @Dependent("OpenGL13")
- void glGetCompressedTextureImageEXT(@GLuint int texture, @GLenum int target, int level,
- @OutParameter
- @BufferObject(BufferKind.PackPBO)
- @Check
- @GLbyte
- @GLshort
- @GLint Buffer img);
-
- /*
- OpenGL 1.3: New multitexture compressed texture commands and queries
- prefix "Multi" before "Tex" and add an initial "enum texunit"
- parameter (to identify the texture unit)
- */
-
- @Dependent("OpenGL13")
- void glCompressedMultiTexImage3DEXT(@GLenum int texunit, @GLenum int target, int level,
- @GLenum int internalformat, @GLsizei int width, @GLsizei int height, @GLsizei int depth, int border, @AutoSize("data") @GLsizei int imageSize,
- @BufferObject(BufferKind.UnpackPBO)
- @Check
- @Const
- @GLvoid
- ByteBuffer data);
-
- @Dependent("OpenGL13")
- void glCompressedMultiTexImage2DEXT(@GLenum int texunit, @GLenum int target, int level,
- @GLenum int internalformat, @GLsizei int width, @GLsizei int height, int border, @AutoSize("data") @GLsizei int imageSize,
- @BufferObject(BufferKind.UnpackPBO)
- @Check
- @Const
- @GLvoid
- ByteBuffer data);
-
- @Dependent("OpenGL13")
- void glCompressedMultiTexImage1DEXT(@GLenum int texunit, @GLenum int target, int level,
- @GLenum int internalformat, @GLsizei int width, int border, @AutoSize("data") @GLsizei int imageSize,
- @BufferObject(BufferKind.UnpackPBO)
- @Check
- @Const
- @GLvoid
- ByteBuffer data);
-
- @Dependent("OpenGL13")
- void glCompressedMultiTexSubImage3DEXT(@GLenum int texunit, @GLenum int target, int level,
- int xoffset, int yoffset, int zoffset, @GLsizei int width, @GLsizei int height, @GLsizei int depth,
- @GLenum int format, @AutoSize("data") @GLsizei int imageSize,
- @BufferObject(BufferKind.UnpackPBO)
- @Check
- @Const
- @GLvoid
- ByteBuffer data);
-
- @Dependent("OpenGL13")
- void glCompressedMultiTexSubImage2DEXT(@GLenum int texunit, @GLenum int target, int level,
- int xoffset, int yoffset, @GLsizei int width, @GLsizei int height, @GLenum int format, @AutoSize("data") @GLsizei int imageSize,
- @BufferObject(BufferKind.UnpackPBO)
- @Check
- @Const
- @GLvoid
- ByteBuffer data);
-
- @Dependent("OpenGL13")
- void glCompressedMultiTexSubImage1DEXT(@GLenum int texunit, @GLenum int target, int level,
- int xoffset, @GLsizei int width, @GLenum int format, @AutoSize("data") @GLsizei int imageSize,
- @BufferObject(BufferKind.UnpackPBO)
- @Check
- @Const
- @GLvoid
- ByteBuffer data);
-
- @Dependent("OpenGL13")
- void glGetCompressedMultiTexImageEXT(@GLenum int texunit, @GLenum int target, int level,
- @OutParameter
- @BufferObject(BufferKind.PackPBO)
- @Check
- @GLbyte
- @GLshort
- @GLint Buffer img);
-
- @Dependent("OpenGL13")
- void glGetCompressedTexImage(@GLenum int target, int lod,
- @OutParameter
- @BufferObject(BufferKind.PackPBO)
- @Check
- @GLbyte
- @GLshort
- @GLint Buffer img);
-
- /*
- OpenGL 1.3: New transpose matrix commands add "Matrix" suffix
- to name, drops "Matrix" suffix from name, and add initial "enum
- matrixMode" parameter
- */
-
- @Dependent("OpenGL13")
- @StripPostfix("m")
- @DeprecatedGL
- void glMatrixLoadTransposefEXT(@GLenum int matrixMode, @Check("16") @Const FloatBuffer m);
-
- @Dependent("OpenGL13")
- @StripPostfix("m")
- @DeprecatedGL
- void glMatrixLoadTransposedEXT(@GLenum int matrixMode, @Check("16") @Const DoubleBuffer m);
-
- @Dependent("OpenGL13")
- @StripPostfix("m")
- @DeprecatedGL
- void glMatrixMultTransposefEXT(@GLenum int matrixMode, @Check("16") @Const FloatBuffer m);
-
- @Dependent("OpenGL13")
- @StripPostfix("m")
- @DeprecatedGL
- void glMatrixMultTransposedEXT(@GLenum int matrixMode, @Check("16") @Const DoubleBuffer m);
-
- /*
- OpenGL 1.5: New buffer commands and queries replace "Buffer" with
- "NamedBuffer" in name and replace "enum target" parameter with
- "uint buffer"
- */
-
- @Dependent("OpenGL15")
- @GenerateAutos
- void glNamedBufferDataEXT(@GLuint int buffer, @AutoSize("data") @GLsizeiptr long size,
- @Const
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer data, @GLenum int usage);
-
- @Dependent("OpenGL15")
- void glNamedBufferSubDataEXT(@GLuint int buffer, @GLintptr long offset, @AutoSize("data") @GLsizeiptr long size,
- @Check
- @Const
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer data);
-
- /**
- * glMapNamedBufferEXT maps a GL buffer object to a ByteBuffer. The old_buffer argument can be null,
- * in which case a new ByteBuffer will be created, pointing to the returned memory. If old_buffer is non-null,
- * it will be returned if it points to the same mapped memory and has the same capacity as the buffer object,
- * otherwise a new ByteBuffer is created. That way, an application will normally use glMapNamedBufferEXT like this:
- * <p/>
- * ByteBuffer mapped_buffer; mapped_buffer = glMapNamedBufferEXT(..., ..., null); ... // Another map on the same buffer mapped_buffer = glMapNamedBufferEXT(..., ..., mapped_buffer);
- * <p/>
- * Only ByteBuffers returned from this method are to be passed as the old_buffer argument. User-created ByteBuffers cannot be reused.
- * <p/>
- * The version of this method without an explicit length argument calls glGetNamedBufferParameterEXT internally to
- * retrieve the current buffer object size, which may cause a pipeline flush and reduce application performance.
- * <p/>
- * The version of this method with an explicit length argument is a fast alternative to the one without. No GL call
- * is made to retrieve the buffer object size, so the user is responsible for tracking and using the appropriate length.<br>
- * Security warning: The length argument should match the buffer object size. Reading from or writing to outside
- * the memory region that corresponds to the mapped buffer object will cause native crashes.
- *
- * @param length the length of the mapped memory in bytes.
- * @param old_buffer A ByteBuffer. If this argument points to the same address and has the same capacity as the new mapping, it will be returned and no new buffer will be created.
- *
- * @return A ByteBuffer representing the mapped buffer memory.
- */
- @Dependent("OpenGL15")
- @CachedResult
- @GLvoid
- @AutoResultSize("GLChecks.getNamedBufferObjectSize(caps, buffer)")
- ByteBuffer glMapNamedBufferEXT(@GLuint int buffer, @GLenum int access);
-
- @Dependent("OpenGL15")
- boolean glUnmapNamedBufferEXT(@GLuint int buffer);
-
- @Dependent("OpenGL15")
- @StripPostfix("params")
- void glGetNamedBufferParameterivEXT(@GLuint int buffer, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
-
- @Alternate("glGetNamedBufferParameterivEXT")
- @GLreturn("params")
- @Dependent("OpenGL15")
- @StripPostfix("params")
- void glGetNamedBufferParameterivEXT2(@GLuint int buffer, @GLenum int pname, @OutParameter IntBuffer params);
-
- @Dependent("OpenGL15")
- @StripPostfix("params")
- @AutoResultSize("GLChecks.getNamedBufferObjectSize(caps, buffer)")
- void glGetNamedBufferPointervEXT(@GLuint int buffer, @GLenum int pname, @OutParameter @Result @GLvoid ByteBuffer params);
-
- @Dependent("OpenGL15")
- void glGetNamedBufferSubDataEXT(@GLuint int buffer, @GLintptr long offset, @AutoSize("data") @GLsizeiptr long size,
- @OutParameter
- @Check
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer data);
-
- /*
- OpenGL 2.0: New uniform commands add "Program" prefix to name and
- add initial "uint program" parameter
- */
-
- @Dependent("OpenGL20")
- void glProgramUniform1fEXT(@GLuint int program, int location, float v0);
-
- @Dependent("OpenGL20")
- void glProgramUniform2fEXT(@GLuint int program, int location, float v0, float v1);
-
- @Dependent("OpenGL20")
- void glProgramUniform3fEXT(@GLuint int program, int location, float v0, float v1, float v2);
-
- @Dependent("OpenGL20")
- void glProgramUniform4fEXT(@GLuint int program, int location, float v0, float v1, float v2, float v3);
-
- @Dependent("OpenGL20")
- void glProgramUniform1iEXT(@GLuint int program, int location, int v0);
-
- @Dependent("OpenGL20")
- void glProgramUniform2iEXT(@GLuint int program, int location, int v0, int v1);
-
- @Dependent("OpenGL20")
- void glProgramUniform3iEXT(@GLuint int program, int location, int v0, int v1, int v2);
-
- @Dependent("OpenGL20")
- void glProgramUniform4iEXT(@GLuint int program, int location, int v0, int v1, int v2, int v3);
-
- @Dependent("OpenGL20")
- @StripPostfix("value")
- void glProgramUniform1fvEXT(@GLuint int program, int location, @AutoSize(value = "value") @GLsizei int count, @Const FloatBuffer value);
-
- @Dependent("OpenGL20")
- @StripPostfix("value")
- void glProgramUniform2fvEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " >> 1") @GLsizei int count, @Const FloatBuffer value);
-
- @Dependent("OpenGL20")
- @StripPostfix("value")
- void glProgramUniform3fvEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " / 3") @GLsizei int count, @Const FloatBuffer value);
-
- @Dependent("OpenGL20")
- @StripPostfix("value")
- void glProgramUniform4fvEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " >> 2") @GLsizei int count, @Const FloatBuffer value);
-
- @Dependent("OpenGL20")
- @StripPostfix("value")
- void glProgramUniform1ivEXT(@GLuint int program, int location, @AutoSize(value = "value") @GLsizei int count, @Const IntBuffer value);
-
- @Dependent("OpenGL20")
- @StripPostfix("value")
- void glProgramUniform2ivEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " >> 1") @GLsizei int count, @Const IntBuffer value);
-
- @Dependent("OpenGL20")
- @StripPostfix("value")
- void glProgramUniform3ivEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " / 3") @GLsizei int count, @Const IntBuffer value);
-
- @Dependent("OpenGL20")
- @StripPostfix("value")
- void glProgramUniform4ivEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " >> 2") @GLsizei int count, @Const IntBuffer value);
-
- @Dependent("OpenGL20")
- @StripPostfix("value")
- void glProgramUniformMatrix2fvEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " >> 2") @GLsizei int count, boolean transpose, @Const FloatBuffer value);
-
- @Dependent("OpenGL20")
- @StripPostfix("value")
- void glProgramUniformMatrix3fvEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " / (3 * 3)") @GLsizei int count, boolean transpose, @Const FloatBuffer value);
-
- @Dependent("OpenGL20")
- @StripPostfix("value")
- void glProgramUniformMatrix4fvEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " >> 4") @GLsizei int count, boolean transpose, @Const FloatBuffer value);
-
- /*
- OpenGL 2.1: New uniform matrix commands add "Program" prefix to
- name and add initial "uint program" parameter
- */
-
- @Dependent("OpenGL21")
- @StripPostfix("value")
- void glProgramUniformMatrix2x3fvEXT(@GLuint int program, int location,
- @AutoSize(value = "value", expression = " / (2 * 3)") @GLsizei int count, boolean transpose, @Const FloatBuffer value);
-
- @Dependent("OpenGL21")
- @StripPostfix("value")
- void glProgramUniformMatrix3x2fvEXT(@GLuint int program, int location,
- @AutoSize(value = "value", expression = " / (3 * 2)") @GLsizei int count, boolean transpose, @Const FloatBuffer value);
-
- @Dependent("OpenGL21")
- @StripPostfix("value")
- void glProgramUniformMatrix2x4fvEXT(@GLuint int program, int location,
- @AutoSize(value = "value", expression = " >> 3") @GLsizei int count, boolean transpose, @Const FloatBuffer value);
-
- @Dependent("OpenGL21")
- @StripPostfix("value")
- void glProgramUniformMatrix4x2fvEXT(@GLuint int program, int location,
- @AutoSize(value = "value", expression = " >> 3") @GLsizei int count, boolean transpose, @Const FloatBuffer value);
-
- @Dependent("OpenGL21")
- @StripPostfix("value")
- void glProgramUniformMatrix3x4fvEXT(@GLuint int program, int location,
- @AutoSize(value = "value", expression = " / (3 * 4)") @GLsizei int count, boolean transpose, @Const FloatBuffer value);
-
- @Dependent("OpenGL21")
- @StripPostfix("value")
- void glProgramUniformMatrix4x3fvEXT(@GLuint int program, int location,
- @AutoSize(value = "value", expression = " / (4 * 3)") @GLsizei int count, boolean transpose, @Const FloatBuffer value);
-
- /*
- EXT_texture_buffer_object: New texture buffer object command
- replaces "Tex" in name with "Texture" and adds initial "uint texture"
- parameter
- */
-
- @Dependent("GL_EXT_texture_buffer_object")
- void glTextureBufferEXT(@GLuint int texture, @GLenum int target, @GLenum int internalformat, @GLuint int buffer);
-
- /*
- EXT_texture_buffer_object: New multitexture texture buffer command
- prefixes "Multi" before "Tex" and add an initial "enum texunit"
- parameter (to identify the texture unit)
- */
-
- @Dependent("GL_EXT_texture_buffer_object")
- void glMultiTexBufferEXT(@GLenum int texunit, @GLenum int target, @GLenum int internalformat, @GLuint int buffer);
-
- /*
- EXT_texture_integer: New integer texture object commands and queries
- replace "Tex" in name with "Texture" and add initial "uint texture"
- parameter
- */
-
- @Dependent("GL_EXT_texture_integer")
- @StripPostfix("params")
- void glTextureParameterIivEXT(@GLuint int texture, @GLenum int target, @GLenum int pname, @Check("4") @Const IntBuffer params);
-
- @Alternate("glTextureParameterIivEXT")
- @Dependent("GL_EXT_texture_integer")
- @StripPostfix("param")
- void glTextureParameterIivEXT(@GLuint int texture, @GLenum int target, @GLenum int pname, @Constant(value = "APIUtils.getBufferInt().put(0, param), 0", keepParam = true) int param);
-
- @Dependent("GL_EXT_texture_integer")
- @StripPostfix("params")
- void glTextureParameterIuivEXT(@GLuint int texture, @GLenum int target, @GLenum int pname, @Check("4") @Const @GLuint IntBuffer params);
-
- @Alternate("glTextureParameterIuivEXT")
- @Dependent("GL_EXT_texture_integer")
- @StripPostfix("param")
- void glTextureParameterIuivEXT(@GLuint int texture, @GLenum int target, @GLenum int pname, @Constant(value = "APIUtils.getBufferInt().put(0, param), 0", keepParam = true) @GLuint int param);
-
- @Dependent("GL_EXT_texture_integer")
- @StripPostfix("params")
- void glGetTextureParameterIivEXT(@GLuint int texture, @GLenum int target, @GLenum int pname, @Check("4") @OutParameter IntBuffer params);
-
- @Alternate("glGetTextureParameterIivEXT")
- @GLreturn("params")
- @Dependent("GL_EXT_texture_integer")
- @StripPostfix(value = "params", postfix = "v")
- void glGetTextureParameterIivEXT2(@GLuint int texture, @GLenum int target, @GLenum int pname, @OutParameter IntBuffer params);
-
- @Dependent("GL_EXT_texture_integer")
- @StripPostfix("params")
- void glGetTextureParameterIuivEXT(@GLuint int texture, @GLenum int target, @GLenum int pname, @Check("4") @OutParameter @GLuint IntBuffer params);
-
- @Alternate("glGetTextureParameterIuivEXT")
- @GLreturn("params")
- @Dependent("GL_EXT_texture_integer")
- @StripPostfix(value = "params", postfix = "v")
- void glGetTextureParameterIuivEXT2(@GLuint int texture, @GLenum int target, @GLenum int pname, @OutParameter @GLuint IntBuffer params);
-
- /*
- EXT_texture_integer: New multitexture integer texture commands and
- queries prefix "Multi" before "Tex" and add an initial "enum texunit"
- parameter (to identify the texture unit)
- */
-
- @Dependent("GL_EXT_texture_integer")
- @StripPostfix("params")
- void glMultiTexParameterIivEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, @Check("4") @Const IntBuffer params);
-
- @Alternate("glMultiTexParameterIivEXT")
- @Dependent("GL_EXT_texture_integer")
- @StripPostfix("param")
- void glMultiTexParameterIivEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, @Constant(value = "APIUtils.getBufferInt().put(0, param), 0", keepParam = true) int param);
-
- @Dependent("GL_EXT_texture_integer")
- @StripPostfix("params")
- void glMultiTexParameterIuivEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, @Check("4") @Const @GLuint IntBuffer params);
-
- @Alternate("glMultiTexParameterIuivEXT")
- @Dependent("GL_EXT_texture_integer")
- @StripPostfix("param")
- void glMultiTexParameterIuivEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, @Constant(value = "APIUtils.getBufferInt().put(0, param), 0", keepParam = true) int param);
-
- @Dependent("GL_EXT_texture_integer")
- @StripPostfix("params")
- void glGetMultiTexParameterIivEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, @Check("4") @OutParameter IntBuffer params);
-
- @Alternate("glGetMultiTexParameterIivEXT")
- @GLreturn("params")
- @Dependent("GL_EXT_texture_integer")
- @StripPostfix(value = "params", postfix = "v")
- void glGetMultiTexParameterIivEXT2(@GLenum int texunit, @GLenum int target, @GLenum int pname, @OutParameter IntBuffer params);
-
- @Dependent("GL_EXT_texture_integer")
- @StripPostfix("params")
- void glGetMultiTexParameterIuivEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, @Check("4") @OutParameter @GLuint IntBuffer params);
-
- @Alternate("glGetMultiTexParameterIuivEXT")
- @GLreturn("params")
- @Dependent("GL_EXT_texture_integer")
- @StripPostfix(value = "params", postfix = "v")
- void glGetMultiTexParameterIuivEXT2(@GLenum int texunit, @GLenum int target, @GLenum int pname, @OutParameter @GLuint IntBuffer params);
-
- /*
- EXT_gpu_shader4: New integer uniform commands add "Program" prefix
- to name and add initial "uint program" parameter
- */
-
- @Dependent("GL_EXT_gpu_shader4")
- void glProgramUniform1uiEXT(@GLuint int program, int location, @GLuint int v0);
-
- @Dependent("GL_EXT_gpu_shader4")
- void glProgramUniform2uiEXT(@GLuint int program, int location, @GLuint int v0, @GLuint int v1);
-
- @Dependent("GL_EXT_gpu_shader4")
- void glProgramUniform3uiEXT(@GLuint int program, int location, @GLuint int v0, @GLuint int v1, @GLuint int v2);
-
- @Dependent("GL_EXT_gpu_shader4")
- void glProgramUniform4uiEXT(@GLuint int program, int location, @GLuint int v0, @GLuint int v1, @GLuint int v2, @GLuint int v3);
-
- @Dependent("GL_EXT_gpu_shader4")
- @StripPostfix("value")
- void glProgramUniform1uivEXT(@GLuint int program, int location, @AutoSize(value = "value") @GLsizei int count, @Const @GLuint IntBuffer value);
-
- @Dependent("GL_EXT_gpu_shader4")
- @StripPostfix("value")
- void glProgramUniform2uivEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " >> 1") @GLsizei int count, @Const @GLuint IntBuffer value);
-
- @Dependent("GL_EXT_gpu_shader4")
- @StripPostfix("value")
- void glProgramUniform3uivEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " / 3") @GLsizei int count, @Const @GLuint IntBuffer value);
-
- @Dependent("GL_EXT_gpu_shader4")
- @StripPostfix("value")
- void glProgramUniform4uivEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " >> 2") @GLsizei int count, @Const @GLuint IntBuffer value);
-
- /*
- EXT_gpu_program_parameters: New program command adds "Named" prefix
- to name and adds "uint program" parameter
- */
-
- @Dependent("GL_EXT_gpu_program_parameters")
- @StripPostfix("params")
- void glNamedProgramLocalParameters4fvEXT(@GLuint int program, @GLenum int target, @GLuint int index,
- @AutoSize(value = "params", expression = " >> 2") @GLsizei int count, @Const FloatBuffer params);
-
- /*
- NV_gpu_program4: New program commands and queries add "Named"
- prefix to name and replace "enum target" with "uint program"
- */
-
- @Dependent("GL_NV_gpu_program4")
- void glNamedProgramLocalParameterI4iEXT(@GLuint int program, @GLenum int target, @GLuint int index, int x, int y, int z, int w);
-
- @Dependent("GL_NV_gpu_program4")
- @StripPostfix("params")
- void glNamedProgramLocalParameterI4ivEXT(@GLuint int program, @GLenum int target, @GLuint int index, @Check("4") @Const IntBuffer params);
-
- @Dependent("GL_NV_gpu_program4")
- @StripPostfix("params")
- void glNamedProgramLocalParametersI4ivEXT(@GLuint int program, @GLenum int target, @GLuint int index,
- @AutoSize(value = "params", expression = " >> 2") @GLsizei int count, @Const IntBuffer params);
-
- @Dependent("GL_NV_gpu_program4")
- void glNamedProgramLocalParameterI4uiEXT(@GLuint int program, @GLenum int target, @GLuint int index, @GLuint int x, @GLuint int y, @GLuint int z, @GLuint int w);
-
- @Dependent("GL_NV_gpu_program4")
- @StripPostfix("params")
- void glNamedProgramLocalParameterI4uivEXT(@GLuint int program, @GLenum int target, @GLuint int index, @Check("4") @Const @GLuint IntBuffer params);
-
- @Dependent("GL_NV_gpu_program4")
- @StripPostfix("params")
- void glNamedProgramLocalParametersI4uivEXT(@GLuint int program, @GLenum int target, @GLuint int index,
- @AutoSize(value = "params", expression = " >> 2") @GLsizei int count, @Const @GLuint IntBuffer params);
-
- @Dependent("GL_NV_gpu_program4")
- @StripPostfix("params")
- void glGetNamedProgramLocalParameterIivEXT(@GLuint int program, @GLenum int target, @GLuint int index, @Check("4") @OutParameter IntBuffer params);
-
- @Dependent("GL_NV_gpu_program4")
- @StripPostfix("params")
- void glGetNamedProgramLocalParameterIuivEXT(@GLuint int program, @GLenum int target, @GLuint int index, @Check("4") @OutParameter @GLuint IntBuffer params);
-
- /*
- OpenGL 3.0: New renderbuffer commands add "Named" prefix to name
- and replace "enum target" with "uint renderbuffer"
- */
-
- @Dependent("OpenGL30,GL_EXT_framebuffer_object")
- void glNamedRenderbufferStorageEXT(@GLuint int renderbuffer, @GLenum int internalformat, @GLsizei int width, @GLsizei int height);
-
- @Dependent("OpenGL30,GL_EXT_framebuffer_object")
- @StripPostfix("params")
- void glGetNamedRenderbufferParameterivEXT(@GLuint int renderbuffer, @GLenum int pname, @Check("4") @OutParameter IntBuffer params);
-
- @Alternate("glGetNamedRenderbufferParameterivEXT")
- @GLreturn("params")
- @Dependent("OpenGL30,GL_EXT_framebuffer_object")
- @StripPostfix("params")
- void glGetNamedRenderbufferParameterivEXT2(@GLuint int renderbuffer, @GLenum int pname, @OutParameter IntBuffer params);
-
- /*
- EXT_framebuffer_multisample: New renderbuffer commands add "Named"
- prefix to name and replace "enum target" with "uint renderbuffer"
- */
-
- @Dependent("OpenGL30,GL_EXT_framebuffer_multisample")
- void glNamedRenderbufferStorageMultisampleEXT(@GLuint int renderbuffer, @GLsizei int samples, @GLenum int internalformat, @GLsizei int width, @GLsizei int height);
-
- /*
- NV_framebuffer_multisample_coverage: New renderbuffer commands
- add "Named" prefix to name and replace "enum target" with "uint
- renderbuffer"
- */
-
- @Dependent("GL_NV_framebuffer_multisample_coverage")
- void glNamedRenderbufferStorageMultisampleCoverageEXT(@GLuint int renderbuffer, @GLsizei int coverageSamples, @GLsizei int colorSamples, @GLenum int internalformat, @GLsizei int width, @GLsizei int height);
-
- /*
- OpenGL 3.0: New framebuffer commands add "Named" prefix to name
- and replace "enum target" with "uint framebuffer"
- */
-
- @Dependent("OpenGL30,GL_EXT_framebuffer_object")
- @GLenum
- int glCheckNamedFramebufferStatusEXT(@GLuint int framebuffer, @GLenum int target);
-
- @Dependent("OpenGL30,GL_EXT_framebuffer_object")
- void glNamedFramebufferTexture1DEXT(@GLuint int framebuffer, @GLenum int attachment, @GLenum int textarget, @GLuint int texture, int level);
-
- @Dependent("OpenGL30,GL_EXT_framebuffer_object")
- void glNamedFramebufferTexture2DEXT(@GLuint int framebuffer, @GLenum int attachment, @GLenum int textarget, @GLuint int texture, int level);
-
- @Dependent("OpenGL30,GL_EXT_framebuffer_object")
- void glNamedFramebufferTexture3DEXT(@GLuint int framebuffer, @GLenum int attachment, @GLenum int textarget, @GLuint int texture, int level, int zoffset);
-
- @Dependent("OpenGL30,GL_EXT_framebuffer_object")
- void glNamedFramebufferRenderbufferEXT(@GLuint int framebuffer, @GLenum int attachment, @GLenum int renderbuffertarget, @GLuint int renderbuffer);
-
- @Dependent("OpenGL30,GL_EXT_framebuffer_object")
- @StripPostfix("params")
- void glGetNamedFramebufferAttachmentParameterivEXT(@GLuint int framebuffer, @GLenum int attachment, @GLenum int pname, @Check("4") @OutParameter IntBuffer params);
-
- @Alternate("glGetNamedFramebufferAttachmentParameterivEXT")
- @GLreturn("params")
- @Dependent("OpenGL30,GL_EXT_framebuffer_object")
- @StripPostfix("params")
- void glGetNamedFramebufferAttachmentParameterivEXT2(@GLuint int framebuffer, @GLenum int attachment, @GLenum int pname, @OutParameter IntBuffer params);
-
- /*
- OpenGL 3.0: New texture commands add "Texture" within name and
- replace "enum target" with "uint texture"
- */
-
- @Dependent("OpenGL30,GL_EXT_framebuffer_object")
- void glGenerateTextureMipmapEXT(@GLuint int texture, @GLenum int target);
-
- /*
- OpenGL 3.0: New texture commands add "MultiTex" within name and
- replace "enum target" with "enum texunit"
- */
-
- @Dependent("OpenGL30,GL_EXT_framebuffer_object")
- void glGenerateMultiTexMipmapEXT(@GLenum int texunit, @GLenum int target);
-
- /*
- OpenGL 3.0: New framebuffer commands
- */
-
- @Dependent("OpenGL30,GL_EXT_framebuffer_object")
- void glFramebufferDrawBufferEXT(@GLuint int framebuffer, @GLenum int mode);
-
- @Dependent("OpenGL30,GL_EXT_framebuffer_object")
- void glFramebufferDrawBuffersEXT(@GLuint int framebuffer, @AutoSize("bufs") @GLsizei int n, @Const @GLenum IntBuffer bufs);
-
- @Dependent("OpenGL30,GL_EXT_framebuffer_object")
- void glFramebufferReadBufferEXT(@GLuint int framebuffer, @GLenum int mode);
-
- /*
- OpenGL 3.0: New framebuffer query
- */
-
- @Dependent("OpenGL30,GL_EXT_framebuffer_object")
- @StripPostfix("param")
- void glGetFramebufferParameterivEXT(@GLuint int framebuffer, @GLenum int pname, @Check("4") @OutParameter IntBuffer param);
-
- @Alternate("glGetFramebufferParameterivEXT")
- @GLreturn("param")
- @Dependent("OpenGL30,GL_EXT_framebuffer_object")
- @StripPostfix("param")
- void glGetFramebufferParameterivEXT2(@GLuint int framebuffer, @GLenum int pname, @OutParameter IntBuffer param);
-
- /*
- OpenGL 3.1: New buffer data copy command
- */
-
- @Dependent("OpenGL31,GL_ARB_copy_buffer")
- void glNamedCopyBufferSubDataEXT(@GLuint int readBuffer, @GLuint int writeBuffer, @GLintptr long readoffset, @GLintptr long writeoffset, @GLsizeiptr long size);
-
- /*
- EXT_geometry_shader4 or NV_geometry_program4: New framebuffer commands
- add "Named" prefix to name and replace "enum target" with "uint
- framebuffer"
- */
-
- @Dependent("GL_EXT_geometry_shader4,NV_geometry_program4")
- void glNamedFramebufferTextureEXT(@GLuint int framebuffer, @GLenum int attachment, @GLuint int texture, int level);
-
- @Dependent("GL_EXT_geometry_shader4,NV_geometry_program4")
- void glNamedFramebufferTextureLayerEXT(@GLuint int framebuffer, @GLenum int attachment, @GLuint int texture, int level, int layer);
-
- @Dependent("GL_EXT_geometry_shader4,NV_geometry_program4")
- void glNamedFramebufferTextureFaceEXT(@GLuint int framebuffer, @GLenum int attachment, @GLuint int texture, int level, @GLenum int face);
-
- /*
- NV_explicit_multisample: New texture renderbuffer object command
- replaces "Tex" in name with "Texture" and add initial "uint texture"
- parameter
- */
-
- @Dependent("GL_NV_explicit_multisample")
- void glTextureRenderbufferEXT(@GLuint int texture, @GLenum int target, @GLuint int renderbuffer);
-
- /*
- NV_explicit_multisample: New multitexture texture renderbuffer command
- prefixes "Multi" before "Tex" and add an initial "enum texunit"
- parameter (to identify the texture unit)
- */
-
- @Dependent("GL_NV_explicit_multisample")
- void glMultiTexRenderbufferEXT(@GLenum int texunit, @GLenum int target, @GLuint int renderbuffer);
-
- /*
- OpenGL 3.0: New vertex array specification commands for vertex
- array objects prefix "VertexArray", add initial "uint vaobj" and
- "uint buffer" parameters, change "Pointer" suffix to "Offset",
- and change the final parameter from "const void *" to "intptr offset"
- */
-
- @Dependent("OpenGL30")
- @DeprecatedGL
- void glVertexArrayVertexOffsetEXT(@GLuint int vaobj, @GLuint int buffer, int size, @GLenum int type, @GLsizei int stride, @GLintptr long offset);
-
- @Dependent("OpenGL30")
- @DeprecatedGL
- void glVertexArrayColorOffsetEXT(@GLuint int vaobj, @GLuint int buffer, int size, @GLenum int type, @GLsizei int stride, @GLintptr long offset);
-
- @Dependent("OpenGL30")
- @DeprecatedGL
- void glVertexArrayEdgeFlagOffsetEXT(@GLuint int vaobj, @GLuint int buffer, @GLsizei int stride, @GLintptr long offset);
-
- @Dependent("OpenGL30")
- void glVertexArrayIndexOffsetEXT(@GLuint int vaobj, @GLuint int buffer, @GLenum int type, @GLsizei int stride, @GLintptr long offset);
-
- @Dependent("OpenGL30")
- @DeprecatedGL
- void glVertexArrayNormalOffsetEXT(@GLuint int vaobj, @GLuint int buffer, @GLenum int type, @GLsizei int stride, @GLintptr long offset);
-
- @Dependent("OpenGL30")
- @DeprecatedGL
- void glVertexArrayTexCoordOffsetEXT(@GLuint int vaobj, @GLuint int buffer, int size, @GLenum int type, @GLsizei int stride, @GLintptr long offset);
-
- @Dependent("OpenGL30")
- @DeprecatedGL
- void glVertexArrayMultiTexCoordOffsetEXT(@GLuint int vaobj, @GLuint int buffer, @GLenum int texunit, int size, @GLenum int type, @GLsizei int stride, @GLintptr long offset);
-
- @Dependent("OpenGL30")
- @DeprecatedGL
- void glVertexArrayFogCoordOffsetEXT(@GLuint int vaobj, @GLuint int buffer, @GLenum int type, @GLsizei int stride, @GLintptr long offset);
-
- @Dependent("OpenGL30")
- @DeprecatedGL
- void glVertexArraySecondaryColorOffsetEXT(@GLuint int vaobj, @GLuint int buffer, int size, @GLenum int type, @GLsizei int stride, @GLintptr long offset);
-
- @Dependent("OpenGL30")
- void glVertexArrayVertexAttribOffsetEXT(@GLuint int vaobj, @GLuint int buffer, @GLuint int index, int size, @GLenum int type, boolean normalized, @GLsizei int stride, @GLintptr long offset);
-
- @Dependent("OpenGL30")
- void glVertexArrayVertexAttribIOffsetEXT(@GLuint int vaobj, @GLuint int buffer, @GLuint int index, int size, @GLenum int type, @GLsizei int stride, @GLintptr long offset);
-
- /*
- OpenGL 3.0: New vertex array enable commands for vertex array
- objects change "ClientState" to "VertexArray" and add an initial
- "uint vaobj" parameter
- */
-
- @Dependent("OpenGL30")
- void glEnableVertexArrayEXT(@GLuint int vaobj, @GLenum int array);
-
- @Dependent("OpenGL30")
- void glDisableVertexArrayEXT(@GLuint int vaobj, @GLenum int array);
-
- /*
- OpenGL 3.0: New vertex attrib array enable commands for vertex
- array objects change "VertexAttribArray" to "VertexArrayAttrib"
- and add an initial "uint vaobj" parameter
- */
-
- @Dependent("OpenGL30")
- void glEnableVertexArrayAttribEXT(@GLuint int vaobj, @GLuint int index);
-
- @Dependent("OpenGL30")
- void glDisableVertexArrayAttribEXT(@GLuint int vaobj, @GLuint int index);
-
- /*
- OpenGL 3.0: New queries for vertex array objects
- */
-
- @Dependent("OpenGL30")
- @StripPostfix("param")
- void glGetVertexArrayIntegervEXT(@GLuint int vaobj, @GLenum int pname, @OutParameter @Check("16") IntBuffer param);
-
- @Alternate("glGetVertexArrayIntegervEXT")
- @GLreturn("param")
- @Dependent("OpenGL30")
- @StripPostfix("param")
- void glGetVertexArrayIntegervEXT2(@GLuint int vaobj, @GLenum int pname, @OutParameter IntBuffer param);
-
- @Dependent("OpenGL30")
- @StripPostfix("param")
- void glGetVertexArrayPointervEXT(@GLuint int vaobj, @GLenum int pname, @Result @GLvoid ByteBuffer param);
-
- @Dependent("OpenGL30")
- @StripPostfix(value = "param")
- void glGetVertexArrayIntegeri_vEXT(@GLuint int vaobj, @GLuint int index, @GLenum int pname, @OutParameter @Check("16") IntBuffer param);
-
- @Alternate("glGetVertexArrayIntegeri_vEXT")
- @GLreturn("param")
- @Dependent("OpenGL30")
- @StripPostfix(value = "param", postfix = "_v")
- void glGetVertexArrayIntegeri_vEXT2(@GLuint int vaobj, @GLuint int index, @GLenum int pname, @OutParameter IntBuffer param);
-
- @Dependent("OpenGL30")
- @StripPostfix(value = "param")
- void glGetVertexArrayPointeri_vEXT(@GLuint int vaobj, @GLuint int index, @GLenum int pname, @Result @GLvoid ByteBuffer param);
-
- /*
- OpenGL 3.0: New buffer commands replace "Buffer" with "NamedBuffer"
- in name and replace "enum target" parameter with "uint buffer"
- */
-
- /**
- * glMapNamedBufferRangeEXT maps a GL buffer object range to a ByteBuffer. The old_buffer argument can be null,
- * in which case a new ByteBuffer will be created, pointing to the returned memory. If old_buffer is non-null,
- * it will be returned if it points to the same mapped memory and has the same capacity as the buffer object,
- * otherwise a new ByteBuffer is created. That way, an application will normally use glMapNamedBufferRangeEXT like this:
- * <p/>
- * ByteBuffer mapped_buffer; mapped_buffer = glMapNamedBufferRangeEXT(..., ..., ..., ..., null); ... // Another map on the same buffer mapped_buffer = glMapNamedBufferRangeEXT(..., ..., ..., ..., mapped_buffer);
- * <p/>
- * Only ByteBuffers returned from this method are to be passed as the old_buffer argument. User-created ByteBuffers cannot be reused.
- *
- * @param old_buffer A ByteBuffer. If this argument points to the same address and has the same capacity as the new mapping, it will be returned and no new buffer will be created.
- *
- * @return A ByteBuffer representing the mapped buffer memory.
- */
- @Dependent("OpenGL30")
- @CachedResult(isRange = true)
- @GLvoid
- @AutoResultSize("length")
- ByteBuffer glMapNamedBufferRangeEXT(@GLuint int buffer, @GLintptr long offset, @GLsizeiptr long length, @GLbitfield int access);
-
- @Dependent("OpenGL30")
- void glFlushMappedNamedBufferRangeEXT(@GLuint int buffer, @GLintptr long offset, @GLsizeiptr long length);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+ at ForceInit
+ at Dependent
+ at DeprecatedGL
+public interface EXT_direct_state_access {
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanIndexedvEXT,
+ * GetIntegerIndexedvEXT, GetFloatIndexedvEXT, GetDoubleIndexedvEXT:
+ * GetBooleani_v, GetIntegeri_v, GetFloati_vEXT, GetDoublei_vEXT:
+ */
+ int GL_PROGRAM_MATRIX_EXT = 0x8E2D;
+ int GL_TRANSPOSE_PROGRAM_MATRIX_EXT = 0x8E2E;
+ int GL_PROGRAM_MATRIX_STACK_DEPTH_EXT = 0x8E2F;
+
+ /*
+ OpenGL 1.1: New client commands
+ */
+
+ @DeprecatedGL
+ void glClientAttribDefaultEXT(@GLbitfield int mask);
+
+ @DeprecatedGL
+ void glPushClientAttribDefaultEXT(@GLbitfield int mask);
+
+ /*
+ OpenGL 1.0: New matrix commands add "Matrix" prefix to name,
+ drops "Matrix" suffix from name, and add initial "enum matrixMode"
+ parameter
+ */
+
+ @StripPostfix("m")
+ @DeprecatedGL
+ void glMatrixLoadfEXT(@GLenum int matrixMode, @Check("16") @Const FloatBuffer m);
+
+ @StripPostfix("m")
+ @DeprecatedGL
+ void glMatrixLoaddEXT(@GLenum int matrixMode, @Check("16") @Const DoubleBuffer m);
+
+ @StripPostfix("m")
+ @DeprecatedGL
+ void glMatrixMultfEXT(@GLenum int matrixMode, @Check("16") @Const FloatBuffer m);
+
+ @StripPostfix("m")
+ @DeprecatedGL
+ void glMatrixMultdEXT(@GLenum int matrixMode, @Check("16") @Const DoubleBuffer m);
+
+ @DeprecatedGL
+ void glMatrixLoadIdentityEXT(@GLenum int matrixMode);
+
+ @DeprecatedGL
+ void glMatrixRotatefEXT(@GLenum int matrixMode, float angle, float x, float y, float z);
+
+ @DeprecatedGL
+ void glMatrixRotatedEXT(@GLenum int matrixMode, double angle, double x, double y, double z);
+
+ @DeprecatedGL
+ void glMatrixScalefEXT(@GLenum int matrixMode, float x, float y, float z);
+
+ @DeprecatedGL
+ void glMatrixScaledEXT(@GLenum int matrixMode, double x, double y, double z);
+
+ @DeprecatedGL
+ void glMatrixTranslatefEXT(@GLenum int matrixMode, float x, float y, float z);
+
+ @DeprecatedGL
+ void glMatrixTranslatedEXT(@GLenum int matrixMode, double x, double y, double z);
+
+ @DeprecatedGL
+ void glMatrixOrthoEXT(@GLenum int matrixMode, double l, double r, double b, double t, double n, double f);
+
+ @DeprecatedGL
+ void glMatrixFrustumEXT(@GLenum int matrixMode, double l, double r, double b, double t, double n, double f);
+
+ @DeprecatedGL
+ void glMatrixPushEXT(@GLenum int matrixMode);
+
+ @DeprecatedGL
+ void glMatrixPopEXT(@GLenum int matrixMode);
+
+ /*
+ OpenGL 1.1: New texture object commands and queries replace "Tex"
+ in name with "Texture" and add initial "uint texture" parameter
+ */
+
+ void glTextureParameteriEXT(@GLuint int texture, @GLenum int target, @GLenum int pname, int param);
+
+ @StripPostfix("param")
+ void glTextureParameterivEXT(@GLuint int texture, @GLenum int target, @GLenum int pname, @Check("4") @Const IntBuffer param);
+
+ void glTextureParameterfEXT(@GLuint int texture, @GLenum int target, @GLenum int pname, float param);
+
+ @StripPostfix("param")
+ void glTextureParameterfvEXT(@GLuint int texture, @GLenum int target, @GLenum int pname, @Check("4") @Const FloatBuffer param);
+
+ void glTextureImage1DEXT(@GLuint int texture, @GLenum int target, int level,
+ int internalformat, @GLsizei int width, int border, @GLenum int format, @GLenum int type,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check(value = "GLChecks.calculateTexImage1DStorage(pixels, format, type, width)", canBeNull = true)
+ @Const
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer pixels);
+
+ void glTextureImage2DEXT(@GLuint int texture, @GLenum int target, int level,
+ int internalformat, @GLsizei int width, @GLsizei int height, int border, @GLenum int format, @GLenum int type,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check(value = "GLChecks.calculateTexImage2DStorage(pixels, format, type, width, height)", canBeNull = true)
+ @Const
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer pixels);
+
+ void glTextureSubImage1DEXT(@GLuint int texture, @GLenum int target, int level,
+ int xoffset, @GLsizei int width, @GLenum int format, @GLenum int type,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check("GLChecks.calculateImageStorage(pixels, format, type, width, 1, 1)")
+ @Const
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer pixels);
+
+ void glTextureSubImage2DEXT(@GLuint int texture, @GLenum int target, int level,
+ int xoffset, int yoffset, @GLsizei int width, @GLsizei int height, @GLenum int format, @GLenum int type,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check("GLChecks.calculateImageStorage(pixels, format, type, width, height, 1)")
+ @Const
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer pixels);
+
+ void glCopyTextureImage1DEXT(@GLuint int texture, @GLenum int target, int level, @GLenum int internalformat, int x, int y, @GLsizei int width, int border);
+
+ void glCopyTextureImage2DEXT(@GLuint int texture, @GLenum int target, int level, @GLenum int internalformat, int x, int y, @GLsizei int width, @GLsizei int height, int border);
+
+ void glCopyTextureSubImage1DEXT(@GLuint int texture, @GLenum int target, int level, int xoffset, int x, int y, @GLsizei int width);
+
+ void glCopyTextureSubImage2DEXT(@GLuint int texture, @GLenum int target, int level, int xoffset, int yoffset, int x, int y, @GLsizei int width, @GLsizei int height);
+
+ void glGetTextureImageEXT(@GLuint int texture, @GLenum int target, int level,
+ @GLenum int format, @GLenum int type,
+ @OutParameter
+ @BufferObject(BufferKind.PackPBO)
+ @Check("GLChecks.calculateImageStorage(pixels, format, type, 1, 1, 1)")
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer pixels);
+
+ @StripPostfix("params")
+ void glGetTextureParameterfvEXT(@GLuint int texture, @GLenum int target, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
+
+ @Alternate("glGetTextureParameterfvEXT")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetTextureParameterfvEXT2(@GLuint int texture, @GLenum int target, @GLenum int pname, @OutParameter FloatBuffer params);
+
+ @StripPostfix("params")
+ void glGetTextureParameterivEXT(@GLuint int texture, @GLenum int target, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
+
+ @Alternate("glGetTextureParameterivEXT")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetTextureParameterivEXT2(@GLuint int texture, @GLenum int target, @GLenum int pname, @OutParameter IntBuffer params);
+
+ @StripPostfix("params")
+ void glGetTextureLevelParameterfvEXT(@GLuint int texture, @GLenum int target, int level, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
+
+ @Alternate("glGetTextureLevelParameterfvEXT")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetTextureLevelParameterfvEXT2(@GLuint int texture, @GLenum int target, int level, @GLenum int pname, @OutParameter FloatBuffer params);
+
+ @StripPostfix("params")
+ void glGetTextureLevelParameterivEXT(@GLuint int texture, @GLenum int target, int level, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
+
+ @Alternate("glGetTextureLevelParameterivEXT")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetTextureLevelParameterivEXT2(@GLuint int texture, @GLenum int target, int level, @GLenum int pname, @OutParameter IntBuffer params);
+
+ /*
+ OpenGL 1.2: New 3D texture object commands replace "Tex" in name with
+ "Texture" and adds initial "uint texture" parameter
+ */
+
+ @Dependent("OpenGL12")
+ void glTextureImage3DEXT(@GLuint int texture, @GLenum int target, int level,
+ int internalformat, @GLsizei int width, @GLsizei int height, @GLsizei int depth, int border, @GLenum int format, @GLenum int type,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check(value = "GLChecks.calculateTexImage3DStorage(pixels, format, type, width, height, depth)", canBeNull = true)
+ @Const
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer pixels);
+
+ @Dependent("OpenGL12")
+ void glTextureSubImage3DEXT(@GLuint int texture, @GLenum int target, int level,
+ int xoffset, int yoffset, int zoffset, @GLsizei int width, @GLsizei int height, @GLsizei int depth, @GLenum int format, @GLenum int type,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check("GLChecks.calculateImageStorage(pixels, format, type, width, height, depth)")
+ @Const
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer pixels);
+
+ @Dependent("OpenGL12")
+ void glCopyTextureSubImage3DEXT(@GLuint int texture, @GLenum int target, int level,
+ int xoffset, int yoffset, int zoffset, int x, int y, @GLsizei int width, @GLsizei int height);
+
+ /*
+ OpenGL 1.2.1: New multitexture commands and queries prefix "Multi"
+ before "Tex" and add an initial "enum texunit" parameter (to identify
+ the texture unit
+ */
+
+ @Dependent("OpenGL13")
+ void glBindMultiTextureEXT(@GLenum int texunit, @GLenum int target, @GLuint int texture);
+
+ @Dependent("OpenGL13")
+ @DeprecatedGL
+ void glMultiTexCoordPointerEXT(@GLenum int texunit, int size, @AutoType("pointer") @GLenum int type, @GLsizei int stride,
+ @BufferObject(BufferKind.ArrayVBO)
+ @Check
+ @Const
+ @GLfloat
+ @GLdouble
+ Buffer pointer);
+
+ @Dependent("OpenGL13")
+ @DeprecatedGL
+ void glMultiTexEnvfEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, float param);
+
+ @Dependent("OpenGL13")
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glMultiTexEnvfvEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, @Check("4") @Const FloatBuffer params);
+
+ @Dependent("OpenGL13")
+ @DeprecatedGL
+ void glMultiTexEnviEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, int param);
+
+ @Dependent("OpenGL13")
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glMultiTexEnvivEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, @Check("4") @Const IntBuffer params);
+
+ @Dependent("OpenGL13")
+ @DeprecatedGL
+ void glMultiTexGendEXT(@GLenum int texunit, @GLenum int coord, @GLenum int pname, double param);
+
+ @Dependent("OpenGL13")
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glMultiTexGendvEXT(@GLenum int texunit, @GLenum int coord, @GLenum int pname, @Check("4") @Const DoubleBuffer params);
+
+ @Dependent("OpenGL13")
+ @DeprecatedGL
+ void glMultiTexGenfEXT(@GLenum int texunit, @GLenum int coord, @GLenum int pname, float param);
+
+ @Dependent("OpenGL13")
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glMultiTexGenfvEXT(@GLenum int texunit, @GLenum int coord, @GLenum int pname, @Check("4") @Const FloatBuffer params);
+
+ @Dependent("OpenGL13")
+ @DeprecatedGL
+ void glMultiTexGeniEXT(@GLenum int texunit, @GLenum int coord, @GLenum int pname, int param);
+
+ @Dependent("OpenGL13")
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glMultiTexGenivEXT(@GLenum int texunit, @GLenum int coord, @GLenum int pname, @Check("4") @Const IntBuffer params);
+
+ @Dependent("OpenGL13")
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glGetMultiTexEnvfvEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, @Check("4") @OutParameter FloatBuffer params);
+
+ @Dependent("OpenGL13")
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glGetMultiTexEnvivEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, @Check("4") @OutParameter IntBuffer params);
+
+ @Dependent("OpenGL13")
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glGetMultiTexGendvEXT(@GLenum int texunit, @GLenum int coord, @GLenum int pname, @Check("4") @OutParameter DoubleBuffer params);
+
+ @Dependent("OpenGL13")
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glGetMultiTexGenfvEXT(@GLenum int texunit, @GLenum int coord, @GLenum int pname, @Check("4") @OutParameter FloatBuffer params);
+
+ @Dependent("OpenGL13")
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glGetMultiTexGenivEXT(@GLenum int texunit, @GLenum int coord, @GLenum int pname, @Check("4") @OutParameter IntBuffer params);
+
+ @Dependent("OpenGL13")
+ void glMultiTexParameteriEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, int param);
+
+ @Dependent("OpenGL13")
+ @StripPostfix("param")
+ void glMultiTexParameterivEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, @Check("4") @Const IntBuffer param);
+
+ @Dependent("OpenGL13")
+ void glMultiTexParameterfEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, float param);
+
+ @Dependent("OpenGL13")
+ @StripPostfix("param")
+ void glMultiTexParameterfvEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, @Check("4") @Const FloatBuffer param);
+
+ @Dependent("OpenGL13")
+ void glMultiTexImage1DEXT(@GLenum int texunit, @GLenum int target, int level,
+ int internalformat, @GLsizei int width, int border, @GLenum int format, @GLenum int type,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check(value = "GLChecks.calculateTexImage1DStorage(pixels, format, type, width)", canBeNull = true)
+ @Const
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer pixels);
+
+ @Dependent("OpenGL13")
+ void glMultiTexImage2DEXT(@GLenum int texunit, @GLenum int target, int level,
+ int internalformat, @GLsizei int width, @GLsizei int height, int border, @GLenum int format, @GLenum int type,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check(value = "GLChecks.calculateTexImage2DStorage(pixels, format, type, width, height)", canBeNull = true)
+ @Const
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer pixels);
+
+ @Dependent("OpenGL13")
+ void glMultiTexSubImage1DEXT(@GLenum int texunit, @GLenum int target, int level,
+ int xoffset, @GLsizei int width, @GLenum int format, @GLenum int type,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check("GLChecks.calculateImageStorage(pixels, format, type, width, 1, 1)")
+ @Const
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer pixels);
+
+ @Dependent("OpenGL13")
+ void glMultiTexSubImage2DEXT(@GLenum int texunit, @GLenum int target, int level,
+ int xoffset, int yoffset, @GLsizei int width, @GLsizei int height, @GLenum int format, @GLenum int type,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check("GLChecks.calculateImageStorage(pixels, format, type, width, height, 1)")
+ @Const
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer pixels);
+
+ @Dependent("OpenGL13")
+ void glCopyMultiTexImage1DEXT(@GLenum int texunit, @GLenum int target, int level, @GLenum int internalformat, int x, int y, @GLsizei int width, int border);
+
+ @Dependent("OpenGL13")
+ void glCopyMultiTexImage2DEXT(@GLenum int texunit, @GLenum int target, int level, @GLenum int internalformat, int x, int y, @GLsizei int width, @GLsizei int height, int border);
+
+ @Dependent("OpenGL13")
+ void glCopyMultiTexSubImage1DEXT(@GLenum int texunit, @GLenum int target, int level, int xoffset, int x, int y, @GLsizei int width);
+
+ @Dependent("OpenGL13")
+ void glCopyMultiTexSubImage2DEXT(@GLenum int texunit, @GLenum int target, int level, int xoffset, int yoffset, int x, int y, @GLsizei int width, @GLsizei int height);
+
+ @Dependent("OpenGL13")
+ void glGetMultiTexImageEXT(@GLenum int texunit, @GLenum int target, int level, @GLenum int format, @GLenum int type,
+ @OutParameter
+ @BufferObject(BufferKind.PackPBO)
+ @Check("GLChecks.calculateImageStorage(pixels, format, type, 1, 1, 1)")
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer pixels);
+
+ @Dependent("OpenGL13")
+ @StripPostfix("params")
+ void glGetMultiTexParameterfvEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, @Check("4") @OutParameter FloatBuffer params);
+
+ @Alternate("glGetMultiTexParameterfvEXT")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetMultiTexParameterfvEXT2(@GLenum int texunit, @GLenum int target, @GLenum int pname, @OutParameter FloatBuffer params);
+
+ @Dependent("OpenGL13")
+ @StripPostfix("params")
+ void glGetMultiTexParameterivEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, @Check("4") @OutParameter IntBuffer params);
+
+ @Alternate("glGetMultiTexParameterivEXT")
+ @GLreturn("params")
+ @Dependent("OpenGL13")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetMultiTexParameterivEXT2(@GLenum int texunit, @GLenum int target, @GLenum int pname, @OutParameter IntBuffer params);
+
+ @Dependent("OpenGL13")
+ @StripPostfix("params")
+ void glGetMultiTexLevelParameterfvEXT(@GLenum int texunit, @GLenum int target, int level, @GLenum int pname, @Check("4") @OutParameter FloatBuffer params);
+
+ @Alternate("glGetMultiTexLevelParameterfvEXT")
+ @GLreturn("params")
+ @Dependent("OpenGL13")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetMultiTexLevelParameterfvEXT2(@GLenum int texunit, @GLenum int target, int level, @GLenum int pname, @OutParameter FloatBuffer params);
+
+ @Dependent("OpenGL13")
+ @StripPostfix("params")
+ void glGetMultiTexLevelParameterivEXT(@GLenum int texunit, @GLenum int target, int level, @GLenum int pname, @Check("4") @OutParameter IntBuffer params);
+
+ @Alternate("glGetMultiTexLevelParameterivEXT")
+ @GLreturn("params")
+ @Dependent("OpenGL13")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetMultiTexLevelParameterivEXT2(@GLenum int texunit, @GLenum int target, int level, @GLenum int pname, @OutParameter IntBuffer params);
+
+ @Dependent("OpenGL13")
+ void glMultiTexImage3DEXT(@GLenum int texunit, @GLenum int target, int level,
+ int internalformat, @GLsizei int width, @GLsizei int height, @GLsizei int depth, int border, @GLenum int format, @GLenum int type,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check(value = "GLChecks.calculateTexImage3DStorage(pixels, format, type, width, height, depth)", canBeNull = true)
+ @Const
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer pixels);
+
+ @Dependent("OpenGL13")
+ void glMultiTexSubImage3DEXT(@GLenum int texunit, @GLenum int target, int level,
+ int xoffset, int yoffset, int zoffset, @GLsizei int width, @GLsizei int height, @GLsizei int depth, @GLenum int format, @GLenum int type,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check("GLChecks.calculateImageStorage(pixels, format, type, width, height, depth)")
+ @Const
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer pixels);
+
+ @Dependent("OpenGL13")
+ void glCopyMultiTexSubImage3DEXT(@GLenum int texunit, @GLenum int target, int level, int xoffset, int yoffset, int zoffset, int x, int y, @GLsizei int width, @GLsizei int height);
+
+ /*
+ OpenGL 1.2.1: New indexed texture commands and queries append
+ "Indexed" to name and add "uint index" parameter (to identify the
+ texture unit index) after state name parameters (if any) and before
+ state value parameters
+ */
+
+ @Dependent("OpenGL13")
+ @DeprecatedGL
+ void glEnableClientStateIndexedEXT(@GLenum int array, @GLuint int index);
+
+ @Dependent("OpenGL13")
+ @DeprecatedGL
+ void glDisableClientStateIndexedEXT(@GLenum int array, @GLuint int index);
+
+ /*
+ OpenGL 3.0: New indexed texture commands and queries append "i"
+ to name and add "uint index" parameter (to identify the texture
+ unit index) after state name parameters (if any) and before state
+ value parameters
+ */
+
+ @Optional(reason = "AMD does not expose this (last driver checked: 10.3)")
+ @Dependent("OpenGL30")
+ void glEnableClientStateiEXT(@GLenum int array, @GLuint int index);
+
+ @Optional(reason = "AMD does not expose this (last driver checked: 10.3)")
+ @Dependent("OpenGL30")
+ void glDisableClientStateiEXT(@GLenum int array, @GLuint int index);
+
+ /*
+ OpenGL 1.2.1: New indexed generic queries (added for indexed texture
+ state) append "Indexed" to name and add "uint index" parameter
+ (to identify the texture unit) after state name parameters (if any)
+ and before state value parameters
+ */
+
+ @Dependent("OpenGL13")
+ @StripPostfix("params")
+ void glGetFloatIndexedvEXT(@GLenum int pname, @GLuint int index, @OutParameter @Check("16") FloatBuffer params);
+
+ @Alternate("glGetFloatIndexedvEXT")
+ @GLreturn("params")
+ @Dependent("OpenGL13")
+ @StripPostfix("params")
+ void glGetFloatIndexedvEXT2(@GLenum int pname, @GLuint int index, @OutParameter FloatBuffer params);
+
+ @Dependent("OpenGL13")
+ @StripPostfix(value = "params", hasPostfix = false)
+ void glGetDoubleIndexedvEXT(@GLenum int pname, @GLuint int index, @OutParameter @Check("16") DoubleBuffer params);
+
+ @Alternate("glGetDoubleIndexedvEXT")
+ @GLreturn("params")
+ @Dependent("OpenGL13")
+ @StripPostfix(value = "params", hasPostfix = false)
+ void glGetDoubleIndexedvEXT2(@GLenum int pname, @GLuint int index, @OutParameter DoubleBuffer params);
+
+ @Dependent("OpenGL13")
+ @StripPostfix("params")
+ void glGetPointerIndexedvEXT(@GLenum int pname, @GLuint int index, @Result @GLvoid ByteBuffer params);
+
+ /*
+ OpenGL 3.0: New indexed generic queries (added for indexed texture
+ state) replace "v" for "i_v" to name and add "uint index" parameter
+ (to identify the texture unit) after state name parameters (if any)
+ and before state value parameters
+ */
+
+ @Optional(reason = "AMD does not expose this (last driver checked: 10.3)")
+ @Dependent("OpenGL30")
+ @StripPostfix("params")
+ void glGetFloati_vEXT(@GLenum int pname, @GLuint int index, @OutParameter @Check("16") FloatBuffer params);
+
+ @Alternate("glGetFloati_vEXT")
+ @GLreturn("params")
+ @Dependent("OpenGL30")
+ @StripPostfix("params")
+ void glGetFloati_vEXT2(@GLenum int pname, @GLuint int index, @OutParameter FloatBuffer params);
+
+ @Optional(reason = "AMD does not expose this (last driver checked: 10.3)")
+ @Dependent("OpenGL30")
+ @StripPostfix("params")
+ void glGetDoublei_vEXT(@GLenum int pname, @GLuint int index, @OutParameter @Check("16") DoubleBuffer params);
+
+ @Alternate("glGetDoublei_vEXT")
+ @GLreturn("params")
+ @Dependent("OpenGL30")
+ @StripPostfix("params")
+ void glGetDoublei_vEXT2(@GLenum int pname, @GLuint int index, @OutParameter DoubleBuffer params);
+
+ @Optional(reason = "AMD does not expose this (last driver checked: 10.3)")
+ @Dependent("OpenGL30")
+ @StripPostfix(value = "params", hasPostfix = false)
+ void glGetPointeri_vEXT(@GLenum int pname, @GLuint int index, @Result @GLvoid ByteBuffer params);
+
+ /*
+ OpenGL 1.2.1: Extend the functionality of these EXT_draw_buffers2
+ commands and queries for multitexture
+ TODO: Why 1.2.1 and not EXT_draw_buffers2?
+ */
+
+ @Dependent("GL_EXT_draw_buffers2")
+ void glEnableIndexedEXT(@GLenum int cap, @GLuint int index);
+
+ @Dependent("GL_EXT_draw_buffers2")
+ void glDisableIndexedEXT(@GLenum int cap, @GLuint int index);
+
+ @Dependent("GL_EXT_draw_buffers2")
+ boolean glIsEnabledIndexedEXT(@GLenum int cap, @GLuint int index);
+
+ @Dependent("GL_EXT_draw_buffers2")
+ @StripPostfix("params")
+ void glGetIntegerIndexedvEXT(@GLenum int pname, @GLuint int index, @OutParameter @Check("16") IntBuffer params);
+
+ @Alternate("glGetIntegerIndexedvEXT")
+ @GLreturn("params")
+ @Dependent("GL_EXT_draw_buffers2")
+ @StripPostfix("params")
+ void glGetIntegerIndexedvEXT2(@GLenum int pname, @GLuint int index, @OutParameter IntBuffer params);
+
+ @Dependent("GL_EXT_draw_buffers2")
+ @StripPostfix("params")
+ void glGetBooleanIndexedvEXT(@GLenum int pname, @GLuint int index, @OutParameter @Check("16") @GLboolean ByteBuffer params);
+
+ @Alternate("glGetBooleanIndexedvEXT")
+ @GLreturn("params")
+ @Dependent("GL_EXT_draw_buffers2")
+ @StripPostfix("params")
+ void glGetBooleanIndexedvEXT2(@GLenum int pname, @GLuint int index, @OutParameter @GLboolean ByteBuffer params);
+
+ /*
+ ARB_vertex_program: New program commands and queries add "Named"
+ prefix to name and adds initial "uint program" parameter
+ */
+
+ @Dependent("GL_ARB_vertex_program")
+ void glNamedProgramStringEXT(@GLuint int program, @GLenum int target, @GLenum int format, @AutoSize("string") @GLsizei int len, @Const @GLvoid Buffer string);
+
+ @Alternate("glNamedProgramStringEXT")
+ @Dependent("GL_ARB_vertex_program")
+ void glNamedProgramStringEXT(@GLuint int program, @GLenum int target, @GLenum int format, @Constant("string.length()") @GLsizei int length, CharSequence string);
+
+ @Dependent("GL_ARB_vertex_program")
+ void glNamedProgramLocalParameter4dEXT(@GLuint int program, @GLenum int target, @GLuint int index, double x, double y, double z, double w);
+
+ @Dependent("GL_ARB_vertex_program")
+ @StripPostfix("params")
+ void glNamedProgramLocalParameter4dvEXT(@GLuint int program, @GLenum int target, @GLuint int index, @Const @Check("4") DoubleBuffer params);
+
+ @Dependent("GL_ARB_vertex_program")
+ void glNamedProgramLocalParameter4fEXT(@GLuint int program, @GLenum int target, @GLuint int index, float x, float y, float z, float w);
+
+ @Dependent("GL_ARB_vertex_program")
+ @StripPostfix("params")
+ void glNamedProgramLocalParameter4fvEXT(@GLuint int program, @GLenum int target, @GLuint int index, @Const @Check("4") FloatBuffer params);
+
+ @Dependent("GL_ARB_vertex_program")
+ @StripPostfix("params")
+ void glGetNamedProgramLocalParameterdvEXT(@GLuint int program, @GLenum int target, @GLuint int index, @OutParameter @Check("4") DoubleBuffer params);
+
+ @Dependent("GL_ARB_vertex_program")
+ @StripPostfix("params")
+ void glGetNamedProgramLocalParameterfvEXT(@GLuint int program, @GLenum int target, @GLuint int index, @OutParameter @Check("4") FloatBuffer params);
+
+ @Dependent("GL_ARB_vertex_program")
+ @StripPostfix("params")
+ void glGetNamedProgramivEXT(@GLuint int program, @GLenum int target, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
+
+ @Alternate("glGetNamedProgramivEXT")
+ @GLreturn("params")
+ @Dependent("GL_ARB_vertex_program")
+ @StripPostfix("params")
+ void glGetNamedProgramivEXT2(@GLuint int program, @GLenum int target, @GLenum int pname, @OutParameter IntBuffer params);
+
+ @Dependent("GL_ARB_vertex_program")
+ void glGetNamedProgramStringEXT(@GLuint int program, @GLenum int target, @GLenum int pname, @OutParameter @Check @GLvoid ByteBuffer string);
+
+ @Alternate("glGetNamedProgramStringEXT")
+ @Code("\t\tint programLength = glGetNamedProgramEXT(program, target, ARBProgram.GL_PROGRAM_LENGTH_ARB);")
+ @GLreturn(value = "paramString", maxLength = "programLength", forceMaxLength = true)
+ void glGetNamedProgramStringEXT2(@GLuint int program, @GLenum int target, @GLenum int pname, @OutParameter @GLchar ByteBuffer paramString);
+
+ /*
+ OpenGL 1.3: New compressed texture object commands replace "Tex"
+ in name with "Texture" and add initial "uint texture" parameter
+ */
+
+ @Dependent("OpenGL13")
+ void glCompressedTextureImage3DEXT(@GLuint int texture, @GLenum int target, int level,
+ @GLenum int internalformat, @GLsizei int width, @GLsizei int height, @GLsizei int depth, int border, @AutoSize("data") @GLsizei int imageSize,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check
+ @Const
+ @GLvoid
+ ByteBuffer data);
+
+ @Dependent("OpenGL13")
+ void glCompressedTextureImage2DEXT(@GLuint int texture, @GLenum int target, int level,
+ @GLenum int internalformat, @GLsizei int width, @GLsizei int height, int border, @AutoSize("data") @GLsizei int imageSize,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check
+ @Const
+ @GLvoid
+ ByteBuffer data);
+
+ @Dependent("OpenGL13")
+ void glCompressedTextureImage1DEXT(@GLuint int texture, @GLenum int target, int level,
+ @GLenum int internalformat, @GLsizei int width, int border, @AutoSize("data") @GLsizei int imageSize,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check
+ @Const
+ @GLvoid
+ ByteBuffer data);
+
+ @Dependent("OpenGL13")
+ void glCompressedTextureSubImage3DEXT(@GLuint int texture, @GLenum int target, int level,
+ int xoffset, int yoffset, int zoffset, @GLsizei int width, @GLsizei int height, @GLsizei int depth,
+ @GLenum int format, @AutoSize("data") @GLsizei int imageSize,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check
+ @Const
+ @GLvoid
+ ByteBuffer data);
+
+ @Dependent("OpenGL13")
+ void glCompressedTextureSubImage2DEXT(@GLuint int texture, @GLenum int target, int level,
+ int xoffset, int yoffset, @GLsizei int width, @GLsizei int height, @GLenum int format, @AutoSize("data") @GLsizei int imageSize,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check
+ @Const
+ @GLvoid
+ ByteBuffer data);
+
+ @Dependent("OpenGL13")
+ void glCompressedTextureSubImage1DEXT(@GLuint int texture, @GLenum int target, int level,
+ int xoffset, @GLsizei int width, @GLenum int format, @AutoSize("data") @GLsizei int imageSize,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check
+ @Const
+ @GLvoid
+ ByteBuffer data);
+
+ @Dependent("OpenGL13")
+ void glGetCompressedTextureImageEXT(@GLuint int texture, @GLenum int target, int level,
+ @OutParameter
+ @BufferObject(BufferKind.PackPBO)
+ @Check
+ @GLbyte
+ @GLshort
+ @GLint Buffer img);
+
+ /*
+ OpenGL 1.3: New multitexture compressed texture commands and queries
+ prefix "Multi" before "Tex" and add an initial "enum texunit"
+ parameter (to identify the texture unit)
+ */
+
+ @Dependent("OpenGL13")
+ void glCompressedMultiTexImage3DEXT(@GLenum int texunit, @GLenum int target, int level,
+ @GLenum int internalformat, @GLsizei int width, @GLsizei int height, @GLsizei int depth, int border, @AutoSize("data") @GLsizei int imageSize,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check
+ @Const
+ @GLvoid
+ ByteBuffer data);
+
+ @Dependent("OpenGL13")
+ void glCompressedMultiTexImage2DEXT(@GLenum int texunit, @GLenum int target, int level,
+ @GLenum int internalformat, @GLsizei int width, @GLsizei int height, int border, @AutoSize("data") @GLsizei int imageSize,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check
+ @Const
+ @GLvoid
+ ByteBuffer data);
+
+ @Dependent("OpenGL13")
+ void glCompressedMultiTexImage1DEXT(@GLenum int texunit, @GLenum int target, int level,
+ @GLenum int internalformat, @GLsizei int width, int border, @AutoSize("data") @GLsizei int imageSize,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check
+ @Const
+ @GLvoid
+ ByteBuffer data);
+
+ @Dependent("OpenGL13")
+ void glCompressedMultiTexSubImage3DEXT(@GLenum int texunit, @GLenum int target, int level,
+ int xoffset, int yoffset, int zoffset, @GLsizei int width, @GLsizei int height, @GLsizei int depth,
+ @GLenum int format, @AutoSize("data") @GLsizei int imageSize,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check
+ @Const
+ @GLvoid
+ ByteBuffer data);
+
+ @Dependent("OpenGL13")
+ void glCompressedMultiTexSubImage2DEXT(@GLenum int texunit, @GLenum int target, int level,
+ int xoffset, int yoffset, @GLsizei int width, @GLsizei int height, @GLenum int format, @AutoSize("data") @GLsizei int imageSize,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check
+ @Const
+ @GLvoid
+ ByteBuffer data);
+
+ @Dependent("OpenGL13")
+ void glCompressedMultiTexSubImage1DEXT(@GLenum int texunit, @GLenum int target, int level,
+ int xoffset, @GLsizei int width, @GLenum int format, @AutoSize("data") @GLsizei int imageSize,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check
+ @Const
+ @GLvoid
+ ByteBuffer data);
+
+ @Dependent("OpenGL13")
+ void glGetCompressedMultiTexImageEXT(@GLenum int texunit, @GLenum int target, int level,
+ @OutParameter
+ @BufferObject(BufferKind.PackPBO)
+ @Check
+ @GLbyte
+ @GLshort
+ @GLint Buffer img);
+
+ @Dependent("OpenGL13")
+ void glGetCompressedTexImage(@GLenum int target, int lod,
+ @OutParameter
+ @BufferObject(BufferKind.PackPBO)
+ @Check
+ @GLbyte
+ @GLshort
+ @GLint Buffer img);
+
+ /*
+ OpenGL 1.3: New transpose matrix commands add "Matrix" suffix
+ to name, drops "Matrix" suffix from name, and add initial "enum
+ matrixMode" parameter
+ */
+
+ @Dependent("OpenGL13")
+ @StripPostfix("m")
+ @DeprecatedGL
+ void glMatrixLoadTransposefEXT(@GLenum int matrixMode, @Check("16") @Const FloatBuffer m);
+
+ @Dependent("OpenGL13")
+ @StripPostfix("m")
+ @DeprecatedGL
+ void glMatrixLoadTransposedEXT(@GLenum int matrixMode, @Check("16") @Const DoubleBuffer m);
+
+ @Dependent("OpenGL13")
+ @StripPostfix("m")
+ @DeprecatedGL
+ void glMatrixMultTransposefEXT(@GLenum int matrixMode, @Check("16") @Const FloatBuffer m);
+
+ @Dependent("OpenGL13")
+ @StripPostfix("m")
+ @DeprecatedGL
+ void glMatrixMultTransposedEXT(@GLenum int matrixMode, @Check("16") @Const DoubleBuffer m);
+
+ /*
+ OpenGL 1.5: New buffer commands and queries replace "Buffer" with
+ "NamedBuffer" in name and replace "enum target" parameter with
+ "uint buffer"
+ */
+
+ @Dependent("OpenGL15")
+ @GenerateAutos
+ void glNamedBufferDataEXT(@GLuint int buffer, @AutoSize("data") @GLsizeiptr long size,
+ @Const
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer data, @GLenum int usage);
+
+ @Dependent("OpenGL15")
+ void glNamedBufferSubDataEXT(@GLuint int buffer, @GLintptr long offset, @AutoSize("data") @GLsizeiptr long size,
+ @Check
+ @Const
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer data);
+
+ /**
+ * glMapNamedBufferEXT maps a GL buffer object to a ByteBuffer. The old_buffer argument can be null,
+ * in which case a new ByteBuffer will be created, pointing to the returned memory. If old_buffer is non-null,
+ * it will be returned if it points to the same mapped memory and has the same capacity as the buffer object,
+ * otherwise a new ByteBuffer is created. That way, an application will normally use glMapNamedBufferEXT like this:
+ * <p/>
+ * ByteBuffer mapped_buffer; mapped_buffer = glMapNamedBufferEXT(..., ..., null); ... // Another map on the same buffer mapped_buffer = glMapNamedBufferEXT(..., ..., mapped_buffer);
+ * <p/>
+ * Only ByteBuffers returned from this method are to be passed as the old_buffer argument. User-created ByteBuffers cannot be reused.
+ * <p/>
+ * The version of this method without an explicit length argument calls glGetNamedBufferParameterEXT internally to
+ * retrieve the current buffer object size, which may cause a pipeline flush and reduce application performance.
+ * <p/>
+ * The version of this method with an explicit length argument is a fast alternative to the one without. No GL call
+ * is made to retrieve the buffer object size, so the user is responsible for tracking and using the appropriate length.<br>
+ * Security warning: The length argument should match the buffer object size. Reading from or writing to outside
+ * the memory region that corresponds to the mapped buffer object will cause native crashes.
+ *
+ * @param length the length of the mapped memory in bytes.
+ * @param old_buffer A ByteBuffer. If this argument points to the same address and has the same capacity as the new mapping, it will be returned and no new buffer will be created.
+ *
+ * @return A ByteBuffer representing the mapped buffer memory.
+ */
+ @Dependent("OpenGL15")
+ @CachedResult
+ @GLvoid
+ @AutoResultSize("GLChecks.getNamedBufferObjectSize(caps, buffer)")
+ ByteBuffer glMapNamedBufferEXT(@GLuint int buffer, @GLenum int access);
+
+ @Dependent("OpenGL15")
+ boolean glUnmapNamedBufferEXT(@GLuint int buffer);
+
+ @Dependent("OpenGL15")
+ @StripPostfix("params")
+ void glGetNamedBufferParameterivEXT(@GLuint int buffer, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
+
+ @Alternate("glGetNamedBufferParameterivEXT")
+ @GLreturn("params")
+ @Dependent("OpenGL15")
+ @StripPostfix("params")
+ void glGetNamedBufferParameterivEXT2(@GLuint int buffer, @GLenum int pname, @OutParameter IntBuffer params);
+
+ @Dependent("OpenGL15")
+ @StripPostfix("params")
+ @AutoResultSize("GLChecks.getNamedBufferObjectSize(caps, buffer)")
+ void glGetNamedBufferPointervEXT(@GLuint int buffer, @GLenum int pname, @OutParameter @Result @GLvoid ByteBuffer params);
+
+ @Dependent("OpenGL15")
+ void glGetNamedBufferSubDataEXT(@GLuint int buffer, @GLintptr long offset, @AutoSize("data") @GLsizeiptr long size,
+ @OutParameter
+ @Check
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer data);
+
+ /*
+ OpenGL 2.0: New uniform commands add "Program" prefix to name and
+ add initial "uint program" parameter
+ */
+
+ @Dependent("OpenGL20")
+ void glProgramUniform1fEXT(@GLuint int program, int location, float v0);
+
+ @Dependent("OpenGL20")
+ void glProgramUniform2fEXT(@GLuint int program, int location, float v0, float v1);
+
+ @Dependent("OpenGL20")
+ void glProgramUniform3fEXT(@GLuint int program, int location, float v0, float v1, float v2);
+
+ @Dependent("OpenGL20")
+ void glProgramUniform4fEXT(@GLuint int program, int location, float v0, float v1, float v2, float v3);
+
+ @Dependent("OpenGL20")
+ void glProgramUniform1iEXT(@GLuint int program, int location, int v0);
+
+ @Dependent("OpenGL20")
+ void glProgramUniform2iEXT(@GLuint int program, int location, int v0, int v1);
+
+ @Dependent("OpenGL20")
+ void glProgramUniform3iEXT(@GLuint int program, int location, int v0, int v1, int v2);
+
+ @Dependent("OpenGL20")
+ void glProgramUniform4iEXT(@GLuint int program, int location, int v0, int v1, int v2, int v3);
+
+ @Dependent("OpenGL20")
+ @StripPostfix("value")
+ void glProgramUniform1fvEXT(@GLuint int program, int location, @AutoSize(value = "value") @GLsizei int count, @Const FloatBuffer value);
+
+ @Dependent("OpenGL20")
+ @StripPostfix("value")
+ void glProgramUniform2fvEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " >> 1") @GLsizei int count, @Const FloatBuffer value);
+
+ @Dependent("OpenGL20")
+ @StripPostfix("value")
+ void glProgramUniform3fvEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " / 3") @GLsizei int count, @Const FloatBuffer value);
+
+ @Dependent("OpenGL20")
+ @StripPostfix("value")
+ void glProgramUniform4fvEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " >> 2") @GLsizei int count, @Const FloatBuffer value);
+
+ @Dependent("OpenGL20")
+ @StripPostfix("value")
+ void glProgramUniform1ivEXT(@GLuint int program, int location, @AutoSize(value = "value") @GLsizei int count, @Const IntBuffer value);
+
+ @Dependent("OpenGL20")
+ @StripPostfix("value")
+ void glProgramUniform2ivEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " >> 1") @GLsizei int count, @Const IntBuffer value);
+
+ @Dependent("OpenGL20")
+ @StripPostfix("value")
+ void glProgramUniform3ivEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " / 3") @GLsizei int count, @Const IntBuffer value);
+
+ @Dependent("OpenGL20")
+ @StripPostfix("value")
+ void glProgramUniform4ivEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " >> 2") @GLsizei int count, @Const IntBuffer value);
+
+ @Dependent("OpenGL20")
+ @StripPostfix("value")
+ void glProgramUniformMatrix2fvEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " >> 2") @GLsizei int count, boolean transpose, @Const FloatBuffer value);
+
+ @Dependent("OpenGL20")
+ @StripPostfix("value")
+ void glProgramUniformMatrix3fvEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " / (3 * 3)") @GLsizei int count, boolean transpose, @Const FloatBuffer value);
+
+ @Dependent("OpenGL20")
+ @StripPostfix("value")
+ void glProgramUniformMatrix4fvEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " >> 4") @GLsizei int count, boolean transpose, @Const FloatBuffer value);
+
+ /*
+ OpenGL 2.1: New uniform matrix commands add "Program" prefix to
+ name and add initial "uint program" parameter
+ */
+
+ @Dependent("OpenGL21")
+ @StripPostfix("value")
+ void glProgramUniformMatrix2x3fvEXT(@GLuint int program, int location,
+ @AutoSize(value = "value", expression = " / (2 * 3)") @GLsizei int count, boolean transpose, @Const FloatBuffer value);
+
+ @Dependent("OpenGL21")
+ @StripPostfix("value")
+ void glProgramUniformMatrix3x2fvEXT(@GLuint int program, int location,
+ @AutoSize(value = "value", expression = " / (3 * 2)") @GLsizei int count, boolean transpose, @Const FloatBuffer value);
+
+ @Dependent("OpenGL21")
+ @StripPostfix("value")
+ void glProgramUniformMatrix2x4fvEXT(@GLuint int program, int location,
+ @AutoSize(value = "value", expression = " >> 3") @GLsizei int count, boolean transpose, @Const FloatBuffer value);
+
+ @Dependent("OpenGL21")
+ @StripPostfix("value")
+ void glProgramUniformMatrix4x2fvEXT(@GLuint int program, int location,
+ @AutoSize(value = "value", expression = " >> 3") @GLsizei int count, boolean transpose, @Const FloatBuffer value);
+
+ @Dependent("OpenGL21")
+ @StripPostfix("value")
+ void glProgramUniformMatrix3x4fvEXT(@GLuint int program, int location,
+ @AutoSize(value = "value", expression = " / (3 * 4)") @GLsizei int count, boolean transpose, @Const FloatBuffer value);
+
+ @Dependent("OpenGL21")
+ @StripPostfix("value")
+ void glProgramUniformMatrix4x3fvEXT(@GLuint int program, int location,
+ @AutoSize(value = "value", expression = " / (4 * 3)") @GLsizei int count, boolean transpose, @Const FloatBuffer value);
+
+ /*
+ EXT_texture_buffer_object: New texture buffer object command
+ replaces "Tex" in name with "Texture" and adds initial "uint texture"
+ parameter
+ */
+
+ @Dependent("GL_EXT_texture_buffer_object")
+ void glTextureBufferEXT(@GLuint int texture, @GLenum int target, @GLenum int internalformat, @GLuint int buffer);
+
+ /*
+ EXT_texture_buffer_object: New multitexture texture buffer command
+ prefixes "Multi" before "Tex" and add an initial "enum texunit"
+ parameter (to identify the texture unit)
+ */
+
+ @Dependent("GL_EXT_texture_buffer_object")
+ void glMultiTexBufferEXT(@GLenum int texunit, @GLenum int target, @GLenum int internalformat, @GLuint int buffer);
+
+ /*
+ EXT_texture_integer: New integer texture object commands and queries
+ replace "Tex" in name with "Texture" and add initial "uint texture"
+ parameter
+ */
+
+ @Dependent("GL_EXT_texture_integer")
+ @StripPostfix("params")
+ void glTextureParameterIivEXT(@GLuint int texture, @GLenum int target, @GLenum int pname, @Check("4") @Const IntBuffer params);
+
+ @Alternate("glTextureParameterIivEXT")
+ @Dependent("GL_EXT_texture_integer")
+ @StripPostfix("param")
+ void glTextureParameterIivEXT(@GLuint int texture, @GLenum int target, @GLenum int pname, @Constant(value = "APIUtils.getBufferInt().put(0, param), 0", keepParam = true) int param);
+
+ @Dependent("GL_EXT_texture_integer")
+ @StripPostfix("params")
+ void glTextureParameterIuivEXT(@GLuint int texture, @GLenum int target, @GLenum int pname, @Check("4") @Const @GLuint IntBuffer params);
+
+ @Alternate("glTextureParameterIuivEXT")
+ @Dependent("GL_EXT_texture_integer")
+ @StripPostfix("param")
+ void glTextureParameterIuivEXT(@GLuint int texture, @GLenum int target, @GLenum int pname, @Constant(value = "APIUtils.getBufferInt().put(0, param), 0", keepParam = true) @GLuint int param);
+
+ @Dependent("GL_EXT_texture_integer")
+ @StripPostfix("params")
+ void glGetTextureParameterIivEXT(@GLuint int texture, @GLenum int target, @GLenum int pname, @Check("4") @OutParameter IntBuffer params);
+
+ @Alternate("glGetTextureParameterIivEXT")
+ @GLreturn("params")
+ @Dependent("GL_EXT_texture_integer")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetTextureParameterIivEXT2(@GLuint int texture, @GLenum int target, @GLenum int pname, @OutParameter IntBuffer params);
+
+ @Dependent("GL_EXT_texture_integer")
+ @StripPostfix("params")
+ void glGetTextureParameterIuivEXT(@GLuint int texture, @GLenum int target, @GLenum int pname, @Check("4") @OutParameter @GLuint IntBuffer params);
+
+ @Alternate("glGetTextureParameterIuivEXT")
+ @GLreturn("params")
+ @Dependent("GL_EXT_texture_integer")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetTextureParameterIuivEXT2(@GLuint int texture, @GLenum int target, @GLenum int pname, @OutParameter @GLuint IntBuffer params);
+
+ /*
+ EXT_texture_integer: New multitexture integer texture commands and
+ queries prefix "Multi" before "Tex" and add an initial "enum texunit"
+ parameter (to identify the texture unit)
+ */
+
+ @Dependent("GL_EXT_texture_integer")
+ @StripPostfix("params")
+ void glMultiTexParameterIivEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, @Check("4") @Const IntBuffer params);
+
+ @Alternate("glMultiTexParameterIivEXT")
+ @Dependent("GL_EXT_texture_integer")
+ @StripPostfix("param")
+ void glMultiTexParameterIivEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, @Constant(value = "APIUtils.getBufferInt().put(0, param), 0", keepParam = true) int param);
+
+ @Dependent("GL_EXT_texture_integer")
+ @StripPostfix("params")
+ void glMultiTexParameterIuivEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, @Check("4") @Const @GLuint IntBuffer params);
+
+ @Alternate("glMultiTexParameterIuivEXT")
+ @Dependent("GL_EXT_texture_integer")
+ @StripPostfix("param")
+ void glMultiTexParameterIuivEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, @Constant(value = "APIUtils.getBufferInt().put(0, param), 0", keepParam = true) int param);
+
+ @Dependent("GL_EXT_texture_integer")
+ @StripPostfix("params")
+ void glGetMultiTexParameterIivEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, @Check("4") @OutParameter IntBuffer params);
+
+ @Alternate("glGetMultiTexParameterIivEXT")
+ @GLreturn("params")
+ @Dependent("GL_EXT_texture_integer")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetMultiTexParameterIivEXT2(@GLenum int texunit, @GLenum int target, @GLenum int pname, @OutParameter IntBuffer params);
+
+ @Dependent("GL_EXT_texture_integer")
+ @StripPostfix("params")
+ void glGetMultiTexParameterIuivEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, @Check("4") @OutParameter @GLuint IntBuffer params);
+
+ @Alternate("glGetMultiTexParameterIuivEXT")
+ @GLreturn("params")
+ @Dependent("GL_EXT_texture_integer")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetMultiTexParameterIuivEXT2(@GLenum int texunit, @GLenum int target, @GLenum int pname, @OutParameter @GLuint IntBuffer params);
+
+ /*
+ EXT_gpu_shader4: New integer uniform commands add "Program" prefix
+ to name and add initial "uint program" parameter
+ */
+
+ @Dependent("GL_EXT_gpu_shader4")
+ void glProgramUniform1uiEXT(@GLuint int program, int location, @GLuint int v0);
+
+ @Dependent("GL_EXT_gpu_shader4")
+ void glProgramUniform2uiEXT(@GLuint int program, int location, @GLuint int v0, @GLuint int v1);
+
+ @Dependent("GL_EXT_gpu_shader4")
+ void glProgramUniform3uiEXT(@GLuint int program, int location, @GLuint int v0, @GLuint int v1, @GLuint int v2);
+
+ @Dependent("GL_EXT_gpu_shader4")
+ void glProgramUniform4uiEXT(@GLuint int program, int location, @GLuint int v0, @GLuint int v1, @GLuint int v2, @GLuint int v3);
+
+ @Dependent("GL_EXT_gpu_shader4")
+ @StripPostfix("value")
+ void glProgramUniform1uivEXT(@GLuint int program, int location, @AutoSize(value = "value") @GLsizei int count, @Const @GLuint IntBuffer value);
+
+ @Dependent("GL_EXT_gpu_shader4")
+ @StripPostfix("value")
+ void glProgramUniform2uivEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " >> 1") @GLsizei int count, @Const @GLuint IntBuffer value);
+
+ @Dependent("GL_EXT_gpu_shader4")
+ @StripPostfix("value")
+ void glProgramUniform3uivEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " / 3") @GLsizei int count, @Const @GLuint IntBuffer value);
+
+ @Dependent("GL_EXT_gpu_shader4")
+ @StripPostfix("value")
+ void glProgramUniform4uivEXT(@GLuint int program, int location, @AutoSize(value = "value", expression = " >> 2") @GLsizei int count, @Const @GLuint IntBuffer value);
+
+ /*
+ EXT_gpu_program_parameters: New program command adds "Named" prefix
+ to name and adds "uint program" parameter
+ */
+
+ @Dependent("GL_EXT_gpu_program_parameters")
+ @StripPostfix("params")
+ void glNamedProgramLocalParameters4fvEXT(@GLuint int program, @GLenum int target, @GLuint int index,
+ @AutoSize(value = "params", expression = " >> 2") @GLsizei int count, @Const FloatBuffer params);
+
+ /*
+ NV_gpu_program4: New program commands and queries add "Named"
+ prefix to name and replace "enum target" with "uint program"
+ */
+
+ @Dependent("GL_NV_gpu_program4")
+ void glNamedProgramLocalParameterI4iEXT(@GLuint int program, @GLenum int target, @GLuint int index, int x, int y, int z, int w);
+
+ @Dependent("GL_NV_gpu_program4")
+ @StripPostfix("params")
+ void glNamedProgramLocalParameterI4ivEXT(@GLuint int program, @GLenum int target, @GLuint int index, @Check("4") @Const IntBuffer params);
+
+ @Dependent("GL_NV_gpu_program4")
+ @StripPostfix("params")
+ void glNamedProgramLocalParametersI4ivEXT(@GLuint int program, @GLenum int target, @GLuint int index,
+ @AutoSize(value = "params", expression = " >> 2") @GLsizei int count, @Const IntBuffer params);
+
+ @Dependent("GL_NV_gpu_program4")
+ void glNamedProgramLocalParameterI4uiEXT(@GLuint int program, @GLenum int target, @GLuint int index, @GLuint int x, @GLuint int y, @GLuint int z, @GLuint int w);
+
+ @Dependent("GL_NV_gpu_program4")
+ @StripPostfix("params")
+ void glNamedProgramLocalParameterI4uivEXT(@GLuint int program, @GLenum int target, @GLuint int index, @Check("4") @Const @GLuint IntBuffer params);
+
+ @Dependent("GL_NV_gpu_program4")
+ @StripPostfix("params")
+ void glNamedProgramLocalParametersI4uivEXT(@GLuint int program, @GLenum int target, @GLuint int index,
+ @AutoSize(value = "params", expression = " >> 2") @GLsizei int count, @Const @GLuint IntBuffer params);
+
+ @Dependent("GL_NV_gpu_program4")
+ @StripPostfix("params")
+ void glGetNamedProgramLocalParameterIivEXT(@GLuint int program, @GLenum int target, @GLuint int index, @Check("4") @OutParameter IntBuffer params);
+
+ @Dependent("GL_NV_gpu_program4")
+ @StripPostfix("params")
+ void glGetNamedProgramLocalParameterIuivEXT(@GLuint int program, @GLenum int target, @GLuint int index, @Check("4") @OutParameter @GLuint IntBuffer params);
+
+ /*
+ OpenGL 3.0: New renderbuffer commands add "Named" prefix to name
+ and replace "enum target" with "uint renderbuffer"
+ */
+
+ @Dependent("OpenGL30,GL_EXT_framebuffer_object")
+ void glNamedRenderbufferStorageEXT(@GLuint int renderbuffer, @GLenum int internalformat, @GLsizei int width, @GLsizei int height);
+
+ @Dependent("OpenGL30,GL_EXT_framebuffer_object")
+ @StripPostfix("params")
+ void glGetNamedRenderbufferParameterivEXT(@GLuint int renderbuffer, @GLenum int pname, @Check("4") @OutParameter IntBuffer params);
+
+ @Alternate("glGetNamedRenderbufferParameterivEXT")
+ @GLreturn("params")
+ @Dependent("OpenGL30,GL_EXT_framebuffer_object")
+ @StripPostfix("params")
+ void glGetNamedRenderbufferParameterivEXT2(@GLuint int renderbuffer, @GLenum int pname, @OutParameter IntBuffer params);
+
+ /*
+ EXT_framebuffer_multisample: New renderbuffer commands add "Named"
+ prefix to name and replace "enum target" with "uint renderbuffer"
+ */
+
+ @Dependent("OpenGL30,GL_EXT_framebuffer_multisample")
+ void glNamedRenderbufferStorageMultisampleEXT(@GLuint int renderbuffer, @GLsizei int samples, @GLenum int internalformat, @GLsizei int width, @GLsizei int height);
+
+ /*
+ NV_framebuffer_multisample_coverage: New renderbuffer commands
+ add "Named" prefix to name and replace "enum target" with "uint
+ renderbuffer"
+ */
+
+ @Dependent("GL_NV_framebuffer_multisample_coverage")
+ void glNamedRenderbufferStorageMultisampleCoverageEXT(@GLuint int renderbuffer, @GLsizei int coverageSamples, @GLsizei int colorSamples, @GLenum int internalformat, @GLsizei int width, @GLsizei int height);
+
+ /*
+ OpenGL 3.0: New framebuffer commands add "Named" prefix to name
+ and replace "enum target" with "uint framebuffer"
+ */
+
+ @Dependent("OpenGL30,GL_EXT_framebuffer_object")
+ @GLenum
+ int glCheckNamedFramebufferStatusEXT(@GLuint int framebuffer, @GLenum int target);
+
+ @Dependent("OpenGL30,GL_EXT_framebuffer_object")
+ void glNamedFramebufferTexture1DEXT(@GLuint int framebuffer, @GLenum int attachment, @GLenum int textarget, @GLuint int texture, int level);
+
+ @Dependent("OpenGL30,GL_EXT_framebuffer_object")
+ void glNamedFramebufferTexture2DEXT(@GLuint int framebuffer, @GLenum int attachment, @GLenum int textarget, @GLuint int texture, int level);
+
+ @Dependent("OpenGL30,GL_EXT_framebuffer_object")
+ void glNamedFramebufferTexture3DEXT(@GLuint int framebuffer, @GLenum int attachment, @GLenum int textarget, @GLuint int texture, int level, int zoffset);
+
+ @Dependent("OpenGL30,GL_EXT_framebuffer_object")
+ void glNamedFramebufferRenderbufferEXT(@GLuint int framebuffer, @GLenum int attachment, @GLenum int renderbuffertarget, @GLuint int renderbuffer);
+
+ @Dependent("OpenGL30,GL_EXT_framebuffer_object")
+ @StripPostfix("params")
+ void glGetNamedFramebufferAttachmentParameterivEXT(@GLuint int framebuffer, @GLenum int attachment, @GLenum int pname, @Check("4") @OutParameter IntBuffer params);
+
+ @Alternate("glGetNamedFramebufferAttachmentParameterivEXT")
+ @GLreturn("params")
+ @Dependent("OpenGL30,GL_EXT_framebuffer_object")
+ @StripPostfix("params")
+ void glGetNamedFramebufferAttachmentParameterivEXT2(@GLuint int framebuffer, @GLenum int attachment, @GLenum int pname, @OutParameter IntBuffer params);
+
+ /*
+ OpenGL 3.0: New texture commands add "Texture" within name and
+ replace "enum target" with "uint texture"
+ */
+
+ @Dependent("OpenGL30,GL_EXT_framebuffer_object")
+ void glGenerateTextureMipmapEXT(@GLuint int texture, @GLenum int target);
+
+ /*
+ OpenGL 3.0: New texture commands add "MultiTex" within name and
+ replace "enum target" with "enum texunit"
+ */
+
+ @Dependent("OpenGL30,GL_EXT_framebuffer_object")
+ void glGenerateMultiTexMipmapEXT(@GLenum int texunit, @GLenum int target);
+
+ /*
+ OpenGL 3.0: New framebuffer commands
+ */
+
+ @Dependent("OpenGL30,GL_EXT_framebuffer_object")
+ void glFramebufferDrawBufferEXT(@GLuint int framebuffer, @GLenum int mode);
+
+ @Dependent("OpenGL30,GL_EXT_framebuffer_object")
+ void glFramebufferDrawBuffersEXT(@GLuint int framebuffer, @AutoSize("bufs") @GLsizei int n, @Const @GLenum IntBuffer bufs);
+
+ @Dependent("OpenGL30,GL_EXT_framebuffer_object")
+ void glFramebufferReadBufferEXT(@GLuint int framebuffer, @GLenum int mode);
+
+ /*
+ OpenGL 3.0: New framebuffer query
+ */
+
+ @Dependent("OpenGL30,GL_EXT_framebuffer_object")
+ @StripPostfix("param")
+ void glGetFramebufferParameterivEXT(@GLuint int framebuffer, @GLenum int pname, @Check("4") @OutParameter IntBuffer param);
+
+ @Alternate("glGetFramebufferParameterivEXT")
+ @GLreturn("param")
+ @Dependent("OpenGL30,GL_EXT_framebuffer_object")
+ @StripPostfix("param")
+ void glGetFramebufferParameterivEXT2(@GLuint int framebuffer, @GLenum int pname, @OutParameter IntBuffer param);
+
+ /*
+ OpenGL 3.1: New buffer data copy command
+ */
+
+ @Dependent("OpenGL31,GL_ARB_copy_buffer")
+ void glNamedCopyBufferSubDataEXT(@GLuint int readBuffer, @GLuint int writeBuffer, @GLintptr long readoffset, @GLintptr long writeoffset, @GLsizeiptr long size);
+
+ /*
+ EXT_geometry_shader4 or NV_geometry_program4: New framebuffer commands
+ add "Named" prefix to name and replace "enum target" with "uint
+ framebuffer"
+ */
+
+ @Dependent("GL_EXT_geometry_shader4,NV_geometry_program4")
+ void glNamedFramebufferTextureEXT(@GLuint int framebuffer, @GLenum int attachment, @GLuint int texture, int level);
+
+ @Dependent("GL_EXT_geometry_shader4,NV_geometry_program4")
+ void glNamedFramebufferTextureLayerEXT(@GLuint int framebuffer, @GLenum int attachment, @GLuint int texture, int level, int layer);
+
+ @Dependent("GL_EXT_geometry_shader4,NV_geometry_program4")
+ void glNamedFramebufferTextureFaceEXT(@GLuint int framebuffer, @GLenum int attachment, @GLuint int texture, int level, @GLenum int face);
+
+ /*
+ NV_explicit_multisample: New texture renderbuffer object command
+ replaces "Tex" in name with "Texture" and add initial "uint texture"
+ parameter
+ */
+
+ @Dependent("GL_NV_explicit_multisample")
+ void glTextureRenderbufferEXT(@GLuint int texture, @GLenum int target, @GLuint int renderbuffer);
+
+ /*
+ NV_explicit_multisample: New multitexture texture renderbuffer command
+ prefixes "Multi" before "Tex" and add an initial "enum texunit"
+ parameter (to identify the texture unit)
+ */
+
+ @Dependent("GL_NV_explicit_multisample")
+ void glMultiTexRenderbufferEXT(@GLenum int texunit, @GLenum int target, @GLuint int renderbuffer);
+
+ /*
+ OpenGL 3.0: New vertex array specification commands for vertex
+ array objects prefix "VertexArray", add initial "uint vaobj" and
+ "uint buffer" parameters, change "Pointer" suffix to "Offset",
+ and change the final parameter from "const void *" to "intptr offset"
+ */
+
+ @Dependent("OpenGL30")
+ @DeprecatedGL
+ void glVertexArrayVertexOffsetEXT(@GLuint int vaobj, @GLuint int buffer, int size, @GLenum int type, @GLsizei int stride, @GLintptr long offset);
+
+ @Dependent("OpenGL30")
+ @DeprecatedGL
+ void glVertexArrayColorOffsetEXT(@GLuint int vaobj, @GLuint int buffer, int size, @GLenum int type, @GLsizei int stride, @GLintptr long offset);
+
+ @Dependent("OpenGL30")
+ @DeprecatedGL
+ void glVertexArrayEdgeFlagOffsetEXT(@GLuint int vaobj, @GLuint int buffer, @GLsizei int stride, @GLintptr long offset);
+
+ @Dependent("OpenGL30")
+ void glVertexArrayIndexOffsetEXT(@GLuint int vaobj, @GLuint int buffer, @GLenum int type, @GLsizei int stride, @GLintptr long offset);
+
+ @Dependent("OpenGL30")
+ @DeprecatedGL
+ void glVertexArrayNormalOffsetEXT(@GLuint int vaobj, @GLuint int buffer, @GLenum int type, @GLsizei int stride, @GLintptr long offset);
+
+ @Dependent("OpenGL30")
+ @DeprecatedGL
+ void glVertexArrayTexCoordOffsetEXT(@GLuint int vaobj, @GLuint int buffer, int size, @GLenum int type, @GLsizei int stride, @GLintptr long offset);
+
+ @Dependent("OpenGL30")
+ @DeprecatedGL
+ void glVertexArrayMultiTexCoordOffsetEXT(@GLuint int vaobj, @GLuint int buffer, @GLenum int texunit, int size, @GLenum int type, @GLsizei int stride, @GLintptr long offset);
+
+ @Dependent("OpenGL30")
+ @DeprecatedGL
+ void glVertexArrayFogCoordOffsetEXT(@GLuint int vaobj, @GLuint int buffer, @GLenum int type, @GLsizei int stride, @GLintptr long offset);
+
+ @Dependent("OpenGL30")
+ @DeprecatedGL
+ void glVertexArraySecondaryColorOffsetEXT(@GLuint int vaobj, @GLuint int buffer, int size, @GLenum int type, @GLsizei int stride, @GLintptr long offset);
+
+ @Dependent("OpenGL30")
+ void glVertexArrayVertexAttribOffsetEXT(@GLuint int vaobj, @GLuint int buffer, @GLuint int index, int size, @GLenum int type, boolean normalized, @GLsizei int stride, @GLintptr long offset);
+
+ @Dependent("OpenGL30")
+ void glVertexArrayVertexAttribIOffsetEXT(@GLuint int vaobj, @GLuint int buffer, @GLuint int index, int size, @GLenum int type, @GLsizei int stride, @GLintptr long offset);
+
+ /*
+ OpenGL 3.0: New vertex array enable commands for vertex array
+ objects change "ClientState" to "VertexArray" and add an initial
+ "uint vaobj" parameter
+ */
+
+ @Dependent("OpenGL30")
+ void glEnableVertexArrayEXT(@GLuint int vaobj, @GLenum int array);
+
+ @Dependent("OpenGL30")
+ void glDisableVertexArrayEXT(@GLuint int vaobj, @GLenum int array);
+
+ /*
+ OpenGL 3.0: New vertex attrib array enable commands for vertex
+ array objects change "VertexAttribArray" to "VertexArrayAttrib"
+ and add an initial "uint vaobj" parameter
+ */
+
+ @Dependent("OpenGL30")
+ void glEnableVertexArrayAttribEXT(@GLuint int vaobj, @GLuint int index);
+
+ @Dependent("OpenGL30")
+ void glDisableVertexArrayAttribEXT(@GLuint int vaobj, @GLuint int index);
+
+ /*
+ OpenGL 3.0: New queries for vertex array objects
+ */
+
+ @Dependent("OpenGL30")
+ @StripPostfix("param")
+ void glGetVertexArrayIntegervEXT(@GLuint int vaobj, @GLenum int pname, @OutParameter @Check("16") IntBuffer param);
+
+ @Alternate("glGetVertexArrayIntegervEXT")
+ @GLreturn("param")
+ @Dependent("OpenGL30")
+ @StripPostfix("param")
+ void glGetVertexArrayIntegervEXT2(@GLuint int vaobj, @GLenum int pname, @OutParameter IntBuffer param);
+
+ @Dependent("OpenGL30")
+ @StripPostfix("param")
+ void glGetVertexArrayPointervEXT(@GLuint int vaobj, @GLenum int pname, @Result @GLvoid ByteBuffer param);
+
+ @Dependent("OpenGL30")
+ @StripPostfix(value = "param")
+ void glGetVertexArrayIntegeri_vEXT(@GLuint int vaobj, @GLuint int index, @GLenum int pname, @OutParameter @Check("16") IntBuffer param);
+
+ @Alternate("glGetVertexArrayIntegeri_vEXT")
+ @GLreturn("param")
+ @Dependent("OpenGL30")
+ @StripPostfix(value = "param", postfix = "_v")
+ void glGetVertexArrayIntegeri_vEXT2(@GLuint int vaobj, @GLuint int index, @GLenum int pname, @OutParameter IntBuffer param);
+
+ @Dependent("OpenGL30")
+ @StripPostfix(value = "param")
+ void glGetVertexArrayPointeri_vEXT(@GLuint int vaobj, @GLuint int index, @GLenum int pname, @Result @GLvoid ByteBuffer param);
+
+ /*
+ OpenGL 3.0: New buffer commands replace "Buffer" with "NamedBuffer"
+ in name and replace "enum target" parameter with "uint buffer"
+ */
+
+ /**
+ * glMapNamedBufferRangeEXT maps a GL buffer object range to a ByteBuffer. The old_buffer argument can be null,
+ * in which case a new ByteBuffer will be created, pointing to the returned memory. If old_buffer is non-null,
+ * it will be returned if it points to the same mapped memory and has the same capacity as the buffer object,
+ * otherwise a new ByteBuffer is created. That way, an application will normally use glMapNamedBufferRangeEXT like this:
+ * <p/>
+ * ByteBuffer mapped_buffer; mapped_buffer = glMapNamedBufferRangeEXT(..., ..., ..., ..., null); ... // Another map on the same buffer mapped_buffer = glMapNamedBufferRangeEXT(..., ..., ..., ..., mapped_buffer);
+ * <p/>
+ * Only ByteBuffers returned from this method are to be passed as the old_buffer argument. User-created ByteBuffers cannot be reused.
+ *
+ * @param old_buffer A ByteBuffer. If this argument points to the same address and has the same capacity as the new mapping, it will be returned and no new buffer will be created.
+ *
+ * @return A ByteBuffer representing the mapped buffer memory.
+ */
+ @Dependent("OpenGL30")
+ @CachedResult(isRange = true)
+ @GLvoid
+ @AutoResultSize("length")
+ ByteBuffer glMapNamedBufferRangeEXT(@GLuint int buffer, @GLintptr long offset, @GLsizeiptr long length, @GLbitfield int access);
+
+ @Dependent("OpenGL30")
+ void glFlushMappedNamedBufferRangeEXT(@GLuint int buffer, @GLintptr long offset, @GLsizeiptr long length);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/EXT_draw_range_elements.java b/src/templates/org/lwjgl/opengl/EXT_draw_range_elements.java
index 1f47a45..f576009 100644
--- a/src/templates/org/lwjgl/opengl/EXT_draw_range_elements.java
+++ b/src/templates/org/lwjgl/opengl/EXT_draw_range_elements.java
@@ -1,48 +1,48 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-public interface EXT_draw_range_elements {
- int GL_MAX_ELEMENTS_VERTICES_EXT = 0x80E8;
- int GL_MAX_ELEMENTS_INDICES_EXT = 0x80E9;
-
- void glDrawRangeElementsEXT(@GLenum int mode, @GLuint int start, @GLuint int end, @AutoSize("pIndices") @GLsizei int count, @AutoType("pIndices") @GLenum int type,
- @BufferObject(BufferKind.ElementVBO)
- @Const
- @GLubyte
- @GLushort
- @GLuint Buffer pIndices);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+public interface EXT_draw_range_elements {
+ int GL_MAX_ELEMENTS_VERTICES_EXT = 0x80E8;
+ int GL_MAX_ELEMENTS_INDICES_EXT = 0x80E9;
+
+ void glDrawRangeElementsEXT(@GLenum int mode, @GLuint int start, @GLuint int end, @AutoSize("pIndices") @GLsizei int count, @AutoType("pIndices") @GLenum int type,
+ @BufferObject(BufferKind.ElementVBO)
+ @Const
+ @GLubyte
+ @GLushort
+ @GLuint Buffer pIndices);
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_fog_coord.java b/src/templates/org/lwjgl/opengl/EXT_fog_coord.java
index 85ba367..331a327 100644
--- a/src/templates/org/lwjgl/opengl/EXT_fog_coord.java
+++ b/src/templates/org/lwjgl/opengl/EXT_fog_coord.java
@@ -1,59 +1,59 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-public interface EXT_fog_coord {
- int GL_FOG_COORDINATE_SOURCE_EXT = 0x8450;
- int GL_FOG_COORDINATE_EXT = 0x8451;
- int GL_FRAGMENT_DEPTH_EXT = 0x8452;
- int GL_CURRENT_FOG_COORDINATE_EXT = 0x8453;
- int GL_FOG_COORDINATE_ARRAY_TYPE_EXT = 0x8454;
- int GL_FOG_COORDINATE_ARRAY_STRIDE_EXT = 0x8455;
- int GL_FOG_COORDINATE_ARRAY_POINTER_EXT = 0x8456;
- int GL_FOG_COORDINATE_ARRAY_EXT = 0x8457;
-
- void glFogCoordfEXT(float coord);
-
- void glFogCoorddEXT(double coord);
-
- void glFogCoordPointerEXT(@AutoType("data") @GLenum int type, @GLsizei int stride,
- @CachedReference
- @BufferObject(BufferKind.ArrayVBO)
- @Check
- @Const
- @GLfloat
- @GLdouble Buffer data);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+public interface EXT_fog_coord {
+ int GL_FOG_COORDINATE_SOURCE_EXT = 0x8450;
+ int GL_FOG_COORDINATE_EXT = 0x8451;
+ int GL_FRAGMENT_DEPTH_EXT = 0x8452;
+ int GL_CURRENT_FOG_COORDINATE_EXT = 0x8453;
+ int GL_FOG_COORDINATE_ARRAY_TYPE_EXT = 0x8454;
+ int GL_FOG_COORDINATE_ARRAY_STRIDE_EXT = 0x8455;
+ int GL_FOG_COORDINATE_ARRAY_POINTER_EXT = 0x8456;
+ int GL_FOG_COORDINATE_ARRAY_EXT = 0x8457;
+
+ void glFogCoordfEXT(float coord);
+
+ void glFogCoorddEXT(double coord);
+
+ void glFogCoordPointerEXT(@AutoType("data") @GLenum int type, @GLsizei int stride,
+ @CachedReference
+ @BufferObject(BufferKind.ArrayVBO)
+ @Check
+ @Const
+ @GLfloat
+ @GLdouble Buffer data);
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_framebuffer_blit.java b/src/templates/org/lwjgl/opengl/EXT_framebuffer_blit.java
index a473d69..203efd8 100644
--- a/src/templates/org/lwjgl/opengl/EXT_framebuffer_blit.java
+++ b/src/templates/org/lwjgl/opengl/EXT_framebuffer_blit.java
@@ -1,75 +1,75 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-public interface EXT_framebuffer_blit {
-
- /**
- Accepted by the <target> parameter of BindFramebufferEXT,
- CheckFramebufferStatusEXT, FramebufferTexture{1D|2D|3D}EXT,
- FramebufferRenderbufferEXT, and
- GetFramebufferAttachmentParameterivEXT.
- */
- int GL_READ_FRAMEBUFFER_EXT = 0x8CA8;
- int GL_DRAW_FRAMEBUFFER_EXT = 0x8CA9;
-
- /**
- Accepted by the <pname> parameters of GetIntegerv, GetFloatv, and GetDoublev.
- */
- int GL_DRAW_FRAMEBUFFER_BINDING_EXT = 0x8CA6; // alias FRAMEBUFFER_BINDING_EXT
- int GL_READ_FRAMEBUFFER_BINDING_EXT = 0x8CAA;
-
- /**
- Transfers a rectangle of pixel values from one
- region of the read framebuffer to another in the draw framebuffer.
- <mask> is the bitwise OR of a number of values indicating which
- buffers are to be copied. The values are COLOR_BUFFER_BIT,
- DEPTH_BUFFER_BIT, and STENCIL_BUFFER_BIT.
- The pixels corresponding to these buffers are
- copied from the source rectangle, bound by the locations (srcX0,
- srcY0) and (srcX1, srcY1) inclusive, to the destination rectangle,
- bound by the locations (dstX0, dstY0) and (dstX1, dstY1)
- inclusive.
- If the source and destination rectangle dimensions do not match,
- the source image is stretched to fit the destination
- rectangle. <filter> must be LINEAR or NEAREST and specifies the
- method of interpolation to be applied if the image is
- stretched.
- */
- void glBlitFramebufferEXT(
- @GLint int srcX0, @GLint int srcY0, @GLint int srcX1, @GLint int srcY1,
- @GLint int dstX0, @GLint int dstY0, @GLint int dstX1, @GLint int dstY1,
- @GLbitfield int mask, @GLenum int filter);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+public interface EXT_framebuffer_blit {
+
+ /**
+ Accepted by the <target> parameter of BindFramebufferEXT,
+ CheckFramebufferStatusEXT, FramebufferTexture{1D|2D|3D}EXT,
+ FramebufferRenderbufferEXT, and
+ GetFramebufferAttachmentParameterivEXT.
+ */
+ int GL_READ_FRAMEBUFFER_EXT = 0x8CA8;
+ int GL_DRAW_FRAMEBUFFER_EXT = 0x8CA9;
+
+ /**
+ Accepted by the <pname> parameters of GetIntegerv, GetFloatv, and GetDoublev.
+ */
+ int GL_DRAW_FRAMEBUFFER_BINDING_EXT = 0x8CA6; // alias FRAMEBUFFER_BINDING_EXT
+ int GL_READ_FRAMEBUFFER_BINDING_EXT = 0x8CAA;
+
+ /**
+ Transfers a rectangle of pixel values from one
+ region of the read framebuffer to another in the draw framebuffer.
+ <mask> is the bitwise OR of a number of values indicating which
+ buffers are to be copied. The values are COLOR_BUFFER_BIT,
+ DEPTH_BUFFER_BIT, and STENCIL_BUFFER_BIT.
+ The pixels corresponding to these buffers are
+ copied from the source rectangle, bound by the locations (srcX0,
+ srcY0) and (srcX1, srcY1) inclusive, to the destination rectangle,
+ bound by the locations (dstX0, dstY0) and (dstX1, dstY1)
+ inclusive.
+ If the source and destination rectangle dimensions do not match,
+ the source image is stretched to fit the destination
+ rectangle. <filter> must be LINEAR or NEAREST and specifies the
+ method of interpolation to be applied if the image is
+ stretched.
+ */
+ void glBlitFramebufferEXT(
+ @GLint int srcX0, @GLint int srcY0, @GLint int srcX1, @GLint int srcY1,
+ @GLint int dstX0, @GLint int dstY0, @GLint int dstX1, @GLint int dstY1,
+ @GLbitfield int mask, @GLenum int filter);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/EXT_framebuffer_multisample.java b/src/templates/org/lwjgl/opengl/EXT_framebuffer_multisample.java
index 9996e3e..6271412 100644
--- a/src/templates/org/lwjgl/opengl/EXT_framebuffer_multisample.java
+++ b/src/templates/org/lwjgl/opengl/EXT_framebuffer_multisample.java
@@ -1,59 +1,59 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.GLenum;
-import org.lwjgl.util.generator.GLsizei;
-
-public interface EXT_framebuffer_multisample {
-
- /** Accepted by the <pname> parameter of GetRenderbufferParameterivEXT. */
- int GL_RENDERBUFFER_SAMPLES_EXT = 0x8CAB;
-
- /** Returned by CheckFramebufferStatusEXT. */
- int GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT = 0x8D56;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv, and GetDoublev.
- */
- int GL_MAX_SAMPLES_EXT = 0x8D57;
-
- /**
- * Establishes the data storage, format, dimensions, and number of
- * samples of a renderbuffer object's image.
- */
- void glRenderbufferStorageMultisampleEXT(
- @GLenum int target, @GLsizei int samples,
- @GLenum int internalformat,
- @GLsizei int width, @GLsizei int height);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.GLenum;
+import org.lwjgl.util.generator.GLsizei;
+
+public interface EXT_framebuffer_multisample {
+
+ /** Accepted by the <pname> parameter of GetRenderbufferParameterivEXT. */
+ int GL_RENDERBUFFER_SAMPLES_EXT = 0x8CAB;
+
+ /** Returned by CheckFramebufferStatusEXT. */
+ int GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT = 0x8D56;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, and GetDoublev.
+ */
+ int GL_MAX_SAMPLES_EXT = 0x8D57;
+
+ /**
+ * Establishes the data storage, format, dimensions, and number of
+ * samples of a renderbuffer object's image.
+ */
+ void glRenderbufferStorageMultisampleEXT(
+ @GLenum int target, @GLsizei int samples,
+ @GLenum int internalformat,
+ @GLsizei int width, @GLsizei int height);
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_framebuffer_object.java b/src/templates/org/lwjgl/opengl/EXT_framebuffer_object.java
index 45e7b20..cc9c98c 100644
--- a/src/templates/org/lwjgl/opengl/EXT_framebuffer_object.java
+++ b/src/templates/org/lwjgl/opengl/EXT_framebuffer_object.java
@@ -1,187 +1,187 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.IntBuffer;
-
-public interface EXT_framebuffer_object {
-
- /**
- * Accepted by the <target> parameter of BindFramebufferEXT,
- * CheckFramebufferStatusEXT, FramebufferTexture{1D|2D|3D}EXT, and
- * FramebufferRenderbufferEXT:
- */
- int GL_FRAMEBUFFER_EXT = 0x8D40;
-
- /**
- * Accepted by the <target> parameter of BindRenderbufferEXT,
- * RenderbufferStorageEXT, and GetRenderbufferParameterivEXT, and
- * returned by GetFramebufferAttachmentParameterivEXT:
- */
- int GL_RENDERBUFFER_EXT = 0x8D41;
-
- /**
- * Accepted by the <internalformat> parameter of
- * RenderbufferStorageEXT:
- */
- int GL_STENCIL_INDEX1_EXT = 0x8D46;
- int GL_STENCIL_INDEX4_EXT = 0x8D47;
- int GL_STENCIL_INDEX8_EXT = 0x8D48;
- int GL_STENCIL_INDEX16_EXT = 0x8D49;
-
- /** Accepted by the <pname> parameter of GetRenderbufferParameterivEXT: */
- int GL_RENDERBUFFER_WIDTH_EXT = 0x8D42;
- int GL_RENDERBUFFER_HEIGHT_EXT = 0x8D43;
- int GL_RENDERBUFFER_INTERNAL_FORMAT_EXT = 0x8D44;
- int GL_RENDERBUFFER_RED_SIZE_EXT = 0x8D50;
- int GL_RENDERBUFFER_GREEN_SIZE_EXT = 0x8D51;
- int GL_RENDERBUFFER_BLUE_SIZE_EXT = 0x8D52;
- int GL_RENDERBUFFER_ALPHA_SIZE_EXT = 0x8D53;
- int GL_RENDERBUFFER_DEPTH_SIZE_EXT = 0x8D54;
- int GL_RENDERBUFFER_STENCIL_SIZE_EXT = 0x8D55;
-
- /**
- * Accepted by the <pname> parameter of
- * GetFramebufferAttachmentParameterivEXT:
- */
- int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT = 0x8CD0;
- int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT = 0x8CD1;
- int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT = 0x8CD2;
- int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT = 0x8CD3;
- int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT = 0x8CD4;
-
- /**
- * Accepted by the <attachment> parameter of
- * FramebufferTexture{1D|2D|3D}EXT, FramebufferRenderbufferEXT, and
- * GetFramebufferAttachmentParameterivEXT
- */
- int GL_COLOR_ATTACHMENT0_EXT = 0x8CE0;
- int GL_COLOR_ATTACHMENT1_EXT = 0x8CE1;
- int GL_COLOR_ATTACHMENT2_EXT = 0x8CE2;
- int GL_COLOR_ATTACHMENT3_EXT = 0x8CE3;
- int GL_COLOR_ATTACHMENT4_EXT = 0x8CE4;
- int GL_COLOR_ATTACHMENT5_EXT = 0x8CE5;
- int GL_COLOR_ATTACHMENT6_EXT = 0x8CE6;
- int GL_COLOR_ATTACHMENT7_EXT = 0x8CE7;
- int GL_COLOR_ATTACHMENT8_EXT = 0x8CE8;
- int GL_COLOR_ATTACHMENT9_EXT = 0x8CE9;
- int GL_COLOR_ATTACHMENT10_EXT = 0x8CEA;
- int GL_COLOR_ATTACHMENT11_EXT = 0x8CEB;
- int GL_COLOR_ATTACHMENT12_EXT = 0x8CEC;
- int GL_COLOR_ATTACHMENT13_EXT = 0x8CED;
- int GL_COLOR_ATTACHMENT14_EXT = 0x8CEE;
- int GL_COLOR_ATTACHMENT15_EXT = 0x8CEF;
- int GL_DEPTH_ATTACHMENT_EXT = 0x8D00;
- int GL_STENCIL_ATTACHMENT_EXT = 0x8D20;
-
- /** Returned by CheckFramebufferStatusEXT(): */
- int GL_FRAMEBUFFER_COMPLETE_EXT = 0x8CD5;
- int GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT = 0x8CD6;
- int GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT = 0x8CD7;
- int GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT = 0x8CD9;
- int GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT = 0x8CDA;
- int GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT = 0x8CDB;
- int GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT = 0x8CDC;
- int GL_FRAMEBUFFER_UNSUPPORTED_EXT = 0x8CDD;
-
- /** Accepted by GetIntegerv(): */
- int GL_FRAMEBUFFER_BINDING_EXT = 0x8CA6;
- int GL_RENDERBUFFER_BINDING_EXT = 0x8CA7;
- int GL_MAX_COLOR_ATTACHMENTS_EXT = 0x8CDF;
- int GL_MAX_RENDERBUFFER_SIZE_EXT = 0x84E8;
-
- /** Returned by GetError(): */
- int GL_INVALID_FRAMEBUFFER_OPERATION_EXT = 0x0506;
-
- boolean glIsRenderbufferEXT(@GLuint int renderbuffer);
-
- void glBindRenderbufferEXT(@GLenum int target, @GLuint int renderbuffer);
-
- void glDeleteRenderbuffersEXT(@AutoSize("renderbuffers") int n, @Const @GLuint IntBuffer renderbuffers);
-
- @Alternate("glDeleteRenderbuffersEXT")
- void glDeleteRenderbuffersEXT(@Constant("1") int n, @Constant(value = "APIUtils.getBufferInt().put(0, renderbuffer), 0", keepParam = true) int renderbuffer);
-
- void glGenRenderbuffersEXT(@AutoSize("renderbuffers") int n, @OutParameter @GLuint IntBuffer renderbuffers);
-
- @Alternate("glGenRenderbuffersEXT")
- @GLreturn("renderbuffers")
- void glGenRenderbuffersEXT2(@Constant("1") int n, @OutParameter @GLuint IntBuffer renderbuffers);
-
- void glRenderbufferStorageEXT(@GLenum int target, @GLenum int internalformat, @GLsizei int width, @GLsizei int height);
-
- @StripPostfix("params")
- void glGetRenderbufferParameterivEXT(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
-
- @Alternate("glGetRenderbufferParameterivEXT")
- @GLreturn("params")
- @StripPostfix("params")
- void glGetRenderbufferParameterivEXT2(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params);
-
- boolean glIsFramebufferEXT(@GLuint int framebuffer);
-
- void glBindFramebufferEXT(@GLenum int target, @GLuint int framebuffer);
-
- void glDeleteFramebuffersEXT(@AutoSize("framebuffers") int n, @Const @GLuint IntBuffer framebuffers);
-
- @Alternate("glDeleteFramebuffersEXT")
- void glDeleteFramebuffersEXT(@Constant("1") int n, @Constant(value = "APIUtils.getBufferInt().put(0, framebuffer), 0", keepParam = true) int framebuffer);
-
- void glGenFramebuffersEXT(@AutoSize("framebuffers") int n, @OutParameter @GLuint IntBuffer framebuffers);
-
- @Alternate("glGenFramebuffersEXT")
- @GLreturn("framebuffers")
- void glGenFramebuffersEXT2(@Constant("1") int n, @OutParameter @GLuint IntBuffer framebuffers);
-
- @GLenum
- int glCheckFramebufferStatusEXT(@GLenum int target);
-
- void glFramebufferTexture1DEXT(@GLenum int target, @GLenum int attachment, @GLenum int textarget, @GLuint int texture, int level);
-
- void glFramebufferTexture2DEXT(@GLenum int target, @GLenum int attachment, @GLenum int textarget, @GLuint int texture, int level);
-
- void glFramebufferTexture3DEXT(@GLenum int target, @GLenum int attachment, @GLenum int textarget, @GLuint int texture, int level, int zoffset);
-
- void glFramebufferRenderbufferEXT(@GLenum int target, @GLenum int attachment, @GLenum int renderbuffertarget, @GLuint int renderbuffer);
-
- @StripPostfix("params")
- void glGetFramebufferAttachmentParameterivEXT(@GLenum int target, @GLenum int attachment, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
-
- @Alternate("glGetFramebufferAttachmentParameterivEXT")
- @GLreturn("params")
- @StripPostfix("params")
- void glGetFramebufferAttachmentParameterivEXT2(@GLenum int target, @GLenum int attachment, @GLenum int pname, @OutParameter IntBuffer params);
-
- void glGenerateMipmapEXT(@GLenum int target);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.IntBuffer;
+
+public interface EXT_framebuffer_object {
+
+ /**
+ * Accepted by the <target> parameter of BindFramebufferEXT,
+ * CheckFramebufferStatusEXT, FramebufferTexture{1D|2D|3D}EXT, and
+ * FramebufferRenderbufferEXT:
+ */
+ int GL_FRAMEBUFFER_EXT = 0x8D40;
+
+ /**
+ * Accepted by the <target> parameter of BindRenderbufferEXT,
+ * RenderbufferStorageEXT, and GetRenderbufferParameterivEXT, and
+ * returned by GetFramebufferAttachmentParameterivEXT:
+ */
+ int GL_RENDERBUFFER_EXT = 0x8D41;
+
+ /**
+ * Accepted by the <internalformat> parameter of
+ * RenderbufferStorageEXT:
+ */
+ int GL_STENCIL_INDEX1_EXT = 0x8D46;
+ int GL_STENCIL_INDEX4_EXT = 0x8D47;
+ int GL_STENCIL_INDEX8_EXT = 0x8D48;
+ int GL_STENCIL_INDEX16_EXT = 0x8D49;
+
+ /** Accepted by the <pname> parameter of GetRenderbufferParameterivEXT: */
+ int GL_RENDERBUFFER_WIDTH_EXT = 0x8D42;
+ int GL_RENDERBUFFER_HEIGHT_EXT = 0x8D43;
+ int GL_RENDERBUFFER_INTERNAL_FORMAT_EXT = 0x8D44;
+ int GL_RENDERBUFFER_RED_SIZE_EXT = 0x8D50;
+ int GL_RENDERBUFFER_GREEN_SIZE_EXT = 0x8D51;
+ int GL_RENDERBUFFER_BLUE_SIZE_EXT = 0x8D52;
+ int GL_RENDERBUFFER_ALPHA_SIZE_EXT = 0x8D53;
+ int GL_RENDERBUFFER_DEPTH_SIZE_EXT = 0x8D54;
+ int GL_RENDERBUFFER_STENCIL_SIZE_EXT = 0x8D55;
+
+ /**
+ * Accepted by the <pname> parameter of
+ * GetFramebufferAttachmentParameterivEXT:
+ */
+ int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT = 0x8CD0;
+ int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT = 0x8CD1;
+ int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT = 0x8CD2;
+ int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT = 0x8CD3;
+ int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT = 0x8CD4;
+
+ /**
+ * Accepted by the <attachment> parameter of
+ * FramebufferTexture{1D|2D|3D}EXT, FramebufferRenderbufferEXT, and
+ * GetFramebufferAttachmentParameterivEXT
+ */
+ int GL_COLOR_ATTACHMENT0_EXT = 0x8CE0;
+ int GL_COLOR_ATTACHMENT1_EXT = 0x8CE1;
+ int GL_COLOR_ATTACHMENT2_EXT = 0x8CE2;
+ int GL_COLOR_ATTACHMENT3_EXT = 0x8CE3;
+ int GL_COLOR_ATTACHMENT4_EXT = 0x8CE4;
+ int GL_COLOR_ATTACHMENT5_EXT = 0x8CE5;
+ int GL_COLOR_ATTACHMENT6_EXT = 0x8CE6;
+ int GL_COLOR_ATTACHMENT7_EXT = 0x8CE7;
+ int GL_COLOR_ATTACHMENT8_EXT = 0x8CE8;
+ int GL_COLOR_ATTACHMENT9_EXT = 0x8CE9;
+ int GL_COLOR_ATTACHMENT10_EXT = 0x8CEA;
+ int GL_COLOR_ATTACHMENT11_EXT = 0x8CEB;
+ int GL_COLOR_ATTACHMENT12_EXT = 0x8CEC;
+ int GL_COLOR_ATTACHMENT13_EXT = 0x8CED;
+ int GL_COLOR_ATTACHMENT14_EXT = 0x8CEE;
+ int GL_COLOR_ATTACHMENT15_EXT = 0x8CEF;
+ int GL_DEPTH_ATTACHMENT_EXT = 0x8D00;
+ int GL_STENCIL_ATTACHMENT_EXT = 0x8D20;
+
+ /** Returned by CheckFramebufferStatusEXT(): */
+ int GL_FRAMEBUFFER_COMPLETE_EXT = 0x8CD5;
+ int GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT = 0x8CD6;
+ int GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT = 0x8CD7;
+ int GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT = 0x8CD9;
+ int GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT = 0x8CDA;
+ int GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT = 0x8CDB;
+ int GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT = 0x8CDC;
+ int GL_FRAMEBUFFER_UNSUPPORTED_EXT = 0x8CDD;
+
+ /** Accepted by GetIntegerv(): */
+ int GL_FRAMEBUFFER_BINDING_EXT = 0x8CA6;
+ int GL_RENDERBUFFER_BINDING_EXT = 0x8CA7;
+ int GL_MAX_COLOR_ATTACHMENTS_EXT = 0x8CDF;
+ int GL_MAX_RENDERBUFFER_SIZE_EXT = 0x84E8;
+
+ /** Returned by GetError(): */
+ int GL_INVALID_FRAMEBUFFER_OPERATION_EXT = 0x0506;
+
+ boolean glIsRenderbufferEXT(@GLuint int renderbuffer);
+
+ void glBindRenderbufferEXT(@GLenum int target, @GLuint int renderbuffer);
+
+ void glDeleteRenderbuffersEXT(@AutoSize("renderbuffers") int n, @Const @GLuint IntBuffer renderbuffers);
+
+ @Alternate("glDeleteRenderbuffersEXT")
+ void glDeleteRenderbuffersEXT(@Constant("1") int n, @Constant(value = "APIUtils.getBufferInt().put(0, renderbuffer), 0", keepParam = true) int renderbuffer);
+
+ void glGenRenderbuffersEXT(@AutoSize("renderbuffers") int n, @OutParameter @GLuint IntBuffer renderbuffers);
+
+ @Alternate("glGenRenderbuffersEXT")
+ @GLreturn("renderbuffers")
+ void glGenRenderbuffersEXT2(@Constant("1") int n, @OutParameter @GLuint IntBuffer renderbuffers);
+
+ void glRenderbufferStorageEXT(@GLenum int target, @GLenum int internalformat, @GLsizei int width, @GLsizei int height);
+
+ @StripPostfix("params")
+ void glGetRenderbufferParameterivEXT(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
+
+ @Alternate("glGetRenderbufferParameterivEXT")
+ @GLreturn("params")
+ @StripPostfix("params")
+ void glGetRenderbufferParameterivEXT2(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params);
+
+ boolean glIsFramebufferEXT(@GLuint int framebuffer);
+
+ void glBindFramebufferEXT(@GLenum int target, @GLuint int framebuffer);
+
+ void glDeleteFramebuffersEXT(@AutoSize("framebuffers") int n, @Const @GLuint IntBuffer framebuffers);
+
+ @Alternate("glDeleteFramebuffersEXT")
+ void glDeleteFramebuffersEXT(@Constant("1") int n, @Constant(value = "APIUtils.getBufferInt().put(0, framebuffer), 0", keepParam = true) int framebuffer);
+
+ void glGenFramebuffersEXT(@AutoSize("framebuffers") int n, @OutParameter @GLuint IntBuffer framebuffers);
+
+ @Alternate("glGenFramebuffersEXT")
+ @GLreturn("framebuffers")
+ void glGenFramebuffersEXT2(@Constant("1") int n, @OutParameter @GLuint IntBuffer framebuffers);
+
+ @GLenum
+ int glCheckFramebufferStatusEXT(@GLenum int target);
+
+ void glFramebufferTexture1DEXT(@GLenum int target, @GLenum int attachment, @GLenum int textarget, @GLuint int texture, int level);
+
+ void glFramebufferTexture2DEXT(@GLenum int target, @GLenum int attachment, @GLenum int textarget, @GLuint int texture, int level);
+
+ void glFramebufferTexture3DEXT(@GLenum int target, @GLenum int attachment, @GLenum int textarget, @GLuint int texture, int level, int zoffset);
+
+ void glFramebufferRenderbufferEXT(@GLenum int target, @GLenum int attachment, @GLenum int renderbuffertarget, @GLuint int renderbuffer);
+
+ @StripPostfix("params")
+ void glGetFramebufferAttachmentParameterivEXT(@GLenum int target, @GLenum int attachment, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
+
+ @Alternate("glGetFramebufferAttachmentParameterivEXT")
+ @GLreturn("params")
+ @StripPostfix("params")
+ void glGetFramebufferAttachmentParameterivEXT2(@GLenum int target, @GLenum int attachment, @GLenum int pname, @OutParameter IntBuffer params);
+
+ void glGenerateMipmapEXT(@GLenum int target);
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_multi_draw_arrays.java b/src/templates/org/lwjgl/opengl/EXT_multi_draw_arrays.java
index 132fc11..1437cf8 100644
--- a/src/templates/org/lwjgl/opengl/EXT_multi_draw_arrays.java
+++ b/src/templates/org/lwjgl/opengl/EXT_multi_draw_arrays.java
@@ -1,40 +1,40 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-public interface EXT_multi_draw_arrays {
- void glMultiDrawArraysEXT(@GLenum int mode, IntBuffer piFirst, @Check("piFirst.remaining()") @GLsizei IntBuffer piCount, @AutoSize("piFirst") int primcount);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+public interface EXT_multi_draw_arrays {
+ void glMultiDrawArraysEXT(@GLenum int mode, IntBuffer piFirst, @Check("piFirst.remaining()") @GLsizei IntBuffer piCount, @AutoSize("piFirst") int primcount);
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_packed_depth_stencil.java b/src/templates/org/lwjgl/opengl/EXT_packed_depth_stencil.java
index 0f4f10d..ffa08fa 100644
--- a/src/templates/org/lwjgl/opengl/EXT_packed_depth_stencil.java
+++ b/src/templates/org/lwjgl/opengl/EXT_packed_depth_stencil.java
@@ -1,67 +1,67 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface EXT_packed_depth_stencil {
-
- /**
- Accepted by the <format> parameter of DrawPixels, ReadPixels,
- TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D,
- TexSubImage3D, and GetTexImage, by the <type> parameter of
- CopyPixels, by the <internalformat> parameter of TexImage1D,
- TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D, and
- RenderbufferStorageEXT, and returned in the <data> parameter of
- GetTexLevelParameter and GetRenderbufferParameterivEXT.
- */
- int GL_DEPTH_STENCIL_EXT = 0x84F9;
-
- /**
- Accepted by the <type> parameter of DrawPixels, ReadPixels,
- TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D,
- TexSubImage3D, and GetTexImage.
- */
- int GL_UNSIGNED_INT_24_8_EXT = 0x84FA;
-
- /**
- Accepted by the <internalformat> parameter of TexImage1D,
- TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D, and
- RenderbufferStorageEXT, and returned in the <data> parameter of
- GetTexLevelParameter and GetRenderbufferParameterivEXT.
- */
- int GL_DEPTH24_STENCIL8_EXT = 0x88F0;
-
- /**
- Accepted by the <value> parameter of GetTexLevelParameter.
- */
- int GL_TEXTURE_STENCIL_SIZE_EXT = 0x88F1;
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface EXT_packed_depth_stencil {
+
+ /**
+ Accepted by the <format> parameter of DrawPixels, ReadPixels,
+ TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D,
+ TexSubImage3D, and GetTexImage, by the <type> parameter of
+ CopyPixels, by the <internalformat> parameter of TexImage1D,
+ TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D, and
+ RenderbufferStorageEXT, and returned in the <data> parameter of
+ GetTexLevelParameter and GetRenderbufferParameterivEXT.
+ */
+ int GL_DEPTH_STENCIL_EXT = 0x84F9;
+
+ /**
+ Accepted by the <type> parameter of DrawPixels, ReadPixels,
+ TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D,
+ TexSubImage3D, and GetTexImage.
+ */
+ int GL_UNSIGNED_INT_24_8_EXT = 0x84FA;
+
+ /**
+ Accepted by the <internalformat> parameter of TexImage1D,
+ TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D, and
+ RenderbufferStorageEXT, and returned in the <data> parameter of
+ GetTexLevelParameter and GetRenderbufferParameterivEXT.
+ */
+ int GL_DEPTH24_STENCIL8_EXT = 0x88F0;
+
+ /**
+ Accepted by the <value> parameter of GetTexLevelParameter.
+ */
+ int GL_TEXTURE_STENCIL_SIZE_EXT = 0x88F1;
+
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_packed_pixels.java b/src/templates/org/lwjgl/opengl/EXT_packed_pixels.java
index a27c59e..bbb4d01 100644
--- a/src/templates/org/lwjgl/opengl/EXT_packed_pixels.java
+++ b/src/templates/org/lwjgl/opengl/EXT_packed_pixels.java
@@ -1,40 +1,40 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface EXT_packed_pixels {
- int GL_UNSIGNED_BYTE_3_3_2_EXT = 0x8032;
- int GL_UNSIGNED_SHORT_4_4_4_4_EXT = 0x8033;
- int GL_UNSIGNED_SHORT_5_5_5_1_EXT = 0x8034;
- int GL_UNSIGNED_INT_8_8_8_8_EXT = 0x8035;
- int GL_UNSIGNED_INT_10_10_10_2_EXT = 0x8036;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface EXT_packed_pixels {
+ int GL_UNSIGNED_BYTE_3_3_2_EXT = 0x8032;
+ int GL_UNSIGNED_SHORT_4_4_4_4_EXT = 0x8033;
+ int GL_UNSIGNED_SHORT_5_5_5_1_EXT = 0x8034;
+ int GL_UNSIGNED_INT_8_8_8_8_EXT = 0x8035;
+ int GL_UNSIGNED_INT_10_10_10_2_EXT = 0x8036;
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_paletted_texture.java b/src/templates/org/lwjgl/opengl/EXT_paletted_texture.java
index ba27db9..1997a08 100644
--- a/src/templates/org/lwjgl/opengl/EXT_paletted_texture.java
+++ b/src/templates/org/lwjgl/opengl/EXT_paletted_texture.java
@@ -1,101 +1,101 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-public interface EXT_paletted_texture {
-
- /**
- * Accepted by the internalformat parameter of TexImage1D, TexImage2D and
- * TexImage3DEXT:
- */
- int GL_COLOR_INDEX1_EXT = 0x80E2;
- int GL_COLOR_INDEX2_EXT = 0x80E3;
- int GL_COLOR_INDEX4_EXT = 0x80E4;
- int GL_COLOR_INDEX8_EXT = 0x80E5;
- int GL_COLOR_INDEX12_EXT = 0x80E6;
- int GL_COLOR_INDEX16_EXT = 0x80E7;
-
- /**
- * Accepted by the pname parameter of GetColorTableParameterivEXT and
- * GetColorTableParameterfvEXT:
- */
- int GL_COLOR_TABLE_FORMAT_EXT = 0x80D8;
- int GL_COLOR_TABLE_WIDTH_EXT = 0x80D9;
- int GL_COLOR_TABLE_RED_SIZE_EXT = 0x80DA;
- int GL_COLOR_TABLE_GREEN_SIZE_EXT = 0x80DB;
- int GL_COLOR_TABLE_BLUE_SIZE_EXT = 0x80DC;
- int GL_COLOR_TABLE_ALPHA_SIZE_EXT = 0x80DD;
- int GL_COLOR_TABLE_LUMINANCE_SIZE_EXT = 0x80DE;
- int GL_COLOR_TABLE_INTENSITY_SIZE_EXT = 0x80DF;
-
- /**
- * Accepted by the value parameter of GetTexLevelParameter{if}v:
- */
- int GL_TEXTURE_INDEX_SIZE_EXT = 0x80ED;
-
- void glColorTableEXT(@GLenum int target, @GLenum int internalFormat, @GLsizei int width, @GLenum int format, @GLenum int type,
- @Check("GLChecks.calculateImageStorage(data, format, type, width, 1, 1)")
- @Const
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer data);
-
- void glColorSubTableEXT(@GLenum int target, @GLsizei int start, @GLsizei int count, @GLenum int format, @GLenum int type,
- @Check("GLChecks.calculateImageStorage(data, format, type, count, 1, 1)")
- @Const
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer data);
-
- void glGetColorTableEXT(@GLenum int target, @GLenum int format, @GLenum int type,
- @OutParameter
- @Check
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer data);
-
- @StripPostfix("params")
- void glGetColorTableParameterivEXT(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
-
- @StripPostfix("params")
- void glGetColorTableParameterfvEXT(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+public interface EXT_paletted_texture {
+
+ /**
+ * Accepted by the internalformat parameter of TexImage1D, TexImage2D and
+ * TexImage3DEXT:
+ */
+ int GL_COLOR_INDEX1_EXT = 0x80E2;
+ int GL_COLOR_INDEX2_EXT = 0x80E3;
+ int GL_COLOR_INDEX4_EXT = 0x80E4;
+ int GL_COLOR_INDEX8_EXT = 0x80E5;
+ int GL_COLOR_INDEX12_EXT = 0x80E6;
+ int GL_COLOR_INDEX16_EXT = 0x80E7;
+
+ /**
+ * Accepted by the pname parameter of GetColorTableParameterivEXT and
+ * GetColorTableParameterfvEXT:
+ */
+ int GL_COLOR_TABLE_FORMAT_EXT = 0x80D8;
+ int GL_COLOR_TABLE_WIDTH_EXT = 0x80D9;
+ int GL_COLOR_TABLE_RED_SIZE_EXT = 0x80DA;
+ int GL_COLOR_TABLE_GREEN_SIZE_EXT = 0x80DB;
+ int GL_COLOR_TABLE_BLUE_SIZE_EXT = 0x80DC;
+ int GL_COLOR_TABLE_ALPHA_SIZE_EXT = 0x80DD;
+ int GL_COLOR_TABLE_LUMINANCE_SIZE_EXT = 0x80DE;
+ int GL_COLOR_TABLE_INTENSITY_SIZE_EXT = 0x80DF;
+
+ /**
+ * Accepted by the value parameter of GetTexLevelParameter{if}v:
+ */
+ int GL_TEXTURE_INDEX_SIZE_EXT = 0x80ED;
+
+ void glColorTableEXT(@GLenum int target, @GLenum int internalFormat, @GLsizei int width, @GLenum int format, @GLenum int type,
+ @Check("GLChecks.calculateImageStorage(data, format, type, width, 1, 1)")
+ @Const
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer data);
+
+ void glColorSubTableEXT(@GLenum int target, @GLsizei int start, @GLsizei int count, @GLenum int format, @GLenum int type,
+ @Check("GLChecks.calculateImageStorage(data, format, type, count, 1, 1)")
+ @Const
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer data);
+
+ void glGetColorTableEXT(@GLenum int target, @GLenum int format, @GLenum int type,
+ @OutParameter
+ @Check
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer data);
+
+ @StripPostfix("params")
+ void glGetColorTableParameterivEXT(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
+
+ @StripPostfix("params")
+ void glGetColorTableParameterfvEXT(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_pixel_buffer_object.java b/src/templates/org/lwjgl/opengl/EXT_pixel_buffer_object.java
index 237b489..b41419e 100644
--- a/src/templates/org/lwjgl/opengl/EXT_pixel_buffer_object.java
+++ b/src/templates/org/lwjgl/opengl/EXT_pixel_buffer_object.java
@@ -1,50 +1,50 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface EXT_pixel_buffer_object extends ARB_buffer_object {
-
- /**
- * Accepted by the <target> parameters of BindBuffer, BufferData,
- * BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData,
- * GetBufferParameteriv, and GetBufferPointerv:
- */
- int GL_PIXEL_PACK_BUFFER_EXT = 0x88EB;
- int GL_PIXEL_UNPACK_BUFFER_EXT = 0x88EC;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv, and GetDoublev:
- */
- int GL_PIXEL_PACK_BUFFER_BINDING_EXT = 0x88ED;
- int GL_PIXEL_UNPACK_BUFFER_BINDING_EXT = 0x88EF;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface EXT_pixel_buffer_object extends ARB_buffer_object {
+
+ /**
+ * Accepted by the <target> parameters of BindBuffer, BufferData,
+ * BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData,
+ * GetBufferParameteriv, and GetBufferPointerv:
+ */
+ int GL_PIXEL_PACK_BUFFER_EXT = 0x88EB;
+ int GL_PIXEL_UNPACK_BUFFER_EXT = 0x88EC;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, and GetDoublev:
+ */
+ int GL_PIXEL_PACK_BUFFER_BINDING_EXT = 0x88ED;
+ int GL_PIXEL_UNPACK_BUFFER_BINDING_EXT = 0x88EF;
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_point_parameters.java b/src/templates/org/lwjgl/opengl/EXT_point_parameters.java
index b2bce5f..61c9438 100644
--- a/src/templates/org/lwjgl/opengl/EXT_point_parameters.java
+++ b/src/templates/org/lwjgl/opengl/EXT_point_parameters.java
@@ -1,48 +1,48 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-public interface EXT_point_parameters {
- int GL_POINT_SIZE_MIN_EXT = 0x8126;
- int GL_POINT_SIZE_MAX_EXT = 0x8127;
- int GL_POINT_FADE_THRESHOLD_SIZE_EXT = 0x8128;
- int GL_DISTANCE_ATTENUATION_EXT = 0x8129;
-
- void glPointParameterfEXT(@GLenum int pname, float param);
-
- @StripPostfix("pfParams")
- void glPointParameterfvEXT(@GLenum int pname, @Check("4") @Const FloatBuffer pfParams);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+public interface EXT_point_parameters {
+ int GL_POINT_SIZE_MIN_EXT = 0x8126;
+ int GL_POINT_SIZE_MAX_EXT = 0x8127;
+ int GL_POINT_FADE_THRESHOLD_SIZE_EXT = 0x8128;
+ int GL_DISTANCE_ATTENUATION_EXT = 0x8129;
+
+ void glPointParameterfEXT(@GLenum int pname, float param);
+
+ @StripPostfix("pfParams")
+ void glPointParameterfvEXT(@GLenum int pname, @Check("4") @Const FloatBuffer pfParams);
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_provoking_vertex.java b/src/templates/org/lwjgl/opengl/EXT_provoking_vertex.java
index 7d91978..077ac9f 100644
--- a/src/templates/org/lwjgl/opengl/EXT_provoking_vertex.java
+++ b/src/templates/org/lwjgl/opengl/EXT_provoking_vertex.java
@@ -1,51 +1,51 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.GLenum;
-
-public interface EXT_provoking_vertex {
-
- /** Accepted by the <mode> parameter of ProvokingVertexEXT: */
- int GL_FIRST_VERTEX_CONVENTION_EXT = 0x8E4D;
- int GL_LAST_VERTEX_CONVENTION_EXT = 0x8E4E;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv, and GetDoublev:
- */
- int GL_PROVOKING_VERTEX_EXT = 0x8E4F;
- int GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT = 0x8E4C;
-
- void glProvokingVertexEXT(@GLenum int mode);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.GLenum;
+
+public interface EXT_provoking_vertex {
+
+ /** Accepted by the <mode> parameter of ProvokingVertexEXT: */
+ int GL_FIRST_VERTEX_CONVENTION_EXT = 0x8E4D;
+ int GL_LAST_VERTEX_CONVENTION_EXT = 0x8E4E;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, and GetDoublev:
+ */
+ int GL_PROVOKING_VERTEX_EXT = 0x8E4F;
+ int GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT = 0x8E4C;
+
+ void glProvokingVertexEXT(@GLenum int mode);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/EXT_rescale_normal.java b/src/templates/org/lwjgl/opengl/EXT_rescale_normal.java
index 9d38af3..23727f9 100644
--- a/src/templates/org/lwjgl/opengl/EXT_rescale_normal.java
+++ b/src/templates/org/lwjgl/opengl/EXT_rescale_normal.java
@@ -1,36 +1,36 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface EXT_rescale_normal {
- int GL_RESCALE_NORMAL_EXT = 0x803A;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface EXT_rescale_normal {
+ int GL_RESCALE_NORMAL_EXT = 0x803A;
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_secondary_color.java b/src/templates/org/lwjgl/opengl/EXT_secondary_color.java
index ec0a0af..10e55e4 100644
--- a/src/templates/org/lwjgl/opengl/EXT_secondary_color.java
+++ b/src/templates/org/lwjgl/opengl/EXT_secondary_color.java
@@ -1,65 +1,65 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.Buffer;
-
-public interface EXT_secondary_color {
-
- int GL_COLOR_SUM_EXT = 0x8458;
- int GL_CURRENT_SECONDARY_COLOR_EXT = 0x8459;
- int GL_SECONDARY_COLOR_ARRAY_SIZE_EXT = 0x845A;
- int GL_SECONDARY_COLOR_ARRAY_TYPE_EXT = 0x845B;
- int GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT = 0x845C;
- int GL_SECONDARY_COLOR_ARRAY_POINTER_EXT = 0x845D;
- int GL_SECONDARY_COLOR_ARRAY_EXT = 0x845E;
-
- void glSecondaryColor3bEXT(byte red, byte green, byte blue);
-
- void glSecondaryColor3fEXT(float red, float green, float blue);
-
- void glSecondaryColor3dEXT(double red, double green, double blue);
-
- void glSecondaryColor3ubEXT(@GLubyte byte red, @GLubyte byte green, @GLubyte byte blue);
-
- void glSecondaryColorPointerEXT(int size, @AutoType("pPointer") @GLenum int type, @GLsizei int stride,
- @CachedReference
- @BufferObject(BufferKind.ArrayVBO)
- @Check
- @Const
- @GLbyte
- @GLubyte
- @GLfloat
- @GLdouble Buffer pPointer);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.Buffer;
+
+public interface EXT_secondary_color {
+
+ int GL_COLOR_SUM_EXT = 0x8458;
+ int GL_CURRENT_SECONDARY_COLOR_EXT = 0x8459;
+ int GL_SECONDARY_COLOR_ARRAY_SIZE_EXT = 0x845A;
+ int GL_SECONDARY_COLOR_ARRAY_TYPE_EXT = 0x845B;
+ int GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT = 0x845C;
+ int GL_SECONDARY_COLOR_ARRAY_POINTER_EXT = 0x845D;
+ int GL_SECONDARY_COLOR_ARRAY_EXT = 0x845E;
+
+ void glSecondaryColor3bEXT(byte red, byte green, byte blue);
+
+ void glSecondaryColor3fEXT(float red, float green, float blue);
+
+ void glSecondaryColor3dEXT(double red, double green, double blue);
+
+ void glSecondaryColor3ubEXT(@GLubyte byte red, @GLubyte byte green, @GLubyte byte blue);
+
+ void glSecondaryColorPointerEXT(int size, @AutoType("pPointer") @GLenum int type, @GLsizei int stride,
+ @CachedReference
+ @BufferObject(BufferKind.ArrayVBO)
+ @Check
+ @Const
+ @GLbyte
+ @GLubyte
+ @GLfloat
+ @GLdouble Buffer pPointer);
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_separate_shader_objects.java b/src/templates/org/lwjgl/opengl/EXT_separate_shader_objects.java
index 152d4b1..7710156 100644
--- a/src/templates/org/lwjgl/opengl/EXT_separate_shader_objects.java
+++ b/src/templates/org/lwjgl/opengl/EXT_separate_shader_objects.java
@@ -1,53 +1,53 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.ByteBuffer;
-
-public interface EXT_separate_shader_objects {
-
- /** Accepted by <type> parameter to GetIntegerv and GetFloatv: */
- int GL_ACTIVE_PROGRAM_EXT = 0x8B8D;
-
- void glUseShaderProgramEXT(@GLenum int type, @GLuint int program);
-
- void glActiveProgramEXT(@GLuint int program);
-
- @GLuint int glCreateShaderProgramEXT(@GLenum int type, @NullTerminated @Const @GLchar ByteBuffer string);
-
- @Alternate("glCreateShaderProgramEXT")
- @GLuint
- int glCreateShaderProgramEXT(@GLenum int type, @NullTerminated CharSequence string);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.ByteBuffer;
+
+public interface EXT_separate_shader_objects {
+
+ /** Accepted by <type> parameter to GetIntegerv and GetFloatv: */
+ int GL_ACTIVE_PROGRAM_EXT = 0x8B8D;
+
+ void glUseShaderProgramEXT(@GLenum int type, @GLuint int program);
+
+ void glActiveProgramEXT(@GLuint int program);
+
+ @GLuint int glCreateShaderProgramEXT(@GLenum int type, @NullTerminated @Const @GLchar ByteBuffer string);
+
+ @Alternate("glCreateShaderProgramEXT")
+ @GLuint
+ int glCreateShaderProgramEXT(@GLenum int type, @NullTerminated CharSequence string);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/EXT_separate_specular_color.java b/src/templates/org/lwjgl/opengl/EXT_separate_specular_color.java
index e8f160f..0aa11cf 100644
--- a/src/templates/org/lwjgl/opengl/EXT_separate_specular_color.java
+++ b/src/templates/org/lwjgl/opengl/EXT_separate_specular_color.java
@@ -1,38 +1,38 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface EXT_separate_specular_color {
- int GL_SINGLE_COLOR_EXT = 0x81F9;
- int GL_SEPARATE_SPECULAR_COLOR_EXT = 0x81FA;
- int GL_LIGHT_MODEL_COLOR_CONTROL_EXT = 0x81F8;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface EXT_separate_specular_color {
+ int GL_SINGLE_COLOR_EXT = 0x81F9;
+ int GL_SEPARATE_SPECULAR_COLOR_EXT = 0x81FA;
+ int GL_LIGHT_MODEL_COLOR_CONTROL_EXT = 0x81F8;
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_shadow_funcs.java b/src/templates/org/lwjgl/opengl/EXT_shadow_funcs.java
index 1fd57bb..b481c31 100644
--- a/src/templates/org/lwjgl/opengl/EXT_shadow_funcs.java
+++ b/src/templates/org/lwjgl/opengl/EXT_shadow_funcs.java
@@ -1,35 +1,35 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface EXT_shadow_funcs {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface EXT_shadow_funcs {
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_shared_texture_palette.java b/src/templates/org/lwjgl/opengl/EXT_shared_texture_palette.java
index 1014d89..42be43a 100644
--- a/src/templates/org/lwjgl/opengl/EXT_shared_texture_palette.java
+++ b/src/templates/org/lwjgl/opengl/EXT_shared_texture_palette.java
@@ -1,36 +1,36 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface EXT_shared_texture_palette {
- int GL_SHARED_TEXTURE_PALETTE_EXT = 0x81FB;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface EXT_shared_texture_palette {
+ int GL_SHARED_TEXTURE_PALETTE_EXT = 0x81FB;
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_stencil_clear_tag.java b/src/templates/org/lwjgl/opengl/EXT_stencil_clear_tag.java
index ba90125..166e985 100644
--- a/src/templates/org/lwjgl/opengl/EXT_stencil_clear_tag.java
+++ b/src/templates/org/lwjgl/opengl/EXT_stencil_clear_tag.java
@@ -1,52 +1,52 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-public interface EXT_stencil_clear_tag {
-
- /**
- Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- GetFloatv, and GetDoublev.
- */
- int GL_STENCIL_TAG_BITS_EXT = 0x88F2;
- int GL_STENCIL_CLEAR_TAG_VALUE_EXT = 0x88F3;
-
- /**
- Controls the stencil clear tag state. stencilTagBits is a count of
- the number of most-significant stencil buffer bits involved in the
- stencil clear tag update.
- */
- void glStencilClearTagEXT(@GLsizei int stencilTagBits, @GLuint int stencilClearTag);
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+public interface EXT_stencil_clear_tag {
+
+ /**
+ Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ GetFloatv, and GetDoublev.
+ */
+ int GL_STENCIL_TAG_BITS_EXT = 0x88F2;
+ int GL_STENCIL_CLEAR_TAG_VALUE_EXT = 0x88F3;
+
+ /**
+ Controls the stencil clear tag state. stencilTagBits is a count of
+ the number of most-significant stencil buffer bits involved in the
+ stencil clear tag update.
+ */
+ void glStencilClearTagEXT(@GLsizei int stencilTagBits, @GLuint int stencilClearTag);
+
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_stencil_two_side.java b/src/templates/org/lwjgl/opengl/EXT_stencil_two_side.java
index a5b2703..ec04da2 100644
--- a/src/templates/org/lwjgl/opengl/EXT_stencil_two_side.java
+++ b/src/templates/org/lwjgl/opengl/EXT_stencil_two_side.java
@@ -1,41 +1,41 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-public interface EXT_stencil_two_side {
- int GL_STENCIL_TEST_TWO_SIDE_EXT = 0x8910;
- int GL_ACTIVE_STENCIL_FACE_EXT = 0x8911;
-
- void glActiveStencilFaceEXT(@GLenum int face);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+public interface EXT_stencil_two_side {
+ int GL_STENCIL_TEST_TWO_SIDE_EXT = 0x8910;
+ int GL_ACTIVE_STENCIL_FACE_EXT = 0x8911;
+
+ void glActiveStencilFaceEXT(@GLenum int face);
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_stencil_wrap.java b/src/templates/org/lwjgl/opengl/EXT_stencil_wrap.java
index 6b00c53..0d018b0 100644
--- a/src/templates/org/lwjgl/opengl/EXT_stencil_wrap.java
+++ b/src/templates/org/lwjgl/opengl/EXT_stencil_wrap.java
@@ -1,37 +1,37 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface EXT_stencil_wrap {
- int GL_INCR_WRAP_EXT = 0x8507;
- int GL_DECR_WRAP_EXT = 0x8508;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface EXT_stencil_wrap {
+ int GL_INCR_WRAP_EXT = 0x8507;
+ int GL_DECR_WRAP_EXT = 0x8508;
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_texture_3d.java b/src/templates/org/lwjgl/opengl/EXT_texture_3d.java
index a5397be..9e93567 100644
--- a/src/templates/org/lwjgl/opengl/EXT_texture_3d.java
+++ b/src/templates/org/lwjgl/opengl/EXT_texture_3d.java
@@ -1,35 +1,35 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface EXT_texture_3d {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface EXT_texture_3d {
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_texture_compression_s3tc.java b/src/templates/org/lwjgl/opengl/EXT_texture_compression_s3tc.java
index d867701..a8b5afe 100644
--- a/src/templates/org/lwjgl/opengl/EXT_texture_compression_s3tc.java
+++ b/src/templates/org/lwjgl/opengl/EXT_texture_compression_s3tc.java
@@ -1,42 +1,42 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
- at Extension(postfix = "EXT", className = "EXTTextureCompressionS3TC")
-public interface EXT_texture_compression_s3tc {
- int GL_COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0;
- int GL_COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1;
- int GL_COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2;
- int GL_COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+ at Extension(postfix = "EXT", className = "EXTTextureCompressionS3TC")
+public interface EXT_texture_compression_s3tc {
+ int GL_COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0;
+ int GL_COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1;
+ int GL_COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2;
+ int GL_COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3;
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_texture_env_combine.java b/src/templates/org/lwjgl/opengl/EXT_texture_env_combine.java
index 0d3bce1..23a2f2f 100644
--- a/src/templates/org/lwjgl/opengl/EXT_texture_env_combine.java
+++ b/src/templates/org/lwjgl/opengl/EXT_texture_env_combine.java
@@ -1,56 +1,56 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface EXT_texture_env_combine {
- int GL_COMBINE_EXT = 0x8570;
- int GL_COMBINE_RGB_EXT = 0x8571;
- int GL_COMBINE_ALPHA_EXT = 0x8572;
- int GL_SOURCE0_RGB_EXT = 0x8580;
- int GL_SOURCE1_RGB_EXT = 0x8581;
- int GL_SOURCE2_RGB_EXT = 0x8582;
- int GL_SOURCE0_ALPHA_EXT = 0x8588;
- int GL_SOURCE1_ALPHA_EXT = 0x8589;
- int GL_SOURCE2_ALPHA_EXT = 0x858A;
- int GL_OPERAND0_RGB_EXT = 0x8590;
- int GL_OPERAND1_RGB_EXT = 0x8591;
- int GL_OPERAND2_RGB_EXT = 0x8592;
- int GL_OPERAND0_ALPHA_EXT = 0x8598;
- int GL_OPERAND1_ALPHA_EXT = 0x8599;
- int GL_OPERAND2_ALPHA_EXT = 0x859A;
- int GL_RGB_SCALE_EXT = 0x8573;
- int GL_ADD_SIGNED_EXT = 0x8574;
- int GL_INTERPOLATE_EXT = 0x8575;
- int GL_CONSTANT_EXT = 0x8576;
- int GL_PRIMARY_COLOR_EXT = 0x8577;
- int GL_PREVIOUS_EXT = 0x8578;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface EXT_texture_env_combine {
+ int GL_COMBINE_EXT = 0x8570;
+ int GL_COMBINE_RGB_EXT = 0x8571;
+ int GL_COMBINE_ALPHA_EXT = 0x8572;
+ int GL_SOURCE0_RGB_EXT = 0x8580;
+ int GL_SOURCE1_RGB_EXT = 0x8581;
+ int GL_SOURCE2_RGB_EXT = 0x8582;
+ int GL_SOURCE0_ALPHA_EXT = 0x8588;
+ int GL_SOURCE1_ALPHA_EXT = 0x8589;
+ int GL_SOURCE2_ALPHA_EXT = 0x858A;
+ int GL_OPERAND0_RGB_EXT = 0x8590;
+ int GL_OPERAND1_RGB_EXT = 0x8591;
+ int GL_OPERAND2_RGB_EXT = 0x8592;
+ int GL_OPERAND0_ALPHA_EXT = 0x8598;
+ int GL_OPERAND1_ALPHA_EXT = 0x8599;
+ int GL_OPERAND2_ALPHA_EXT = 0x859A;
+ int GL_RGB_SCALE_EXT = 0x8573;
+ int GL_ADD_SIGNED_EXT = 0x8574;
+ int GL_INTERPOLATE_EXT = 0x8575;
+ int GL_CONSTANT_EXT = 0x8576;
+ int GL_PRIMARY_COLOR_EXT = 0x8577;
+ int GL_PREVIOUS_EXT = 0x8578;
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_texture_env_dot3.java b/src/templates/org/lwjgl/opengl/EXT_texture_env_dot3.java
index 4346fd8..a14aca0 100644
--- a/src/templates/org/lwjgl/opengl/EXT_texture_env_dot3.java
+++ b/src/templates/org/lwjgl/opengl/EXT_texture_env_dot3.java
@@ -1,37 +1,37 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface EXT_texture_env_dot3 {
- int GL_DOT3_RGB_EXT = 0x8740;
- int GL_DOT3_RGBA_EXT = 0x8741;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface EXT_texture_env_dot3 {
+ int GL_DOT3_RGB_EXT = 0x8740;
+ int GL_DOT3_RGBA_EXT = 0x8741;
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_texture_filter_anisotropic.java b/src/templates/org/lwjgl/opengl/EXT_texture_filter_anisotropic.java
index f369dd9..086b427 100644
--- a/src/templates/org/lwjgl/opengl/EXT_texture_filter_anisotropic.java
+++ b/src/templates/org/lwjgl/opengl/EXT_texture_filter_anisotropic.java
@@ -1,37 +1,37 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface EXT_texture_filter_anisotropic {
- int GL_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE;
- int GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface EXT_texture_filter_anisotropic {
+ int GL_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE;
+ int GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF;
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_texture_lod_bias.java b/src/templates/org/lwjgl/opengl/EXT_texture_lod_bias.java
index 66545ae..0b5a0b3 100644
--- a/src/templates/org/lwjgl/opengl/EXT_texture_lod_bias.java
+++ b/src/templates/org/lwjgl/opengl/EXT_texture_lod_bias.java
@@ -1,41 +1,41 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
- at Extension(postfix = "EXT", className = "EXTTextureLODBias")
-public interface EXT_texture_lod_bias {
- int GL_TEXTURE_FILTER_CONTROL_EXT = 0x8500;
- int GL_TEXTURE_LOD_BIAS_EXT = 0x8501;
- int GL_MAX_TEXTURE_LOD_BIAS_EXT = 0x84FD;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+ at Extension(postfix = "EXT", className = "EXTTextureLODBias")
+public interface EXT_texture_lod_bias {
+ int GL_TEXTURE_FILTER_CONTROL_EXT = 0x8500;
+ int GL_TEXTURE_LOD_BIAS_EXT = 0x8501;
+ int GL_MAX_TEXTURE_LOD_BIAS_EXT = 0x84FD;
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_texture_mirror_clamp.java b/src/templates/org/lwjgl/opengl/EXT_texture_mirror_clamp.java
index 33983a0..440a5b0 100644
--- a/src/templates/org/lwjgl/opengl/EXT_texture_mirror_clamp.java
+++ b/src/templates/org/lwjgl/opengl/EXT_texture_mirror_clamp.java
@@ -1,45 +1,45 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface EXT_texture_mirror_clamp {
-
- /**
- * Accepted by the <param> parameter of TexParameteri and TexParameterf,
- * and by the <params> parameter of TexParameteriv and TexParameterfv,
- * when their <pname> parameter is TEXTURE_WRAP_S, TEXTURE_WRAP_T,
- * or TEXTURE_WRAP_R:
- */
- int GL_MIRROR_CLAMP_EXT = 0x8742;
- int GL_MIRROR_CLAMP_TO_EDGE_EXT = 0x8743;
- int GL_MIRROR_CLAMP_TO_BORDER_EXT = 0x8912;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface EXT_texture_mirror_clamp {
+
+ /**
+ * Accepted by the <param> parameter of TexParameteri and TexParameterf,
+ * and by the <params> parameter of TexParameteriv and TexParameterfv,
+ * when their <pname> parameter is TEXTURE_WRAP_S, TEXTURE_WRAP_T,
+ * or TEXTURE_WRAP_R:
+ */
+ int GL_MIRROR_CLAMP_EXT = 0x8742;
+ int GL_MIRROR_CLAMP_TO_EDGE_EXT = 0x8743;
+ int GL_MIRROR_CLAMP_TO_BORDER_EXT = 0x8912;
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_texture_rectangle.java b/src/templates/org/lwjgl/opengl/EXT_texture_rectangle.java
index caa73fe..a19bdb7 100644
--- a/src/templates/org/lwjgl/opengl/EXT_texture_rectangle.java
+++ b/src/templates/org/lwjgl/opengl/EXT_texture_rectangle.java
@@ -1,39 +1,39 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface EXT_texture_rectangle {
- int GL_TEXTURE_RECTANGLE_EXT = 0x84F5;
- int GL_TEXTURE_BINDING_RECTANGLE_EXT = 0x84F6;
- int GL_PROXY_TEXTURE_RECTANGLE_EXT = 0x84F7;
- int GL_MAX_RECTANGLE_TEXTURE_SIZE_EXT = 0x84F8;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface EXT_texture_rectangle {
+ int GL_TEXTURE_RECTANGLE_EXT = 0x84F5;
+ int GL_TEXTURE_BINDING_RECTANGLE_EXT = 0x84F6;
+ int GL_PROXY_TEXTURE_RECTANGLE_EXT = 0x84F7;
+ int GL_MAX_RECTANGLE_TEXTURE_SIZE_EXT = 0x84F8;
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_texture_sRGB.java b/src/templates/org/lwjgl/opengl/EXT_texture_sRGB.java
index e03d496..8e918e0 100644
--- a/src/templates/org/lwjgl/opengl/EXT_texture_sRGB.java
+++ b/src/templates/org/lwjgl/opengl/EXT_texture_sRGB.java
@@ -1,63 +1,63 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface EXT_texture_sRGB {
-
- /**
- Accepted by the <internalformat> parameter of TexImage1D, TexImage2D,
- TexImage3D, CopyTexImage1D, CopyTexImage2D.
- */
- int GL_SRGB_EXT = 0x8C40;
- int GL_SRGB8_EXT = 0x8C41;
- int GL_SRGB_ALPHA_EXT = 0x8C42;
- int GL_SRGB8_ALPHA8_EXT = 0x8C43;
- int GL_SLUMINANCE_ALPHA_EXT = 0x8C44;
- int GL_SLUMINANCE8_ALPHA8_EXT = 0x8C45;
- int GL_SLUMINANCE_EXT = 0x8C46;
- int GL_SLUMINANCE8_EXT = 0x8C47;
- int GL_COMPRESSED_SRGB_EXT = 0x8C48;
- int GL_COMPRESSED_SRGB_ALPHA_EXT = 0x8C49;
- int GL_COMPRESSED_SLUMINANCE_EXT = 0x8C4A;
- int GL_COMPRESSED_SLUMINANCE_ALPHA_EXT = 0x8C4B;
-
- /**
- Accepted by the <internalformat> parameter of TexImage2D,
- CopyTexImage2D, and CompressedTexImage2DARB and the <format> parameter
- of CompressedTexSubImage2DARB.
- */
- int GL_COMPRESSED_SRGB_S3TC_DXT1_EXT = 0x8C4C;
- int GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 0x8C4D;
- int GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 0x8C4E;
- int GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 0x8C4F;
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface EXT_texture_sRGB {
+
+ /**
+ Accepted by the <internalformat> parameter of TexImage1D, TexImage2D,
+ TexImage3D, CopyTexImage1D, CopyTexImage2D.
+ */
+ int GL_SRGB_EXT = 0x8C40;
+ int GL_SRGB8_EXT = 0x8C41;
+ int GL_SRGB_ALPHA_EXT = 0x8C42;
+ int GL_SRGB8_ALPHA8_EXT = 0x8C43;
+ int GL_SLUMINANCE_ALPHA_EXT = 0x8C44;
+ int GL_SLUMINANCE8_ALPHA8_EXT = 0x8C45;
+ int GL_SLUMINANCE_EXT = 0x8C46;
+ int GL_SLUMINANCE8_EXT = 0x8C47;
+ int GL_COMPRESSED_SRGB_EXT = 0x8C48;
+ int GL_COMPRESSED_SRGB_ALPHA_EXT = 0x8C49;
+ int GL_COMPRESSED_SLUMINANCE_EXT = 0x8C4A;
+ int GL_COMPRESSED_SLUMINANCE_ALPHA_EXT = 0x8C4B;
+
+ /**
+ Accepted by the <internalformat> parameter of TexImage2D,
+ CopyTexImage2D, and CompressedTexImage2DARB and the <format> parameter
+ of CompressedTexSubImage2DARB.
+ */
+ int GL_COMPRESSED_SRGB_S3TC_DXT1_EXT = 0x8C4C;
+ int GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 0x8C4D;
+ int GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 0x8C4E;
+ int GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 0x8C4F;
+
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_texture_snorm.java b/src/templates/org/lwjgl/opengl/EXT_texture_snorm.java
index 7782cc0..6816705 100644
--- a/src/templates/org/lwjgl/opengl/EXT_texture_snorm.java
+++ b/src/templates/org/lwjgl/opengl/EXT_texture_snorm.java
@@ -1,70 +1,70 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface EXT_texture_snorm {
-
- /**
- * Accepted by the <internalFormat> parameter of TexImage1D,
- * TexImage2D, and TexImage3D:
- */
- int GL_RED_SNORM = 0x8F90;
- int GL_RG_SNORM = 0x8F91;
- int GL_RGB_SNORM = 0x8F92;
- int GL_RGBA_SNORM = 0x8F93;
- int GL_ALPHA_SNORM = 0x9010;
- int GL_LUMINANCE_SNORM = 0x9011;
- int GL_LUMINANCE_ALPHA_SNORM = 0x9012;
- int GL_INTENSITY_SNORM = 0x9013;
-
- int GL_R8_SNORM = 0x8F94;
- int GL_RG8_SNORM = 0x8F95;
- int GL_RGB8_SNORM = 0x8F96;
- int GL_RGBA8_SNORM = 0x8F97;
- int GL_ALPHA8_SNORM = 0x9014;
- int GL_LUMINANCE8_SNORM = 0x9015;
- int GL_LUMINANCE8_ALPHA8_SNORM = 0x9016;
- int GL_INTENSITY8_SNORM = 0x9017;
-
- int GL_R16_SNORM = 0x8F98;
- int GL_RG16_SNORM = 0x8F99;
- int GL_RGB16_SNORM = 0x8F9A;
- int GL_RGBA16_SNORM = 0x8F9B;
- int GL_ALPHA16_SNORM = 0x9018;
- int GL_LUMINANCE16_SNORM = 0x9019;
- int GL_LUMINANCE16_ALPHA16_SNORM = 0x901A;
- int GL_INTENSITY16_SNORM = 0x901B;
-
- /** Returned by GetTexLevelParmeter */
- int GL_SIGNED_NORMALIZED = 0x8F9C;
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface EXT_texture_snorm {
+
+ /**
+ * Accepted by the <internalFormat> parameter of TexImage1D,
+ * TexImage2D, and TexImage3D:
+ */
+ int GL_RED_SNORM = 0x8F90;
+ int GL_RG_SNORM = 0x8F91;
+ int GL_RGB_SNORM = 0x8F92;
+ int GL_RGBA_SNORM = 0x8F93;
+ int GL_ALPHA_SNORM = 0x9010;
+ int GL_LUMINANCE_SNORM = 0x9011;
+ int GL_LUMINANCE_ALPHA_SNORM = 0x9012;
+ int GL_INTENSITY_SNORM = 0x9013;
+
+ int GL_R8_SNORM = 0x8F94;
+ int GL_RG8_SNORM = 0x8F95;
+ int GL_RGB8_SNORM = 0x8F96;
+ int GL_RGBA8_SNORM = 0x8F97;
+ int GL_ALPHA8_SNORM = 0x9014;
+ int GL_LUMINANCE8_SNORM = 0x9015;
+ int GL_LUMINANCE8_ALPHA8_SNORM = 0x9016;
+ int GL_INTENSITY8_SNORM = 0x9017;
+
+ int GL_R16_SNORM = 0x8F98;
+ int GL_RG16_SNORM = 0x8F99;
+ int GL_RGB16_SNORM = 0x8F9A;
+ int GL_RGBA16_SNORM = 0x8F9B;
+ int GL_ALPHA16_SNORM = 0x9018;
+ int GL_LUMINANCE16_SNORM = 0x9019;
+ int GL_LUMINANCE16_ALPHA16_SNORM = 0x901A;
+ int GL_INTENSITY16_SNORM = 0x901B;
+
+ /** Returned by GetTexLevelParmeter */
+ int GL_SIGNED_NORMALIZED = 0x8F9C;
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/EXT_timer_query.java b/src/templates/org/lwjgl/opengl/EXT_timer_query.java
index 520c729..87e9d3d 100644
--- a/src/templates/org/lwjgl/opengl/EXT_timer_query.java
+++ b/src/templates/org/lwjgl/opengl/EXT_timer_query.java
@@ -1,62 +1,62 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-public interface EXT_timer_query {
-
- /**
- * Accepted by the <target> parameter of BeginQuery, EndQuery, and
- * GetQueryiv:
- */
- int GL_TIME_ELAPSED_EXT = 0x88BF;
-
- @StripPostfix("params")
- void glGetQueryObjecti64vEXT(@GLuint int id, @GLenum int pname, @OutParameter @Check("1") @GLint64EXT LongBuffer params);
-
- @Alternate("glGetQueryObjecti64vEXT")
- @GLreturn("params")
- @StripPostfix("params")
- void glGetQueryObjecti64vEXT2(@GLuint int id, @GLenum int pname, @OutParameter @GLint64EXT LongBuffer params);
-
- @StripPostfix("params")
- void glGetQueryObjectui64vEXT(@GLuint int id, @GLenum int pname, @OutParameter @Check("1") @GLuint64EXT LongBuffer params);
-
- @Alternate("glGetQueryObjectui64vEXT")
- @GLreturn("params")
- @StripPostfix("params")
- void glGetQueryObjectui64vEXT2(@GLuint int id, @GLenum int pname, @OutParameter @GLuint64EXT LongBuffer params);
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+public interface EXT_timer_query {
+
+ /**
+ * Accepted by the <target> parameter of BeginQuery, EndQuery, and
+ * GetQueryiv:
+ */
+ int GL_TIME_ELAPSED_EXT = 0x88BF;
+
+ @StripPostfix("params")
+ void glGetQueryObjecti64vEXT(@GLuint int id, @GLenum int pname, @OutParameter @Check("1") @GLint64EXT LongBuffer params);
+
+ @Alternate("glGetQueryObjecti64vEXT")
+ @GLreturn("params")
+ @StripPostfix("params")
+ void glGetQueryObjecti64vEXT2(@GLuint int id, @GLenum int pname, @OutParameter @GLint64EXT LongBuffer params);
+
+ @StripPostfix("params")
+ void glGetQueryObjectui64vEXT(@GLuint int id, @GLenum int pname, @OutParameter @Check("1") @GLuint64EXT LongBuffer params);
+
+ @Alternate("glGetQueryObjectui64vEXT")
+ @GLreturn("params")
+ @StripPostfix("params")
+ void glGetQueryObjectui64vEXT2(@GLuint int id, @GLenum int pname, @OutParameter @GLuint64EXT LongBuffer params);
+
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_vertex_shader.java b/src/templates/org/lwjgl/opengl/EXT_vertex_shader.java
index b08d437..553df9f 100644
--- a/src/templates/org/lwjgl/opengl/EXT_vertex_shader.java
+++ b/src/templates/org/lwjgl/opengl/EXT_vertex_shader.java
@@ -1,290 +1,290 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-public interface EXT_vertex_shader {
- int GL_VERTEX_SHADER_EXT = 0x8780;
- int GL_VERTEX_SHADER_BINDING_EXT = 0x8781;
- int GL_OP_INDEX_EXT = 0x8782;
- int GL_OP_NEGATE_EXT = 0x8783;
- int GL_OP_DOT3_EXT = 0x8784;
- int GL_OP_DOT4_EXT = 0x8785;
- int GL_OP_MUL_EXT = 0x8786;
- int GL_OP_ADD_EXT = 0x8787;
- int GL_OP_MADD_EXT = 0x8788;
- int GL_OP_FRAC_EXT = 0x8789;
- int GL_OP_MAX_EXT = 0x878A;
- int GL_OP_MIN_EXT = 0x878B;
- int GL_OP_SET_GE_EXT = 0x878C;
- int GL_OP_SET_LT_EXT = 0x878D;
- int GL_OP_CLAMP_EXT = 0x878E;
- int GL_OP_FLOOR_EXT = 0x878F;
- int GL_OP_ROUND_EXT = 0x8790;
- int GL_OP_EXP_BASE_2_EXT = 0x8791;
- int GL_OP_LOG_BASE_2_EXT = 0x8792;
- int GL_OP_POWER_EXT = 0x8793;
- int GL_OP_RECIP_EXT = 0x8794;
- int GL_OP_RECIP_SQRT_EXT = 0x8795;
- int GL_OP_SUB_EXT = 0x8796;
- int GL_OP_CROSS_PRODUCT_EXT = 0x8797;
- int GL_OP_MULTIPLY_MATRIX_EXT = 0x8798;
- int GL_OP_MOV_EXT = 0x8799;
- int GL_OUTPUT_VERTEX_EXT = 0x879A;
- int GL_OUTPUT_COLOR0_EXT = 0x879B;
- int GL_OUTPUT_COLOR1_EXT = 0x879C;
- int GL_OUTPUT_TEXTURE_COORD0_EXT = 0x879D;
- int GL_OUTPUT_TEXTURE_COORD1_EXT = 0x879E;
- int GL_OUTPUT_TEXTURE_COORD2_EXT = 0x879F;
- int GL_OUTPUT_TEXTURE_COORD3_EXT = 0x87A0;
- int GL_OUTPUT_TEXTURE_COORD4_EXT = 0x87A1;
- int GL_OUTPUT_TEXTURE_COORD5_EXT = 0x87A2;
- int GL_OUTPUT_TEXTURE_COORD6_EXT = 0x87A3;
- int GL_OUTPUT_TEXTURE_COORD7_EXT = 0x87A4;
- int GL_OUTPUT_TEXTURE_COORD8_EXT = 0x87A5;
- int GL_OUTPUT_TEXTURE_COORD9_EXT = 0x87A6;
- int GL_OUTPUT_TEXTURE_COORD10_EXT = 0x87A7;
- int GL_OUTPUT_TEXTURE_COORD11_EXT = 0x87A8;
- int GL_OUTPUT_TEXTURE_COORD12_EXT = 0x87A9;
- int GL_OUTPUT_TEXTURE_COORD13_EXT = 0x87AA;
- int GL_OUTPUT_TEXTURE_COORD14_EXT = 0x87AB;
- int GL_OUTPUT_TEXTURE_COORD15_EXT = 0x87AC;
- int GL_OUTPUT_TEXTURE_COORD16_EXT = 0x87AD;
- int GL_OUTPUT_TEXTURE_COORD17_EXT = 0x87AE;
- int GL_OUTPUT_TEXTURE_COORD18_EXT = 0x87AF;
- int GL_OUTPUT_TEXTURE_COORD19_EXT = 0x87B0;
- int GL_OUTPUT_TEXTURE_COORD20_EXT = 0x87B1;
- int GL_OUTPUT_TEXTURE_COORD21_EXT = 0x87B2;
- int GL_OUTPUT_TEXTURE_COORD22_EXT = 0x87B3;
- int GL_OUTPUT_TEXTURE_COORD23_EXT = 0x87B4;
- int GL_OUTPUT_TEXTURE_COORD24_EXT = 0x87B5;
- int GL_OUTPUT_TEXTURE_COORD25_EXT = 0x87B6;
- int GL_OUTPUT_TEXTURE_COORD26_EXT = 0x87B7;
- int GL_OUTPUT_TEXTURE_COORD27_EXT = 0x87B8;
- int GL_OUTPUT_TEXTURE_COORD28_EXT = 0x87B9;
- int GL_OUTPUT_TEXTURE_COORD29_EXT = 0x87BA;
- int GL_OUTPUT_TEXTURE_COORD30_EXT = 0x87BB;
- int GL_OUTPUT_TEXTURE_COORD31_EXT = 0x87BC;
- int GL_OUTPUT_FOG_EXT = 0x87BD;
- int GL_SCALAR_EXT = 0x87BE;
- int GL_VECTOR_EXT = 0x87BF;
- int GL_MATRIX_EXT = 0x87C0;
- int GL_VARIANT_EXT = 0x87C1;
- int GL_INVARIANT_EXT = 0x87C2;
- int GL_LOCAL_CONSTANT_EXT = 0x87C3;
- int GL_LOCAL_EXT = 0x87C4;
- int GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT = 0x87C5;
- int GL_MAX_VERTEX_SHADER_VARIANTS_EXT = 0x87C6;
- int GL_MAX_VERTEX_SHADER_INVARIANTS_EXT = 0x87C7;
- int GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT = 0x87C8;
- int GL_MAX_VERTEX_SHADER_LOCALS_EXT = 0x87C9;
- int GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT = 0x87CA;
- int GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT = 0x87CB;
- int GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT = 0x87CC;
- int GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT = 0x87CD;
- int GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT = 0x87CE;
- int GL_VERTEX_SHADER_INSTRUCTIONS_EXT = 0x87CF;
- int GL_VERTEX_SHADER_VARIANTS_EXT = 0x87D0;
- int GL_VERTEX_SHADER_INVARIANTS_EXT = 0x87D1;
- int GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT = 0x87D2;
- int GL_VERTEX_SHADER_LOCALS_EXT = 0x87D3;
- int GL_VERTEX_SHADER_OPTIMIZED_EXT = 0x87D4;
- int GL_X_EXT = 0x87D5;
- int GL_Y_EXT = 0x87D6;
- int GL_Z_EXT = 0x87D7;
- int GL_W_EXT = 0x87D8;
- int GL_NEGATIVE_X_EXT = 0x87D9;
- int GL_NEGATIVE_Y_EXT = 0x87DA;
- int GL_NEGATIVE_Z_EXT = 0x87DB;
- int GL_NEGATIVE_W_EXT = 0x87DC;
- int GL_ZERO_EXT = 0x87DD;
- int GL_ONE_EXT = 0x87DE;
- int GL_NEGATIVE_ONE_EXT = 0x87DF;
- int GL_NORMALIZED_RANGE_EXT = 0x87E0;
- int GL_FULL_RANGE_EXT = 0x87E1;
- int GL_CURRENT_VERTEX_EXT = 0x87E2;
- int GL_MVP_MATRIX_EXT = 0x87E3;
- int GL_VARIANT_VALUE_EXT = 0x87E4;
- int GL_VARIANT_DATATYPE_EXT = 0x87E5;
- int GL_VARIANT_ARRAY_STRIDE_EXT = 0x87E6;
- int GL_VARIANT_ARRAY_TYPE_EXT = 0x87E7;
- int GL_VARIANT_ARRAY_EXT = 0x87E8;
- int GL_VARIANT_ARRAY_POINTER_EXT = 0x87E9;
- int GL_INVARIANT_VALUE_EXT = 0x87EA;
- int GL_INVARIANT_DATATYPE_EXT = 0x87EB;
- int GL_LOCAL_CONSTANT_VALUE_EXT = 0x87EC;
- int GL_LOCAL_CONSTANT_DATATYPE_EXT = 0x87ED;
-
- void glBeginVertexShaderEXT();
-
- void glEndVertexShaderEXT();
-
- void glBindVertexShaderEXT(@GLuint int id);
-
- @GLuint
- int glGenVertexShadersEXT(@GLuint int range);
-
- void glDeleteVertexShaderEXT(@GLuint int id);
-
- void glShaderOp1EXT(@GLenum int op, @GLuint int res, @GLuint int arg1);
-
- void glShaderOp2EXT(@GLenum int op, @GLuint int res, @GLuint int arg1, @GLuint int arg2);
-
- void glShaderOp3EXT(@GLenum int op, @GLuint int res, @GLuint int arg1, @GLuint int arg2, @GLuint int arg3);
-
- void glSwizzleEXT(@GLuint int res, @GLuint int in, @GLenum int outX, @GLenum int outY, @GLenum int outZ, @GLenum int outW);
-
- void glWriteMaskEXT(@GLuint int res, @GLuint int in, @GLenum int outX, @GLenum int outY, @GLenum int outZ, @GLenum int outW);
-
- void glInsertComponentEXT(@GLuint int res, @GLuint int src, @GLuint int num);
-
- void glExtractComponentEXT(@GLuint int res, @GLuint int src, @GLuint int num);
-
- @GLuint
- int glGenSymbolsEXT(@GLenum int dataType, @GLenum int storageType, @GLenum int range, @GLuint int components);
-
- void glSetInvariantEXT(@GLuint int id, @AutoType("pAddr") @GLenum int type,
- @Check("4")
- @Const
- @GLbyte
- @GLubyte
- @GLshort
- @GLushort
- @GLint
- @GLuint
- @GLfloat
- @GLdouble Buffer pAddr);
-
- void glSetLocalConstantEXT(@GLuint int id, @AutoType("pAddr") @GLenum int type,
- @Check("4")
- @Const
- @GLbyte
- @GLubyte
- @GLshort
- @GLushort
- @GLint
- @GLuint
- @GLfloat
- @GLdouble Buffer pAddr);
-
- @StripPostfix("pAddr")
- void glVariantbvEXT(@GLuint int id, @Check("4") @Const ByteBuffer pAddr);
-
- @StripPostfix("pAddr")
- void glVariantsvEXT(@GLuint int id, @Check("4") @Const ShortBuffer pAddr);
-
- @StripPostfix("pAddr")
- void glVariantivEXT(@GLuint int id, @Check("4") @Const IntBuffer pAddr);
-
- @StripPostfix("pAddr")
- void glVariantfvEXT(@GLuint int id, @Check("4") @Const FloatBuffer pAddr);
-
- @StripPostfix("pAddr")
- void glVariantdvEXT(@GLuint int id, @Check("4") @Const DoubleBuffer pAddr);
-
- @StripPostfix("pAddr")
- void glVariantubvEXT(@GLuint int id, @Check("4") @Const @GLubyte ByteBuffer pAddr);
-
- @StripPostfix("pAddr")
- void glVariantusvEXT(@GLuint int id, @Check("4") @Const @GLushort ShortBuffer pAddr);
-
- @StripPostfix("pAddr")
- void glVariantuivEXT(@GLuint int id, @Check("4") @Const @GLuint IntBuffer pAddr);
-
- void glVariantPointerEXT(@GLuint int id, @AutoType("pAddr") @GLenum int type, @GLuint int stride,
- @CachedReference
- @BufferObject(BufferKind.ArrayVBO)
- @Check
- @Const
- @GLbyte
- @GLshort
- @GLint
- @GLubyte
- @GLushort
- @GLuint
- @GLfloat
- @GLdouble Buffer pAddr);
-
- void glEnableVariantClientStateEXT(@GLuint int id);
-
- void glDisableVariantClientStateEXT(@GLuint int id);
-
- @GLuint
- int glBindLightParameterEXT(@GLenum int light, @GLenum int value);
-
- @GLuint
- int glBindMaterialParameterEXT(@GLenum int face, @GLenum int value);
-
- @GLuint
- int glBindTexGenParameterEXT(@GLenum int unit, @GLenum int coord, @GLenum int value);
-
- @GLuint
- int glBindTextureUnitParameterEXT(@GLenum int unit, @GLenum int value);
-
- @GLuint
- int glBindParameterEXT(@GLenum int value);
-
- boolean glIsVariantEnabledEXT(@GLuint int id, @GLenum int cap);
-
- @StripPostfix("pbData")
- void glGetVariantBooleanvEXT(@GLuint int id, @GLenum int value, @OutParameter @Check("4") ByteBuffer pbData);
-
- @StripPostfix("pbData")
- void glGetVariantIntegervEXT(@GLuint int id, @GLenum int value, @OutParameter @Check("4") IntBuffer pbData);
-
- @StripPostfix("pbData")
- void glGetVariantFloatvEXT(@GLuint int id, @GLenum int value, @OutParameter @Check("4") FloatBuffer pbData);
-
- @StripPostfix("pbData")
- void glGetVariantPointervEXT(@GLuint int id, @GLenum int value, @OutParameter @Result @GLvoid ByteBuffer pbData);
-
- @StripPostfix("pbData")
- void glGetInvariantBooleanvEXT(@GLuint int id, @GLenum int value, @OutParameter @Check("4") ByteBuffer pbData);
-
- @StripPostfix("pbData")
- void glGetInvariantIntegervEXT(@GLuint int id, @GLenum int value, @OutParameter @Check("4") IntBuffer pbData);
-
- @StripPostfix("pbData")
- void glGetInvariantFloatvEXT(@GLuint int id, @GLenum int value, @OutParameter @Check("4") FloatBuffer pbData);
-
- @StripPostfix("pbData")
- void glGetLocalConstantBooleanvEXT(@GLuint int id, @GLenum int value, @OutParameter @Check("4") ByteBuffer pbData);
-
- @StripPostfix("pbData")
- void glGetLocalConstantIntegervEXT(@GLuint int id, @GLenum int value, @OutParameter @Check("4") IntBuffer pbData);
-
- @StripPostfix("pbData")
- void glGetLocalConstantFloatvEXT(@GLuint int id, @GLenum int value, @OutParameter @Check("4") FloatBuffer pbData);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+public interface EXT_vertex_shader {
+ int GL_VERTEX_SHADER_EXT = 0x8780;
+ int GL_VERTEX_SHADER_BINDING_EXT = 0x8781;
+ int GL_OP_INDEX_EXT = 0x8782;
+ int GL_OP_NEGATE_EXT = 0x8783;
+ int GL_OP_DOT3_EXT = 0x8784;
+ int GL_OP_DOT4_EXT = 0x8785;
+ int GL_OP_MUL_EXT = 0x8786;
+ int GL_OP_ADD_EXT = 0x8787;
+ int GL_OP_MADD_EXT = 0x8788;
+ int GL_OP_FRAC_EXT = 0x8789;
+ int GL_OP_MAX_EXT = 0x878A;
+ int GL_OP_MIN_EXT = 0x878B;
+ int GL_OP_SET_GE_EXT = 0x878C;
+ int GL_OP_SET_LT_EXT = 0x878D;
+ int GL_OP_CLAMP_EXT = 0x878E;
+ int GL_OP_FLOOR_EXT = 0x878F;
+ int GL_OP_ROUND_EXT = 0x8790;
+ int GL_OP_EXP_BASE_2_EXT = 0x8791;
+ int GL_OP_LOG_BASE_2_EXT = 0x8792;
+ int GL_OP_POWER_EXT = 0x8793;
+ int GL_OP_RECIP_EXT = 0x8794;
+ int GL_OP_RECIP_SQRT_EXT = 0x8795;
+ int GL_OP_SUB_EXT = 0x8796;
+ int GL_OP_CROSS_PRODUCT_EXT = 0x8797;
+ int GL_OP_MULTIPLY_MATRIX_EXT = 0x8798;
+ int GL_OP_MOV_EXT = 0x8799;
+ int GL_OUTPUT_VERTEX_EXT = 0x879A;
+ int GL_OUTPUT_COLOR0_EXT = 0x879B;
+ int GL_OUTPUT_COLOR1_EXT = 0x879C;
+ int GL_OUTPUT_TEXTURE_COORD0_EXT = 0x879D;
+ int GL_OUTPUT_TEXTURE_COORD1_EXT = 0x879E;
+ int GL_OUTPUT_TEXTURE_COORD2_EXT = 0x879F;
+ int GL_OUTPUT_TEXTURE_COORD3_EXT = 0x87A0;
+ int GL_OUTPUT_TEXTURE_COORD4_EXT = 0x87A1;
+ int GL_OUTPUT_TEXTURE_COORD5_EXT = 0x87A2;
+ int GL_OUTPUT_TEXTURE_COORD6_EXT = 0x87A3;
+ int GL_OUTPUT_TEXTURE_COORD7_EXT = 0x87A4;
+ int GL_OUTPUT_TEXTURE_COORD8_EXT = 0x87A5;
+ int GL_OUTPUT_TEXTURE_COORD9_EXT = 0x87A6;
+ int GL_OUTPUT_TEXTURE_COORD10_EXT = 0x87A7;
+ int GL_OUTPUT_TEXTURE_COORD11_EXT = 0x87A8;
+ int GL_OUTPUT_TEXTURE_COORD12_EXT = 0x87A9;
+ int GL_OUTPUT_TEXTURE_COORD13_EXT = 0x87AA;
+ int GL_OUTPUT_TEXTURE_COORD14_EXT = 0x87AB;
+ int GL_OUTPUT_TEXTURE_COORD15_EXT = 0x87AC;
+ int GL_OUTPUT_TEXTURE_COORD16_EXT = 0x87AD;
+ int GL_OUTPUT_TEXTURE_COORD17_EXT = 0x87AE;
+ int GL_OUTPUT_TEXTURE_COORD18_EXT = 0x87AF;
+ int GL_OUTPUT_TEXTURE_COORD19_EXT = 0x87B0;
+ int GL_OUTPUT_TEXTURE_COORD20_EXT = 0x87B1;
+ int GL_OUTPUT_TEXTURE_COORD21_EXT = 0x87B2;
+ int GL_OUTPUT_TEXTURE_COORD22_EXT = 0x87B3;
+ int GL_OUTPUT_TEXTURE_COORD23_EXT = 0x87B4;
+ int GL_OUTPUT_TEXTURE_COORD24_EXT = 0x87B5;
+ int GL_OUTPUT_TEXTURE_COORD25_EXT = 0x87B6;
+ int GL_OUTPUT_TEXTURE_COORD26_EXT = 0x87B7;
+ int GL_OUTPUT_TEXTURE_COORD27_EXT = 0x87B8;
+ int GL_OUTPUT_TEXTURE_COORD28_EXT = 0x87B9;
+ int GL_OUTPUT_TEXTURE_COORD29_EXT = 0x87BA;
+ int GL_OUTPUT_TEXTURE_COORD30_EXT = 0x87BB;
+ int GL_OUTPUT_TEXTURE_COORD31_EXT = 0x87BC;
+ int GL_OUTPUT_FOG_EXT = 0x87BD;
+ int GL_SCALAR_EXT = 0x87BE;
+ int GL_VECTOR_EXT = 0x87BF;
+ int GL_MATRIX_EXT = 0x87C0;
+ int GL_VARIANT_EXT = 0x87C1;
+ int GL_INVARIANT_EXT = 0x87C2;
+ int GL_LOCAL_CONSTANT_EXT = 0x87C3;
+ int GL_LOCAL_EXT = 0x87C4;
+ int GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT = 0x87C5;
+ int GL_MAX_VERTEX_SHADER_VARIANTS_EXT = 0x87C6;
+ int GL_MAX_VERTEX_SHADER_INVARIANTS_EXT = 0x87C7;
+ int GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT = 0x87C8;
+ int GL_MAX_VERTEX_SHADER_LOCALS_EXT = 0x87C9;
+ int GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT = 0x87CA;
+ int GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT = 0x87CB;
+ int GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT = 0x87CC;
+ int GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT = 0x87CD;
+ int GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT = 0x87CE;
+ int GL_VERTEX_SHADER_INSTRUCTIONS_EXT = 0x87CF;
+ int GL_VERTEX_SHADER_VARIANTS_EXT = 0x87D0;
+ int GL_VERTEX_SHADER_INVARIANTS_EXT = 0x87D1;
+ int GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT = 0x87D2;
+ int GL_VERTEX_SHADER_LOCALS_EXT = 0x87D3;
+ int GL_VERTEX_SHADER_OPTIMIZED_EXT = 0x87D4;
+ int GL_X_EXT = 0x87D5;
+ int GL_Y_EXT = 0x87D6;
+ int GL_Z_EXT = 0x87D7;
+ int GL_W_EXT = 0x87D8;
+ int GL_NEGATIVE_X_EXT = 0x87D9;
+ int GL_NEGATIVE_Y_EXT = 0x87DA;
+ int GL_NEGATIVE_Z_EXT = 0x87DB;
+ int GL_NEGATIVE_W_EXT = 0x87DC;
+ int GL_ZERO_EXT = 0x87DD;
+ int GL_ONE_EXT = 0x87DE;
+ int GL_NEGATIVE_ONE_EXT = 0x87DF;
+ int GL_NORMALIZED_RANGE_EXT = 0x87E0;
+ int GL_FULL_RANGE_EXT = 0x87E1;
+ int GL_CURRENT_VERTEX_EXT = 0x87E2;
+ int GL_MVP_MATRIX_EXT = 0x87E3;
+ int GL_VARIANT_VALUE_EXT = 0x87E4;
+ int GL_VARIANT_DATATYPE_EXT = 0x87E5;
+ int GL_VARIANT_ARRAY_STRIDE_EXT = 0x87E6;
+ int GL_VARIANT_ARRAY_TYPE_EXT = 0x87E7;
+ int GL_VARIANT_ARRAY_EXT = 0x87E8;
+ int GL_VARIANT_ARRAY_POINTER_EXT = 0x87E9;
+ int GL_INVARIANT_VALUE_EXT = 0x87EA;
+ int GL_INVARIANT_DATATYPE_EXT = 0x87EB;
+ int GL_LOCAL_CONSTANT_VALUE_EXT = 0x87EC;
+ int GL_LOCAL_CONSTANT_DATATYPE_EXT = 0x87ED;
+
+ void glBeginVertexShaderEXT();
+
+ void glEndVertexShaderEXT();
+
+ void glBindVertexShaderEXT(@GLuint int id);
+
+ @GLuint
+ int glGenVertexShadersEXT(@GLuint int range);
+
+ void glDeleteVertexShaderEXT(@GLuint int id);
+
+ void glShaderOp1EXT(@GLenum int op, @GLuint int res, @GLuint int arg1);
+
+ void glShaderOp2EXT(@GLenum int op, @GLuint int res, @GLuint int arg1, @GLuint int arg2);
+
+ void glShaderOp3EXT(@GLenum int op, @GLuint int res, @GLuint int arg1, @GLuint int arg2, @GLuint int arg3);
+
+ void glSwizzleEXT(@GLuint int res, @GLuint int in, @GLenum int outX, @GLenum int outY, @GLenum int outZ, @GLenum int outW);
+
+ void glWriteMaskEXT(@GLuint int res, @GLuint int in, @GLenum int outX, @GLenum int outY, @GLenum int outZ, @GLenum int outW);
+
+ void glInsertComponentEXT(@GLuint int res, @GLuint int src, @GLuint int num);
+
+ void glExtractComponentEXT(@GLuint int res, @GLuint int src, @GLuint int num);
+
+ @GLuint
+ int glGenSymbolsEXT(@GLenum int dataType, @GLenum int storageType, @GLenum int range, @GLuint int components);
+
+ void glSetInvariantEXT(@GLuint int id, @AutoType("pAddr") @GLenum int type,
+ @Check("4")
+ @Const
+ @GLbyte
+ @GLubyte
+ @GLshort
+ @GLushort
+ @GLint
+ @GLuint
+ @GLfloat
+ @GLdouble Buffer pAddr);
+
+ void glSetLocalConstantEXT(@GLuint int id, @AutoType("pAddr") @GLenum int type,
+ @Check("4")
+ @Const
+ @GLbyte
+ @GLubyte
+ @GLshort
+ @GLushort
+ @GLint
+ @GLuint
+ @GLfloat
+ @GLdouble Buffer pAddr);
+
+ @StripPostfix("pAddr")
+ void glVariantbvEXT(@GLuint int id, @Check("4") @Const ByteBuffer pAddr);
+
+ @StripPostfix("pAddr")
+ void glVariantsvEXT(@GLuint int id, @Check("4") @Const ShortBuffer pAddr);
+
+ @StripPostfix("pAddr")
+ void glVariantivEXT(@GLuint int id, @Check("4") @Const IntBuffer pAddr);
+
+ @StripPostfix("pAddr")
+ void glVariantfvEXT(@GLuint int id, @Check("4") @Const FloatBuffer pAddr);
+
+ @StripPostfix("pAddr")
+ void glVariantdvEXT(@GLuint int id, @Check("4") @Const DoubleBuffer pAddr);
+
+ @StripPostfix("pAddr")
+ void glVariantubvEXT(@GLuint int id, @Check("4") @Const @GLubyte ByteBuffer pAddr);
+
+ @StripPostfix("pAddr")
+ void glVariantusvEXT(@GLuint int id, @Check("4") @Const @GLushort ShortBuffer pAddr);
+
+ @StripPostfix("pAddr")
+ void glVariantuivEXT(@GLuint int id, @Check("4") @Const @GLuint IntBuffer pAddr);
+
+ void glVariantPointerEXT(@GLuint int id, @AutoType("pAddr") @GLenum int type, @GLuint int stride,
+ @CachedReference
+ @BufferObject(BufferKind.ArrayVBO)
+ @Check
+ @Const
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLubyte
+ @GLushort
+ @GLuint
+ @GLfloat
+ @GLdouble Buffer pAddr);
+
+ void glEnableVariantClientStateEXT(@GLuint int id);
+
+ void glDisableVariantClientStateEXT(@GLuint int id);
+
+ @GLuint
+ int glBindLightParameterEXT(@GLenum int light, @GLenum int value);
+
+ @GLuint
+ int glBindMaterialParameterEXT(@GLenum int face, @GLenum int value);
+
+ @GLuint
+ int glBindTexGenParameterEXT(@GLenum int unit, @GLenum int coord, @GLenum int value);
+
+ @GLuint
+ int glBindTextureUnitParameterEXT(@GLenum int unit, @GLenum int value);
+
+ @GLuint
+ int glBindParameterEXT(@GLenum int value);
+
+ boolean glIsVariantEnabledEXT(@GLuint int id, @GLenum int cap);
+
+ @StripPostfix("pbData")
+ void glGetVariantBooleanvEXT(@GLuint int id, @GLenum int value, @OutParameter @Check("4") ByteBuffer pbData);
+
+ @StripPostfix("pbData")
+ void glGetVariantIntegervEXT(@GLuint int id, @GLenum int value, @OutParameter @Check("4") IntBuffer pbData);
+
+ @StripPostfix("pbData")
+ void glGetVariantFloatvEXT(@GLuint int id, @GLenum int value, @OutParameter @Check("4") FloatBuffer pbData);
+
+ @StripPostfix("pbData")
+ void glGetVariantPointervEXT(@GLuint int id, @GLenum int value, @OutParameter @Result @GLvoid ByteBuffer pbData);
+
+ @StripPostfix("pbData")
+ void glGetInvariantBooleanvEXT(@GLuint int id, @GLenum int value, @OutParameter @Check("4") ByteBuffer pbData);
+
+ @StripPostfix("pbData")
+ void glGetInvariantIntegervEXT(@GLuint int id, @GLenum int value, @OutParameter @Check("4") IntBuffer pbData);
+
+ @StripPostfix("pbData")
+ void glGetInvariantFloatvEXT(@GLuint int id, @GLenum int value, @OutParameter @Check("4") FloatBuffer pbData);
+
+ @StripPostfix("pbData")
+ void glGetLocalConstantBooleanvEXT(@GLuint int id, @GLenum int value, @OutParameter @Check("4") ByteBuffer pbData);
+
+ @StripPostfix("pbData")
+ void glGetLocalConstantIntegervEXT(@GLuint int id, @GLenum int value, @OutParameter @Check("4") IntBuffer pbData);
+
+ @StripPostfix("pbData")
+ void glGetLocalConstantFloatvEXT(@GLuint int id, @GLenum int value, @OutParameter @Check("4") FloatBuffer pbData);
+}
diff --git a/src/templates/org/lwjgl/opengl/EXT_vertex_weighting.java b/src/templates/org/lwjgl/opengl/EXT_vertex_weighting.java
index cf2a5b6..3788e78 100644
--- a/src/templates/org/lwjgl/opengl/EXT_vertex_weighting.java
+++ b/src/templates/org/lwjgl/opengl/EXT_vertex_weighting.java
@@ -1,62 +1,62 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-public interface EXT_vertex_weighting {
- int GL_MODELVIEW0_STACK_DEPTH_EXT = 0x0BA3;
- int GL_MODELVIEW1_STACK_DEPTH_EXT = 0x8502;
- int GL_MODELVIEW0_MATRIX_EXT = 0x0BA6;
- int GL_MODELVIEW1_MATRIX_EXT = 0x8506;
- int GL_VERTEX_WEIGHTING_EXT = 0x8509;
- int GL_MODELVIEW0_EXT = 0x1700;
- int GL_MODELVIEW1_EXT = 0x850A;
- int GL_CURRENT_VERTEX_WEIGHT_EXT = 0x850B;
- int GL_VERTEX_WEIGHT_ARRAY_EXT = 0x850C;
- int GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT = 0x850D;
- int GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT = 0x850E;
- int GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT = 0x850F;
- int GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT = 0x8510;
-
- @NoErrorCheck
- void glVertexWeightfEXT(float weight);
-
- void glVertexWeightPointerEXT(@GLsizei int size, @AutoType("pPointer") @GLenum int type, @GLsizei int stride,
- @CachedReference
- @BufferObject(BufferKind.ArrayVBO)
- @Check
- @Const
- @GLfloat Buffer pPointer);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+public interface EXT_vertex_weighting {
+ int GL_MODELVIEW0_STACK_DEPTH_EXT = 0x0BA3;
+ int GL_MODELVIEW1_STACK_DEPTH_EXT = 0x8502;
+ int GL_MODELVIEW0_MATRIX_EXT = 0x0BA6;
+ int GL_MODELVIEW1_MATRIX_EXT = 0x8506;
+ int GL_VERTEX_WEIGHTING_EXT = 0x8509;
+ int GL_MODELVIEW0_EXT = 0x1700;
+ int GL_MODELVIEW1_EXT = 0x850A;
+ int GL_CURRENT_VERTEX_WEIGHT_EXT = 0x850B;
+ int GL_VERTEX_WEIGHT_ARRAY_EXT = 0x850C;
+ int GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT = 0x850D;
+ int GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT = 0x850E;
+ int GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT = 0x850F;
+ int GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT = 0x8510;
+
+ @NoErrorCheck
+ void glVertexWeightfEXT(float weight);
+
+ void glVertexWeightPointerEXT(@GLsizei int size, @AutoType("pPointer") @GLenum int type, @GLsizei int stride,
+ @CachedReference
+ @BufferObject(BufferKind.ArrayVBO)
+ @Check
+ @Const
+ @GLfloat Buffer pPointer);
+}
diff --git a/src/templates/org/lwjgl/opengl/GL11.java b/src/templates/org/lwjgl/opengl/GL11.java
index 4a19432..249dd78 100644
--- a/src/templates/org/lwjgl/opengl/GL11.java
+++ b/src/templates/org/lwjgl/opengl/GL11.java
@@ -1,1612 +1,1612 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-/**
- * The core OpenGL1.1 API.
- *
- * @author cix_foo <cix_foo at users.sourceforge.net>
- * @version $Revision: 3316 $
- * $Id: GL11.java 3316 2010-04-09 23:57:40Z spasi $
- */
- at DeprecatedGL
-public interface GL11 {
- /* AccumOp */
- int GL_ACCUM = 0x0100;
- int GL_LOAD = 0x0101;
- int GL_RETURN = 0x0102;
- int GL_MULT = 0x0103;
- int GL_ADD = 0x0104;
-
- /* AlphaFunction */
- int GL_NEVER = 0x0200;
- int GL_LESS = 0x0201;
- int GL_EQUAL = 0x0202;
- int GL_LEQUAL = 0x0203;
- int GL_GREATER = 0x0204;
- int GL_NOTEQUAL = 0x0205;
- int GL_GEQUAL = 0x0206;
- int GL_ALWAYS = 0x0207;
-
- /* AttribMask */
- int GL_CURRENT_BIT = 0x00000001;
- int GL_POINT_BIT = 0x00000002;
- int GL_LINE_BIT = 0x00000004;
- int GL_POLYGON_BIT = 0x00000008;
- int GL_POLYGON_STIPPLE_BIT = 0x00000010;
- int GL_PIXEL_MODE_BIT = 0x00000020;
- int GL_LIGHTING_BIT = 0x00000040;
- int GL_FOG_BIT = 0x00000080;
- int GL_DEPTH_BUFFER_BIT = 0x00000100;
- int GL_ACCUM_BUFFER_BIT = 0x00000200;
- int GL_STENCIL_BUFFER_BIT = 0x00000400;
- int GL_VIEWPORT_BIT = 0x00000800;
- int GL_TRANSFORM_BIT = 0x00001000;
- int GL_ENABLE_BIT = 0x00002000;
- int GL_COLOR_BUFFER_BIT = 0x00004000;
- int GL_HINT_BIT = 0x00008000;
- int GL_EVAL_BIT = 0x00010000;
- int GL_LIST_BIT = 0x00020000;
- int GL_TEXTURE_BIT = 0x00040000;
- int GL_SCISSOR_BIT = 0x00080000;
- int GL_ALL_ATTRIB_BITS = 0x000fffff;
-
- /* BeginMode */
- int GL_POINTS = 0x0000;
- int GL_LINES = 0x0001;
- int GL_LINE_LOOP = 0x0002;
- int GL_LINE_STRIP = 0x0003;
- int GL_TRIANGLES = 0x0004;
- int GL_TRIANGLE_STRIP = 0x0005;
- int GL_TRIANGLE_FAN = 0x0006;
- int GL_QUADS = 0x0007;
- int GL_QUAD_STRIP = 0x0008;
- int GL_POLYGON = 0x0009;
-
- /* BlendingFactorDest */
- int GL_ZERO = 0;
- int GL_ONE = 1;
- int GL_SRC_COLOR = 0x0300;
- int GL_ONE_MINUS_SRC_COLOR = 0x0301;
- int GL_SRC_ALPHA = 0x0302;
- int GL_ONE_MINUS_SRC_ALPHA = 0x0303;
- int GL_DST_ALPHA = 0x0304;
- int GL_ONE_MINUS_DST_ALPHA = 0x0305;
-
- /* BlendingFactorSrc */
- /* GL_ZERO */
- /* GL_ONE */
- int GL_DST_COLOR = 0x0306;
- int GL_ONE_MINUS_DST_COLOR = 0x0307;
- int GL_SRC_ALPHA_SATURATE = 0x0308;
- int GL_CONSTANT_COLOR = 0x8001;
- int GL_ONE_MINUS_CONSTANT_COLOR = 0x8002;
- int GL_CONSTANT_ALPHA = 0x8003;
- int GL_ONE_MINUS_CONSTANT_ALPHA = 0x8004;
-
- /* Boolean */
- int GL_TRUE = 1;
- int GL_FALSE = 0;
-
- /* ClipPlaneName */
- int GL_CLIP_PLANE0 = 0x3000;
- int GL_CLIP_PLANE1 = 0x3001;
- int GL_CLIP_PLANE2 = 0x3002;
- int GL_CLIP_PLANE3 = 0x3003;
- int GL_CLIP_PLANE4 = 0x3004;
- int GL_CLIP_PLANE5 = 0x3005;
-
- /* DataType */
- int GL_BYTE = 0x1400;
- int GL_UNSIGNED_BYTE = 0x1401;
- int GL_SHORT = 0x1402;
- int GL_UNSIGNED_SHORT = 0x1403;
- int GL_INT = 0x1404;
- int GL_UNSIGNED_INT = 0x1405;
- int GL_FLOAT = 0x1406;
- int GL_2_BYTES = 0x1407;
- int GL_3_BYTES = 0x1408;
- int GL_4_BYTES = 0x1409;
- int GL_DOUBLE = 0x140A;
-
- /* DrawBufferMode */
- int GL_NONE = 0;
- int GL_FRONT_LEFT = 0x0400;
- int GL_FRONT_RIGHT = 0x0401;
- int GL_BACK_LEFT = 0x0402;
- int GL_BACK_RIGHT = 0x0403;
- int GL_FRONT = 0x0404;
- int GL_BACK = 0x0405;
- int GL_LEFT = 0x0406;
- int GL_RIGHT = 0x0407;
- int GL_FRONT_AND_BACK = 0x0408;
- int GL_AUX0 = 0x0409;
- int GL_AUX1 = 0x040A;
- int GL_AUX2 = 0x040B;
- int GL_AUX3 = 0x040C;
-
- /* ErrorCode */
- int GL_NO_ERROR = 0;
- int GL_INVALID_ENUM = 0x0500;
- int GL_INVALID_VALUE = 0x0501;
- int GL_INVALID_OPERATION = 0x0502;
- int GL_STACK_OVERFLOW = 0x0503;
- int GL_STACK_UNDERFLOW = 0x0504;
- int GL_OUT_OF_MEMORY = 0x0505;
-
- /* FeedBackMode */
- int GL_2D = 0x0600;
- int GL_3D = 0x0601;
- int GL_3D_COLOR = 0x0602;
- int GL_3D_COLOR_TEXTURE = 0x0603;
- int GL_4D_COLOR_TEXTURE = 0x0604;
-
- /* FeedBackToken */
- int GL_PASS_THROUGH_TOKEN = 0x0700;
- int GL_POINT_TOKEN = 0x0701;
- int GL_LINE_TOKEN = 0x0702;
- int GL_POLYGON_TOKEN = 0x0703;
- int GL_BITMAP_TOKEN = 0x0704;
- int GL_DRAW_PIXEL_TOKEN = 0x0705;
- int GL_COPY_PIXEL_TOKEN = 0x0706;
- int GL_LINE_RESET_TOKEN = 0x0707;
-
- /* FogMode */
- /* GL_LINEAR */
- int GL_EXP = 0x0800;
- int GL_EXP2 = 0x0801;
-
- /* FrontFaceDirection */
- int GL_CW = 0x0900;
- int GL_CCW = 0x0901;
-
- /* GetMapTarget */
- int GL_COEFF = 0x0A00;
- int GL_ORDER = 0x0A01;
- int GL_DOMAIN = 0x0A02;
-
- /* GetTarget */
- int GL_CURRENT_COLOR = 0x0B00;
- int GL_CURRENT_INDEX = 0x0B01;
- int GL_CURRENT_NORMAL = 0x0B02;
- int GL_CURRENT_TEXTURE_COORDS = 0x0B03;
- int GL_CURRENT_RASTER_COLOR = 0x0B04;
- int GL_CURRENT_RASTER_INDEX = 0x0B05;
- int GL_CURRENT_RASTER_TEXTURE_COORDS = 0x0B06;
- int GL_CURRENT_RASTER_POSITION = 0x0B07;
- int GL_CURRENT_RASTER_POSITION_VALID = 0x0B08;
- int GL_CURRENT_RASTER_DISTANCE = 0x0B09;
- int GL_POINT_SMOOTH = 0x0B10;
- int GL_POINT_SIZE = 0x0B11;
- int GL_POINT_SIZE_RANGE = 0x0B12;
- int GL_POINT_SIZE_GRANULARITY = 0x0B13;
- int GL_LINE_SMOOTH = 0x0B20;
- int GL_LINE_WIDTH = 0x0B21;
- int GL_LINE_WIDTH_RANGE = 0x0B22;
- int GL_LINE_WIDTH_GRANULARITY = 0x0B23;
- int GL_LINE_STIPPLE = 0x0B24;
- int GL_LINE_STIPPLE_PATTERN = 0x0B25;
- int GL_LINE_STIPPLE_REPEAT = 0x0B26;
- int GL_LIST_MODE = 0x0B30;
- int GL_MAX_LIST_NESTING = 0x0B31;
- int GL_LIST_BASE = 0x0B32;
- int GL_LIST_INDEX = 0x0B33;
- int GL_POLYGON_MODE = 0x0B40;
- int GL_POLYGON_SMOOTH = 0x0B41;
- int GL_POLYGON_STIPPLE = 0x0B42;
- int GL_EDGE_FLAG = 0x0B43;
- int GL_CULL_FACE = 0x0B44;
- int GL_CULL_FACE_MODE = 0x0B45;
- int GL_FRONT_FACE = 0x0B46;
- int GL_LIGHTING = 0x0B50;
- int GL_LIGHT_MODEL_LOCAL_VIEWER = 0x0B51;
- int GL_LIGHT_MODEL_TWO_SIDE = 0x0B52;
- int GL_LIGHT_MODEL_AMBIENT = 0x0B53;
- int GL_SHADE_MODEL = 0x0B54;
- int GL_COLOR_MATERIAL_FACE = 0x0B55;
- int GL_COLOR_MATERIAL_PARAMETER = 0x0B56;
- int GL_COLOR_MATERIAL = 0x0B57;
- int GL_FOG = 0x0B60;
- int GL_FOG_INDEX = 0x0B61;
- int GL_FOG_DENSITY = 0x0B62;
- int GL_FOG_START = 0x0B63;
- int GL_FOG_END = 0x0B64;
- int GL_FOG_MODE = 0x0B65;
- int GL_FOG_COLOR = 0x0B66;
- int GL_DEPTH_RANGE = 0x0B70;
- int GL_DEPTH_TEST = 0x0B71;
- int GL_DEPTH_WRITEMASK = 0x0B72;
- int GL_DEPTH_CLEAR_VALUE = 0x0B73;
- int GL_DEPTH_FUNC = 0x0B74;
- int GL_ACCUM_CLEAR_VALUE = 0x0B80;
- int GL_STENCIL_TEST = 0x0B90;
- int GL_STENCIL_CLEAR_VALUE = 0x0B91;
- int GL_STENCIL_FUNC = 0x0B92;
- int GL_STENCIL_VALUE_MASK = 0x0B93;
- int GL_STENCIL_FAIL = 0x0B94;
- int GL_STENCIL_PASS_DEPTH_FAIL = 0x0B95;
- int GL_STENCIL_PASS_DEPTH_PASS = 0x0B96;
- int GL_STENCIL_REF = 0x0B97;
- int GL_STENCIL_WRITEMASK = 0x0B98;
- int GL_MATRIX_MODE = 0x0BA0;
- int GL_NORMALIZE = 0x0BA1;
- int GL_VIEWPORT = 0x0BA2;
- int GL_MODELVIEW_STACK_DEPTH = 0x0BA3;
- int GL_PROJECTION_STACK_DEPTH = 0x0BA4;
- int GL_TEXTURE_STACK_DEPTH = 0x0BA5;
- int GL_MODELVIEW_MATRIX = 0x0BA6;
- int GL_PROJECTION_MATRIX = 0x0BA7;
- int GL_TEXTURE_MATRIX = 0x0BA8;
- int GL_ATTRIB_STACK_DEPTH = 0x0BB0;
- int GL_CLIENT_ATTRIB_STACK_DEPTH = 0x0BB1;
- int GL_ALPHA_TEST = 0x0BC0;
- int GL_ALPHA_TEST_FUNC = 0x0BC1;
- int GL_ALPHA_TEST_REF = 0x0BC2;
- int GL_DITHER = 0x0BD0;
- int GL_BLEND_DST = 0x0BE0;
- int GL_BLEND_SRC = 0x0BE1;
- int GL_BLEND = 0x0BE2;
- int GL_LOGIC_OP_MODE = 0x0BF0;
- int GL_INDEX_LOGIC_OP = 0x0BF1;
- int GL_COLOR_LOGIC_OP = 0x0BF2;
- int GL_AUX_BUFFERS = 0x0C00;
- int GL_DRAW_BUFFER = 0x0C01;
- int GL_READ_BUFFER = 0x0C02;
- int GL_SCISSOR_BOX = 0x0C10;
- int GL_SCISSOR_TEST = 0x0C11;
- int GL_INDEX_CLEAR_VALUE = 0x0C20;
- int GL_INDEX_WRITEMASK = 0x0C21;
- int GL_COLOR_CLEAR_VALUE = 0x0C22;
- int GL_COLOR_WRITEMASK = 0x0C23;
- int GL_INDEX_MODE = 0x0C30;
- int GL_RGBA_MODE = 0x0C31;
- int GL_DOUBLEBUFFER = 0x0C32;
- int GL_STEREO = 0x0C33;
- int GL_RENDER_MODE = 0x0C40;
- int GL_PERSPECTIVE_CORRECTION_HINT = 0x0C50;
- int GL_POINT_SMOOTH_HINT = 0x0C51;
- int GL_LINE_SMOOTH_HINT = 0x0C52;
- int GL_POLYGON_SMOOTH_HINT = 0x0C53;
- int GL_FOG_HINT = 0x0C54;
- int GL_TEXTURE_GEN_S = 0x0C60;
- int GL_TEXTURE_GEN_T = 0x0C61;
- int GL_TEXTURE_GEN_R = 0x0C62;
- int GL_TEXTURE_GEN_Q = 0x0C63;
- int GL_PIXEL_MAP_I_TO_I = 0x0C70;
- int GL_PIXEL_MAP_S_TO_S = 0x0C71;
- int GL_PIXEL_MAP_I_TO_R = 0x0C72;
- int GL_PIXEL_MAP_I_TO_G = 0x0C73;
- int GL_PIXEL_MAP_I_TO_B = 0x0C74;
- int GL_PIXEL_MAP_I_TO_A = 0x0C75;
- int GL_PIXEL_MAP_R_TO_R = 0x0C76;
- int GL_PIXEL_MAP_G_TO_G = 0x0C77;
- int GL_PIXEL_MAP_B_TO_B = 0x0C78;
- int GL_PIXEL_MAP_A_TO_A = 0x0C79;
- int GL_PIXEL_MAP_I_TO_I_SIZE = 0x0CB0;
- int GL_PIXEL_MAP_S_TO_S_SIZE = 0x0CB1;
- int GL_PIXEL_MAP_I_TO_R_SIZE = 0x0CB2;
- int GL_PIXEL_MAP_I_TO_G_SIZE = 0x0CB3;
- int GL_PIXEL_MAP_I_TO_B_SIZE = 0x0CB4;
- int GL_PIXEL_MAP_I_TO_A_SIZE = 0x0CB5;
- int GL_PIXEL_MAP_R_TO_R_SIZE = 0x0CB6;
- int GL_PIXEL_MAP_G_TO_G_SIZE = 0x0CB7;
- int GL_PIXEL_MAP_B_TO_B_SIZE = 0x0CB8;
- int GL_PIXEL_MAP_A_TO_A_SIZE = 0x0CB9;
- int GL_UNPACK_SWAP_BYTES = 0x0CF0;
- int GL_UNPACK_LSB_FIRST = 0x0CF1;
- int GL_UNPACK_ROW_LENGTH = 0x0CF2;
- int GL_UNPACK_SKIP_ROWS = 0x0CF3;
- int GL_UNPACK_SKIP_PIXELS = 0x0CF4;
- int GL_UNPACK_ALIGNMENT = 0x0CF5;
- int GL_PACK_SWAP_BYTES = 0x0D00;
- int GL_PACK_LSB_FIRST = 0x0D01;
- int GL_PACK_ROW_LENGTH = 0x0D02;
- int GL_PACK_SKIP_ROWS = 0x0D03;
- int GL_PACK_SKIP_PIXELS = 0x0D04;
- int GL_PACK_ALIGNMENT = 0x0D05;
- int GL_MAP_COLOR = 0x0D10;
- int GL_MAP_STENCIL = 0x0D11;
- int GL_INDEX_SHIFT = 0x0D12;
- int GL_INDEX_OFFSET = 0x0D13;
- int GL_RED_SCALE = 0x0D14;
- int GL_RED_BIAS = 0x0D15;
- int GL_ZOOM_X = 0x0D16;
- int GL_ZOOM_Y = 0x0D17;
- int GL_GREEN_SCALE = 0x0D18;
- int GL_GREEN_BIAS = 0x0D19;
- int GL_BLUE_SCALE = 0x0D1A;
- int GL_BLUE_BIAS = 0x0D1B;
- int GL_ALPHA_SCALE = 0x0D1C;
- int GL_ALPHA_BIAS = 0x0D1D;
- int GL_DEPTH_SCALE = 0x0D1E;
- int GL_DEPTH_BIAS = 0x0D1F;
- int GL_MAX_EVAL_ORDER = 0x0D30;
- int GL_MAX_LIGHTS = 0x0D31;
- int GL_MAX_CLIP_PLANES = 0x0D32;
- int GL_MAX_TEXTURE_SIZE = 0x0D33;
- int GL_MAX_PIXEL_MAP_TABLE = 0x0D34;
- int GL_MAX_ATTRIB_STACK_DEPTH = 0x0D35;
- int GL_MAX_MODELVIEW_STACK_DEPTH = 0x0D36;
- int GL_MAX_NAME_STACK_DEPTH = 0x0D37;
- int GL_MAX_PROJECTION_STACK_DEPTH = 0x0D38;
- int GL_MAX_TEXTURE_STACK_DEPTH = 0x0D39;
- int GL_MAX_VIEWPORT_DIMS = 0x0D3A;
- int GL_MAX_CLIENT_ATTRIB_STACK_DEPTH = 0x0D3B;
- int GL_SUBPIXEL_BITS = 0x0D50;
- int GL_INDEX_BITS = 0x0D51;
- int GL_RED_BITS = 0x0D52;
- int GL_GREEN_BITS = 0x0D53;
- int GL_BLUE_BITS = 0x0D54;
- int GL_ALPHA_BITS = 0x0D55;
- int GL_DEPTH_BITS = 0x0D56;
- int GL_STENCIL_BITS = 0x0D57;
- int GL_ACCUM_RED_BITS = 0x0D58;
- int GL_ACCUM_GREEN_BITS = 0x0D59;
- int GL_ACCUM_BLUE_BITS = 0x0D5A;
- int GL_ACCUM_ALPHA_BITS = 0x0D5B;
- int GL_NAME_STACK_DEPTH = 0x0D70;
- int GL_AUTO_NORMAL = 0x0D80;
- int GL_MAP1_COLOR_4 = 0x0D90;
- int GL_MAP1_INDEX = 0x0D91;
- int GL_MAP1_NORMAL = 0x0D92;
- int GL_MAP1_TEXTURE_COORD_1 = 0x0D93;
- int GL_MAP1_TEXTURE_COORD_2 = 0x0D94;
- int GL_MAP1_TEXTURE_COORD_3 = 0x0D95;
- int GL_MAP1_TEXTURE_COORD_4 = 0x0D96;
- int GL_MAP1_VERTEX_3 = 0x0D97;
- int GL_MAP1_VERTEX_4 = 0x0D98;
- int GL_MAP2_COLOR_4 = 0x0DB0;
- int GL_MAP2_INDEX = 0x0DB1;
- int GL_MAP2_NORMAL = 0x0DB2;
- int GL_MAP2_TEXTURE_COORD_1 = 0x0DB3;
- int GL_MAP2_TEXTURE_COORD_2 = 0x0DB4;
- int GL_MAP2_TEXTURE_COORD_3 = 0x0DB5;
- int GL_MAP2_TEXTURE_COORD_4 = 0x0DB6;
- int GL_MAP2_VERTEX_3 = 0x0DB7;
- int GL_MAP2_VERTEX_4 = 0x0DB8;
- int GL_MAP1_GRID_DOMAIN = 0x0DD0;
- int GL_MAP1_GRID_SEGMENTS = 0x0DD1;
- int GL_MAP2_GRID_DOMAIN = 0x0DD2;
- int GL_MAP2_GRID_SEGMENTS = 0x0DD3;
- int GL_TEXTURE_1D = 0x0DE0;
- int GL_TEXTURE_2D = 0x0DE1;
- int GL_FEEDBACK_BUFFER_POINTER = 0x0DF0;
- int GL_FEEDBACK_BUFFER_SIZE = 0x0DF1;
- int GL_FEEDBACK_BUFFER_TYPE = 0x0DF2;
- int GL_SELECTION_BUFFER_POINTER = 0x0DF3;
- int GL_SELECTION_BUFFER_SIZE = 0x0DF4;
-
- /* GetTextureParameter */
- /* GL_TEXTURE_MAG_FILTER */
- /* GL_TEXTURE_MIN_FILTER */
- /* GL_TEXTURE_WRAP_S */
- /* GL_TEXTURE_WRAP_T */
- int GL_TEXTURE_WIDTH = 0x1000;
- int GL_TEXTURE_HEIGHT = 0x1001;
- int GL_TEXTURE_INTERNAL_FORMAT = 0x1003;
- int GL_TEXTURE_BORDER_COLOR = 0x1004;
- int GL_TEXTURE_BORDER = 0x1005;
- /* GL_TEXTURE_RED_SIZE */
- /* GL_TEXTURE_GREEN_SIZE */
- /* GL_TEXTURE_BLUE_SIZE */
- /* GL_TEXTURE_ALPHA_SIZE */
- /* GL_TEXTURE_LUMINANCE_SIZE */
- /* GL_TEXTURE_INTENSITY_SIZE */
- /* GL_TEXTURE_PRIORITY */
- /* GL_TEXTURE_RESIDENT */
-
- /* HintMode */
- int GL_DONT_CARE = 0x1100;
- int GL_FASTEST = 0x1101;
- int GL_NICEST = 0x1102;
-
- /* LightName */
- int GL_LIGHT0 = 0x4000;
- int GL_LIGHT1 = 0x4001;
- int GL_LIGHT2 = 0x4002;
- int GL_LIGHT3 = 0x4003;
- int GL_LIGHT4 = 0x4004;
- int GL_LIGHT5 = 0x4005;
- int GL_LIGHT6 = 0x4006;
- int GL_LIGHT7 = 0x4007;
-
- /* LightParameter */
- int GL_AMBIENT = 0x1200;
- int GL_DIFFUSE = 0x1201;
- int GL_SPECULAR = 0x1202;
- int GL_POSITION = 0x1203;
- int GL_SPOT_DIRECTION = 0x1204;
- int GL_SPOT_EXPONENT = 0x1205;
- int GL_SPOT_CUTOFF = 0x1206;
- int GL_CONSTANT_ATTENUATION = 0x1207;
- int GL_LINEAR_ATTENUATION = 0x1208;
- int GL_QUADRATIC_ATTENUATION = 0x1209;
-
- /* ListMode */
- int GL_COMPILE = 0x1300;
- int GL_COMPILE_AND_EXECUTE = 0x1301;
-
- /* LogicOp */
- int GL_CLEAR = 0x1500;
- int GL_AND = 0x1501;
- int GL_AND_REVERSE = 0x1502;
- int GL_COPY = 0x1503;
- int GL_AND_INVERTED = 0x1504;
- int GL_NOOP = 0x1505;
- int GL_XOR = 0x1506;
- int GL_OR = 0x1507;
- int GL_NOR = 0x1508;
- int GL_EQUIV = 0x1509;
- int GL_INVERT = 0x150A;
- int GL_OR_REVERSE = 0x150B;
- int GL_COPY_INVERTED = 0x150C;
- int GL_OR_INVERTED = 0x150D;
- int GL_NAND = 0x150E;
- int GL_SET = 0x150F;
-
- /* MaterialParameter */
- int GL_EMISSION = 0x1600;
- int GL_SHININESS = 0x1601;
- int GL_AMBIENT_AND_DIFFUSE = 0x1602;
- int GL_COLOR_INDEXES = 0x1603;
- /* GL_AMBIENT */
- /* GL_DIFFUSE */
- /* GL_SPECULAR */
-
- /* MatrixMode */
- int GL_MODELVIEW = 0x1700;
- int GL_PROJECTION = 0x1701;
- int GL_TEXTURE = 0x1702;
-
- /* PixelCopyType */
- int GL_COLOR = 0x1800;
- int GL_DEPTH = 0x1801;
- int GL_STENCIL = 0x1802;
-
- /* PixelFormat */
- int GL_COLOR_INDEX = 0x1900;
- int GL_STENCIL_INDEX = 0x1901;
- int GL_DEPTH_COMPONENT = 0x1902;
- int GL_RED = 0x1903;
- int GL_GREEN = 0x1904;
- int GL_BLUE = 0x1905;
- int GL_ALPHA = 0x1906;
- int GL_RGB = 0x1907;
- int GL_RGBA = 0x1908;
- int GL_LUMINANCE = 0x1909;
- int GL_LUMINANCE_ALPHA = 0x190A;
-
- /* PixelType */
- int GL_BITMAP = 0x1A00;
- /* GL_BYTE */
- /* GL_UNSIGNED_BYTE */
- /* GL_SHORT */
- /* GL_UNSIGNED_SHORT */
- /* GL_INT */
- /* GL_UNSIGNED_INT */
- /* GL_FLOAT */
-
- /* PolygonMode */
- int GL_POINT = 0x1B00;
- int GL_LINE = 0x1B01;
- int GL_FILL = 0x1B02;
-
- /* RenderingMode */
- int GL_RENDER = 0x1C00;
- int GL_FEEDBACK = 0x1C01;
- int GL_SELECT = 0x1C02;
-
- /* ShadingModel */
- int GL_FLAT = 0x1D00;
- int GL_SMOOTH = 0x1D01;
-
- /* StencilOp */
- /* GL_ZERO */
- int GL_KEEP = 0x1E00;
- int GL_REPLACE = 0x1E01;
- int GL_INCR = 0x1E02;
- int GL_DECR = 0x1E03;
- /* GL_INVERT */
-
- /* StringName */
- int GL_VENDOR = 0x1F00;
- int GL_RENDERER = 0x1F01;
- int GL_VERSION = 0x1F02;
- int GL_EXTENSIONS = 0x1F03;
-
- /* TextureCoordName */
- int GL_S = 0x2000;
- int GL_T = 0x2001;
- int GL_R = 0x2002;
- int GL_Q = 0x2003;
-
- /* TexCoordPointerType */
- /* GL_SHORT */
- /* GL_INT */
- /* GL_FLOAT */
- /* GL_DOUBLE */
-
- /* TextureEnvMode */
- int GL_MODULATE = 0x2100;
- int GL_DECAL = 0x2101;
- /* GL_BLEND */
- /* GL_REPLACE */
-
- /* TextureEnvParameter */
- int GL_TEXTURE_ENV_MODE = 0x2200;
- int GL_TEXTURE_ENV_COLOR = 0x2201;
-
- /* TextureEnvTarget */
- int GL_TEXTURE_ENV = 0x2300;
-
- /* TextureGenMode */
- int GL_EYE_LINEAR = 0x2400;
- int GL_OBJECT_LINEAR = 0x2401;
- int GL_SPHERE_MAP = 0x2402;
-
- /* TextureGenParameter */
- int GL_TEXTURE_GEN_MODE = 0x2500;
- int GL_OBJECT_PLANE = 0x2501;
- int GL_EYE_PLANE = 0x2502;
-
- /* TextureMagFilter */
- int GL_NEAREST = 0x2600;
- int GL_LINEAR = 0x2601;
-
- /* TextureMinFilter */
- /* GL_NEAREST */
- /* GL_LINEAR */
- int GL_NEAREST_MIPMAP_NEAREST = 0x2700;
- int GL_LINEAR_MIPMAP_NEAREST = 0x2701;
- int GL_NEAREST_MIPMAP_LINEAR = 0x2702;
- int GL_LINEAR_MIPMAP_LINEAR = 0x2703;
-
- /* TextureParameterName */
- int GL_TEXTURE_MAG_FILTER = 0x2800;
- int GL_TEXTURE_MIN_FILTER = 0x2801;
- int GL_TEXTURE_WRAP_S = 0x2802;
- int GL_TEXTURE_WRAP_T = 0x2803;
- /* GL_TEXTURE_BORDER_COLOR */
- /* GL_TEXTURE_PRIORITY */
-
- /* TextureWrapMode */
- int GL_CLAMP = 0x2900;
- int GL_REPEAT = 0x2901;
-
- /* ClientAttribMask */
- int GL_CLIENT_PIXEL_STORE_BIT = 0x00000001;
- int GL_CLIENT_VERTEX_ARRAY_BIT = 0x00000002;
- int GL_ALL_CLIENT_ATTRIB_BITS = 0xffffffff;
-
- /* polygon_offset */
- int GL_POLYGON_OFFSET_FACTOR = 0x8038;
- int GL_POLYGON_OFFSET_UNITS = 0x2A00;
- int GL_POLYGON_OFFSET_POINT = 0x2A01;
- int GL_POLYGON_OFFSET_LINE = 0x2A02;
- int GL_POLYGON_OFFSET_FILL = 0x8037;
-
- /* texture */
- int GL_ALPHA4 = 0x803B;
- int GL_ALPHA8 = 0x803C;
- int GL_ALPHA12 = 0x803D;
- int GL_ALPHA16 = 0x803E;
- int GL_LUMINANCE4 = 0x803F;
- int GL_LUMINANCE8 = 0x8040;
- int GL_LUMINANCE12 = 0x8041;
- int GL_LUMINANCE16 = 0x8042;
- int GL_LUMINANCE4_ALPHA4 = 0x8043;
- int GL_LUMINANCE6_ALPHA2 = 0x8044;
- int GL_LUMINANCE8_ALPHA8 = 0x8045;
- int GL_LUMINANCE12_ALPHA4 = 0x8046;
- int GL_LUMINANCE12_ALPHA12 = 0x8047;
- int GL_LUMINANCE16_ALPHA16 = 0x8048;
- int GL_INTENSITY = 0x8049;
- int GL_INTENSITY4 = 0x804A;
- int GL_INTENSITY8 = 0x804B;
- int GL_INTENSITY12 = 0x804C;
- int GL_INTENSITY16 = 0x804D;
- int GL_R3_G3_B2 = 0x2A10;
- int GL_RGB4 = 0x804F;
- int GL_RGB5 = 0x8050;
- int GL_RGB8 = 0x8051;
- int GL_RGB10 = 0x8052;
- int GL_RGB12 = 0x8053;
- int GL_RGB16 = 0x8054;
- int GL_RGBA2 = 0x8055;
- int GL_RGBA4 = 0x8056;
- int GL_RGB5_A1 = 0x8057;
- int GL_RGBA8 = 0x8058;
- int GL_RGB10_A2 = 0x8059;
- int GL_RGBA12 = 0x805A;
- int GL_RGBA16 = 0x805B;
- int GL_TEXTURE_RED_SIZE = 0x805C;
- int GL_TEXTURE_GREEN_SIZE = 0x805D;
- int GL_TEXTURE_BLUE_SIZE = 0x805E;
- int GL_TEXTURE_ALPHA_SIZE = 0x805F;
- int GL_TEXTURE_LUMINANCE_SIZE = 0x8060;
- int GL_TEXTURE_INTENSITY_SIZE = 0x8061;
- int GL_PROXY_TEXTURE_1D = 0x8063;
- int GL_PROXY_TEXTURE_2D = 0x8064;
-
- /* texture_object */
- int GL_TEXTURE_PRIORITY = 0x8066;
- int GL_TEXTURE_RESIDENT = 0x8067;
- int GL_TEXTURE_BINDING_1D = 0x8068;
- int GL_TEXTURE_BINDING_2D = 0x8069;
-
- /* vertex_array */
- int GL_VERTEX_ARRAY = 0x8074;
- int GL_NORMAL_ARRAY = 0x8075;
- int GL_COLOR_ARRAY = 0x8076;
- int GL_INDEX_ARRAY = 0x8077;
- int GL_TEXTURE_COORD_ARRAY = 0x8078;
- int GL_EDGE_FLAG_ARRAY = 0x8079;
- int GL_VERTEX_ARRAY_SIZE = 0x807A;
- int GL_VERTEX_ARRAY_TYPE = 0x807B;
- int GL_VERTEX_ARRAY_STRIDE = 0x807C;
- int GL_NORMAL_ARRAY_TYPE = 0x807E;
- int GL_NORMAL_ARRAY_STRIDE = 0x807F;
- int GL_COLOR_ARRAY_SIZE = 0x8081;
- int GL_COLOR_ARRAY_TYPE = 0x8082;
- int GL_COLOR_ARRAY_STRIDE = 0x8083;
- int GL_INDEX_ARRAY_TYPE = 0x8085;
- int GL_INDEX_ARRAY_STRIDE = 0x8086;
- int GL_TEXTURE_COORD_ARRAY_SIZE = 0x8088;
- int GL_TEXTURE_COORD_ARRAY_TYPE = 0x8089;
- int GL_TEXTURE_COORD_ARRAY_STRIDE = 0x808A;
- int GL_EDGE_FLAG_ARRAY_STRIDE = 0x808C;
- int GL_VERTEX_ARRAY_POINTER = 0x808E;
- int GL_NORMAL_ARRAY_POINTER = 0x808F;
- int GL_COLOR_ARRAY_POINTER = 0x8090;
- int GL_INDEX_ARRAY_POINTER = 0x8091;
- int GL_TEXTURE_COORD_ARRAY_POINTER = 0x8092;
- int GL_EDGE_FLAG_ARRAY_POINTER = 0x8093;
- int GL_V2F = 0x2A20;
- int GL_V3F = 0x2A21;
- int GL_C4UB_V2F = 0x2A22;
- int GL_C4UB_V3F = 0x2A23;
- int GL_C3F_V3F = 0x2A24;
- int GL_N3F_V3F = 0x2A25;
- int GL_C4F_N3F_V3F = 0x2A26;
- int GL_T2F_V3F = 0x2A27;
- int GL_T4F_V4F = 0x2A28;
- int GL_T2F_C4UB_V3F = 0x2A29;
- int GL_T2F_C3F_V3F = 0x2A2A;
- int GL_T2F_N3F_V3F = 0x2A2B;
- int GL_T2F_C4F_N3F_V3F = 0x2A2C;
- int GL_T4F_C4F_N3F_V4F = 0x2A2D;
-
- /* For compatibility with OpenGL v1.0 */
- int GL_LOGIC_OP = GL_INDEX_LOGIC_OP;
- int GL_TEXTURE_COMPONENTS = GL_TEXTURE_INTERNAL_FORMAT;
-
- @DeprecatedGL
- void glAccum(@GLenum int op, float value);
-
- @DeprecatedGL
- void glAlphaFunc(@GLenum int func, @GLclampf float ref);
-
- void glClearColor(@GLclampf float red, @GLclampf float green, @GLclampf float blue, @GLclampf float alpha);
-
- @DeprecatedGL
- void glClearAccum(float red, float green, float blue, float alpha);
-
- void glClear(@GLbitfield int mask);
-
- @DeprecatedGL
- void glCallLists(@AutoSize("lists") @GLsizei int n, @AutoType("lists") @GLenum int type,
- @Const
- @GLubyte
- @GLushort
- @GLuint Buffer lists);
-
- @DeprecatedGL
- void glCallList(@GLuint int list);
-
- void glBlendFunc(@GLenum int sfactor, @GLenum int dfactor);
-
- @DeprecatedGL
- void glBitmap(@GLsizei int width, @GLsizei int height, float xorig, float yorig, float xmove, float ymove,
- @BufferObject(BufferKind.UnpackPBO)
- @Check("(((width + 7)/8)*height)")
- @Const
- @GLubyte ByteBuffer bitmap);
-
- void glBindTexture(@GLenum int target, @GLuint int texture);
-
- @DeprecatedGL
- void glPrioritizeTextures(@AutoSize("textures") @GLsizei int n,
- @Const
- @GLuint IntBuffer textures,
- @Const
- @Check("textures.remaining()")
- @GLclampf FloatBuffer priorities);
-
- @DeprecatedGL
- boolean glAreTexturesResident(@AutoSize("textures") @GLsizei int n,
- @Const
- @GLuint IntBuffer textures,
- @Check("textures.remaining()")
- @GLboolean ByteBuffer residences);
-
- @NoErrorCheck
- @DeprecatedGL
- @Code("\t\tif ( ContextCapabilities.DEBUG ) StateTracker.setBeginEnd(caps, true);")
- void glBegin(@GLenum int mode);
-
- @DeprecatedGL
- @Code("\t\tif ( ContextCapabilities.DEBUG ) StateTracker.setBeginEnd(caps, false);")
- void glEnd();
-
- @NoErrorCheck
- void glArrayElement(int i);
-
- void glClearDepth(@GLclampd double depth);
-
- @DeprecatedGL
- void glDeleteLists(@GLuint int list, @GLsizei int range);
-
- void glDeleteTextures(@AutoSize("textures") @GLsizei int n, @Const @GLuint IntBuffer textures);
-
- @Alternate("glDeleteTextures")
- void glDeleteTextures(@Constant("1") @GLsizei int n, @Constant(value = "APIUtils.getBufferInt().put(0, texture), 0", keepParam = true) int texture);
-
- void glCullFace(@GLenum int mode);
-
- void glCopyTexSubImage2D(@GLenum int target, int level, int xoffset, int yoffset, int x, int y, @GLsizei int width, @GLsizei int height);
-
- void glCopyTexSubImage1D(@GLenum int target, int level, int xoffset, int x, int y, @GLsizei int width);
-
- void glCopyTexImage2D(@GLenum int target, int level, int internalFormat, int x, int y, @GLsizei int width, @GLsizei int height, int border);
-
- void glCopyTexImage1D(@GLenum int target, int level, int internalFormat, int x, int y, @GLsizei int width, int border);
-
- void glCopyPixels(int x, int y, int width, int height, int type);
-
- @DeprecatedGL
- void glColorPointer(int size, @AutoType("pointer") @GLenum int type, @GLsizei int stride,
- @CachedReference
- @Check
- @BufferObject(BufferKind.ArrayVBO)
- @Const
- @GLfloat
- @GLdouble
- @GLubyte
- @GLbyte Buffer pointer);
-
- @DeprecatedGL
- void glColorMaterial(@GLenum int face, @GLenum int mode);
-
- void glColorMask(boolean red, boolean green, boolean blue, boolean alpha);
-
- @NoErrorCheck
- @DeprecatedGL
- void glColor3b(byte red, byte green, byte blue);
-
- @NoErrorCheck
- @DeprecatedGL
- void glColor3f(float red, float green, float blue);
-
- @NoErrorCheck
- @DeprecatedGL
- void glColor3d(double red, double green, double blue);
-
- @NoErrorCheck
- @DeprecatedGL
- void glColor3ub(@GLubyte byte red, @GLubyte byte green, @GLubyte byte blue);
-
- @NoErrorCheck
- @DeprecatedGL
- void glColor4b(byte red, byte green, byte blue, byte alpha);
-
- @NoErrorCheck
- @DeprecatedGL
- void glColor4f(float red, float green, float blue, float alpha);
-
- @NoErrorCheck
- @DeprecatedGL
- void glColor4d(double red, double green, double blue, double alpha);
-
- @NoErrorCheck
- @DeprecatedGL
- void glColor4ub(@GLubyte byte red, @GLubyte byte green, @GLubyte byte blue, @GLubyte byte alpha);
-
- void glClipPlane(@GLenum int plane, @Check("4") @Const DoubleBuffer equation);
-
- void glClearStencil(int s);
-
- // This function is only used in indexed color mode
- // void glClearIndex(float c);
-
- @DeprecatedGL
- void glEvalPoint1(int i);
-
- @DeprecatedGL
- void glEvalPoint2(int i, int j);
-
- @DeprecatedGL
- void glEvalMesh1(@GLenum int mode, int i1, int i2);
-
- @DeprecatedGL
- void glEvalMesh2(@GLenum int mode, int i1, int i2, int j1, int j2);
-
- @DeprecatedGL
- void glEvalCoord1f(float u);
-
- @DeprecatedGL
- void glEvalCoord1d(double u);
-
- @DeprecatedGL
- void glEvalCoord2f(float u, float v);
-
- @DeprecatedGL
- void glEvalCoord2d(double u, double v);
-
- @DeprecatedGL
- void glEnableClientState(@GLenum int cap);
-
- @DeprecatedGL
- void glDisableClientState(@GLenum int cap);
-
- void glEnable(@GLenum int cap);
-
- void glDisable(@GLenum int cap);
-
- @DeprecatedGL
- void glEdgeFlagPointer(int stride,
- @CachedReference
- @BufferObject(BufferKind.ArrayVBO)
- @Check
- @Const
- @GLbyte Buffer pointer);
-
- @DeprecatedGL
- void glEdgeFlag(boolean flag);
-
- @DeprecatedGL
- void glDrawPixels(@GLsizei int width, @GLsizei int height, @GLenum int format, @GLenum int type,
- @Check("GLChecks.calculateImageStorage(pixels, format, type, width, height, 1)")
- @BufferObject(BufferKind.UnpackPBO)
- @Const
- @GLbyte
- @GLshort
- @GLint Buffer pixels);
-
- void glDrawElements(@GLenum int mode, @AutoSize("indices") @GLsizei int count, @AutoType("indices") @GLenum int type,
- @BufferObject(BufferKind.ElementVBO)
- @Const
- @GLubyte
- @GLushort
- @GLuint Buffer indices);
-
- void glDrawBuffer(@GLenum int mode);
-
- void glDrawArrays(@GLenum int mode, int first, @GLsizei int count);
-
- void glDepthRange(@GLclampd double zNear, @GLclampd double zFar);
-
- void glDepthMask(boolean flag);
-
- void glDepthFunc(@GLenum int func);
-
- @DeprecatedGL
- void glFeedbackBuffer(@AutoSize("buffer") @GLsizei int size, @GLenum int type, FloatBuffer buffer);
-
- @StripPostfix("values")
- @DeprecatedGL
- void glGetPixelMapfv(@GLenum int map, @OutParameter @Check("256") @BufferObject(BufferKind.PackPBO) FloatBuffer values);
-
- @StripPostfix("values")
- @DeprecatedGL
- void glGetPixelMapuiv(@GLenum int map, @OutParameter @Check("256") @BufferObject(BufferKind.PackPBO) @GLuint IntBuffer values);
-
- @StripPostfix("values")
- @DeprecatedGL
- void glGetPixelMapusv(@GLenum int map, @OutParameter @Check("256") @BufferObject(BufferKind.PackPBO) @GLushort ShortBuffer values);
-
- @StripPostfix("params")
- @DeprecatedGL
- void glGetMaterialfv(@GLenum int face, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
-
- @StripPostfix("params")
- @DeprecatedGL
- void glGetMaterialiv(@GLenum int face, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
-
- @StripPostfix("v")
- @DeprecatedGL
- void glGetMapfv(@GLenum int target, @GLenum int query, @OutParameter @Check("256") FloatBuffer v);
-
- @StripPostfix("v")
- @DeprecatedGL
- void glGetMapdv(@GLenum int target, @GLenum int query, @OutParameter @Check("256") DoubleBuffer v);
-
- @StripPostfix("v")
- @DeprecatedGL
- void glGetMapiv(@GLenum int target, @GLenum int query, @OutParameter @Check("256") IntBuffer v);
-
- @StripPostfix("params")
- @DeprecatedGL
- void glGetLightfv(@GLenum int light, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
-
- @StripPostfix("params")
- @DeprecatedGL
- void glGetLightiv(@GLenum int light, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
-
- @NoErrorCheck
- int glGetError();
-
- void glGetClipPlane(@GLenum int plane, @OutParameter @Check("4") DoubleBuffer equation);
-
- @StripPostfix("params")
- void glGetBooleanv(@GLenum int pname, @OutParameter @Check("16") @GLboolean ByteBuffer params);
-
- @Alternate("glGetBooleanv")
- @GLreturn("params")
- @StripPostfix("params")
- void glGetBooleanv2(@GLenum int pname, @OutParameter @GLboolean ByteBuffer params);
-
- @StripPostfix("params")
- void glGetDoublev(@GLenum int pname, @OutParameter @Check("16") DoubleBuffer params);
-
- @Alternate("glGetDoublev")
- @GLreturn("params")
- @StripPostfix("params")
- void glGetDoublev2(@GLenum int pname, @OutParameter DoubleBuffer params);
-
- @StripPostfix("params")
- void glGetFloatv(@GLenum int pname, @OutParameter @Check("16") FloatBuffer params);
-
- @Alternate("glGetFloatv")
- @GLreturn("params")
- @StripPostfix("params")
- void glGetFloatv2(@GLenum int pname, @OutParameter FloatBuffer params);
-
- @StripPostfix("params")
- void glGetIntegerv(@GLenum int pname, @OutParameter @Check("16") IntBuffer params);
-
- @Alternate("glGetIntegerv")
- @GLreturn("params")
- @StripPostfix("params")
- void glGetIntegerv2(@GLenum int pname, @OutParameter IntBuffer params);
-
- void glGenTextures(@AutoSize("textures") @GLsizei int n, @OutParameter @GLuint IntBuffer textures);
-
- @Alternate("glGenTextures")
- @GLreturn("textures")
- void glGenTextures2(@Constant("1") @GLsizei int n, @OutParameter @GLuint IntBuffer textures);
-
- @GLuint
- @DeprecatedGL
- int glGenLists(@GLsizei int range);
-
- @DeprecatedGL
- void glFrustum(double left, double right, double bottom, double top, double zNear, double zFar);
-
- void glFrontFace(@GLenum int mode);
-
- @DeprecatedGL
- void glFogf(@GLenum int pname, float param);
-
- @DeprecatedGL
- void glFogi(@GLenum int pname, int param);
-
- @StripPostfix("params")
- @DeprecatedGL
- void glFogfv(@GLenum int pname, @Check("4") @Const FloatBuffer params);
-
- @StripPostfix("params")
- @DeprecatedGL
- void glFogiv(@GLenum int pname, @Check("4") @Const IntBuffer params);
-
- void glFlush();
-
- void glFinish();
-
- @StripPostfix("result")
- void glGetPointerv(@GLenum int pname, @Result @GLvoid ByteBuffer result);
-
- boolean glIsEnabled(@GLenum int cap);
-
- void glInterleavedArrays(@GLenum int format, @GLsizei int stride,
- @BufferObject(BufferKind.ArrayVBO)
- @Check
- @Const
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer pointer);
-
- @DeprecatedGL
- void glInitNames();
-
- void glHint(@GLenum int target, @GLenum int mode);
-
- @StripPostfix("params")
- void glGetTexParameterfv(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
-
- @Alternate("glGetTexParameterfv")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- void glGetTexParameterfv2(@GLenum int target, @GLenum int pname, @OutParameter FloatBuffer params);
-
- @StripPostfix("params")
- void glGetTexParameteriv(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
-
- @Alternate("glGetTexParameteriv")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- void glGetTexParameteriv2(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params);
-
- @StripPostfix("params")
- void glGetTexLevelParameterfv(@GLenum int target, int level, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
-
- @Alternate("glGetTexLevelParameterfv")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- void glGetTexLevelParameterfv2(@GLenum int target, int level, @GLenum int pname, @OutParameter FloatBuffer params);
-
- @StripPostfix("params")
- void glGetTexLevelParameteriv(@GLenum int target, int level, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
-
- @Alternate("glGetTexLevelParameteriv")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- void glGetTexLevelParameteriv2(@GLenum int target, int level, @GLenum int pname, @OutParameter IntBuffer params);
-
- void glGetTexImage(@GLenum int target, int level, @GLenum int format, @GLenum int type,
- @OutParameter
- @BufferObject(BufferKind.PackPBO)
- @Check("GLChecks.calculateImageStorage(pixels, format, type, 1, 1, 1)")
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer pixels);
-
- @StripPostfix("params")
- @DeprecatedGL
- void glGetTexGeniv(@GLenum int coord, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
-
- @Alternate("glGetTexGeniv")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- @DeprecatedGL
- void glGetTexGeniv2(@GLenum int coord, @GLenum int pname, @OutParameter IntBuffer params);
-
- @StripPostfix("params")
- @DeprecatedGL
- void glGetTexGenfv(@GLenum int coord, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
-
- @Alternate("glGetTexGenfv")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- @DeprecatedGL
- void glGetTexGenfv2(@GLenum int coord, @GLenum int pname, @OutParameter FloatBuffer params);
-
- @StripPostfix("params")
- @DeprecatedGL
- void glGetTexGendv(@GLenum int coord, @GLenum int pname, @OutParameter @Check("4") DoubleBuffer params);
-
- @Alternate("glGetTexGendv")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- @DeprecatedGL
- void glGetTexGendv2(@GLenum int coord, @GLenum int pname, @OutParameter DoubleBuffer params);
-
- @StripPostfix("params")
- void glGetTexEnviv(@GLenum int coord, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
-
- @Alternate("glGetTexEnviv")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- void glGetTexEnviv2(@GLenum int coord, @GLenum int pname, @OutParameter IntBuffer params);
-
- @StripPostfix("params")
- void glGetTexEnvfv(@GLenum int coord, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
-
- @Alternate("glGetTexEnvfv")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- void glGetTexEnvfv2(@GLenum int coord, @GLenum int pname, @OutParameter FloatBuffer params);
-
- @Const
- String glGetString(int name);
-
- @DeprecatedGL
- void glGetPolygonStipple(@OutParameter @BufferObject(BufferKind.PackPBO) @Check("1024") @GLubyte ByteBuffer mask);
-
- @DeprecatedGL
- boolean glIsList(@GLuint int list);
-
- @DeprecatedGL
- void glMaterialf(@GLenum int face, @GLenum int pname, float param);
-
- @DeprecatedGL
- void glMateriali(@GLenum int face, @GLenum int pname, int param);
-
- @StripPostfix("params")
- @DeprecatedGL
- void glMaterialfv(@GLenum int face, @GLenum int pname, @Check("4") @Const FloatBuffer params);
-
- @StripPostfix("params")
- @DeprecatedGL
- void glMaterialiv(@GLenum int face, @GLenum int pname, @Check("4") @Const IntBuffer params);
-
- @DeprecatedGL
- void glMapGrid1f(int un, float u1, float u2);
-
- @DeprecatedGL
- void glMapGrid1d(int un, double u1, double u2);
-
- @DeprecatedGL
- void glMapGrid2f(int un, float u1, float u2, int vn, float v1, float v2);
-
- @DeprecatedGL
- void glMapGrid2d(int un, double u1, double u2, int vn, double v1, double v2);
-
- // TODO: check buffer size valid
-
- @DeprecatedGL
- void glMap2f(@GLenum int target, float u1, float u2, int ustride, int uorder, float v1, float v2, int vstride, int vorder, @Check @Const FloatBuffer points);
-
- @DeprecatedGL
- void glMap2d(@GLenum int target, double u1, double u2, int ustride, int uorder, double v1, double v2, int vstride, int vorder, @Check @Const DoubleBuffer points);
-
- // TODO: check buffer size valid
-
- @DeprecatedGL
- void glMap1f(@GLenum int target, float u1, float u2, int stride, int order, @Check @Const FloatBuffer points);
-
- @DeprecatedGL
- void glMap1d(@GLenum int target, double u1, double u2, int stride, int order, @Check @Const DoubleBuffer points);
-
- void glLogicOp(@GLenum int opcode);
-
- @DeprecatedGL
- void glLoadName(@GLuint int name);
-
- @StripPostfix("m")
- @DeprecatedGL
- void glLoadMatrixf(@Check("16") @Const FloatBuffer m);
-
- @StripPostfix("m")
- @DeprecatedGL
- void glLoadMatrixd(@Check("16") @Const DoubleBuffer m);
-
- @DeprecatedGL
- void glLoadIdentity();
-
- @DeprecatedGL
- void glListBase(@GLuint int base);
-
- void glLineWidth(float width);
-
- @DeprecatedGL
- void glLineStipple(int factor, @GLushort short pattern);
-
- @DeprecatedGL
- void glLightModelf(@GLenum int pname, float param);
-
- @DeprecatedGL
- void glLightModeli(@GLenum int pname, int param);
-
- @StripPostfix("params")
- @DeprecatedGL
- void glLightModelfv(@GLenum int pname, @Check("4") @Const FloatBuffer params);
-
- @StripPostfix("params")
- @DeprecatedGL
- void glLightModeliv(@GLenum int pname, @Check("4") @Const IntBuffer params);
-
- @DeprecatedGL
- void glLightf(@GLenum int light, @GLenum int pname, float param);
-
- @DeprecatedGL
- void glLighti(@GLenum int light, @GLenum int pname, int param);
-
- @StripPostfix("params")
- @DeprecatedGL
- void glLightfv(@GLenum int light, @GLenum int pname, @Check("4") @Const FloatBuffer params);
-
- @StripPostfix("params")
- @DeprecatedGL
- void glLightiv(@GLenum int light, @GLenum int pname, @Check("4") @Const IntBuffer params);
-
- boolean glIsTexture(@GLuint int texture);
-
- @DeprecatedGL
- void glMatrixMode(@GLenum int mode);
-
- @DeprecatedGL
- void glPolygonStipple(@BufferObject(BufferKind.UnpackPBO) @Check("1024") @Const @GLubyte ByteBuffer mask);
-
- void glPolygonOffset(float factor, float units);
-
- void glPolygonMode(@GLenum int face, @GLenum int mode);
-
- void glPointSize(float size);
-
- @DeprecatedGL
- void glPixelZoom(float xfactor, float yfactor);
-
- @DeprecatedGL
- void glPixelTransferf(@GLenum int pname, float param);
-
- @DeprecatedGL
- void glPixelTransferi(@GLenum int pname, int param);
-
- void glPixelStoref(@GLenum int pname, float param);
-
- void glPixelStorei(@GLenum int pname, int param);
-
- @StripPostfix("values")
- @DeprecatedGL
- void glPixelMapfv(@GLenum int map, @AutoSize("values") @GLsizei int mapsize, @BufferObject(BufferKind.UnpackPBO) @Const FloatBuffer values);
-
- @StripPostfix("values")
- @DeprecatedGL
- void glPixelMapuiv(@GLenum int map, @AutoSize("values") @GLsizei int mapsize, @BufferObject(BufferKind.UnpackPBO) @Const @GLuint IntBuffer values);
-
- @StripPostfix("values")
- @DeprecatedGL
- void glPixelMapusv(@GLenum int map, @AutoSize("values") @GLsizei int mapsize, @BufferObject(BufferKind.UnpackPBO) @Const @GLushort ShortBuffer values);
-
- @DeprecatedGL
- void glPassThrough(float token);
-
- @DeprecatedGL
- void glOrtho(double left, double right, double bottom, double top, double zNear, double zFar);
-
- @DeprecatedGL
- void glNormalPointer(@AutoType("pointer") @GLenum int type, @GLsizei int stride,
- @CachedReference
- @BufferObject(BufferKind.ArrayVBO)
- @Check
- @Const
- @GLint
- @GLbyte
- @GLfloat
- @GLdouble Buffer pointer);
-
- @NoErrorCheck
- @DeprecatedGL
- void glNormal3b(byte nx, byte ny, byte nz);
-
- @NoErrorCheck
- @DeprecatedGL
- void glNormal3f(float nx, float ny, float nz);
-
- @NoErrorCheck
- @DeprecatedGL
- void glNormal3d(double nx, double ny, double nz);
-
- @NoErrorCheck
- @DeprecatedGL
- void glNormal3i(int nx, int ny, int nz);
-
- @DeprecatedGL
- void glNewList(@GLuint int list, @GLenum int mode);
-
- @DeprecatedGL
- void glEndList();
-
- @StripPostfix("m")
- @DeprecatedGL
- void glMultMatrixf(@Check("16") @Const FloatBuffer m);
-
- @StripPostfix("m")
- @DeprecatedGL
- void glMultMatrixd(@Check("16") @Const DoubleBuffer m);
-
- void glShadeModel(@GLenum int mode);
-
- @DeprecatedGL
- void glSelectBuffer(@AutoSize("buffer") @GLsizei int size, @GLuint IntBuffer buffer);
-
- void glScissor(int x, int y, @GLsizei int width, @GLsizei int height);
-
- @DeprecatedGL
- void glScalef(float x, float y, float z);
-
- @DeprecatedGL
- void glScaled(double x, double y, double z);
-
- @DeprecatedGL
- void glRotatef(float angle, float x, float y, float z);
-
- @DeprecatedGL
- int glRenderMode(@GLenum int mode);
-
- @DeprecatedGL
- void glRectf(float x1, float y1, float x2, float y2);
-
- @DeprecatedGL
- void glRectd(double x1, double y1, double x2, double y2);
-
- @DeprecatedGL
- void glRecti(int x1, int y1, int x2, int y2);
-
- void glReadPixels(int x, int y, @GLsizei int width, @GLsizei int height, @GLenum int format, @GLenum int type,
- @OutParameter
- @BufferObject(BufferKind.PackPBO)
- @Check("GLChecks.calculateImageStorage(pixels, format, type, width, height, 1)")
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer pixels);
-
- void glReadBuffer(@GLenum int mode);
-
- @DeprecatedGL
- void glRasterPos2f(float x, float y);
-
- @DeprecatedGL
- void glRasterPos2d(double x, double y);
-
- @DeprecatedGL
- void glRasterPos2i(int x, int y);
-
- @DeprecatedGL
- void glRasterPos3f(float x, float y, float z);
-
- @DeprecatedGL
- void glRasterPos3d(double x, double y, double z);
-
- @DeprecatedGL
- void glRasterPos3i(int x, int y, int z);
-
- @DeprecatedGL
- void glRasterPos4f(float x, float y, float z, float w);
-
- @DeprecatedGL
- void glRasterPos4d(double x, double y, double z, double w);
-
- @DeprecatedGL
- void glRasterPos4i(int x, int y, int z, int w);
-
- @DeprecatedGL
- void glPushName(@GLuint int name);
-
- @DeprecatedGL
- void glPopName();
-
- @DeprecatedGL
- void glPushMatrix();
-
- @DeprecatedGL
- void glPopMatrix();
-
- @Code(" StateTracker.pushAttrib(caps, mask);")
- @DeprecatedGL
- void glPushClientAttrib(@GLbitfield int mask);
-
- @Code(" StateTracker.popAttrib(caps);")
- @DeprecatedGL
- void glPopClientAttrib();
-
- @DeprecatedGL
- void glPushAttrib(@GLbitfield int mask);
-
- @DeprecatedGL
- void glPopAttrib();
-
- void glStencilFunc(@GLenum int func, int ref, @GLuint int mask);
-
- @DeprecatedGL
- void glVertexPointer(int size, @AutoType("pointer") @GLenum int type, @GLsizei int stride,
- @CachedReference
- @BufferObject(BufferKind.ArrayVBO)
- @Check
- @Const
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer pointer);
-
- @NoErrorCheck
- @DeprecatedGL
- void glVertex2f(float x, float y);
-
- @NoErrorCheck
- @DeprecatedGL
- void glVertex2d(double x, double y);
-
- @NoErrorCheck
- @DeprecatedGL
- void glVertex2i(int x, int y);
-
- @NoErrorCheck
- @DeprecatedGL
- void glVertex3f(float x, float y, float z);
-
- @NoErrorCheck
- @DeprecatedGL
- void glVertex3d(double x, double y, double z);
-
- @NoErrorCheck
- @DeprecatedGL
- void glVertex3i(int x, int y, int z);
-
- @NoErrorCheck
- @DeprecatedGL
- void glVertex4f(float x, float y, float z, float w);
-
- @NoErrorCheck
- @DeprecatedGL
- void glVertex4d(double x, double y, double z, double w);
-
- @NoErrorCheck
- @DeprecatedGL
- void glVertex4i(int x, int y, int z, int w);
-
- @DeprecatedGL
- void glTranslatef(float x, float y, float z);
-
- @DeprecatedGL
- void glTranslated(double x, double y, double z);
-
- void glTexImage1D(@GLenum int target, int level, int internalformat, @GLsizei int width, int border, @GLenum int format, @GLenum int type,
- @BufferObject(BufferKind.UnpackPBO)
- @Check(value = "GLChecks.calculateTexImage1DStorage(pixels, format, type, width)", canBeNull = true)
- @Const
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer pixels);
-
- void glTexImage2D(@GLenum int target, int level, int internalformat, int width, int height, int border, @GLenum int format, @GLenum int type,
- @BufferObject(BufferKind.UnpackPBO)
- @Check(value = "GLChecks.calculateTexImage2DStorage(pixels, format, type, width, height)", canBeNull = true)
- @Const
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer pixels);
-
- void glTexSubImage1D(@GLenum int target, int level, int xoffset, @GLsizei int width, @GLenum int format, @GLenum int type,
- @BufferObject(BufferKind.UnpackPBO)
- @Check("GLChecks.calculateImageStorage(pixels, format, type, width, 1, 1)")
- @Const
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer pixels);
-
- void glTexSubImage2D(@GLenum int target, int level, int xoffset, int yoffset, @GLsizei int width, @GLsizei int height, @GLenum int format, @GLenum int type,
- @BufferObject(BufferKind.UnpackPBO)
- @Check("GLChecks.calculateImageStorage(pixels, format, type, width, height, 1)")
- @Const
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer pixels);
-
- void glTexParameterf(@GLenum int target, @GLenum int pname, float param);
-
- void glTexParameteri(@GLenum int target, @GLenum int pname, int param);
-
- @StripPostfix("param")
- void glTexParameterfv(@GLenum int target, @GLenum int pname, @Check("4") @Const FloatBuffer param);
-
- @StripPostfix("param")
- void glTexParameteriv(@GLenum int target, @GLenum int pname, @Check("4") @Const IntBuffer param);
-
- @DeprecatedGL
- void glTexGenf(@GLenum int coord, @GLenum int pname, float param);
-
- @DeprecatedGL
- void glTexGend(@GLenum int coord, @GLenum int pname, double param);
-
- @StripPostfix("params")
- @DeprecatedGL
- void glTexGenfv(@GLenum int coord, @GLenum int pname, @Check("4") @Const FloatBuffer params);
-
- @StripPostfix("params")
- @DeprecatedGL
- void glTexGendv(@GLenum int coord, @GLenum int pname, @Check("4") @Const DoubleBuffer params);
-
- @DeprecatedGL
- void glTexGeni(@GLenum int coord, @GLenum int pname, int param);
-
- @StripPostfix("params")
- @DeprecatedGL
- void glTexGeniv(@GLenum int coord, @GLenum int pname, @Check("4") @Const IntBuffer params);
-
- void glTexEnvf(@GLenum int target, @GLenum int pname, float param);
-
- void glTexEnvi(@GLenum int target, @GLenum int pname, int param);
-
- @StripPostfix("params")
- void glTexEnvfv(@GLenum int target, @GLenum int pname, @Check("4") @Const FloatBuffer params);
-
- @StripPostfix("params")
- void glTexEnviv(@GLenum int target, @GLenum int pname, @Check("4") @Const IntBuffer params);
-
- @DeprecatedGL
- void glTexCoordPointer(int size, @AutoType("pointer") @GLenum int type, @GLsizei int stride,
- @CachedReference(index = "GLChecks.getReferences(caps).glClientActiveTexture", name = "glTexCoordPointer_buffer")
- @BufferObject(BufferKind.ArrayVBO)
- @Check
- @Const
- @GLint
- @GLshort
- @GLfloat
- @GLdouble Buffer pointer);
-
- @NoErrorCheck
- @DeprecatedGL
- void glTexCoord1f(float s);
-
- @NoErrorCheck
- @DeprecatedGL
- void glTexCoord1d(double s);
-
- @NoErrorCheck
- @DeprecatedGL
- void glTexCoord2f(float s, float t);
-
- @NoErrorCheck
- @DeprecatedGL
- void glTexCoord2d(double s, double t);
-
- @NoErrorCheck
- @DeprecatedGL
- void glTexCoord3f(float s, float t, float r);
-
- @NoErrorCheck
- @DeprecatedGL
- void glTexCoord3d(double s, double t, double r);
-
- @NoErrorCheck
- @DeprecatedGL
- void glTexCoord4f(float s, float t, float r, float q);
-
- @NoErrorCheck
- @DeprecatedGL
- void glTexCoord4d(double s, double t, double r, double q);
-
- void glStencilOp(@GLenum int fail, @GLenum int zfail, @GLenum int zpass);
-
- void glStencilMask(@GLuint int mask);
-
- void glViewport(int x, int y, @GLsizei int width, @GLsizei int height);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+/**
+ * The core OpenGL1.1 API.
+ *
+ * @author cix_foo <cix_foo at users.sourceforge.net>
+ * @version $Revision: 3316 $
+ * $Id: GL11.java 3316 2010-04-09 23:57:40Z spasi $
+ */
+ at DeprecatedGL
+public interface GL11 {
+ /* AccumOp */
+ int GL_ACCUM = 0x0100;
+ int GL_LOAD = 0x0101;
+ int GL_RETURN = 0x0102;
+ int GL_MULT = 0x0103;
+ int GL_ADD = 0x0104;
+
+ /* AlphaFunction */
+ int GL_NEVER = 0x0200;
+ int GL_LESS = 0x0201;
+ int GL_EQUAL = 0x0202;
+ int GL_LEQUAL = 0x0203;
+ int GL_GREATER = 0x0204;
+ int GL_NOTEQUAL = 0x0205;
+ int GL_GEQUAL = 0x0206;
+ int GL_ALWAYS = 0x0207;
+
+ /* AttribMask */
+ int GL_CURRENT_BIT = 0x00000001;
+ int GL_POINT_BIT = 0x00000002;
+ int GL_LINE_BIT = 0x00000004;
+ int GL_POLYGON_BIT = 0x00000008;
+ int GL_POLYGON_STIPPLE_BIT = 0x00000010;
+ int GL_PIXEL_MODE_BIT = 0x00000020;
+ int GL_LIGHTING_BIT = 0x00000040;
+ int GL_FOG_BIT = 0x00000080;
+ int GL_DEPTH_BUFFER_BIT = 0x00000100;
+ int GL_ACCUM_BUFFER_BIT = 0x00000200;
+ int GL_STENCIL_BUFFER_BIT = 0x00000400;
+ int GL_VIEWPORT_BIT = 0x00000800;
+ int GL_TRANSFORM_BIT = 0x00001000;
+ int GL_ENABLE_BIT = 0x00002000;
+ int GL_COLOR_BUFFER_BIT = 0x00004000;
+ int GL_HINT_BIT = 0x00008000;
+ int GL_EVAL_BIT = 0x00010000;
+ int GL_LIST_BIT = 0x00020000;
+ int GL_TEXTURE_BIT = 0x00040000;
+ int GL_SCISSOR_BIT = 0x00080000;
+ int GL_ALL_ATTRIB_BITS = 0x000fffff;
+
+ /* BeginMode */
+ int GL_POINTS = 0x0000;
+ int GL_LINES = 0x0001;
+ int GL_LINE_LOOP = 0x0002;
+ int GL_LINE_STRIP = 0x0003;
+ int GL_TRIANGLES = 0x0004;
+ int GL_TRIANGLE_STRIP = 0x0005;
+ int GL_TRIANGLE_FAN = 0x0006;
+ int GL_QUADS = 0x0007;
+ int GL_QUAD_STRIP = 0x0008;
+ int GL_POLYGON = 0x0009;
+
+ /* BlendingFactorDest */
+ int GL_ZERO = 0;
+ int GL_ONE = 1;
+ int GL_SRC_COLOR = 0x0300;
+ int GL_ONE_MINUS_SRC_COLOR = 0x0301;
+ int GL_SRC_ALPHA = 0x0302;
+ int GL_ONE_MINUS_SRC_ALPHA = 0x0303;
+ int GL_DST_ALPHA = 0x0304;
+ int GL_ONE_MINUS_DST_ALPHA = 0x0305;
+
+ /* BlendingFactorSrc */
+ /* GL_ZERO */
+ /* GL_ONE */
+ int GL_DST_COLOR = 0x0306;
+ int GL_ONE_MINUS_DST_COLOR = 0x0307;
+ int GL_SRC_ALPHA_SATURATE = 0x0308;
+ int GL_CONSTANT_COLOR = 0x8001;
+ int GL_ONE_MINUS_CONSTANT_COLOR = 0x8002;
+ int GL_CONSTANT_ALPHA = 0x8003;
+ int GL_ONE_MINUS_CONSTANT_ALPHA = 0x8004;
+
+ /* Boolean */
+ int GL_TRUE = 1;
+ int GL_FALSE = 0;
+
+ /* ClipPlaneName */
+ int GL_CLIP_PLANE0 = 0x3000;
+ int GL_CLIP_PLANE1 = 0x3001;
+ int GL_CLIP_PLANE2 = 0x3002;
+ int GL_CLIP_PLANE3 = 0x3003;
+ int GL_CLIP_PLANE4 = 0x3004;
+ int GL_CLIP_PLANE5 = 0x3005;
+
+ /* DataType */
+ int GL_BYTE = 0x1400;
+ int GL_UNSIGNED_BYTE = 0x1401;
+ int GL_SHORT = 0x1402;
+ int GL_UNSIGNED_SHORT = 0x1403;
+ int GL_INT = 0x1404;
+ int GL_UNSIGNED_INT = 0x1405;
+ int GL_FLOAT = 0x1406;
+ int GL_2_BYTES = 0x1407;
+ int GL_3_BYTES = 0x1408;
+ int GL_4_BYTES = 0x1409;
+ int GL_DOUBLE = 0x140A;
+
+ /* DrawBufferMode */
+ int GL_NONE = 0;
+ int GL_FRONT_LEFT = 0x0400;
+ int GL_FRONT_RIGHT = 0x0401;
+ int GL_BACK_LEFT = 0x0402;
+ int GL_BACK_RIGHT = 0x0403;
+ int GL_FRONT = 0x0404;
+ int GL_BACK = 0x0405;
+ int GL_LEFT = 0x0406;
+ int GL_RIGHT = 0x0407;
+ int GL_FRONT_AND_BACK = 0x0408;
+ int GL_AUX0 = 0x0409;
+ int GL_AUX1 = 0x040A;
+ int GL_AUX2 = 0x040B;
+ int GL_AUX3 = 0x040C;
+
+ /* ErrorCode */
+ int GL_NO_ERROR = 0;
+ int GL_INVALID_ENUM = 0x0500;
+ int GL_INVALID_VALUE = 0x0501;
+ int GL_INVALID_OPERATION = 0x0502;
+ int GL_STACK_OVERFLOW = 0x0503;
+ int GL_STACK_UNDERFLOW = 0x0504;
+ int GL_OUT_OF_MEMORY = 0x0505;
+
+ /* FeedBackMode */
+ int GL_2D = 0x0600;
+ int GL_3D = 0x0601;
+ int GL_3D_COLOR = 0x0602;
+ int GL_3D_COLOR_TEXTURE = 0x0603;
+ int GL_4D_COLOR_TEXTURE = 0x0604;
+
+ /* FeedBackToken */
+ int GL_PASS_THROUGH_TOKEN = 0x0700;
+ int GL_POINT_TOKEN = 0x0701;
+ int GL_LINE_TOKEN = 0x0702;
+ int GL_POLYGON_TOKEN = 0x0703;
+ int GL_BITMAP_TOKEN = 0x0704;
+ int GL_DRAW_PIXEL_TOKEN = 0x0705;
+ int GL_COPY_PIXEL_TOKEN = 0x0706;
+ int GL_LINE_RESET_TOKEN = 0x0707;
+
+ /* FogMode */
+ /* GL_LINEAR */
+ int GL_EXP = 0x0800;
+ int GL_EXP2 = 0x0801;
+
+ /* FrontFaceDirection */
+ int GL_CW = 0x0900;
+ int GL_CCW = 0x0901;
+
+ /* GetMapTarget */
+ int GL_COEFF = 0x0A00;
+ int GL_ORDER = 0x0A01;
+ int GL_DOMAIN = 0x0A02;
+
+ /* GetTarget */
+ int GL_CURRENT_COLOR = 0x0B00;
+ int GL_CURRENT_INDEX = 0x0B01;
+ int GL_CURRENT_NORMAL = 0x0B02;
+ int GL_CURRENT_TEXTURE_COORDS = 0x0B03;
+ int GL_CURRENT_RASTER_COLOR = 0x0B04;
+ int GL_CURRENT_RASTER_INDEX = 0x0B05;
+ int GL_CURRENT_RASTER_TEXTURE_COORDS = 0x0B06;
+ int GL_CURRENT_RASTER_POSITION = 0x0B07;
+ int GL_CURRENT_RASTER_POSITION_VALID = 0x0B08;
+ int GL_CURRENT_RASTER_DISTANCE = 0x0B09;
+ int GL_POINT_SMOOTH = 0x0B10;
+ int GL_POINT_SIZE = 0x0B11;
+ int GL_POINT_SIZE_RANGE = 0x0B12;
+ int GL_POINT_SIZE_GRANULARITY = 0x0B13;
+ int GL_LINE_SMOOTH = 0x0B20;
+ int GL_LINE_WIDTH = 0x0B21;
+ int GL_LINE_WIDTH_RANGE = 0x0B22;
+ int GL_LINE_WIDTH_GRANULARITY = 0x0B23;
+ int GL_LINE_STIPPLE = 0x0B24;
+ int GL_LINE_STIPPLE_PATTERN = 0x0B25;
+ int GL_LINE_STIPPLE_REPEAT = 0x0B26;
+ int GL_LIST_MODE = 0x0B30;
+ int GL_MAX_LIST_NESTING = 0x0B31;
+ int GL_LIST_BASE = 0x0B32;
+ int GL_LIST_INDEX = 0x0B33;
+ int GL_POLYGON_MODE = 0x0B40;
+ int GL_POLYGON_SMOOTH = 0x0B41;
+ int GL_POLYGON_STIPPLE = 0x0B42;
+ int GL_EDGE_FLAG = 0x0B43;
+ int GL_CULL_FACE = 0x0B44;
+ int GL_CULL_FACE_MODE = 0x0B45;
+ int GL_FRONT_FACE = 0x0B46;
+ int GL_LIGHTING = 0x0B50;
+ int GL_LIGHT_MODEL_LOCAL_VIEWER = 0x0B51;
+ int GL_LIGHT_MODEL_TWO_SIDE = 0x0B52;
+ int GL_LIGHT_MODEL_AMBIENT = 0x0B53;
+ int GL_SHADE_MODEL = 0x0B54;
+ int GL_COLOR_MATERIAL_FACE = 0x0B55;
+ int GL_COLOR_MATERIAL_PARAMETER = 0x0B56;
+ int GL_COLOR_MATERIAL = 0x0B57;
+ int GL_FOG = 0x0B60;
+ int GL_FOG_INDEX = 0x0B61;
+ int GL_FOG_DENSITY = 0x0B62;
+ int GL_FOG_START = 0x0B63;
+ int GL_FOG_END = 0x0B64;
+ int GL_FOG_MODE = 0x0B65;
+ int GL_FOG_COLOR = 0x0B66;
+ int GL_DEPTH_RANGE = 0x0B70;
+ int GL_DEPTH_TEST = 0x0B71;
+ int GL_DEPTH_WRITEMASK = 0x0B72;
+ int GL_DEPTH_CLEAR_VALUE = 0x0B73;
+ int GL_DEPTH_FUNC = 0x0B74;
+ int GL_ACCUM_CLEAR_VALUE = 0x0B80;
+ int GL_STENCIL_TEST = 0x0B90;
+ int GL_STENCIL_CLEAR_VALUE = 0x0B91;
+ int GL_STENCIL_FUNC = 0x0B92;
+ int GL_STENCIL_VALUE_MASK = 0x0B93;
+ int GL_STENCIL_FAIL = 0x0B94;
+ int GL_STENCIL_PASS_DEPTH_FAIL = 0x0B95;
+ int GL_STENCIL_PASS_DEPTH_PASS = 0x0B96;
+ int GL_STENCIL_REF = 0x0B97;
+ int GL_STENCIL_WRITEMASK = 0x0B98;
+ int GL_MATRIX_MODE = 0x0BA0;
+ int GL_NORMALIZE = 0x0BA1;
+ int GL_VIEWPORT = 0x0BA2;
+ int GL_MODELVIEW_STACK_DEPTH = 0x0BA3;
+ int GL_PROJECTION_STACK_DEPTH = 0x0BA4;
+ int GL_TEXTURE_STACK_DEPTH = 0x0BA5;
+ int GL_MODELVIEW_MATRIX = 0x0BA6;
+ int GL_PROJECTION_MATRIX = 0x0BA7;
+ int GL_TEXTURE_MATRIX = 0x0BA8;
+ int GL_ATTRIB_STACK_DEPTH = 0x0BB0;
+ int GL_CLIENT_ATTRIB_STACK_DEPTH = 0x0BB1;
+ int GL_ALPHA_TEST = 0x0BC0;
+ int GL_ALPHA_TEST_FUNC = 0x0BC1;
+ int GL_ALPHA_TEST_REF = 0x0BC2;
+ int GL_DITHER = 0x0BD0;
+ int GL_BLEND_DST = 0x0BE0;
+ int GL_BLEND_SRC = 0x0BE1;
+ int GL_BLEND = 0x0BE2;
+ int GL_LOGIC_OP_MODE = 0x0BF0;
+ int GL_INDEX_LOGIC_OP = 0x0BF1;
+ int GL_COLOR_LOGIC_OP = 0x0BF2;
+ int GL_AUX_BUFFERS = 0x0C00;
+ int GL_DRAW_BUFFER = 0x0C01;
+ int GL_READ_BUFFER = 0x0C02;
+ int GL_SCISSOR_BOX = 0x0C10;
+ int GL_SCISSOR_TEST = 0x0C11;
+ int GL_INDEX_CLEAR_VALUE = 0x0C20;
+ int GL_INDEX_WRITEMASK = 0x0C21;
+ int GL_COLOR_CLEAR_VALUE = 0x0C22;
+ int GL_COLOR_WRITEMASK = 0x0C23;
+ int GL_INDEX_MODE = 0x0C30;
+ int GL_RGBA_MODE = 0x0C31;
+ int GL_DOUBLEBUFFER = 0x0C32;
+ int GL_STEREO = 0x0C33;
+ int GL_RENDER_MODE = 0x0C40;
+ int GL_PERSPECTIVE_CORRECTION_HINT = 0x0C50;
+ int GL_POINT_SMOOTH_HINT = 0x0C51;
+ int GL_LINE_SMOOTH_HINT = 0x0C52;
+ int GL_POLYGON_SMOOTH_HINT = 0x0C53;
+ int GL_FOG_HINT = 0x0C54;
+ int GL_TEXTURE_GEN_S = 0x0C60;
+ int GL_TEXTURE_GEN_T = 0x0C61;
+ int GL_TEXTURE_GEN_R = 0x0C62;
+ int GL_TEXTURE_GEN_Q = 0x0C63;
+ int GL_PIXEL_MAP_I_TO_I = 0x0C70;
+ int GL_PIXEL_MAP_S_TO_S = 0x0C71;
+ int GL_PIXEL_MAP_I_TO_R = 0x0C72;
+ int GL_PIXEL_MAP_I_TO_G = 0x0C73;
+ int GL_PIXEL_MAP_I_TO_B = 0x0C74;
+ int GL_PIXEL_MAP_I_TO_A = 0x0C75;
+ int GL_PIXEL_MAP_R_TO_R = 0x0C76;
+ int GL_PIXEL_MAP_G_TO_G = 0x0C77;
+ int GL_PIXEL_MAP_B_TO_B = 0x0C78;
+ int GL_PIXEL_MAP_A_TO_A = 0x0C79;
+ int GL_PIXEL_MAP_I_TO_I_SIZE = 0x0CB0;
+ int GL_PIXEL_MAP_S_TO_S_SIZE = 0x0CB1;
+ int GL_PIXEL_MAP_I_TO_R_SIZE = 0x0CB2;
+ int GL_PIXEL_MAP_I_TO_G_SIZE = 0x0CB3;
+ int GL_PIXEL_MAP_I_TO_B_SIZE = 0x0CB4;
+ int GL_PIXEL_MAP_I_TO_A_SIZE = 0x0CB5;
+ int GL_PIXEL_MAP_R_TO_R_SIZE = 0x0CB6;
+ int GL_PIXEL_MAP_G_TO_G_SIZE = 0x0CB7;
+ int GL_PIXEL_MAP_B_TO_B_SIZE = 0x0CB8;
+ int GL_PIXEL_MAP_A_TO_A_SIZE = 0x0CB9;
+ int GL_UNPACK_SWAP_BYTES = 0x0CF0;
+ int GL_UNPACK_LSB_FIRST = 0x0CF1;
+ int GL_UNPACK_ROW_LENGTH = 0x0CF2;
+ int GL_UNPACK_SKIP_ROWS = 0x0CF3;
+ int GL_UNPACK_SKIP_PIXELS = 0x0CF4;
+ int GL_UNPACK_ALIGNMENT = 0x0CF5;
+ int GL_PACK_SWAP_BYTES = 0x0D00;
+ int GL_PACK_LSB_FIRST = 0x0D01;
+ int GL_PACK_ROW_LENGTH = 0x0D02;
+ int GL_PACK_SKIP_ROWS = 0x0D03;
+ int GL_PACK_SKIP_PIXELS = 0x0D04;
+ int GL_PACK_ALIGNMENT = 0x0D05;
+ int GL_MAP_COLOR = 0x0D10;
+ int GL_MAP_STENCIL = 0x0D11;
+ int GL_INDEX_SHIFT = 0x0D12;
+ int GL_INDEX_OFFSET = 0x0D13;
+ int GL_RED_SCALE = 0x0D14;
+ int GL_RED_BIAS = 0x0D15;
+ int GL_ZOOM_X = 0x0D16;
+ int GL_ZOOM_Y = 0x0D17;
+ int GL_GREEN_SCALE = 0x0D18;
+ int GL_GREEN_BIAS = 0x0D19;
+ int GL_BLUE_SCALE = 0x0D1A;
+ int GL_BLUE_BIAS = 0x0D1B;
+ int GL_ALPHA_SCALE = 0x0D1C;
+ int GL_ALPHA_BIAS = 0x0D1D;
+ int GL_DEPTH_SCALE = 0x0D1E;
+ int GL_DEPTH_BIAS = 0x0D1F;
+ int GL_MAX_EVAL_ORDER = 0x0D30;
+ int GL_MAX_LIGHTS = 0x0D31;
+ int GL_MAX_CLIP_PLANES = 0x0D32;
+ int GL_MAX_TEXTURE_SIZE = 0x0D33;
+ int GL_MAX_PIXEL_MAP_TABLE = 0x0D34;
+ int GL_MAX_ATTRIB_STACK_DEPTH = 0x0D35;
+ int GL_MAX_MODELVIEW_STACK_DEPTH = 0x0D36;
+ int GL_MAX_NAME_STACK_DEPTH = 0x0D37;
+ int GL_MAX_PROJECTION_STACK_DEPTH = 0x0D38;
+ int GL_MAX_TEXTURE_STACK_DEPTH = 0x0D39;
+ int GL_MAX_VIEWPORT_DIMS = 0x0D3A;
+ int GL_MAX_CLIENT_ATTRIB_STACK_DEPTH = 0x0D3B;
+ int GL_SUBPIXEL_BITS = 0x0D50;
+ int GL_INDEX_BITS = 0x0D51;
+ int GL_RED_BITS = 0x0D52;
+ int GL_GREEN_BITS = 0x0D53;
+ int GL_BLUE_BITS = 0x0D54;
+ int GL_ALPHA_BITS = 0x0D55;
+ int GL_DEPTH_BITS = 0x0D56;
+ int GL_STENCIL_BITS = 0x0D57;
+ int GL_ACCUM_RED_BITS = 0x0D58;
+ int GL_ACCUM_GREEN_BITS = 0x0D59;
+ int GL_ACCUM_BLUE_BITS = 0x0D5A;
+ int GL_ACCUM_ALPHA_BITS = 0x0D5B;
+ int GL_NAME_STACK_DEPTH = 0x0D70;
+ int GL_AUTO_NORMAL = 0x0D80;
+ int GL_MAP1_COLOR_4 = 0x0D90;
+ int GL_MAP1_INDEX = 0x0D91;
+ int GL_MAP1_NORMAL = 0x0D92;
+ int GL_MAP1_TEXTURE_COORD_1 = 0x0D93;
+ int GL_MAP1_TEXTURE_COORD_2 = 0x0D94;
+ int GL_MAP1_TEXTURE_COORD_3 = 0x0D95;
+ int GL_MAP1_TEXTURE_COORD_4 = 0x0D96;
+ int GL_MAP1_VERTEX_3 = 0x0D97;
+ int GL_MAP1_VERTEX_4 = 0x0D98;
+ int GL_MAP2_COLOR_4 = 0x0DB0;
+ int GL_MAP2_INDEX = 0x0DB1;
+ int GL_MAP2_NORMAL = 0x0DB2;
+ int GL_MAP2_TEXTURE_COORD_1 = 0x0DB3;
+ int GL_MAP2_TEXTURE_COORD_2 = 0x0DB4;
+ int GL_MAP2_TEXTURE_COORD_3 = 0x0DB5;
+ int GL_MAP2_TEXTURE_COORD_4 = 0x0DB6;
+ int GL_MAP2_VERTEX_3 = 0x0DB7;
+ int GL_MAP2_VERTEX_4 = 0x0DB8;
+ int GL_MAP1_GRID_DOMAIN = 0x0DD0;
+ int GL_MAP1_GRID_SEGMENTS = 0x0DD1;
+ int GL_MAP2_GRID_DOMAIN = 0x0DD2;
+ int GL_MAP2_GRID_SEGMENTS = 0x0DD3;
+ int GL_TEXTURE_1D = 0x0DE0;
+ int GL_TEXTURE_2D = 0x0DE1;
+ int GL_FEEDBACK_BUFFER_POINTER = 0x0DF0;
+ int GL_FEEDBACK_BUFFER_SIZE = 0x0DF1;
+ int GL_FEEDBACK_BUFFER_TYPE = 0x0DF2;
+ int GL_SELECTION_BUFFER_POINTER = 0x0DF3;
+ int GL_SELECTION_BUFFER_SIZE = 0x0DF4;
+
+ /* GetTextureParameter */
+ /* GL_TEXTURE_MAG_FILTER */
+ /* GL_TEXTURE_MIN_FILTER */
+ /* GL_TEXTURE_WRAP_S */
+ /* GL_TEXTURE_WRAP_T */
+ int GL_TEXTURE_WIDTH = 0x1000;
+ int GL_TEXTURE_HEIGHT = 0x1001;
+ int GL_TEXTURE_INTERNAL_FORMAT = 0x1003;
+ int GL_TEXTURE_BORDER_COLOR = 0x1004;
+ int GL_TEXTURE_BORDER = 0x1005;
+ /* GL_TEXTURE_RED_SIZE */
+ /* GL_TEXTURE_GREEN_SIZE */
+ /* GL_TEXTURE_BLUE_SIZE */
+ /* GL_TEXTURE_ALPHA_SIZE */
+ /* GL_TEXTURE_LUMINANCE_SIZE */
+ /* GL_TEXTURE_INTENSITY_SIZE */
+ /* GL_TEXTURE_PRIORITY */
+ /* GL_TEXTURE_RESIDENT */
+
+ /* HintMode */
+ int GL_DONT_CARE = 0x1100;
+ int GL_FASTEST = 0x1101;
+ int GL_NICEST = 0x1102;
+
+ /* LightName */
+ int GL_LIGHT0 = 0x4000;
+ int GL_LIGHT1 = 0x4001;
+ int GL_LIGHT2 = 0x4002;
+ int GL_LIGHT3 = 0x4003;
+ int GL_LIGHT4 = 0x4004;
+ int GL_LIGHT5 = 0x4005;
+ int GL_LIGHT6 = 0x4006;
+ int GL_LIGHT7 = 0x4007;
+
+ /* LightParameter */
+ int GL_AMBIENT = 0x1200;
+ int GL_DIFFUSE = 0x1201;
+ int GL_SPECULAR = 0x1202;
+ int GL_POSITION = 0x1203;
+ int GL_SPOT_DIRECTION = 0x1204;
+ int GL_SPOT_EXPONENT = 0x1205;
+ int GL_SPOT_CUTOFF = 0x1206;
+ int GL_CONSTANT_ATTENUATION = 0x1207;
+ int GL_LINEAR_ATTENUATION = 0x1208;
+ int GL_QUADRATIC_ATTENUATION = 0x1209;
+
+ /* ListMode */
+ int GL_COMPILE = 0x1300;
+ int GL_COMPILE_AND_EXECUTE = 0x1301;
+
+ /* LogicOp */
+ int GL_CLEAR = 0x1500;
+ int GL_AND = 0x1501;
+ int GL_AND_REVERSE = 0x1502;
+ int GL_COPY = 0x1503;
+ int GL_AND_INVERTED = 0x1504;
+ int GL_NOOP = 0x1505;
+ int GL_XOR = 0x1506;
+ int GL_OR = 0x1507;
+ int GL_NOR = 0x1508;
+ int GL_EQUIV = 0x1509;
+ int GL_INVERT = 0x150A;
+ int GL_OR_REVERSE = 0x150B;
+ int GL_COPY_INVERTED = 0x150C;
+ int GL_OR_INVERTED = 0x150D;
+ int GL_NAND = 0x150E;
+ int GL_SET = 0x150F;
+
+ /* MaterialParameter */
+ int GL_EMISSION = 0x1600;
+ int GL_SHININESS = 0x1601;
+ int GL_AMBIENT_AND_DIFFUSE = 0x1602;
+ int GL_COLOR_INDEXES = 0x1603;
+ /* GL_AMBIENT */
+ /* GL_DIFFUSE */
+ /* GL_SPECULAR */
+
+ /* MatrixMode */
+ int GL_MODELVIEW = 0x1700;
+ int GL_PROJECTION = 0x1701;
+ int GL_TEXTURE = 0x1702;
+
+ /* PixelCopyType */
+ int GL_COLOR = 0x1800;
+ int GL_DEPTH = 0x1801;
+ int GL_STENCIL = 0x1802;
+
+ /* PixelFormat */
+ int GL_COLOR_INDEX = 0x1900;
+ int GL_STENCIL_INDEX = 0x1901;
+ int GL_DEPTH_COMPONENT = 0x1902;
+ int GL_RED = 0x1903;
+ int GL_GREEN = 0x1904;
+ int GL_BLUE = 0x1905;
+ int GL_ALPHA = 0x1906;
+ int GL_RGB = 0x1907;
+ int GL_RGBA = 0x1908;
+ int GL_LUMINANCE = 0x1909;
+ int GL_LUMINANCE_ALPHA = 0x190A;
+
+ /* PixelType */
+ int GL_BITMAP = 0x1A00;
+ /* GL_BYTE */
+ /* GL_UNSIGNED_BYTE */
+ /* GL_SHORT */
+ /* GL_UNSIGNED_SHORT */
+ /* GL_INT */
+ /* GL_UNSIGNED_INT */
+ /* GL_FLOAT */
+
+ /* PolygonMode */
+ int GL_POINT = 0x1B00;
+ int GL_LINE = 0x1B01;
+ int GL_FILL = 0x1B02;
+
+ /* RenderingMode */
+ int GL_RENDER = 0x1C00;
+ int GL_FEEDBACK = 0x1C01;
+ int GL_SELECT = 0x1C02;
+
+ /* ShadingModel */
+ int GL_FLAT = 0x1D00;
+ int GL_SMOOTH = 0x1D01;
+
+ /* StencilOp */
+ /* GL_ZERO */
+ int GL_KEEP = 0x1E00;
+ int GL_REPLACE = 0x1E01;
+ int GL_INCR = 0x1E02;
+ int GL_DECR = 0x1E03;
+ /* GL_INVERT */
+
+ /* StringName */
+ int GL_VENDOR = 0x1F00;
+ int GL_RENDERER = 0x1F01;
+ int GL_VERSION = 0x1F02;
+ int GL_EXTENSIONS = 0x1F03;
+
+ /* TextureCoordName */
+ int GL_S = 0x2000;
+ int GL_T = 0x2001;
+ int GL_R = 0x2002;
+ int GL_Q = 0x2003;
+
+ /* TexCoordPointerType */
+ /* GL_SHORT */
+ /* GL_INT */
+ /* GL_FLOAT */
+ /* GL_DOUBLE */
+
+ /* TextureEnvMode */
+ int GL_MODULATE = 0x2100;
+ int GL_DECAL = 0x2101;
+ /* GL_BLEND */
+ /* GL_REPLACE */
+
+ /* TextureEnvParameter */
+ int GL_TEXTURE_ENV_MODE = 0x2200;
+ int GL_TEXTURE_ENV_COLOR = 0x2201;
+
+ /* TextureEnvTarget */
+ int GL_TEXTURE_ENV = 0x2300;
+
+ /* TextureGenMode */
+ int GL_EYE_LINEAR = 0x2400;
+ int GL_OBJECT_LINEAR = 0x2401;
+ int GL_SPHERE_MAP = 0x2402;
+
+ /* TextureGenParameter */
+ int GL_TEXTURE_GEN_MODE = 0x2500;
+ int GL_OBJECT_PLANE = 0x2501;
+ int GL_EYE_PLANE = 0x2502;
+
+ /* TextureMagFilter */
+ int GL_NEAREST = 0x2600;
+ int GL_LINEAR = 0x2601;
+
+ /* TextureMinFilter */
+ /* GL_NEAREST */
+ /* GL_LINEAR */
+ int GL_NEAREST_MIPMAP_NEAREST = 0x2700;
+ int GL_LINEAR_MIPMAP_NEAREST = 0x2701;
+ int GL_NEAREST_MIPMAP_LINEAR = 0x2702;
+ int GL_LINEAR_MIPMAP_LINEAR = 0x2703;
+
+ /* TextureParameterName */
+ int GL_TEXTURE_MAG_FILTER = 0x2800;
+ int GL_TEXTURE_MIN_FILTER = 0x2801;
+ int GL_TEXTURE_WRAP_S = 0x2802;
+ int GL_TEXTURE_WRAP_T = 0x2803;
+ /* GL_TEXTURE_BORDER_COLOR */
+ /* GL_TEXTURE_PRIORITY */
+
+ /* TextureWrapMode */
+ int GL_CLAMP = 0x2900;
+ int GL_REPEAT = 0x2901;
+
+ /* ClientAttribMask */
+ int GL_CLIENT_PIXEL_STORE_BIT = 0x00000001;
+ int GL_CLIENT_VERTEX_ARRAY_BIT = 0x00000002;
+ int GL_ALL_CLIENT_ATTRIB_BITS = 0xffffffff;
+
+ /* polygon_offset */
+ int GL_POLYGON_OFFSET_FACTOR = 0x8038;
+ int GL_POLYGON_OFFSET_UNITS = 0x2A00;
+ int GL_POLYGON_OFFSET_POINT = 0x2A01;
+ int GL_POLYGON_OFFSET_LINE = 0x2A02;
+ int GL_POLYGON_OFFSET_FILL = 0x8037;
+
+ /* texture */
+ int GL_ALPHA4 = 0x803B;
+ int GL_ALPHA8 = 0x803C;
+ int GL_ALPHA12 = 0x803D;
+ int GL_ALPHA16 = 0x803E;
+ int GL_LUMINANCE4 = 0x803F;
+ int GL_LUMINANCE8 = 0x8040;
+ int GL_LUMINANCE12 = 0x8041;
+ int GL_LUMINANCE16 = 0x8042;
+ int GL_LUMINANCE4_ALPHA4 = 0x8043;
+ int GL_LUMINANCE6_ALPHA2 = 0x8044;
+ int GL_LUMINANCE8_ALPHA8 = 0x8045;
+ int GL_LUMINANCE12_ALPHA4 = 0x8046;
+ int GL_LUMINANCE12_ALPHA12 = 0x8047;
+ int GL_LUMINANCE16_ALPHA16 = 0x8048;
+ int GL_INTENSITY = 0x8049;
+ int GL_INTENSITY4 = 0x804A;
+ int GL_INTENSITY8 = 0x804B;
+ int GL_INTENSITY12 = 0x804C;
+ int GL_INTENSITY16 = 0x804D;
+ int GL_R3_G3_B2 = 0x2A10;
+ int GL_RGB4 = 0x804F;
+ int GL_RGB5 = 0x8050;
+ int GL_RGB8 = 0x8051;
+ int GL_RGB10 = 0x8052;
+ int GL_RGB12 = 0x8053;
+ int GL_RGB16 = 0x8054;
+ int GL_RGBA2 = 0x8055;
+ int GL_RGBA4 = 0x8056;
+ int GL_RGB5_A1 = 0x8057;
+ int GL_RGBA8 = 0x8058;
+ int GL_RGB10_A2 = 0x8059;
+ int GL_RGBA12 = 0x805A;
+ int GL_RGBA16 = 0x805B;
+ int GL_TEXTURE_RED_SIZE = 0x805C;
+ int GL_TEXTURE_GREEN_SIZE = 0x805D;
+ int GL_TEXTURE_BLUE_SIZE = 0x805E;
+ int GL_TEXTURE_ALPHA_SIZE = 0x805F;
+ int GL_TEXTURE_LUMINANCE_SIZE = 0x8060;
+ int GL_TEXTURE_INTENSITY_SIZE = 0x8061;
+ int GL_PROXY_TEXTURE_1D = 0x8063;
+ int GL_PROXY_TEXTURE_2D = 0x8064;
+
+ /* texture_object */
+ int GL_TEXTURE_PRIORITY = 0x8066;
+ int GL_TEXTURE_RESIDENT = 0x8067;
+ int GL_TEXTURE_BINDING_1D = 0x8068;
+ int GL_TEXTURE_BINDING_2D = 0x8069;
+
+ /* vertex_array */
+ int GL_VERTEX_ARRAY = 0x8074;
+ int GL_NORMAL_ARRAY = 0x8075;
+ int GL_COLOR_ARRAY = 0x8076;
+ int GL_INDEX_ARRAY = 0x8077;
+ int GL_TEXTURE_COORD_ARRAY = 0x8078;
+ int GL_EDGE_FLAG_ARRAY = 0x8079;
+ int GL_VERTEX_ARRAY_SIZE = 0x807A;
+ int GL_VERTEX_ARRAY_TYPE = 0x807B;
+ int GL_VERTEX_ARRAY_STRIDE = 0x807C;
+ int GL_NORMAL_ARRAY_TYPE = 0x807E;
+ int GL_NORMAL_ARRAY_STRIDE = 0x807F;
+ int GL_COLOR_ARRAY_SIZE = 0x8081;
+ int GL_COLOR_ARRAY_TYPE = 0x8082;
+ int GL_COLOR_ARRAY_STRIDE = 0x8083;
+ int GL_INDEX_ARRAY_TYPE = 0x8085;
+ int GL_INDEX_ARRAY_STRIDE = 0x8086;
+ int GL_TEXTURE_COORD_ARRAY_SIZE = 0x8088;
+ int GL_TEXTURE_COORD_ARRAY_TYPE = 0x8089;
+ int GL_TEXTURE_COORD_ARRAY_STRIDE = 0x808A;
+ int GL_EDGE_FLAG_ARRAY_STRIDE = 0x808C;
+ int GL_VERTEX_ARRAY_POINTER = 0x808E;
+ int GL_NORMAL_ARRAY_POINTER = 0x808F;
+ int GL_COLOR_ARRAY_POINTER = 0x8090;
+ int GL_INDEX_ARRAY_POINTER = 0x8091;
+ int GL_TEXTURE_COORD_ARRAY_POINTER = 0x8092;
+ int GL_EDGE_FLAG_ARRAY_POINTER = 0x8093;
+ int GL_V2F = 0x2A20;
+ int GL_V3F = 0x2A21;
+ int GL_C4UB_V2F = 0x2A22;
+ int GL_C4UB_V3F = 0x2A23;
+ int GL_C3F_V3F = 0x2A24;
+ int GL_N3F_V3F = 0x2A25;
+ int GL_C4F_N3F_V3F = 0x2A26;
+ int GL_T2F_V3F = 0x2A27;
+ int GL_T4F_V4F = 0x2A28;
+ int GL_T2F_C4UB_V3F = 0x2A29;
+ int GL_T2F_C3F_V3F = 0x2A2A;
+ int GL_T2F_N3F_V3F = 0x2A2B;
+ int GL_T2F_C4F_N3F_V3F = 0x2A2C;
+ int GL_T4F_C4F_N3F_V4F = 0x2A2D;
+
+ /* For compatibility with OpenGL v1.0 */
+ int GL_LOGIC_OP = GL_INDEX_LOGIC_OP;
+ int GL_TEXTURE_COMPONENTS = GL_TEXTURE_INTERNAL_FORMAT;
+
+ @DeprecatedGL
+ void glAccum(@GLenum int op, float value);
+
+ @DeprecatedGL
+ void glAlphaFunc(@GLenum int func, @GLclampf float ref);
+
+ void glClearColor(@GLclampf float red, @GLclampf float green, @GLclampf float blue, @GLclampf float alpha);
+
+ @DeprecatedGL
+ void glClearAccum(float red, float green, float blue, float alpha);
+
+ void glClear(@GLbitfield int mask);
+
+ @DeprecatedGL
+ void glCallLists(@AutoSize("lists") @GLsizei int n, @AutoType("lists") @GLenum int type,
+ @Const
+ @GLubyte
+ @GLushort
+ @GLuint Buffer lists);
+
+ @DeprecatedGL
+ void glCallList(@GLuint int list);
+
+ void glBlendFunc(@GLenum int sfactor, @GLenum int dfactor);
+
+ @DeprecatedGL
+ void glBitmap(@GLsizei int width, @GLsizei int height, float xorig, float yorig, float xmove, float ymove,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check("(((width + 7)/8)*height)")
+ @Const
+ @GLubyte ByteBuffer bitmap);
+
+ void glBindTexture(@GLenum int target, @GLuint int texture);
+
+ @DeprecatedGL
+ void glPrioritizeTextures(@AutoSize("textures") @GLsizei int n,
+ @Const
+ @GLuint IntBuffer textures,
+ @Const
+ @Check("textures.remaining()")
+ @GLclampf FloatBuffer priorities);
+
+ @DeprecatedGL
+ boolean glAreTexturesResident(@AutoSize("textures") @GLsizei int n,
+ @Const
+ @GLuint IntBuffer textures,
+ @Check("textures.remaining()")
+ @GLboolean ByteBuffer residences);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ @Code("\t\tif ( ContextCapabilities.DEBUG ) StateTracker.setBeginEnd(caps, true);")
+ void glBegin(@GLenum int mode);
+
+ @DeprecatedGL
+ @Code("\t\tif ( ContextCapabilities.DEBUG ) StateTracker.setBeginEnd(caps, false);")
+ void glEnd();
+
+ @NoErrorCheck
+ void glArrayElement(int i);
+
+ void glClearDepth(@GLclampd double depth);
+
+ @DeprecatedGL
+ void glDeleteLists(@GLuint int list, @GLsizei int range);
+
+ void glDeleteTextures(@AutoSize("textures") @GLsizei int n, @Const @GLuint IntBuffer textures);
+
+ @Alternate("glDeleteTextures")
+ void glDeleteTextures(@Constant("1") @GLsizei int n, @Constant(value = "APIUtils.getBufferInt().put(0, texture), 0", keepParam = true) int texture);
+
+ void glCullFace(@GLenum int mode);
+
+ void glCopyTexSubImage2D(@GLenum int target, int level, int xoffset, int yoffset, int x, int y, @GLsizei int width, @GLsizei int height);
+
+ void glCopyTexSubImage1D(@GLenum int target, int level, int xoffset, int x, int y, @GLsizei int width);
+
+ void glCopyTexImage2D(@GLenum int target, int level, int internalFormat, int x, int y, @GLsizei int width, @GLsizei int height, int border);
+
+ void glCopyTexImage1D(@GLenum int target, int level, int internalFormat, int x, int y, @GLsizei int width, int border);
+
+ void glCopyPixels(int x, int y, int width, int height, int type);
+
+ @DeprecatedGL
+ void glColorPointer(int size, @AutoType("pointer") @GLenum int type, @GLsizei int stride,
+ @CachedReference
+ @Check
+ @BufferObject(BufferKind.ArrayVBO)
+ @Const
+ @GLfloat
+ @GLdouble
+ @GLubyte
+ @GLbyte Buffer pointer);
+
+ @DeprecatedGL
+ void glColorMaterial(@GLenum int face, @GLenum int mode);
+
+ void glColorMask(boolean red, boolean green, boolean blue, boolean alpha);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glColor3b(byte red, byte green, byte blue);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glColor3f(float red, float green, float blue);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glColor3d(double red, double green, double blue);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glColor3ub(@GLubyte byte red, @GLubyte byte green, @GLubyte byte blue);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glColor4b(byte red, byte green, byte blue, byte alpha);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glColor4f(float red, float green, float blue, float alpha);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glColor4d(double red, double green, double blue, double alpha);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glColor4ub(@GLubyte byte red, @GLubyte byte green, @GLubyte byte blue, @GLubyte byte alpha);
+
+ void glClipPlane(@GLenum int plane, @Check("4") @Const DoubleBuffer equation);
+
+ void glClearStencil(int s);
+
+ // This function is only used in indexed color mode
+ // void glClearIndex(float c);
+
+ @DeprecatedGL
+ void glEvalPoint1(int i);
+
+ @DeprecatedGL
+ void glEvalPoint2(int i, int j);
+
+ @DeprecatedGL
+ void glEvalMesh1(@GLenum int mode, int i1, int i2);
+
+ @DeprecatedGL
+ void glEvalMesh2(@GLenum int mode, int i1, int i2, int j1, int j2);
+
+ @DeprecatedGL
+ void glEvalCoord1f(float u);
+
+ @DeprecatedGL
+ void glEvalCoord1d(double u);
+
+ @DeprecatedGL
+ void glEvalCoord2f(float u, float v);
+
+ @DeprecatedGL
+ void glEvalCoord2d(double u, double v);
+
+ @DeprecatedGL
+ void glEnableClientState(@GLenum int cap);
+
+ @DeprecatedGL
+ void glDisableClientState(@GLenum int cap);
+
+ void glEnable(@GLenum int cap);
+
+ void glDisable(@GLenum int cap);
+
+ @DeprecatedGL
+ void glEdgeFlagPointer(int stride,
+ @CachedReference
+ @BufferObject(BufferKind.ArrayVBO)
+ @Check
+ @Const
+ @GLbyte Buffer pointer);
+
+ @DeprecatedGL
+ void glEdgeFlag(boolean flag);
+
+ @DeprecatedGL
+ void glDrawPixels(@GLsizei int width, @GLsizei int height, @GLenum int format, @GLenum int type,
+ @Check("GLChecks.calculateImageStorage(pixels, format, type, width, height, 1)")
+ @BufferObject(BufferKind.UnpackPBO)
+ @Const
+ @GLbyte
+ @GLshort
+ @GLint Buffer pixels);
+
+ void glDrawElements(@GLenum int mode, @AutoSize("indices") @GLsizei int count, @AutoType("indices") @GLenum int type,
+ @BufferObject(BufferKind.ElementVBO)
+ @Const
+ @GLubyte
+ @GLushort
+ @GLuint Buffer indices);
+
+ void glDrawBuffer(@GLenum int mode);
+
+ void glDrawArrays(@GLenum int mode, int first, @GLsizei int count);
+
+ void glDepthRange(@GLclampd double zNear, @GLclampd double zFar);
+
+ void glDepthMask(boolean flag);
+
+ void glDepthFunc(@GLenum int func);
+
+ @DeprecatedGL
+ void glFeedbackBuffer(@AutoSize("buffer") @GLsizei int size, @GLenum int type, FloatBuffer buffer);
+
+ @StripPostfix("values")
+ @DeprecatedGL
+ void glGetPixelMapfv(@GLenum int map, @OutParameter @Check("256") @BufferObject(BufferKind.PackPBO) FloatBuffer values);
+
+ @StripPostfix("values")
+ @DeprecatedGL
+ void glGetPixelMapuiv(@GLenum int map, @OutParameter @Check("256") @BufferObject(BufferKind.PackPBO) @GLuint IntBuffer values);
+
+ @StripPostfix("values")
+ @DeprecatedGL
+ void glGetPixelMapusv(@GLenum int map, @OutParameter @Check("256") @BufferObject(BufferKind.PackPBO) @GLushort ShortBuffer values);
+
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glGetMaterialfv(@GLenum int face, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
+
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glGetMaterialiv(@GLenum int face, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
+
+ @StripPostfix("v")
+ @DeprecatedGL
+ void glGetMapfv(@GLenum int target, @GLenum int query, @OutParameter @Check("256") FloatBuffer v);
+
+ @StripPostfix("v")
+ @DeprecatedGL
+ void glGetMapdv(@GLenum int target, @GLenum int query, @OutParameter @Check("256") DoubleBuffer v);
+
+ @StripPostfix("v")
+ @DeprecatedGL
+ void glGetMapiv(@GLenum int target, @GLenum int query, @OutParameter @Check("256") IntBuffer v);
+
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glGetLightfv(@GLenum int light, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
+
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glGetLightiv(@GLenum int light, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
+
+ @NoErrorCheck
+ int glGetError();
+
+ void glGetClipPlane(@GLenum int plane, @OutParameter @Check("4") DoubleBuffer equation);
+
+ @StripPostfix("params")
+ void glGetBooleanv(@GLenum int pname, @OutParameter @Check("16") @GLboolean ByteBuffer params);
+
+ @Alternate("glGetBooleanv")
+ @GLreturn("params")
+ @StripPostfix("params")
+ void glGetBooleanv2(@GLenum int pname, @OutParameter @GLboolean ByteBuffer params);
+
+ @StripPostfix("params")
+ void glGetDoublev(@GLenum int pname, @OutParameter @Check("16") DoubleBuffer params);
+
+ @Alternate("glGetDoublev")
+ @GLreturn("params")
+ @StripPostfix("params")
+ void glGetDoublev2(@GLenum int pname, @OutParameter DoubleBuffer params);
+
+ @StripPostfix("params")
+ void glGetFloatv(@GLenum int pname, @OutParameter @Check("16") FloatBuffer params);
+
+ @Alternate("glGetFloatv")
+ @GLreturn("params")
+ @StripPostfix("params")
+ void glGetFloatv2(@GLenum int pname, @OutParameter FloatBuffer params);
+
+ @StripPostfix("params")
+ void glGetIntegerv(@GLenum int pname, @OutParameter @Check("16") IntBuffer params);
+
+ @Alternate("glGetIntegerv")
+ @GLreturn("params")
+ @StripPostfix("params")
+ void glGetIntegerv2(@GLenum int pname, @OutParameter IntBuffer params);
+
+ void glGenTextures(@AutoSize("textures") @GLsizei int n, @OutParameter @GLuint IntBuffer textures);
+
+ @Alternate("glGenTextures")
+ @GLreturn("textures")
+ void glGenTextures2(@Constant("1") @GLsizei int n, @OutParameter @GLuint IntBuffer textures);
+
+ @GLuint
+ @DeprecatedGL
+ int glGenLists(@GLsizei int range);
+
+ @DeprecatedGL
+ void glFrustum(double left, double right, double bottom, double top, double zNear, double zFar);
+
+ void glFrontFace(@GLenum int mode);
+
+ @DeprecatedGL
+ void glFogf(@GLenum int pname, float param);
+
+ @DeprecatedGL
+ void glFogi(@GLenum int pname, int param);
+
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glFogfv(@GLenum int pname, @Check("4") @Const FloatBuffer params);
+
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glFogiv(@GLenum int pname, @Check("4") @Const IntBuffer params);
+
+ void glFlush();
+
+ void glFinish();
+
+ @StripPostfix("result")
+ void glGetPointerv(@GLenum int pname, @Result @GLvoid ByteBuffer result);
+
+ boolean glIsEnabled(@GLenum int cap);
+
+ void glInterleavedArrays(@GLenum int format, @GLsizei int stride,
+ @BufferObject(BufferKind.ArrayVBO)
+ @Check
+ @Const
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer pointer);
+
+ @DeprecatedGL
+ void glInitNames();
+
+ void glHint(@GLenum int target, @GLenum int mode);
+
+ @StripPostfix("params")
+ void glGetTexParameterfv(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
+
+ @Alternate("glGetTexParameterfv")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetTexParameterfv2(@GLenum int target, @GLenum int pname, @OutParameter FloatBuffer params);
+
+ @StripPostfix("params")
+ void glGetTexParameteriv(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
+
+ @Alternate("glGetTexParameteriv")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetTexParameteriv2(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params);
+
+ @StripPostfix("params")
+ void glGetTexLevelParameterfv(@GLenum int target, int level, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
+
+ @Alternate("glGetTexLevelParameterfv")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetTexLevelParameterfv2(@GLenum int target, int level, @GLenum int pname, @OutParameter FloatBuffer params);
+
+ @StripPostfix("params")
+ void glGetTexLevelParameteriv(@GLenum int target, int level, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
+
+ @Alternate("glGetTexLevelParameteriv")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetTexLevelParameteriv2(@GLenum int target, int level, @GLenum int pname, @OutParameter IntBuffer params);
+
+ void glGetTexImage(@GLenum int target, int level, @GLenum int format, @GLenum int type,
+ @OutParameter
+ @BufferObject(BufferKind.PackPBO)
+ @Check("GLChecks.calculateImageStorage(pixels, format, type, 1, 1, 1)")
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer pixels);
+
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glGetTexGeniv(@GLenum int coord, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
+
+ @Alternate("glGetTexGeniv")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ @DeprecatedGL
+ void glGetTexGeniv2(@GLenum int coord, @GLenum int pname, @OutParameter IntBuffer params);
+
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glGetTexGenfv(@GLenum int coord, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
+
+ @Alternate("glGetTexGenfv")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ @DeprecatedGL
+ void glGetTexGenfv2(@GLenum int coord, @GLenum int pname, @OutParameter FloatBuffer params);
+
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glGetTexGendv(@GLenum int coord, @GLenum int pname, @OutParameter @Check("4") DoubleBuffer params);
+
+ @Alternate("glGetTexGendv")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ @DeprecatedGL
+ void glGetTexGendv2(@GLenum int coord, @GLenum int pname, @OutParameter DoubleBuffer params);
+
+ @StripPostfix("params")
+ void glGetTexEnviv(@GLenum int coord, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
+
+ @Alternate("glGetTexEnviv")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetTexEnviv2(@GLenum int coord, @GLenum int pname, @OutParameter IntBuffer params);
+
+ @StripPostfix("params")
+ void glGetTexEnvfv(@GLenum int coord, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
+
+ @Alternate("glGetTexEnvfv")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetTexEnvfv2(@GLenum int coord, @GLenum int pname, @OutParameter FloatBuffer params);
+
+ @Const
+ String glGetString(int name);
+
+ @DeprecatedGL
+ void glGetPolygonStipple(@OutParameter @BufferObject(BufferKind.PackPBO) @Check("1024") @GLubyte ByteBuffer mask);
+
+ @DeprecatedGL
+ boolean glIsList(@GLuint int list);
+
+ @DeprecatedGL
+ void glMaterialf(@GLenum int face, @GLenum int pname, float param);
+
+ @DeprecatedGL
+ void glMateriali(@GLenum int face, @GLenum int pname, int param);
+
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glMaterialfv(@GLenum int face, @GLenum int pname, @Check("4") @Const FloatBuffer params);
+
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glMaterialiv(@GLenum int face, @GLenum int pname, @Check("4") @Const IntBuffer params);
+
+ @DeprecatedGL
+ void glMapGrid1f(int un, float u1, float u2);
+
+ @DeprecatedGL
+ void glMapGrid1d(int un, double u1, double u2);
+
+ @DeprecatedGL
+ void glMapGrid2f(int un, float u1, float u2, int vn, float v1, float v2);
+
+ @DeprecatedGL
+ void glMapGrid2d(int un, double u1, double u2, int vn, double v1, double v2);
+
+ // TODO: check buffer size valid
+
+ @DeprecatedGL
+ void glMap2f(@GLenum int target, float u1, float u2, int ustride, int uorder, float v1, float v2, int vstride, int vorder, @Check @Const FloatBuffer points);
+
+ @DeprecatedGL
+ void glMap2d(@GLenum int target, double u1, double u2, int ustride, int uorder, double v1, double v2, int vstride, int vorder, @Check @Const DoubleBuffer points);
+
+ // TODO: check buffer size valid
+
+ @DeprecatedGL
+ void glMap1f(@GLenum int target, float u1, float u2, int stride, int order, @Check @Const FloatBuffer points);
+
+ @DeprecatedGL
+ void glMap1d(@GLenum int target, double u1, double u2, int stride, int order, @Check @Const DoubleBuffer points);
+
+ void glLogicOp(@GLenum int opcode);
+
+ @DeprecatedGL
+ void glLoadName(@GLuint int name);
+
+ @StripPostfix("m")
+ @DeprecatedGL
+ void glLoadMatrixf(@Check("16") @Const FloatBuffer m);
+
+ @StripPostfix("m")
+ @DeprecatedGL
+ void glLoadMatrixd(@Check("16") @Const DoubleBuffer m);
+
+ @DeprecatedGL
+ void glLoadIdentity();
+
+ @DeprecatedGL
+ void glListBase(@GLuint int base);
+
+ void glLineWidth(float width);
+
+ @DeprecatedGL
+ void glLineStipple(int factor, @GLushort short pattern);
+
+ @DeprecatedGL
+ void glLightModelf(@GLenum int pname, float param);
+
+ @DeprecatedGL
+ void glLightModeli(@GLenum int pname, int param);
+
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glLightModelfv(@GLenum int pname, @Check("4") @Const FloatBuffer params);
+
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glLightModeliv(@GLenum int pname, @Check("4") @Const IntBuffer params);
+
+ @DeprecatedGL
+ void glLightf(@GLenum int light, @GLenum int pname, float param);
+
+ @DeprecatedGL
+ void glLighti(@GLenum int light, @GLenum int pname, int param);
+
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glLightfv(@GLenum int light, @GLenum int pname, @Check("4") @Const FloatBuffer params);
+
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glLightiv(@GLenum int light, @GLenum int pname, @Check("4") @Const IntBuffer params);
+
+ boolean glIsTexture(@GLuint int texture);
+
+ @DeprecatedGL
+ void glMatrixMode(@GLenum int mode);
+
+ @DeprecatedGL
+ void glPolygonStipple(@BufferObject(BufferKind.UnpackPBO) @Check("1024") @Const @GLubyte ByteBuffer mask);
+
+ void glPolygonOffset(float factor, float units);
+
+ void glPolygonMode(@GLenum int face, @GLenum int mode);
+
+ void glPointSize(float size);
+
+ @DeprecatedGL
+ void glPixelZoom(float xfactor, float yfactor);
+
+ @DeprecatedGL
+ void glPixelTransferf(@GLenum int pname, float param);
+
+ @DeprecatedGL
+ void glPixelTransferi(@GLenum int pname, int param);
+
+ void glPixelStoref(@GLenum int pname, float param);
+
+ void glPixelStorei(@GLenum int pname, int param);
+
+ @StripPostfix("values")
+ @DeprecatedGL
+ void glPixelMapfv(@GLenum int map, @AutoSize("values") @GLsizei int mapsize, @BufferObject(BufferKind.UnpackPBO) @Const FloatBuffer values);
+
+ @StripPostfix("values")
+ @DeprecatedGL
+ void glPixelMapuiv(@GLenum int map, @AutoSize("values") @GLsizei int mapsize, @BufferObject(BufferKind.UnpackPBO) @Const @GLuint IntBuffer values);
+
+ @StripPostfix("values")
+ @DeprecatedGL
+ void glPixelMapusv(@GLenum int map, @AutoSize("values") @GLsizei int mapsize, @BufferObject(BufferKind.UnpackPBO) @Const @GLushort ShortBuffer values);
+
+ @DeprecatedGL
+ void glPassThrough(float token);
+
+ @DeprecatedGL
+ void glOrtho(double left, double right, double bottom, double top, double zNear, double zFar);
+
+ @DeprecatedGL
+ void glNormalPointer(@AutoType("pointer") @GLenum int type, @GLsizei int stride,
+ @CachedReference
+ @BufferObject(BufferKind.ArrayVBO)
+ @Check
+ @Const
+ @GLint
+ @GLbyte
+ @GLfloat
+ @GLdouble Buffer pointer);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glNormal3b(byte nx, byte ny, byte nz);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glNormal3f(float nx, float ny, float nz);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glNormal3d(double nx, double ny, double nz);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glNormal3i(int nx, int ny, int nz);
+
+ @DeprecatedGL
+ void glNewList(@GLuint int list, @GLenum int mode);
+
+ @DeprecatedGL
+ void glEndList();
+
+ @StripPostfix("m")
+ @DeprecatedGL
+ void glMultMatrixf(@Check("16") @Const FloatBuffer m);
+
+ @StripPostfix("m")
+ @DeprecatedGL
+ void glMultMatrixd(@Check("16") @Const DoubleBuffer m);
+
+ void glShadeModel(@GLenum int mode);
+
+ @DeprecatedGL
+ void glSelectBuffer(@AutoSize("buffer") @GLsizei int size, @GLuint IntBuffer buffer);
+
+ void glScissor(int x, int y, @GLsizei int width, @GLsizei int height);
+
+ @DeprecatedGL
+ void glScalef(float x, float y, float z);
+
+ @DeprecatedGL
+ void glScaled(double x, double y, double z);
+
+ @DeprecatedGL
+ void glRotatef(float angle, float x, float y, float z);
+
+ @DeprecatedGL
+ int glRenderMode(@GLenum int mode);
+
+ @DeprecatedGL
+ void glRectf(float x1, float y1, float x2, float y2);
+
+ @DeprecatedGL
+ void glRectd(double x1, double y1, double x2, double y2);
+
+ @DeprecatedGL
+ void glRecti(int x1, int y1, int x2, int y2);
+
+ void glReadPixels(int x, int y, @GLsizei int width, @GLsizei int height, @GLenum int format, @GLenum int type,
+ @OutParameter
+ @BufferObject(BufferKind.PackPBO)
+ @Check("GLChecks.calculateImageStorage(pixels, format, type, width, height, 1)")
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer pixels);
+
+ void glReadBuffer(@GLenum int mode);
+
+ @DeprecatedGL
+ void glRasterPos2f(float x, float y);
+
+ @DeprecatedGL
+ void glRasterPos2d(double x, double y);
+
+ @DeprecatedGL
+ void glRasterPos2i(int x, int y);
+
+ @DeprecatedGL
+ void glRasterPos3f(float x, float y, float z);
+
+ @DeprecatedGL
+ void glRasterPos3d(double x, double y, double z);
+
+ @DeprecatedGL
+ void glRasterPos3i(int x, int y, int z);
+
+ @DeprecatedGL
+ void glRasterPos4f(float x, float y, float z, float w);
+
+ @DeprecatedGL
+ void glRasterPos4d(double x, double y, double z, double w);
+
+ @DeprecatedGL
+ void glRasterPos4i(int x, int y, int z, int w);
+
+ @DeprecatedGL
+ void glPushName(@GLuint int name);
+
+ @DeprecatedGL
+ void glPopName();
+
+ @DeprecatedGL
+ void glPushMatrix();
+
+ @DeprecatedGL
+ void glPopMatrix();
+
+ @Code(" StateTracker.pushAttrib(caps, mask);")
+ @DeprecatedGL
+ void glPushClientAttrib(@GLbitfield int mask);
+
+ @Code(" StateTracker.popAttrib(caps);")
+ @DeprecatedGL
+ void glPopClientAttrib();
+
+ @DeprecatedGL
+ void glPushAttrib(@GLbitfield int mask);
+
+ @DeprecatedGL
+ void glPopAttrib();
+
+ void glStencilFunc(@GLenum int func, int ref, @GLuint int mask);
+
+ @DeprecatedGL
+ void glVertexPointer(int size, @AutoType("pointer") @GLenum int type, @GLsizei int stride,
+ @CachedReference
+ @BufferObject(BufferKind.ArrayVBO)
+ @Check
+ @Const
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer pointer);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glVertex2f(float x, float y);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glVertex2d(double x, double y);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glVertex2i(int x, int y);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glVertex3f(float x, float y, float z);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glVertex3d(double x, double y, double z);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glVertex3i(int x, int y, int z);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glVertex4f(float x, float y, float z, float w);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glVertex4d(double x, double y, double z, double w);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glVertex4i(int x, int y, int z, int w);
+
+ @DeprecatedGL
+ void glTranslatef(float x, float y, float z);
+
+ @DeprecatedGL
+ void glTranslated(double x, double y, double z);
+
+ void glTexImage1D(@GLenum int target, int level, int internalformat, @GLsizei int width, int border, @GLenum int format, @GLenum int type,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check(value = "GLChecks.calculateTexImage1DStorage(pixels, format, type, width)", canBeNull = true)
+ @Const
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer pixels);
+
+ void glTexImage2D(@GLenum int target, int level, int internalformat, int width, int height, int border, @GLenum int format, @GLenum int type,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check(value = "GLChecks.calculateTexImage2DStorage(pixels, format, type, width, height)", canBeNull = true)
+ @Const
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer pixels);
+
+ void glTexSubImage1D(@GLenum int target, int level, int xoffset, @GLsizei int width, @GLenum int format, @GLenum int type,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check("GLChecks.calculateImageStorage(pixels, format, type, width, 1, 1)")
+ @Const
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer pixels);
+
+ void glTexSubImage2D(@GLenum int target, int level, int xoffset, int yoffset, @GLsizei int width, @GLsizei int height, @GLenum int format, @GLenum int type,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check("GLChecks.calculateImageStorage(pixels, format, type, width, height, 1)")
+ @Const
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer pixels);
+
+ void glTexParameterf(@GLenum int target, @GLenum int pname, float param);
+
+ void glTexParameteri(@GLenum int target, @GLenum int pname, int param);
+
+ @StripPostfix("param")
+ void glTexParameterfv(@GLenum int target, @GLenum int pname, @Check("4") @Const FloatBuffer param);
+
+ @StripPostfix("param")
+ void glTexParameteriv(@GLenum int target, @GLenum int pname, @Check("4") @Const IntBuffer param);
+
+ @DeprecatedGL
+ void glTexGenf(@GLenum int coord, @GLenum int pname, float param);
+
+ @DeprecatedGL
+ void glTexGend(@GLenum int coord, @GLenum int pname, double param);
+
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glTexGenfv(@GLenum int coord, @GLenum int pname, @Check("4") @Const FloatBuffer params);
+
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glTexGendv(@GLenum int coord, @GLenum int pname, @Check("4") @Const DoubleBuffer params);
+
+ @DeprecatedGL
+ void glTexGeni(@GLenum int coord, @GLenum int pname, int param);
+
+ @StripPostfix("params")
+ @DeprecatedGL
+ void glTexGeniv(@GLenum int coord, @GLenum int pname, @Check("4") @Const IntBuffer params);
+
+ void glTexEnvf(@GLenum int target, @GLenum int pname, float param);
+
+ void glTexEnvi(@GLenum int target, @GLenum int pname, int param);
+
+ @StripPostfix("params")
+ void glTexEnvfv(@GLenum int target, @GLenum int pname, @Check("4") @Const FloatBuffer params);
+
+ @StripPostfix("params")
+ void glTexEnviv(@GLenum int target, @GLenum int pname, @Check("4") @Const IntBuffer params);
+
+ @DeprecatedGL
+ void glTexCoordPointer(int size, @AutoType("pointer") @GLenum int type, @GLsizei int stride,
+ @CachedReference(index = "GLChecks.getReferences(caps).glClientActiveTexture", name = "glTexCoordPointer_buffer")
+ @BufferObject(BufferKind.ArrayVBO)
+ @Check
+ @Const
+ @GLint
+ @GLshort
+ @GLfloat
+ @GLdouble Buffer pointer);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glTexCoord1f(float s);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glTexCoord1d(double s);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glTexCoord2f(float s, float t);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glTexCoord2d(double s, double t);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glTexCoord3f(float s, float t, float r);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glTexCoord3d(double s, double t, double r);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glTexCoord4f(float s, float t, float r, float q);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glTexCoord4d(double s, double t, double r, double q);
+
+ void glStencilOp(@GLenum int fail, @GLenum int zfail, @GLenum int zpass);
+
+ void glStencilMask(@GLuint int mask);
+
+ void glViewport(int x, int y, @GLsizei int width, @GLsizei int height);
+}
diff --git a/src/templates/org/lwjgl/opengl/GL12.java b/src/templates/org/lwjgl/opengl/GL12.java
index 55ac853..7da3a78 100644
--- a/src/templates/org/lwjgl/opengl/GL12.java
+++ b/src/templates/org/lwjgl/opengl/GL12.java
@@ -1,122 +1,122 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.Buffer;
-
-/**
- * <p/>
- * The core OpenGL1.2.1 API, with the imaging subset.
- *
- * @author cix_foo <cix_foo at users.sourceforge.net>
- * @version $Revision: 2984 $
- * $Id: GL12.java 2984 2008-04-07 18:39:53Z matzon $
- */
-
-public interface GL12 {
-
- int GL_TEXTURE_BINDING_3D = 0x806A;
- int GL_PACK_SKIP_IMAGES = 0x806B;
- int GL_PACK_IMAGE_HEIGHT = 0x806C;
- int GL_UNPACK_SKIP_IMAGES = 0x806D;
- int GL_UNPACK_IMAGE_HEIGHT = 0x806E;
- int GL_TEXTURE_3D = 0x806F;
- int GL_PROXY_TEXTURE_3D = 0x8070;
- int GL_TEXTURE_DEPTH = 0x8071;
- int GL_TEXTURE_WRAP_R = 0x8072;
- int GL_MAX_3D_TEXTURE_SIZE = 0x8073;
- int GL_BGR = 0x80E0;
- int GL_BGRA = 0x80E1;
- int GL_UNSIGNED_BYTE_3_3_2 = 0x8032;
- int GL_UNSIGNED_BYTE_2_3_3_REV = 0x8362;
- int GL_UNSIGNED_SHORT_5_6_5 = 0x8363;
- int GL_UNSIGNED_SHORT_5_6_5_REV = 0x8364;
- int GL_UNSIGNED_SHORT_4_4_4_4 = 0x8033;
- int GL_UNSIGNED_SHORT_4_4_4_4_REV = 0x8365;
- int GL_UNSIGNED_SHORT_5_5_5_1 = 0x8034;
- int GL_UNSIGNED_SHORT_1_5_5_5_REV = 0x8366;
- int GL_UNSIGNED_INT_8_8_8_8 = 0x8035;
- int GL_UNSIGNED_INT_8_8_8_8_REV = 0x8367;
- int GL_UNSIGNED_INT_10_10_10_2 = 0x8036;
- int GL_UNSIGNED_INT_2_10_10_10_REV = 0x8368;
- int GL_RESCALE_NORMAL = 0x803A;
- int GL_LIGHT_MODEL_COLOR_CONTROL = 0x81F8;
- int GL_SINGLE_COLOR = 0x81F9;
- int GL_SEPARATE_SPECULAR_COLOR = 0x81FA;
- int GL_CLAMP_TO_EDGE = 0x812F;
- int GL_TEXTURE_MIN_LOD = 0x813A;
- int GL_TEXTURE_MAX_LOD = 0x813B;
- int GL_TEXTURE_BASE_LEVEL = 0x813C;
- int GL_TEXTURE_MAX_LEVEL = 0x813D;
- int GL_MAX_ELEMENTS_VERTICES = 0x80E8;
- int GL_MAX_ELEMENTS_INDICES = 0x80E9;
- int GL_ALIASED_POINT_SIZE_RANGE = 0x846D;
- int GL_ALIASED_LINE_WIDTH_RANGE = 0x846E;
-
- int GL_SMOOTH_POINT_SIZE_RANGE = 0x0B12;
- int GL_SMOOTH_POINT_SIZE_GRANULARITY = 0x0B13;
- int GL_SMOOTH_LINE_WIDTH_RANGE = 0x0B22;
- int GL_SMOOTH_LINE_WIDTH_GRANULARITY = 0x0B23;
-
- void glDrawRangeElements(@GLenum int mode, @GLuint int start, @GLuint int end, @AutoSize("indices") @GLsizei int count,
- @AutoType("indices")
- @GLenum int type,
- @BufferObject(BufferKind.ElementVBO)
- @Const
- @GLubyte
- @GLushort
- @GLuint Buffer indices);
-
- void glTexImage3D(@GLenum int target, int level, int internalFormat, @GLsizei int width, @GLsizei int height, @GLsizei int depth, int border, @GLenum int format, @GLenum int type,
- @BufferObject(BufferKind.UnpackPBO)
- @Check(value = "GLChecks.calculateTexImage3DStorage(pixels, format, type, width, height, depth)", canBeNull = true)
- @Const
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer pixels);
-
- void glTexSubImage3D(@GLenum int target, int level, int xoffset, int yoffset, int zoffset, @GLsizei int width, @GLsizei int height, @GLsizei int depth, @GLenum int format, @GLenum int type,
- @BufferObject(BufferKind.UnpackPBO)
- @Check("GLChecks.calculateImageStorage(pixels, format, type, width, height, depth)")
- @Const
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer pixels);
-
- void glCopyTexSubImage3D(@GLenum int target, int level, int xoffset, int yoffset, int zoffset, int x, int y, @GLsizei int width, @GLsizei int height);
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.Buffer;
+
+/**
+ * <p/>
+ * The core OpenGL1.2.1 API, with the imaging subset.
+ *
+ * @author cix_foo <cix_foo at users.sourceforge.net>
+ * @version $Revision: 2984 $
+ * $Id: GL12.java 2984 2008-04-07 18:39:53Z matzon $
+ */
+
+public interface GL12 {
+
+ int GL_TEXTURE_BINDING_3D = 0x806A;
+ int GL_PACK_SKIP_IMAGES = 0x806B;
+ int GL_PACK_IMAGE_HEIGHT = 0x806C;
+ int GL_UNPACK_SKIP_IMAGES = 0x806D;
+ int GL_UNPACK_IMAGE_HEIGHT = 0x806E;
+ int GL_TEXTURE_3D = 0x806F;
+ int GL_PROXY_TEXTURE_3D = 0x8070;
+ int GL_TEXTURE_DEPTH = 0x8071;
+ int GL_TEXTURE_WRAP_R = 0x8072;
+ int GL_MAX_3D_TEXTURE_SIZE = 0x8073;
+ int GL_BGR = 0x80E0;
+ int GL_BGRA = 0x80E1;
+ int GL_UNSIGNED_BYTE_3_3_2 = 0x8032;
+ int GL_UNSIGNED_BYTE_2_3_3_REV = 0x8362;
+ int GL_UNSIGNED_SHORT_5_6_5 = 0x8363;
+ int GL_UNSIGNED_SHORT_5_6_5_REV = 0x8364;
+ int GL_UNSIGNED_SHORT_4_4_4_4 = 0x8033;
+ int GL_UNSIGNED_SHORT_4_4_4_4_REV = 0x8365;
+ int GL_UNSIGNED_SHORT_5_5_5_1 = 0x8034;
+ int GL_UNSIGNED_SHORT_1_5_5_5_REV = 0x8366;
+ int GL_UNSIGNED_INT_8_8_8_8 = 0x8035;
+ int GL_UNSIGNED_INT_8_8_8_8_REV = 0x8367;
+ int GL_UNSIGNED_INT_10_10_10_2 = 0x8036;
+ int GL_UNSIGNED_INT_2_10_10_10_REV = 0x8368;
+ int GL_RESCALE_NORMAL = 0x803A;
+ int GL_LIGHT_MODEL_COLOR_CONTROL = 0x81F8;
+ int GL_SINGLE_COLOR = 0x81F9;
+ int GL_SEPARATE_SPECULAR_COLOR = 0x81FA;
+ int GL_CLAMP_TO_EDGE = 0x812F;
+ int GL_TEXTURE_MIN_LOD = 0x813A;
+ int GL_TEXTURE_MAX_LOD = 0x813B;
+ int GL_TEXTURE_BASE_LEVEL = 0x813C;
+ int GL_TEXTURE_MAX_LEVEL = 0x813D;
+ int GL_MAX_ELEMENTS_VERTICES = 0x80E8;
+ int GL_MAX_ELEMENTS_INDICES = 0x80E9;
+ int GL_ALIASED_POINT_SIZE_RANGE = 0x846D;
+ int GL_ALIASED_LINE_WIDTH_RANGE = 0x846E;
+
+ int GL_SMOOTH_POINT_SIZE_RANGE = 0x0B12;
+ int GL_SMOOTH_POINT_SIZE_GRANULARITY = 0x0B13;
+ int GL_SMOOTH_LINE_WIDTH_RANGE = 0x0B22;
+ int GL_SMOOTH_LINE_WIDTH_GRANULARITY = 0x0B23;
+
+ void glDrawRangeElements(@GLenum int mode, @GLuint int start, @GLuint int end, @AutoSize("indices") @GLsizei int count,
+ @AutoType("indices")
+ @GLenum int type,
+ @BufferObject(BufferKind.ElementVBO)
+ @Const
+ @GLubyte
+ @GLushort
+ @GLuint Buffer indices);
+
+ void glTexImage3D(@GLenum int target, int level, int internalFormat, @GLsizei int width, @GLsizei int height, @GLsizei int depth, int border, @GLenum int format, @GLenum int type,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check(value = "GLChecks.calculateTexImage3DStorage(pixels, format, type, width, height, depth)", canBeNull = true)
+ @Const
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer pixels);
+
+ void glTexSubImage3D(@GLenum int target, int level, int xoffset, int yoffset, int zoffset, @GLsizei int width, @GLsizei int height, @GLsizei int depth, @GLenum int format, @GLenum int type,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check("GLChecks.calculateImageStorage(pixels, format, type, width, height, depth)")
+ @Const
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer pixels);
+
+ void glCopyTexSubImage3D(@GLenum int target, int level, int xoffset, int yoffset, int zoffset, int x, int y, @GLsizei int width, @GLsizei int height);
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/GL13.java b/src/templates/org/lwjgl/opengl/GL13.java
index a170f1b..2049c23 100644
--- a/src/templates/org/lwjgl/opengl/GL13.java
+++ b/src/templates/org/lwjgl/opengl/GL13.java
@@ -1,257 +1,257 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-/**
- * <p/>
- * The core OpenGL1.3 API.
- *
- * @author cix_foo <cix_foo at users.sourceforge.net>
- * @version $Revision: 3116 $
- * $Id: GL13.java 3116 2008-08-19 16:46:03Z spasi $
- */
- at DeprecatedGL
-public interface GL13 {
- int GL_TEXTURE0 = 0x84C0;
- int GL_TEXTURE1 = 0x84C1;
- int GL_TEXTURE2 = 0x84C2;
- int GL_TEXTURE3 = 0x84C3;
- int GL_TEXTURE4 = 0x84C4;
- int GL_TEXTURE5 = 0x84C5;
- int GL_TEXTURE6 = 0x84C6;
- int GL_TEXTURE7 = 0x84C7;
- int GL_TEXTURE8 = 0x84C8;
- int GL_TEXTURE9 = 0x84C9;
- int GL_TEXTURE10 = 0x84CA;
- int GL_TEXTURE11 = 0x84CB;
- int GL_TEXTURE12 = 0x84CC;
- int GL_TEXTURE13 = 0x84CD;
- int GL_TEXTURE14 = 0x84CE;
- int GL_TEXTURE15 = 0x84CF;
- int GL_TEXTURE16 = 0x84D0;
- int GL_TEXTURE17 = 0x84D1;
- int GL_TEXTURE18 = 0x84D2;
- int GL_TEXTURE19 = 0x84D3;
- int GL_TEXTURE20 = 0x84D4;
- int GL_TEXTURE21 = 0x84D5;
- int GL_TEXTURE22 = 0x84D6;
- int GL_TEXTURE23 = 0x84D7;
- int GL_TEXTURE24 = 0x84D8;
- int GL_TEXTURE25 = 0x84D9;
- int GL_TEXTURE26 = 0x84DA;
- int GL_TEXTURE27 = 0x84DB;
- int GL_TEXTURE28 = 0x84DC;
- int GL_TEXTURE29 = 0x84DD;
- int GL_TEXTURE30 = 0x84DE;
- int GL_TEXTURE31 = 0x84DF;
- int GL_ACTIVE_TEXTURE = 0x84E0;
- int GL_CLIENT_ACTIVE_TEXTURE = 0x84E1;
- int GL_MAX_TEXTURE_UNITS = 0x84E2;
-
- int GL_NORMAL_MAP = 0x8511;
- int GL_REFLECTION_MAP = 0x8512;
- int GL_TEXTURE_CUBE_MAP = 0x8513;
- int GL_TEXTURE_BINDING_CUBE_MAP = 0x8514;
- int GL_TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515;
- int GL_TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516;
- int GL_TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517;
- int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518;
- int GL_TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519;
- int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A;
- int GL_PROXY_TEXTURE_CUBE_MAP = 0x851B;
- int GL_MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C;
-
- int GL_COMPRESSED_ALPHA = 0x84E9;
- int GL_COMPRESSED_LUMINANCE = 0x84EA;
- int GL_COMPRESSED_LUMINANCE_ALPHA = 0x84EB;
- int GL_COMPRESSED_INTENSITY = 0x84EC;
- int GL_COMPRESSED_RGB = 0x84ED;
- int GL_COMPRESSED_RGBA = 0x84EE;
- int GL_TEXTURE_COMPRESSION_HINT = 0x84EF;
- int GL_TEXTURE_COMPRESSED_IMAGE_SIZE = 0x86A0;
- int GL_TEXTURE_COMPRESSED = 0x86A1;
- int GL_NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2;
- int GL_COMPRESSED_TEXTURE_FORMATS = 0x86A3;
-
- int GL_MULTISAMPLE = 0x809D;
- int GL_SAMPLE_ALPHA_TO_COVERAGE = 0x809E;
- int GL_SAMPLE_ALPHA_TO_ONE = 0x809F;
- int GL_SAMPLE_COVERAGE = 0x80A0;
- int GL_SAMPLE_BUFFERS = 0x80A8;
- int GL_SAMPLES = 0x80A9;
- int GL_SAMPLE_COVERAGE_VALUE = 0x80AA;
- int GL_SAMPLE_COVERAGE_INVERT = 0x80AB;
- int GL_MULTISAMPLE_BIT = 0x20000000;
-
- int GL_TRANSPOSE_MODELVIEW_MATRIX = 0x84E3;
- int GL_TRANSPOSE_PROJECTION_MATRIX = 0x84E4;
- int GL_TRANSPOSE_TEXTURE_MATRIX = 0x84E5;
- int GL_TRANSPOSE_COLOR_MATRIX = 0x84E6;
-
- int GL_COMBINE = 0x8570;
- int GL_COMBINE_RGB = 0x8571;
- int GL_COMBINE_ALPHA = 0x8572;
- int GL_SOURCE0_RGB = 0x8580;
- int GL_SOURCE1_RGB = 0x8581;
- int GL_SOURCE2_RGB = 0x8582;
- int GL_SOURCE0_ALPHA = 0x8588;
- int GL_SOURCE1_ALPHA = 0x8589;
- int GL_SOURCE2_ALPHA = 0x858A;
- int GL_OPERAND0_RGB = 0x8590;
- int GL_OPERAND1_RGB = 0x8591;
- int GL_OPERAND2_RGB = 0x8592;
- int GL_OPERAND0_ALPHA = 0x8598;
- int GL_OPERAND1_ALPHA = 0x8599;
- int GL_OPERAND2_ALPHA = 0x859A;
- int GL_RGB_SCALE = 0x8573;
- int GL_ADD_SIGNED = 0x8574;
- int GL_INTERPOLATE = 0x8575;
- int GL_SUBTRACT = 0x84E7;
- int GL_CONSTANT = 0x8576;
- int GL_PRIMARY_COLOR = 0x8577;
- int GL_PREVIOUS = 0x8578;
- int GL_DOT3_RGB = 0x86AE;
- int GL_DOT3_RGBA = 0x86AF;
- int GL_CLAMP_TO_BORDER = 0x812D;
-
- void glActiveTexture(@GLenum int texture);
-
- @Code("\t\tGLChecks.getReferences(caps).glClientActiveTexture = texture - GL_TEXTURE0;")
- @DeprecatedGL
- void glClientActiveTexture(@GLenum int texture);
-
- void glCompressedTexImage1D(@GLenum int target, int level, @GLenum int internalformat, @GLsizei int width, int border, @AutoSize("data") @GLsizei int imageSize,
- @BufferObject(BufferKind.UnpackPBO)
- @Check
- @Const
- @GLvoid
- Buffer data);
-
- void glCompressedTexImage2D(@GLenum int target, int level, @GLenum int internalformat, @GLsizei int width, @GLsizei int height, int border, @AutoSize("data") @GLsizei int imageSize,
- @BufferObject(BufferKind.UnpackPBO)
- @Check
- @Const
- @GLvoid
- ByteBuffer data);
-
- void glCompressedTexImage3D(@GLenum int target, int level, @GLenum int internalformat, @GLsizei int width, @GLsizei int height, @GLsizei int depth, int border, @AutoSize("data") @GLsizei int imageSize,
- @BufferObject(BufferKind.UnpackPBO)
- @Check
- @Const
- @GLvoid
- ByteBuffer data);
-
- void glCompressedTexSubImage1D(@GLenum int target, int level, int xoffset, @GLsizei int width, @GLenum int format, @AutoSize("data") @GLsizei int imageSize,
- @BufferObject(BufferKind.UnpackPBO)
- @Check
- @Const
- @GLvoid
- ByteBuffer data);
-
- void glCompressedTexSubImage2D(@GLenum int target, int level, int xoffset, int yoffset, @GLsizei int width, @GLsizei int height, @GLenum int format, @AutoSize("data") @GLsizei int imageSize,
- @BufferObject(BufferKind.UnpackPBO)
- @Check
- @Const
- @GLvoid
- ByteBuffer data);
-
- void glCompressedTexSubImage3D(@GLenum int target, int level, int xoffset, int yoffset, int zoffset, @GLsizei int width, @GLsizei int height, @GLsizei int depth, @GLenum int format, @AutoSize("data") @GLsizei int imageSize,
- @BufferObject(BufferKind.UnpackPBO)
- @Check
- @Const
- @GLvoid
- ByteBuffer data);
-
- // TODO: check buffer size valid
- void glGetCompressedTexImage(@GLenum int target, int lod,
- @OutParameter
- @BufferObject(BufferKind.PackPBO)
- @Check
- @GLbyte
- @GLshort
- @GLint Buffer img);
-
- @NoErrorCheck
- @DeprecatedGL
- void glMultiTexCoord1f(@GLenum int target, float s);
-
- @NoErrorCheck
- @DeprecatedGL
- void glMultiTexCoord1d(@GLenum int target, double s);
-
- @NoErrorCheck
- @DeprecatedGL
- void glMultiTexCoord2f(@GLenum int target, float s, float t);
-
- @NoErrorCheck
- @DeprecatedGL
- void glMultiTexCoord2d(@GLenum int target, double s, double t);
-
- @NoErrorCheck
- @DeprecatedGL
- void glMultiTexCoord3f(@GLenum int target, float s, float t, float r);
-
- @NoErrorCheck
- @DeprecatedGL
- void glMultiTexCoord3d(@GLenum int target, double s, double t, double r);
-
- @NoErrorCheck
- @DeprecatedGL
- void glMultiTexCoord4f(@GLenum int target, float s, float t, float r, float q);
-
- @NoErrorCheck
- @DeprecatedGL
- void glMultiTexCoord4d(@GLenum int target, double s, double t, double r, double q);
-
- @StripPostfix("m")
- @DeprecatedGL
- void glLoadTransposeMatrixf(@Check("16") @Const FloatBuffer m);
-
- @StripPostfix("m")
- @DeprecatedGL
- void glLoadTransposeMatrixd(@Check("16") @Const DoubleBuffer m);
-
- @StripPostfix("m")
- @DeprecatedGL
- void glMultTransposeMatrixf(@Check("16") @Const FloatBuffer m);
-
- @StripPostfix("m")
- @DeprecatedGL
- void glMultTransposeMatrixd(@Check("16") @Const DoubleBuffer m);
-
- void glSampleCoverage(@GLclampf float value, boolean invert);
-}
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+/**
+ * <p/>
+ * The core OpenGL1.3 API.
+ *
+ * @author cix_foo <cix_foo at users.sourceforge.net>
+ * @version $Revision: 3116 $
+ * $Id: GL13.java 3116 2008-08-19 16:46:03Z spasi $
+ */
+ at DeprecatedGL
+public interface GL13 {
+ int GL_TEXTURE0 = 0x84C0;
+ int GL_TEXTURE1 = 0x84C1;
+ int GL_TEXTURE2 = 0x84C2;
+ int GL_TEXTURE3 = 0x84C3;
+ int GL_TEXTURE4 = 0x84C4;
+ int GL_TEXTURE5 = 0x84C5;
+ int GL_TEXTURE6 = 0x84C6;
+ int GL_TEXTURE7 = 0x84C7;
+ int GL_TEXTURE8 = 0x84C8;
+ int GL_TEXTURE9 = 0x84C9;
+ int GL_TEXTURE10 = 0x84CA;
+ int GL_TEXTURE11 = 0x84CB;
+ int GL_TEXTURE12 = 0x84CC;
+ int GL_TEXTURE13 = 0x84CD;
+ int GL_TEXTURE14 = 0x84CE;
+ int GL_TEXTURE15 = 0x84CF;
+ int GL_TEXTURE16 = 0x84D0;
+ int GL_TEXTURE17 = 0x84D1;
+ int GL_TEXTURE18 = 0x84D2;
+ int GL_TEXTURE19 = 0x84D3;
+ int GL_TEXTURE20 = 0x84D4;
+ int GL_TEXTURE21 = 0x84D5;
+ int GL_TEXTURE22 = 0x84D6;
+ int GL_TEXTURE23 = 0x84D7;
+ int GL_TEXTURE24 = 0x84D8;
+ int GL_TEXTURE25 = 0x84D9;
+ int GL_TEXTURE26 = 0x84DA;
+ int GL_TEXTURE27 = 0x84DB;
+ int GL_TEXTURE28 = 0x84DC;
+ int GL_TEXTURE29 = 0x84DD;
+ int GL_TEXTURE30 = 0x84DE;
+ int GL_TEXTURE31 = 0x84DF;
+ int GL_ACTIVE_TEXTURE = 0x84E0;
+ int GL_CLIENT_ACTIVE_TEXTURE = 0x84E1;
+ int GL_MAX_TEXTURE_UNITS = 0x84E2;
+
+ int GL_NORMAL_MAP = 0x8511;
+ int GL_REFLECTION_MAP = 0x8512;
+ int GL_TEXTURE_CUBE_MAP = 0x8513;
+ int GL_TEXTURE_BINDING_CUBE_MAP = 0x8514;
+ int GL_TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515;
+ int GL_TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516;
+ int GL_TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517;
+ int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518;
+ int GL_TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519;
+ int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A;
+ int GL_PROXY_TEXTURE_CUBE_MAP = 0x851B;
+ int GL_MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C;
+
+ int GL_COMPRESSED_ALPHA = 0x84E9;
+ int GL_COMPRESSED_LUMINANCE = 0x84EA;
+ int GL_COMPRESSED_LUMINANCE_ALPHA = 0x84EB;
+ int GL_COMPRESSED_INTENSITY = 0x84EC;
+ int GL_COMPRESSED_RGB = 0x84ED;
+ int GL_COMPRESSED_RGBA = 0x84EE;
+ int GL_TEXTURE_COMPRESSION_HINT = 0x84EF;
+ int GL_TEXTURE_COMPRESSED_IMAGE_SIZE = 0x86A0;
+ int GL_TEXTURE_COMPRESSED = 0x86A1;
+ int GL_NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2;
+ int GL_COMPRESSED_TEXTURE_FORMATS = 0x86A3;
+
+ int GL_MULTISAMPLE = 0x809D;
+ int GL_SAMPLE_ALPHA_TO_COVERAGE = 0x809E;
+ int GL_SAMPLE_ALPHA_TO_ONE = 0x809F;
+ int GL_SAMPLE_COVERAGE = 0x80A0;
+ int GL_SAMPLE_BUFFERS = 0x80A8;
+ int GL_SAMPLES = 0x80A9;
+ int GL_SAMPLE_COVERAGE_VALUE = 0x80AA;
+ int GL_SAMPLE_COVERAGE_INVERT = 0x80AB;
+ int GL_MULTISAMPLE_BIT = 0x20000000;
+
+ int GL_TRANSPOSE_MODELVIEW_MATRIX = 0x84E3;
+ int GL_TRANSPOSE_PROJECTION_MATRIX = 0x84E4;
+ int GL_TRANSPOSE_TEXTURE_MATRIX = 0x84E5;
+ int GL_TRANSPOSE_COLOR_MATRIX = 0x84E6;
+
+ int GL_COMBINE = 0x8570;
+ int GL_COMBINE_RGB = 0x8571;
+ int GL_COMBINE_ALPHA = 0x8572;
+ int GL_SOURCE0_RGB = 0x8580;
+ int GL_SOURCE1_RGB = 0x8581;
+ int GL_SOURCE2_RGB = 0x8582;
+ int GL_SOURCE0_ALPHA = 0x8588;
+ int GL_SOURCE1_ALPHA = 0x8589;
+ int GL_SOURCE2_ALPHA = 0x858A;
+ int GL_OPERAND0_RGB = 0x8590;
+ int GL_OPERAND1_RGB = 0x8591;
+ int GL_OPERAND2_RGB = 0x8592;
+ int GL_OPERAND0_ALPHA = 0x8598;
+ int GL_OPERAND1_ALPHA = 0x8599;
+ int GL_OPERAND2_ALPHA = 0x859A;
+ int GL_RGB_SCALE = 0x8573;
+ int GL_ADD_SIGNED = 0x8574;
+ int GL_INTERPOLATE = 0x8575;
+ int GL_SUBTRACT = 0x84E7;
+ int GL_CONSTANT = 0x8576;
+ int GL_PRIMARY_COLOR = 0x8577;
+ int GL_PREVIOUS = 0x8578;
+ int GL_DOT3_RGB = 0x86AE;
+ int GL_DOT3_RGBA = 0x86AF;
+ int GL_CLAMP_TO_BORDER = 0x812D;
+
+ void glActiveTexture(@GLenum int texture);
+
+ @Code("\t\tGLChecks.getReferences(caps).glClientActiveTexture = texture - GL_TEXTURE0;")
+ @DeprecatedGL
+ void glClientActiveTexture(@GLenum int texture);
+
+ void glCompressedTexImage1D(@GLenum int target, int level, @GLenum int internalformat, @GLsizei int width, int border, @AutoSize("data") @GLsizei int imageSize,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check
+ @Const
+ @GLvoid
+ Buffer data);
+
+ void glCompressedTexImage2D(@GLenum int target, int level, @GLenum int internalformat, @GLsizei int width, @GLsizei int height, int border, @AutoSize("data") @GLsizei int imageSize,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check
+ @Const
+ @GLvoid
+ ByteBuffer data);
+
+ void glCompressedTexImage3D(@GLenum int target, int level, @GLenum int internalformat, @GLsizei int width, @GLsizei int height, @GLsizei int depth, int border, @AutoSize("data") @GLsizei int imageSize,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check
+ @Const
+ @GLvoid
+ ByteBuffer data);
+
+ void glCompressedTexSubImage1D(@GLenum int target, int level, int xoffset, @GLsizei int width, @GLenum int format, @AutoSize("data") @GLsizei int imageSize,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check
+ @Const
+ @GLvoid
+ ByteBuffer data);
+
+ void glCompressedTexSubImage2D(@GLenum int target, int level, int xoffset, int yoffset, @GLsizei int width, @GLsizei int height, @GLenum int format, @AutoSize("data") @GLsizei int imageSize,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check
+ @Const
+ @GLvoid
+ ByteBuffer data);
+
+ void glCompressedTexSubImage3D(@GLenum int target, int level, int xoffset, int yoffset, int zoffset, @GLsizei int width, @GLsizei int height, @GLsizei int depth, @GLenum int format, @AutoSize("data") @GLsizei int imageSize,
+ @BufferObject(BufferKind.UnpackPBO)
+ @Check
+ @Const
+ @GLvoid
+ ByteBuffer data);
+
+ // TODO: check buffer size valid
+ void glGetCompressedTexImage(@GLenum int target, int lod,
+ @OutParameter
+ @BufferObject(BufferKind.PackPBO)
+ @Check
+ @GLbyte
+ @GLshort
+ @GLint Buffer img);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glMultiTexCoord1f(@GLenum int target, float s);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glMultiTexCoord1d(@GLenum int target, double s);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glMultiTexCoord2f(@GLenum int target, float s, float t);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glMultiTexCoord2d(@GLenum int target, double s, double t);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glMultiTexCoord3f(@GLenum int target, float s, float t, float r);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glMultiTexCoord3d(@GLenum int target, double s, double t, double r);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glMultiTexCoord4f(@GLenum int target, float s, float t, float r, float q);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glMultiTexCoord4d(@GLenum int target, double s, double t, double r, double q);
+
+ @StripPostfix("m")
+ @DeprecatedGL
+ void glLoadTransposeMatrixf(@Check("16") @Const FloatBuffer m);
+
+ @StripPostfix("m")
+ @DeprecatedGL
+ void glLoadTransposeMatrixd(@Check("16") @Const DoubleBuffer m);
+
+ @StripPostfix("m")
+ @DeprecatedGL
+ void glMultTransposeMatrixf(@Check("16") @Const FloatBuffer m);
+
+ @StripPostfix("m")
+ @DeprecatedGL
+ void glMultTransposeMatrixd(@Check("16") @Const DoubleBuffer m);
+
+ void glSampleCoverage(@GLclampf float value, boolean invert);
+}
+
diff --git a/src/templates/org/lwjgl/opengl/GL14.java b/src/templates/org/lwjgl/opengl/GL14.java
index 1c1997a..7681c93 100644
--- a/src/templates/org/lwjgl/opengl/GL14.java
+++ b/src/templates/org/lwjgl/opengl/GL14.java
@@ -1,172 +1,172 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-/**
- * <p/>
- * The core OpenGL1.4 API.
- *
- * @author cix_foo <cix_foo at users.sourceforge.net>
- * @version $Revision: 3287 $
- * $Id: GL14.java 3287 2010-03-14 23:24:40Z spasi $
- */
- at DeprecatedGL
-public interface GL14 {
- int GL_GENERATE_MIPMAP = 0x8191;
- int GL_GENERATE_MIPMAP_HINT = 0x8192;
- int GL_DEPTH_COMPONENT16 = 0x81A5;
- int GL_DEPTH_COMPONENT24 = 0x81A6;
- int GL_DEPTH_COMPONENT32 = 0x81A7;
- int GL_TEXTURE_DEPTH_SIZE = 0x884A;
- int GL_DEPTH_TEXTURE_MODE = 0x884B;
- int GL_TEXTURE_COMPARE_MODE = 0x884C;
- int GL_TEXTURE_COMPARE_FUNC = 0x884D;
- int GL_COMPARE_R_TO_TEXTURE = 0x884E;
- int GL_FOG_COORDINATE_SOURCE = 0x8450;
- int GL_FOG_COORDINATE = 0x8451;
- int GL_FRAGMENT_DEPTH = 0x8452;
- int GL_CURRENT_FOG_COORDINATE = 0x8453;
- int GL_FOG_COORDINATE_ARRAY_TYPE = 0x8454;
- int GL_FOG_COORDINATE_ARRAY_STRIDE = 0x8455;
- int GL_FOG_COORDINATE_ARRAY_POINTER = 0x8456;
- int GL_FOG_COORDINATE_ARRAY = 0x8457;
- int GL_POINT_SIZE_MIN = 0x8126;
- int GL_POINT_SIZE_MAX = 0x8127;
- int GL_POINT_FADE_THRESHOLD_SIZE = 0x8128;
- int GL_POINT_DISTANCE_ATTENUATION = 0x8129;
- int GL_COLOR_SUM = 0x8458;
- int GL_CURRENT_SECONDARY_COLOR = 0x8459;
- int GL_SECONDARY_COLOR_ARRAY_SIZE = 0x845A;
- int GL_SECONDARY_COLOR_ARRAY_TYPE = 0x845B;
- int GL_SECONDARY_COLOR_ARRAY_STRIDE = 0x845C;
- int GL_SECONDARY_COLOR_ARRAY_POINTER = 0x845D;
- int GL_SECONDARY_COLOR_ARRAY = 0x845E;
- int GL_BLEND_DST_RGB = 0x80C8;
- int GL_BLEND_SRC_RGB = 0x80C9;
- int GL_BLEND_DST_ALPHA = 0x80CA;
- int GL_BLEND_SRC_ALPHA = 0x80CB;
- int GL_INCR_WRAP = 0x8507;
- int GL_DECR_WRAP = 0x8508;
- int GL_TEXTURE_FILTER_CONTROL = 0x8500;
- int GL_TEXTURE_LOD_BIAS = 0x8501;
- int GL_MAX_TEXTURE_LOD_BIAS = 0x84FD;
- int GL_MIRRORED_REPEAT = 0x8370;
-
- int GL_BLEND_COLOR = 0x8005;
- int GL_BLEND_EQUATION = 0x8009;
-
- int GL_FUNC_ADD = 0x8006;
- int GL_FUNC_SUBTRACT = 0x800A;
- int GL_FUNC_REVERSE_SUBTRACT = 0x800B;
- int GL_MIN = 0x8007;
- int GL_MAX = 0x8008;
-
- void glBlendEquation(@GLenum int mode);
-
- void glBlendColor(@GLclampf float red, @GLclampf float green, @GLclampf float blue, @GLclampf float alpha);
-
- @DeprecatedGL
- void glFogCoordf(float coord);
-
- @DeprecatedGL
- void glFogCoordd(double coord);
-
- @DeprecatedGL
- void glFogCoordPointer(@AutoType("data") @GLenum int type, @GLsizei int stride,
- @CachedReference
- @BufferObject(BufferKind.ArrayVBO)
- @Check
- @Const
- @GLfloat
- @GLdouble Buffer data);
-
- void glMultiDrawArrays(@GLenum int mode, IntBuffer piFirst, @Check("piFirst.remaining()") @GLsizei IntBuffer piCount, @AutoSize("piFirst") @GLsizei int primcount);
-
- //void glMultiDrawElements(int mode, int piCount, int type, int pIndices, int primcount);
-
- void glPointParameteri(@GLenum int pname, int param);
-
- void glPointParameterf(@GLenum int pname, float param);
-
- @StripPostfix("params")
- void glPointParameteriv(@GLenum int pname, @Check("4") @Const IntBuffer params);
-
- @StripPostfix("params")
- void glPointParameterfv(@GLenum int pname, @Check("4") @Const FloatBuffer params);
-
- @DeprecatedGL
- void glSecondaryColor3b(byte red, byte green, byte blue);
-
- @DeprecatedGL
- void glSecondaryColor3f(float red, float green, float blue);
-
- @DeprecatedGL
- void glSecondaryColor3d(double red, double green, double blue);
-
- @DeprecatedGL
- void glSecondaryColor3ub(@GLubyte byte red, @GLubyte byte green, @GLubyte byte blue);
-
- @DeprecatedGL
- void glSecondaryColorPointer(int size, @AutoType("data") @GLenum int type, @GLsizei int stride,
- @BufferObject(BufferKind.ArrayVBO)
- @Check
- @Const
- @GLbyte
- @GLubyte
- @GLfloat
- @GLdouble Buffer data);
-
- void glBlendFuncSeparate(@GLenum int sfactorRGB, @GLenum int dfactorRGB, @GLenum int sfactorAlpha, @GLenum int dfactorAlpha);
-
- @DeprecatedGL
- void glWindowPos2f(float x, float y);
-
- @DeprecatedGL
- void glWindowPos2d(double x, double y);
-
- @DeprecatedGL
- void glWindowPos2i(int x, int y);
-
- @DeprecatedGL
- void glWindowPos3f(float x, float y, float z);
-
- @DeprecatedGL
- void glWindowPos3d(double x, double y, double z);
-
- @DeprecatedGL
- void glWindowPos3i(int x, int y, int z);
-}
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+/**
+ * <p/>
+ * The core OpenGL1.4 API.
+ *
+ * @author cix_foo <cix_foo at users.sourceforge.net>
+ * @version $Revision: 3287 $
+ * $Id: GL14.java 3287 2010-03-14 23:24:40Z spasi $
+ */
+ at DeprecatedGL
+public interface GL14 {
+ int GL_GENERATE_MIPMAP = 0x8191;
+ int GL_GENERATE_MIPMAP_HINT = 0x8192;
+ int GL_DEPTH_COMPONENT16 = 0x81A5;
+ int GL_DEPTH_COMPONENT24 = 0x81A6;
+ int GL_DEPTH_COMPONENT32 = 0x81A7;
+ int GL_TEXTURE_DEPTH_SIZE = 0x884A;
+ int GL_DEPTH_TEXTURE_MODE = 0x884B;
+ int GL_TEXTURE_COMPARE_MODE = 0x884C;
+ int GL_TEXTURE_COMPARE_FUNC = 0x884D;
+ int GL_COMPARE_R_TO_TEXTURE = 0x884E;
+ int GL_FOG_COORDINATE_SOURCE = 0x8450;
+ int GL_FOG_COORDINATE = 0x8451;
+ int GL_FRAGMENT_DEPTH = 0x8452;
+ int GL_CURRENT_FOG_COORDINATE = 0x8453;
+ int GL_FOG_COORDINATE_ARRAY_TYPE = 0x8454;
+ int GL_FOG_COORDINATE_ARRAY_STRIDE = 0x8455;
+ int GL_FOG_COORDINATE_ARRAY_POINTER = 0x8456;
+ int GL_FOG_COORDINATE_ARRAY = 0x8457;
+ int GL_POINT_SIZE_MIN = 0x8126;
+ int GL_POINT_SIZE_MAX = 0x8127;
+ int GL_POINT_FADE_THRESHOLD_SIZE = 0x8128;
+ int GL_POINT_DISTANCE_ATTENUATION = 0x8129;
+ int GL_COLOR_SUM = 0x8458;
+ int GL_CURRENT_SECONDARY_COLOR = 0x8459;
+ int GL_SECONDARY_COLOR_ARRAY_SIZE = 0x845A;
+ int GL_SECONDARY_COLOR_ARRAY_TYPE = 0x845B;
+ int GL_SECONDARY_COLOR_ARRAY_STRIDE = 0x845C;
+ int GL_SECONDARY_COLOR_ARRAY_POINTER = 0x845D;
+ int GL_SECONDARY_COLOR_ARRAY = 0x845E;
+ int GL_BLEND_DST_RGB = 0x80C8;
+ int GL_BLEND_SRC_RGB = 0x80C9;
+ int GL_BLEND_DST_ALPHA = 0x80CA;
+ int GL_BLEND_SRC_ALPHA = 0x80CB;
+ int GL_INCR_WRAP = 0x8507;
+ int GL_DECR_WRAP = 0x8508;
+ int GL_TEXTURE_FILTER_CONTROL = 0x8500;
+ int GL_TEXTURE_LOD_BIAS = 0x8501;
+ int GL_MAX_TEXTURE_LOD_BIAS = 0x84FD;
+ int GL_MIRRORED_REPEAT = 0x8370;
+
+ int GL_BLEND_COLOR = 0x8005;
+ int GL_BLEND_EQUATION = 0x8009;
+
+ int GL_FUNC_ADD = 0x8006;
+ int GL_FUNC_SUBTRACT = 0x800A;
+ int GL_FUNC_REVERSE_SUBTRACT = 0x800B;
+ int GL_MIN = 0x8007;
+ int GL_MAX = 0x8008;
+
+ void glBlendEquation(@GLenum int mode);
+
+ void glBlendColor(@GLclampf float red, @GLclampf float green, @GLclampf float blue, @GLclampf float alpha);
+
+ @DeprecatedGL
+ void glFogCoordf(float coord);
+
+ @DeprecatedGL
+ void glFogCoordd(double coord);
+
+ @DeprecatedGL
+ void glFogCoordPointer(@AutoType("data") @GLenum int type, @GLsizei int stride,
+ @CachedReference
+ @BufferObject(BufferKind.ArrayVBO)
+ @Check
+ @Const
+ @GLfloat
+ @GLdouble Buffer data);
+
+ void glMultiDrawArrays(@GLenum int mode, IntBuffer piFirst, @Check("piFirst.remaining()") @GLsizei IntBuffer piCount, @AutoSize("piFirst") @GLsizei int primcount);
+
+ //void glMultiDrawElements(int mode, int piCount, int type, int pIndices, int primcount);
+
+ void glPointParameteri(@GLenum int pname, int param);
+
+ void glPointParameterf(@GLenum int pname, float param);
+
+ @StripPostfix("params")
+ void glPointParameteriv(@GLenum int pname, @Check("4") @Const IntBuffer params);
+
+ @StripPostfix("params")
+ void glPointParameterfv(@GLenum int pname, @Check("4") @Const FloatBuffer params);
+
+ @DeprecatedGL
+ void glSecondaryColor3b(byte red, byte green, byte blue);
+
+ @DeprecatedGL
+ void glSecondaryColor3f(float red, float green, float blue);
+
+ @DeprecatedGL
+ void glSecondaryColor3d(double red, double green, double blue);
+
+ @DeprecatedGL
+ void glSecondaryColor3ub(@GLubyte byte red, @GLubyte byte green, @GLubyte byte blue);
+
+ @DeprecatedGL
+ void glSecondaryColorPointer(int size, @AutoType("data") @GLenum int type, @GLsizei int stride,
+ @BufferObject(BufferKind.ArrayVBO)
+ @Check
+ @Const
+ @GLbyte
+ @GLubyte
+ @GLfloat
+ @GLdouble Buffer data);
+
+ void glBlendFuncSeparate(@GLenum int sfactorRGB, @GLenum int dfactorRGB, @GLenum int sfactorAlpha, @GLenum int dfactorAlpha);
+
+ @DeprecatedGL
+ void glWindowPos2f(float x, float y);
+
+ @DeprecatedGL
+ void glWindowPos2d(double x, double y);
+
+ @DeprecatedGL
+ void glWindowPos2i(int x, int y);
+
+ @DeprecatedGL
+ void glWindowPos3f(float x, float y, float z);
+
+ @DeprecatedGL
+ void glWindowPos3d(double x, double y, double z);
+
+ @DeprecatedGL
+ void glWindowPos3i(int x, int y, int z);
+}
+
diff --git a/src/templates/org/lwjgl/opengl/GL15.java b/src/templates/org/lwjgl/opengl/GL15.java
index 1756093..f88f7d3 100644
--- a/src/templates/org/lwjgl/opengl/GL15.java
+++ b/src/templates/org/lwjgl/opengl/GL15.java
@@ -1,237 +1,237 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.Buffer;
-import java.nio.ByteBuffer;
-import java.nio.IntBuffer;
-
-public interface GL15 {
- // ----------------------------------------------------------------------
- // ---------------------- ARB_vertex_buffer_object ----------------------
- // ----------------------------------------------------------------------
-
- int GL_ARRAY_BUFFER = 0x8892;
- int GL_ELEMENT_ARRAY_BUFFER = 0x8893;
- int GL_ARRAY_BUFFER_BINDING = 0x8894;
- int GL_ELEMENT_ARRAY_BUFFER_BINDING = 0x8895;
- int GL_VERTEX_ARRAY_BUFFER_BINDING = 0x8896;
- int GL_NORMAL_ARRAY_BUFFER_BINDING = 0x8897;
- int GL_COLOR_ARRAY_BUFFER_BINDING = 0x8898;
- int GL_INDEX_ARRAY_BUFFER_BINDING = 0x8899;
- int GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING = 0x889A;
- int GL_EDGE_FLAG_ARRAY_BUFFER_BINDING = 0x889B;
- int GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING = 0x889C;
- int GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING = 0x889D;
- int GL_WEIGHT_ARRAY_BUFFER_BINDING = 0x889E;
- int GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F;
- int GL_STREAM_DRAW = 0x88E0;
- int GL_STREAM_READ = 0x88E1;
- int GL_STREAM_COPY = 0x88E2;
- int GL_STATIC_DRAW = 0x88E4;
- int GL_STATIC_READ = 0x88E5;
- int GL_STATIC_COPY = 0x88E6;
- int GL_DYNAMIC_DRAW = 0x88E8;
- int GL_DYNAMIC_READ = 0x88E9;
- int GL_DYNAMIC_COPY = 0x88EA;
- int GL_READ_ONLY = 0x88B8;
- int GL_WRITE_ONLY = 0x88B9;
- int GL_READ_WRITE = 0x88BA;
- int GL_BUFFER_SIZE = 0x8764;
- int GL_BUFFER_USAGE = 0x8765;
- int GL_BUFFER_ACCESS = 0x88BB;
- int GL_BUFFER_MAPPED = 0x88BC;
- int GL_BUFFER_MAP_POINTER = 0x88BD;
-
- int FOG_COORD_SRC = GL14.GL_FOG_COORDINATE_SOURCE;
- int GL_FOG_COORD = GL14.GL_FOG_COORDINATE;
- int GL_CURRENT_FOG_COORD = GL14.GL_CURRENT_FOG_COORDINATE;
- int GL_FOG_COORD_ARRAY_TYPE = GL14.GL_FOG_COORDINATE_ARRAY_TYPE;
- int GL_FOG_COORD_ARRAY_STRIDE = GL14.GL_FOG_COORDINATE_ARRAY_STRIDE;
- int GL_FOG_COORD_ARRAY_POINTER = GL14.GL_FOG_COORDINATE_ARRAY_POINTER;
- int GL_FOG_COORD_ARRAY = GL14.GL_FOG_COORDINATE_ARRAY;
- int GL_FOG_COORD_ARRAY_BUFFER_BINDING = GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING;
- int GL_SRC0_RGB = GL13.GL_SOURCE0_RGB;
- int GL_SRC1_RGB = GL13.GL_SOURCE1_RGB;
- int GL_SRC2_RGB = GL13.GL_SOURCE2_RGB;
- int GL_SRC0_ALPHA = GL13.GL_SOURCE0_ALPHA;
- int GL_SRC1_ALPHA = GL13.GL_SOURCE1_ALPHA;
- int GL_SRC2_ALPHA = GL13.GL_SOURCE2_ALPHA;
-
- @Code(" StateTracker.bindBuffer(caps, target, buffer);")
- void glBindBuffer(@GLenum int target, @GLuint int buffer);
-
- void glDeleteBuffers(@AutoSize("buffers") @GLsizei int n, @Const @GLuint IntBuffer buffers);
-
- @Alternate("glDeleteBuffers")
- void glDeleteBuffers(@Constant("1") @GLsizei int n, @Constant(value = "APIUtils.getBufferInt().put(0, buffer), 0", keepParam = true) int buffer);
-
- void glGenBuffers(@AutoSize("buffers") @GLsizei int n, @OutParameter @GLuint IntBuffer buffers);
-
- @Alternate("glGenBuffers")
- @GLreturn("buffers")
- void glGenBuffers2(@Constant("1") @GLsizei int n, @OutParameter @GLuint IntBuffer buffers);
-
- boolean glIsBuffer(@GLuint int buffer);
-
- @GenerateAutos
- void glBufferData(@GLenum int target, @AutoSize("data") @GLsizeiptr long size,
- @Const
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer data, @GLenum int usage);
-
- void glBufferSubData(@GLenum int target, @GLintptr long offset, @AutoSize("data") @GLsizeiptr long size,
- @Check
- @Const
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer data);
-
- void glGetBufferSubData(@GLenum int target, @GLintptr long offset, @AutoSize("data") @GLsizeiptr long size,
- @OutParameter
- @Check
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer data);
-
- /**
- * glMapBuffer maps a GL buffer object to a ByteBuffer. The old_buffer argument can be null,
- * in which case a new ByteBuffer will be created, pointing to the returned memory. If old_buffer is non-null,
- * it will be returned if it points to the same mapped memory and has the same capacity as the buffer object,
- * otherwise a new ByteBuffer is created. That way, an application will normally use glMapBuffer like this:
- * <p/>
- * ByteBuffer mapped_buffer; mapped_buffer = glMapBuffer(..., ..., null); ... // Another map on the same buffer mapped_buffer = glMapBuffer(..., ..., mapped_buffer);
- * <p/>
- * Only ByteBuffers returned from this method are to be passed as the old_buffer argument. User-created ByteBuffers cannot be reused.
- * <p/>
- * The version of this method without an explicit length argument calls glGetBufferParameter internally to
- * retrieve the current buffer object size, which may cause a pipeline flush and reduce application performance.
- * <p/>
- * The version of this method with an explicit length argument is a fast alternative to the one without. No GL call
- * is made to retrieve the buffer object size, so the user is responsible for tracking and using the appropriate length.<br>
- * Security warning: The length argument should match the buffer object size. Reading from or writing to outside
- * the memory region that corresponds to the mapped buffer object will cause native crashes.
- *
- * @param old_buffer A ByteBuffer. If this argument points to the same address and has the same capacity as the new mapping, it will be returned and no new buffer will be created.
- *
- * @return A ByteBuffer representing the mapped buffer memory.
- */
- @CachedResult
- @GLvoid
- @AutoResultSize("GLChecks.getBufferObjectSize(caps, target)")
- ByteBuffer glMapBuffer(@GLenum int target, @GLenum int access);
-
- boolean glUnmapBuffer(@GLenum int target);
-
- @StripPostfix("params")
- void glGetBufferParameteriv(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
-
- @Alternate("glGetBufferParameteriv")
- @GLreturn("params")
- @StripPostfix("params")
- void glGetBufferParameteriv2(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params);
-
- @StripPostfix("pointer")
- @AutoResultSize("GLChecks.getBufferObjectSize(caps, target)")
- void glGetBufferPointerv(@GLenum int target, @GLenum int pname, @OutParameter @Result @GLvoid ByteBuffer pointer);
-
- // -----------------------------------------------------------------
- // ---------------------- ARB_occlusion_query ----------------------
- // -----------------------------------------------------------------
-
- /**
- * Accepted by the <target> parameter of BeginQuery, EndQuery,
- * and GetQueryiv:
- */
- int GL_SAMPLES_PASSED = 0x8914;
-
- /** Accepted by the <pname> parameter of GetQueryiv: */
- int GL_QUERY_COUNTER_BITS = 0x8864;
- int GL_CURRENT_QUERY = 0x8865;
-
- /**
- * Accepted by the <pname> parameter of GetQueryObjectiv and
- * GetQueryObjectuiv:
- */
- int GL_QUERY_RESULT = 0x8866;
- int GL_QUERY_RESULT_AVAILABLE = 0x8867;
-
- void glGenQueries(@AutoSize("ids") @GLsizei int n, @OutParameter @GLuint IntBuffer ids);
-
- @Alternate("glGenQueries")
- @GLreturn("ids")
- void glGenQueries2(@Constant("1") @GLsizei int n, @OutParameter @GLuint IntBuffer ids);
-
- void glDeleteQueries(@AutoSize("ids") @GLsizei int n, @GLuint IntBuffer ids);
-
- @Alternate("glDeleteQueries")
- void glDeleteQueries(@Constant("1") @GLsizei int n, @Constant(value = "APIUtils.getBufferInt().put(0, id), 0", keepParam = true) int id);
-
- boolean glIsQuery(@GLuint int id);
-
- void glBeginQuery(@GLenum int target, @GLuint int id);
-
- void glEndQuery(@GLenum int target);
-
- @StripPostfix("params")
- void glGetQueryiv(@GLenum int target, @GLenum int pname, @OutParameter @Check("1") IntBuffer params);
-
- @Alternate("glGetQueryiv")
- @GLreturn("params")
- @StripPostfix("params")
- void glGetQueryiv2(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params);
-
- @StripPostfix("params")
- void glGetQueryObjectiv(@GLenum int id, @GLenum int pname, @OutParameter @Check("1") @GLint IntBuffer params);
-
- @Alternate("glGetQueryObjectiv")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- void glGetQueryObjectiv2(@GLenum int id, @GLenum int pname, @OutParameter @GLint IntBuffer params);
-
- @StripPostfix("params")
- void glGetQueryObjectuiv(@GLenum int id, @GLenum int pname, @OutParameter @Check("1") @GLuint IntBuffer params);
-
- @Alternate("glGetQueryObjectuiv")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- void glGetQueryObjectuiv2(@GLenum int id, @GLenum int pname, @OutParameter @GLuint IntBuffer params);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.Buffer;
+import java.nio.ByteBuffer;
+import java.nio.IntBuffer;
+
+public interface GL15 {
+ // ----------------------------------------------------------------------
+ // ---------------------- ARB_vertex_buffer_object ----------------------
+ // ----------------------------------------------------------------------
+
+ int GL_ARRAY_BUFFER = 0x8892;
+ int GL_ELEMENT_ARRAY_BUFFER = 0x8893;
+ int GL_ARRAY_BUFFER_BINDING = 0x8894;
+ int GL_ELEMENT_ARRAY_BUFFER_BINDING = 0x8895;
+ int GL_VERTEX_ARRAY_BUFFER_BINDING = 0x8896;
+ int GL_NORMAL_ARRAY_BUFFER_BINDING = 0x8897;
+ int GL_COLOR_ARRAY_BUFFER_BINDING = 0x8898;
+ int GL_INDEX_ARRAY_BUFFER_BINDING = 0x8899;
+ int GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING = 0x889A;
+ int GL_EDGE_FLAG_ARRAY_BUFFER_BINDING = 0x889B;
+ int GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING = 0x889C;
+ int GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING = 0x889D;
+ int GL_WEIGHT_ARRAY_BUFFER_BINDING = 0x889E;
+ int GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F;
+ int GL_STREAM_DRAW = 0x88E0;
+ int GL_STREAM_READ = 0x88E1;
+ int GL_STREAM_COPY = 0x88E2;
+ int GL_STATIC_DRAW = 0x88E4;
+ int GL_STATIC_READ = 0x88E5;
+ int GL_STATIC_COPY = 0x88E6;
+ int GL_DYNAMIC_DRAW = 0x88E8;
+ int GL_DYNAMIC_READ = 0x88E9;
+ int GL_DYNAMIC_COPY = 0x88EA;
+ int GL_READ_ONLY = 0x88B8;
+ int GL_WRITE_ONLY = 0x88B9;
+ int GL_READ_WRITE = 0x88BA;
+ int GL_BUFFER_SIZE = 0x8764;
+ int GL_BUFFER_USAGE = 0x8765;
+ int GL_BUFFER_ACCESS = 0x88BB;
+ int GL_BUFFER_MAPPED = 0x88BC;
+ int GL_BUFFER_MAP_POINTER = 0x88BD;
+
+ int FOG_COORD_SRC = GL14.GL_FOG_COORDINATE_SOURCE;
+ int GL_FOG_COORD = GL14.GL_FOG_COORDINATE;
+ int GL_CURRENT_FOG_COORD = GL14.GL_CURRENT_FOG_COORDINATE;
+ int GL_FOG_COORD_ARRAY_TYPE = GL14.GL_FOG_COORDINATE_ARRAY_TYPE;
+ int GL_FOG_COORD_ARRAY_STRIDE = GL14.GL_FOG_COORDINATE_ARRAY_STRIDE;
+ int GL_FOG_COORD_ARRAY_POINTER = GL14.GL_FOG_COORDINATE_ARRAY_POINTER;
+ int GL_FOG_COORD_ARRAY = GL14.GL_FOG_COORDINATE_ARRAY;
+ int GL_FOG_COORD_ARRAY_BUFFER_BINDING = GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING;
+ int GL_SRC0_RGB = GL13.GL_SOURCE0_RGB;
+ int GL_SRC1_RGB = GL13.GL_SOURCE1_RGB;
+ int GL_SRC2_RGB = GL13.GL_SOURCE2_RGB;
+ int GL_SRC0_ALPHA = GL13.GL_SOURCE0_ALPHA;
+ int GL_SRC1_ALPHA = GL13.GL_SOURCE1_ALPHA;
+ int GL_SRC2_ALPHA = GL13.GL_SOURCE2_ALPHA;
+
+ @Code(" StateTracker.bindBuffer(caps, target, buffer);")
+ void glBindBuffer(@GLenum int target, @GLuint int buffer);
+
+ void glDeleteBuffers(@AutoSize("buffers") @GLsizei int n, @Const @GLuint IntBuffer buffers);
+
+ @Alternate("glDeleteBuffers")
+ void glDeleteBuffers(@Constant("1") @GLsizei int n, @Constant(value = "APIUtils.getBufferInt().put(0, buffer), 0", keepParam = true) int buffer);
+
+ void glGenBuffers(@AutoSize("buffers") @GLsizei int n, @OutParameter @GLuint IntBuffer buffers);
+
+ @Alternate("glGenBuffers")
+ @GLreturn("buffers")
+ void glGenBuffers2(@Constant("1") @GLsizei int n, @OutParameter @GLuint IntBuffer buffers);
+
+ boolean glIsBuffer(@GLuint int buffer);
+
+ @GenerateAutos
+ void glBufferData(@GLenum int target, @AutoSize("data") @GLsizeiptr long size,
+ @Const
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer data, @GLenum int usage);
+
+ void glBufferSubData(@GLenum int target, @GLintptr long offset, @AutoSize("data") @GLsizeiptr long size,
+ @Check
+ @Const
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer data);
+
+ void glGetBufferSubData(@GLenum int target, @GLintptr long offset, @AutoSize("data") @GLsizeiptr long size,
+ @OutParameter
+ @Check
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer data);
+
+ /**
+ * glMapBuffer maps a GL buffer object to a ByteBuffer. The old_buffer argument can be null,
+ * in which case a new ByteBuffer will be created, pointing to the returned memory. If old_buffer is non-null,
+ * it will be returned if it points to the same mapped memory and has the same capacity as the buffer object,
+ * otherwise a new ByteBuffer is created. That way, an application will normally use glMapBuffer like this:
+ * <p/>
+ * ByteBuffer mapped_buffer; mapped_buffer = glMapBuffer(..., ..., null); ... // Another map on the same buffer mapped_buffer = glMapBuffer(..., ..., mapped_buffer);
+ * <p/>
+ * Only ByteBuffers returned from this method are to be passed as the old_buffer argument. User-created ByteBuffers cannot be reused.
+ * <p/>
+ * The version of this method without an explicit length argument calls glGetBufferParameter internally to
+ * retrieve the current buffer object size, which may cause a pipeline flush and reduce application performance.
+ * <p/>
+ * The version of this method with an explicit length argument is a fast alternative to the one without. No GL call
+ * is made to retrieve the buffer object size, so the user is responsible for tracking and using the appropriate length.<br>
+ * Security warning: The length argument should match the buffer object size. Reading from or writing to outside
+ * the memory region that corresponds to the mapped buffer object will cause native crashes.
+ *
+ * @param old_buffer A ByteBuffer. If this argument points to the same address and has the same capacity as the new mapping, it will be returned and no new buffer will be created.
+ *
+ * @return A ByteBuffer representing the mapped buffer memory.
+ */
+ @CachedResult
+ @GLvoid
+ @AutoResultSize("GLChecks.getBufferObjectSize(caps, target)")
+ ByteBuffer glMapBuffer(@GLenum int target, @GLenum int access);
+
+ boolean glUnmapBuffer(@GLenum int target);
+
+ @StripPostfix("params")
+ void glGetBufferParameteriv(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
+
+ @Alternate("glGetBufferParameteriv")
+ @GLreturn("params")
+ @StripPostfix("params")
+ void glGetBufferParameteriv2(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params);
+
+ @StripPostfix("pointer")
+ @AutoResultSize("GLChecks.getBufferObjectSize(caps, target)")
+ void glGetBufferPointerv(@GLenum int target, @GLenum int pname, @OutParameter @Result @GLvoid ByteBuffer pointer);
+
+ // -----------------------------------------------------------------
+ // ---------------------- ARB_occlusion_query ----------------------
+ // -----------------------------------------------------------------
+
+ /**
+ * Accepted by the <target> parameter of BeginQuery, EndQuery,
+ * and GetQueryiv:
+ */
+ int GL_SAMPLES_PASSED = 0x8914;
+
+ /** Accepted by the <pname> parameter of GetQueryiv: */
+ int GL_QUERY_COUNTER_BITS = 0x8864;
+ int GL_CURRENT_QUERY = 0x8865;
+
+ /**
+ * Accepted by the <pname> parameter of GetQueryObjectiv and
+ * GetQueryObjectuiv:
+ */
+ int GL_QUERY_RESULT = 0x8866;
+ int GL_QUERY_RESULT_AVAILABLE = 0x8867;
+
+ void glGenQueries(@AutoSize("ids") @GLsizei int n, @OutParameter @GLuint IntBuffer ids);
+
+ @Alternate("glGenQueries")
+ @GLreturn("ids")
+ void glGenQueries2(@Constant("1") @GLsizei int n, @OutParameter @GLuint IntBuffer ids);
+
+ void glDeleteQueries(@AutoSize("ids") @GLsizei int n, @GLuint IntBuffer ids);
+
+ @Alternate("glDeleteQueries")
+ void glDeleteQueries(@Constant("1") @GLsizei int n, @Constant(value = "APIUtils.getBufferInt().put(0, id), 0", keepParam = true) int id);
+
+ boolean glIsQuery(@GLuint int id);
+
+ void glBeginQuery(@GLenum int target, @GLuint int id);
+
+ void glEndQuery(@GLenum int target);
+
+ @StripPostfix("params")
+ void glGetQueryiv(@GLenum int target, @GLenum int pname, @OutParameter @Check("1") IntBuffer params);
+
+ @Alternate("glGetQueryiv")
+ @GLreturn("params")
+ @StripPostfix("params")
+ void glGetQueryiv2(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params);
+
+ @StripPostfix("params")
+ void glGetQueryObjectiv(@GLenum int id, @GLenum int pname, @OutParameter @Check("1") @GLint IntBuffer params);
+
+ @Alternate("glGetQueryObjectiv")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetQueryObjectiv2(@GLenum int id, @GLenum int pname, @OutParameter @GLint IntBuffer params);
+
+ @StripPostfix("params")
+ void glGetQueryObjectuiv(@GLenum int id, @GLenum int pname, @OutParameter @Check("1") @GLuint IntBuffer params);
+
+ @Alternate("glGetQueryObjectuiv")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetQueryObjectuiv2(@GLenum int id, @GLenum int pname, @OutParameter @GLuint IntBuffer params);
+}
diff --git a/src/templates/org/lwjgl/opengl/GL20.java b/src/templates/org/lwjgl/opengl/GL20.java
index c53bc32..f94129c 100644
--- a/src/templates/org/lwjgl/opengl/GL20.java
+++ b/src/templates/org/lwjgl/opengl/GL20.java
@@ -1,567 +1,567 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-public interface GL20 {
- // ------------------------------------------------------------------
- // -------------------[ ARB_shading_language_100 ]-------------------
- // ------------------------------------------------------------------
-
- /** Accepted by the <name> parameter of GetString: */
- int GL_SHADING_LANGUAGE_VERSION = 0x8B8C;
-
- // ------------------------------------------------------------------
- // ----------------------[ ARB_shader_objects ]----------------------
- // ------------------------------------------------------------------
-
- /** Accepted by the <pname> argument of GetInteger: */
- int GL_CURRENT_PROGRAM = 0x8B8D;
-
- /** Accepted by the <pname> parameter of GetObjectParameter{fi}vARB: */
- int GL_SHADER_TYPE = 0x8B4F;
- int GL_DELETE_STATUS = 0x8B80;
- int GL_COMPILE_STATUS = 0x8B81;
- int GL_LINK_STATUS = 0x8B82;
- int GL_VALIDATE_STATUS = 0x8B83;
- int GL_INFO_LOG_LENGTH = 0x8B84;
- int GL_ATTACHED_SHADERS = 0x8B85;
- int GL_ACTIVE_UNIFORMS = 0x8B86;
- int GL_ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87;
- int GL_ACTIVE_ATTRIBUTES = 0x8B89;
- int GL_ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A;
- int GL_SHADER_SOURCE_LENGTH = 0x8B88;
-
- /** Returned by the <params> parameter of GetObjectParameter{fi}vARB: */
- int GL_SHADER_OBJECT = 0x8B48;
-
- /** Returned by the <type> parameter of GetActiveUniformARB: */
- int GL_FLOAT_VEC2 = 0x8B50;
- int GL_FLOAT_VEC3 = 0x8B51;
- int GL_FLOAT_VEC4 = 0x8B52;
- int GL_INT_VEC2 = 0x8B53;
- int GL_INT_VEC3 = 0x8B54;
- int GL_INT_VEC4 = 0x8B55;
- int GL_BOOL = 0x8B56;
- int GL_BOOL_VEC2 = 0x8B57;
- int GL_BOOL_VEC3 = 0x8B58;
- int GL_BOOL_VEC4 = 0x8B59;
- int GL_FLOAT_MAT2 = 0x8B5A;
- int GL_FLOAT_MAT3 = 0x8B5B;
- int GL_FLOAT_MAT4 = 0x8B5C;
- int GL_SAMPLER_1D = 0x8B5D;
- int GL_SAMPLER_2D = 0x8B5E;
- int GL_SAMPLER_3D = 0x8B5F;
- int GL_SAMPLER_CUBE = 0x8B60;
- int GL_SAMPLER_1D_SHADOW = 0x8B61;
- int GL_SAMPLER_2D_SHADOW = 0x8B62;
-
- /**
- * The ARB_shader_objects extension allows multiple, optionally null-terminated, source strings to define a shader program.
- * <p/>
- * This method uses just a single string, that should NOT be null-terminated.
- *
- * @param shader
- * @param string
- */
- void glShaderSource(@GLuint int shader, @Constant("1") @GLsizei int count,
- @Indirect @Const @GLchar @Check ByteBuffer string,
- @AutoSize("string") @Indirect @Const @GLint int length);
-
- @Alternate("glShaderSource")
- void glShaderSource2(@GLuint int shader, @Constant("1") @GLsizei int count, CharSequence string, @Constant("string.length()") @Indirect @Const int length);
-
- @Alternate(value = "glShaderSource", nativeAlt = true)
- void glShaderSource3(@GLuint int shader, @Constant("strings.length") @GLsizei int count,
- @Const @StringList(value = "count", lengths = "length") CharSequence[] strings,
- @Constant("APIUtils.getLengths(strings), 0") @Const IntBuffer length);
-
- int glCreateShader(@GLuint int type);
-
- boolean glIsShader(@GLuint int shader);
-
- void glCompileShader(@GLuint int shader);
-
- void glDeleteShader(@GLuint int shader);
-
- int glCreateProgram();
-
- boolean glIsProgram(int program);
-
- void glAttachShader(@GLuint int program, @GLuint int shader);
-
- void glDetachShader(@GLuint int program, @GLuint int shader);
-
- void glLinkProgram(@GLuint int program);
-
- void glUseProgram(@GLuint int program);
-
- void glValidateProgram(@GLuint int program);
-
- void glDeleteProgram(@GLuint int program);
-
- void glUniform1f(int location, float v0);
-
- void glUniform2f(int location, float v0, float v1);
-
- void glUniform3f(int location, float v0, float v1, float v2);
-
- void glUniform4f(int location, float v0, float v1, float v2, float v3);
-
- void glUniform1i(int location, int v0);
-
- void glUniform2i(int location, int v0, int v1);
-
- void glUniform3i(int location, int v0, int v1, int v2);
-
- void glUniform4i(int location, int v0, int v1, int v2, int v3);
-
- @StripPostfix("values")
- void glUniform1fv(int location, @AutoSize("values") @GLsizei int count, @Const FloatBuffer values);
-
- @StripPostfix("values")
- void glUniform2fv(int location, @AutoSize(value = "values", expression = " >> 1") @GLsizei int count, @Const FloatBuffer values);
-
- @StripPostfix("values")
- void glUniform3fv(int location, @AutoSize(value = "values", expression = " / 3") @GLsizei int count, @Const FloatBuffer values);
-
- @StripPostfix("values")
- void glUniform4fv(int location, @AutoSize(value = "values", expression = " >> 2") @GLsizei int count, @Const FloatBuffer values);
-
- @StripPostfix("values")
- void glUniform1iv(int location, @AutoSize("values") @GLsizei int count, @Const IntBuffer values);
-
- @StripPostfix("values")
- void glUniform2iv(int location, @AutoSize(value = "values", expression = " >> 1") @GLsizei int count, @Const IntBuffer values);
-
- @StripPostfix("values")
- void glUniform3iv(int location, @AutoSize(value = "values", expression = " / 3") @GLsizei int count, @Const IntBuffer values);
-
- @StripPostfix("values")
- void glUniform4iv(int location, @AutoSize(value = "values", expression = " >> 2") @GLsizei int count, @Const IntBuffer values);
-
- @StripPostfix("matrices")
- void glUniformMatrix2fv(int location, @AutoSize(value = "matrices", expression = " >> 2") @GLsizei int count,
- boolean transpose, @Const FloatBuffer matrices);
-
- @StripPostfix("matrices")
- void glUniformMatrix3fv(int location, @AutoSize(value = "matrices", expression = " / (3 * 3)") @GLsizei int count,
- boolean transpose, @Const FloatBuffer matrices);
-
- @StripPostfix("matrices")
- void glUniformMatrix4fv(int location, @AutoSize(value = "matrices", expression = " >> 4") @GLsizei int count,
- boolean transpose, @Const FloatBuffer matrices);
-
- @StripPostfix("params")
- void glGetShaderiv(@GLuint int shader, @GLenum int pname, @OutParameter @Check IntBuffer params);
-
- @Alternate("glGetShaderiv")
- @GLreturn("params")
- @StripPostfix("params")
- void glGetShaderiv2(@GLuint int shader, @GLenum int pname, @OutParameter IntBuffer params);
-
- @StripPostfix("params")
- void glGetProgramiv(@GLuint int program, @GLenum int pname, @OutParameter @Check IntBuffer params);
-
- @Alternate("glGetProgramiv")
- @GLreturn("params")
- @StripPostfix("params")
- void glGetProgramiv2(@GLuint int program, @GLenum int pname, @OutParameter IntBuffer params);
-
- void glGetShaderInfoLog(@GLuint int shader, @AutoSize("infoLog") @GLsizei int maxLength,
- @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
- @OutParameter @GLchar ByteBuffer infoLog);
-
- @Alternate("glGetShaderInfoLog")
- @GLreturn(value = "infoLog", maxLength = "maxLength")
- void glGetShaderInfoLog2(@GLuint int shader, @GLsizei int maxLength,
- @OutParameter @GLsizei @Constant("infoLog_length, 0") IntBuffer length,
- @OutParameter @GLchar ByteBuffer infoLog);
-
- void glGetProgramInfoLog(@GLuint int program, @AutoSize("infoLog") @GLsizei int maxLength,
- @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
- @OutParameter @GLchar ByteBuffer infoLog);
-
- @Alternate("glGetProgramInfoLog")
- @GLreturn(value = "infoLog", maxLength = "maxLength")
- void glGetProgramInfoLog2(@GLuint int program, @GLsizei int maxLength,
- @OutParameter @GLsizei @Constant("infoLog_length, 0") IntBuffer length,
- @OutParameter @GLchar ByteBuffer infoLog);
-
- void glGetAttachedShaders(@GLuint int program, @AutoSize("shaders") @GLsizei int maxCount,
- @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer count,
- @OutParameter @GLuint IntBuffer shaders);
-
- /**
- * Returns the location of the uniform with the specified name. The ByteBuffer should contain the uniform name as a
- * <b>null-terminated</b> string.
- *
- * @param program
- * @param name
- */
- int glGetUniformLocation(@GLuint int program, @NullTerminated @Check("1") @Const @GLchar ByteBuffer name);
-
- @Alternate("glGetUniformLocation")
- int glGetUniformLocation(@GLuint int program, @NullTerminated CharSequence name);
-
- void glGetActiveUniform(@GLuint int program, @GLuint int index, @AutoSize("name") @GLsizei int maxLength,
- @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
- @OutParameter @GLsizei @Check("1") IntBuffer size,
- @OutParameter @GLenum @Check("1") IntBuffer type,
- @OutParameter @GLchar ByteBuffer name);
-
- /** Overloads glGetActiveUniform. This version returns both size and type in the sizeType buffer (at .position() and .position() + 1). */
- @Alternate("glGetActiveUniform")
- @GLreturn(value = "name", maxLength = "maxLength")
- void glGetActiveUniform2(@GLuint int program, @GLuint int index, @GLsizei int maxLength,
- @OutParameter @GLsizei @Constant("name_length, 0") IntBuffer length,
- @OutParameter @Check("2") IntBuffer sizeType,
- @OutParameter @GLenum @Constant("sizeType, sizeType.position() + 1") IntBuffer type,
- @OutParameter @GLchar ByteBuffer name);
-
- /** Overloads glGetActiveUniformARB. This version returns only the uniform name. */
- @Alternate(value = "glGetActiveUniform", javaAlt = true)
- @GLreturn(value = "name", maxLength = "maxLength")
- void glGetActiveUniform(@GLuint int program, @GLuint int index, @GLsizei int maxLength,
- @OutParameter @GLsizei @Constant("name_length, 0, APIUtils.getBufferInt(), 0, APIUtils.getBufferInt(), 1") IntBuffer length,
- @OutParameter @GLchar ByteBuffer name);
-
- /** Overloads glGetActiveUniform. This version returns only the uniform size. */
- @Alternate(value = "glGetActiveUniform", javaAlt = true)
- @GLreturn(value = "size")
- void glGetActiveUniformSize(@GLuint int program, @GLuint int index, @Constant("0") @GLsizei int maxLength,
- @OutParameter @GLsizei @Constant("null, 0") IntBuffer length,
- @OutParameter IntBuffer size,
- @OutParameter @GLenum @Constant("size, 1") IntBuffer type, // Reuse size buffer and ignore
- @OutParameter @GLchar @Constant("APIUtils.getBufferByte(0), 0") ByteBuffer name);
-
- /** Overloads glGetActiveUniform. This version returns only the uniform type. */
- @Alternate(value = "glGetActiveUniform", javaAlt = true)
- @GLreturn(value = "type")
- void glGetActiveUniformType(@GLuint int program, @GLuint int index, @Constant("0") @GLsizei int maxLength,
- @OutParameter @GLsizei @Constant("null, 0") IntBuffer length,
- @OutParameter @Constant("type, 1") IntBuffer size, // Reuse type buffer and ignore
- @OutParameter @GLenum IntBuffer type,
- @OutParameter @GLchar @Constant("APIUtils.getBufferByte(0), 0") ByteBuffer name);
-
- @StripPostfix("params")
- void glGetUniformfv(@GLuint int program, int location, @OutParameter @Check FloatBuffer params);
-
- @StripPostfix("params")
- void glGetUniformiv(@GLuint int program, int location, @OutParameter @Check IntBuffer params);
-
- void glGetShaderSource(@GLuint int shader, @AutoSize("source") @GLsizei int maxLength,
- @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
- @OutParameter @GLchar ByteBuffer source);
-
- @Alternate("glGetShaderSource")
- @GLreturn(value = "source", maxLength = "maxLength")
- void glGetShaderSource2(@GLuint int shader, @GLsizei int maxLength,
- @OutParameter @GLsizei @Constant("source_length, 0") IntBuffer length,
- @OutParameter @GLchar ByteBuffer source);
-
- // ------------------------------------------------------------------
- // ----------------------[ ARB_vertex_program ]----------------------
- // ------------------------------------------------------------------
-
- @NoErrorCheck
- void glVertexAttrib1s(@GLuint int index, short x);
-
- @NoErrorCheck
- void glVertexAttrib1f(@GLuint int index, float x);
-
- @NoErrorCheck
- void glVertexAttrib1d(@GLuint int index, double x);
-
- @NoErrorCheck
- void glVertexAttrib2s(@GLuint int index, short x, short y);
-
- @NoErrorCheck
- void glVertexAttrib2f(@GLuint int index, float x, float y);
-
- @NoErrorCheck
- void glVertexAttrib2d(@GLuint int index, double x, double y);
-
- @NoErrorCheck
- void glVertexAttrib3s(@GLuint int index, short x, short y, short z);
-
- @NoErrorCheck
- void glVertexAttrib3f(@GLuint int index, float x, float y, float z);
-
- @NoErrorCheck
- void glVertexAttrib3d(@GLuint int index, double x, double y, double z);
-
- @NoErrorCheck
- void glVertexAttrib4s(@GLuint int index, short x, short y, short z, short w);
-
- @NoErrorCheck
- void glVertexAttrib4f(@GLuint int index, float x, float y, float z, float w);
-
- @NoErrorCheck
- void glVertexAttrib4d(@GLuint int index, double x, double y, double z, double w);
-
- @NoErrorCheck
- void glVertexAttrib4Nub(@GLuint int index, @GLubyte byte x, @GLubyte byte y, @GLubyte byte z, @GLubyte byte w);
-
- void glVertexAttribPointer(@GLuint int index, int size, @AutoType("buffer") @GLenum int type, boolean normalized, @GLsizei int stride,
- @CachedReference(index = "index", name = "glVertexAttribPointer_buffer")
- @BufferObject(BufferKind.ArrayVBO)
- @Check
- @Const
- @GLubyte
- @GLbyte
- @GLshort
- @GLushort
- @GLint
- @GLuint
- @GLfloat
- @GLdouble Buffer buffer);
-
- void glEnableVertexAttribArray(@GLuint int index);
-
- void glDisableVertexAttribArray(@GLuint int index);
-
- @StripPostfix("params")
- void glGetVertexAttribfv(@GLuint int index, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
-
- @StripPostfix("params")
- void glGetVertexAttribdv(@GLuint int index, @GLenum int pname, @OutParameter @Check("4") DoubleBuffer params);
-
- @StripPostfix("params")
- void glGetVertexAttribiv(@GLuint int index, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
-
- @StripPostfix("pointer")
- void glGetVertexAttribPointerv(@GLuint int index, @GLenum int pname, @Result @GLvoid ByteBuffer pointer);
-
- // -----------------------------------------------------------------
- // ----------------------[ ARB_vertex_shader ]----------------------
- // -----------------------------------------------------------------
-
- /**
- * Accepted by the <shaderType> argument of CreateShader and
- * returned by the <params> parameter of GetShader{if}v:
- */
- int GL_VERTEX_SHADER = 0x8B31;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv, and GetDoublev:
- */
- int GL_MAX_VERTEX_UNIFORM_COMPONENTS = 0x8B4A;
- int GL_MAX_VARYING_FLOATS = 0x8B4B;
- int GL_MAX_VERTEX_ATTRIBS = 0x8869;
- int GL_MAX_TEXTURE_IMAGE_UNITS = 0x8872;
- int GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C;
- int GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D;
- int GL_MAX_TEXTURE_COORDS = 0x8871;
-
- /**
- * Accepted by the <cap> parameter of Disable, Enable, and IsEnabled, and
- * by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
- * GetDoublev:
- */
- int GL_VERTEX_PROGRAM_POINT_SIZE = 0x8642;
- int GL_VERTEX_PROGRAM_TWO_SIDE = 0x8643;
-
- /** Accepted by the <pname> parameter of GetVertexAttrib{dfi}vARB: */
- int GL_VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622;
- int GL_VERTEX_ATTRIB_ARRAY_SIZE = 0x8623;
- int GL_VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624;
- int GL_VERTEX_ATTRIB_ARRAY_TYPE = 0x8625;
- int GL_VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A;
- int GL_CURRENT_VERTEX_ATTRIB = 0x8626;
-
- /** Accepted by the <pname> parameter of GetVertexAttribPointervARB: */
- int GL_VERTEX_ATTRIB_ARRAY_POINTER = 0x8645;
-
- void glBindAttribLocation(@GLuint int program, @GLuint int index, @NullTerminated @Const @GLchar ByteBuffer name);
-
- @Alternate("glBindAttribLocation")
- void glBindAttribLocation(@GLuint int program, @GLuint int index, @NullTerminated CharSequence name);
-
- void glGetActiveAttrib(@GLuint int program, @GLuint int index, @AutoSize("name") @GLsizei int maxLength,
- @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
- @OutParameter @Check("1") IntBuffer size,
- @OutParameter @GLenum @Check("1") IntBuffer type,
- @OutParameter @GLchar ByteBuffer name);
-
- /** Overloads glGetActiveAttrib. This version returns both size and type in the sizeType buffer (at .position() and .position() + 1). */
- @Alternate("glGetActiveAttrib")
- @GLreturn(value = "name", maxLength = "maxLength")
- void glGetActiveAttrib2(@GLuint int program, @GLuint int index, @GLsizei int maxLength,
- @OutParameter @GLsizei @Constant("name_length, 0") IntBuffer length,
- @OutParameter @Check("2") IntBuffer sizeType,
- @OutParameter @GLenum @Constant("sizeType, sizeType.position() + 1") IntBuffer type,
- @OutParameter @GLchar ByteBuffer name);
-
- /** Overloads glGetActiveAttrib. This version returns only the attrib name. */
- @Alternate(value = "glGetActiveAttrib", javaAlt = true)
- @GLreturn(value = "name", maxLength = "maxLength")
- void glGetActiveAttrib(@GLuint int program, @GLuint int index, @GLsizei int maxLength,
- @OutParameter @GLsizei @Constant("name_length, 0, APIUtils.getBufferInt(), 0, APIUtils.getBufferInt(), 1") IntBuffer length,
- @OutParameter @GLchar ByteBuffer name);
-
- /** Overloads glGetActiveAttribARB. This version returns only the attrib size. */
- @Alternate(value = "glGetActiveAttrib", javaAlt = true)
- @GLreturn(value = "size")
- void glGetActiveAttribSize(@GLuint int program, @GLuint int index, @Constant("0") @GLsizei int maxLength,
- @OutParameter @GLsizei @Constant("null, 0") IntBuffer length,
- @OutParameter IntBuffer size,
- @OutParameter @GLenum @Constant("size, 1") IntBuffer type, // Reuse size buffer and ignore
- @OutParameter @GLchar @Constant("APIUtils.getBufferByte(0), 0") ByteBuffer name);
-
- /** Overloads glGetActiveAttrib. This version returns only the attrib type. */
- @Alternate(value = "glGetActiveAttrib", javaAlt = true)
- @GLreturn(value = "type")
- void glGetActiveAttribType(@GLuint int program, @GLuint int index, @Constant("0") @GLsizei int maxLength,
- @OutParameter @GLsizei @Constant("null, 0") IntBuffer length,
- @OutParameter @Constant("type, 1") IntBuffer size, // Reuse type buffer and ignore
- @OutParameter @GLenum IntBuffer type,
- @OutParameter @GLchar @Constant("APIUtils.getBufferByte(0), 0") ByteBuffer name);
-
- int glGetAttribLocation(@GLuint int program, @NullTerminated @Const @GLchar ByteBuffer name);
-
- @Alternate("glGetAttribLocation")
- int glGetAttribLocation(@GLuint int program, @NullTerminated CharSequence name);
-
- // -------------------------------------------------------------------
- // ----------------------[ ARB_fragment_shader ]----------------------
- // -------------------------------------------------------------------
-
- /**
- * Accepted by the <shaderType> argument of CreateShader and
- * returned by the <params> parameter of GetShader{fi}vARB:
- */
- int GL_FRAGMENT_SHADER = 0x8B30;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv, and GetDoublev:
- */
- int GL_MAX_FRAGMENT_UNIFORM_COMPONENTS = 0x8B49;
-
- /**
- * Accepted by the <target> parameter of Hint and the <pname> parameter of
- * GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev:
- */
- int GL_FRAGMENT_SHADER_DERIVATIVE_HINT = 0x8B8B;
-
- // ----------------------------------------------------------------
- // ----------------------[ ARB_draw_buffers ]----------------------
- // ----------------------------------------------------------------
-
- /**
- * Accepted by the <pname> parameters of GetIntegerv, GetFloatv,
- * and GetDoublev:
- */
- int GL_MAX_DRAW_BUFFERS = 0x8824;
- int GL_DRAW_BUFFER0 = 0x8825;
- int GL_DRAW_BUFFER1 = 0x8826;
- int GL_DRAW_BUFFER2 = 0x8827;
- int GL_DRAW_BUFFER3 = 0x8828;
- int GL_DRAW_BUFFER4 = 0x8829;
- int GL_DRAW_BUFFER5 = 0x882A;
- int GL_DRAW_BUFFER6 = 0x882B;
- int GL_DRAW_BUFFER7 = 0x882C;
- int GL_DRAW_BUFFER8 = 0x882D;
- int GL_DRAW_BUFFER9 = 0x882E;
- int GL_DRAW_BUFFER10 = 0x882F;
- int GL_DRAW_BUFFER11 = 0x8830;
- int GL_DRAW_BUFFER12 = 0x8831;
- int GL_DRAW_BUFFER13 = 0x8832;
- int GL_DRAW_BUFFER14 = 0x8833;
- int GL_DRAW_BUFFER15 = 0x8834;
-
- void glDrawBuffers(@AutoSize("buffers") @GLsizei int size, @Const @GLenum IntBuffer buffers);
-
- @Alternate("glDrawBuffers")
- void glDrawBuffers(@Constant("1") @GLsizei int size, @Constant(value = "APIUtils.getBufferInt().put(0, buffer), 0", keepParam = true) int buffer);
-
- // ----------------------------------------------------------------
- // ----------------------[ ARB_point_sprite ]----------------------
- // ----------------------------------------------------------------
-
- /**
- * Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, by
- * the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
- * GetDoublev, and by the <target> parameter of TexEnvi, TexEnviv,
- * TexEnvf, TexEnvfv, GetTexEnviv, and GetTexEnvfv:
- */
- int GL_POINT_SPRITE = 0x8861;
-
- /**
- * When the <target> parameter of TexEnvf, TexEnvfv, TexEnvi, TexEnviv,
- * GetTexEnvfv, or GetTexEnviv is POINT_SPRITE, then the value of
- * <pname> may be:
- */
- int GL_COORD_REPLACE = 0x8862;
-
- /**
- * Accepted by the <pname> parameter of PointParameter{if}vARB, and the
- * <pname> of Get:
- */
- int GL_POINT_SPRITE_COORD_ORIGIN = 0x8CA0;
-
- /** Accepted by the <param> parameter of PointParameter{if}vARB: */
- int GL_LOWER_LEFT = 0x8CA1;
- int GL_UPPER_LEFT = 0x8CA2;
-
- // -----------------------------------------------------------------
- // ----------------------[ Two-Sided Stencil ]----------------------
- // -----------------------------------------------------------------
-
- int GL_STENCIL_BACK_FUNC = 0x8800;
- int GL_STENCIL_BACK_FAIL = 0x8801;
- int GL_STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802;
- int GL_STENCIL_BACK_PASS_DEPTH_PASS = 0x8803;
- int GL_STENCIL_BACK_REF = 0x8CA3;
- int GL_STENCIL_BACK_VALUE_MASK = 0x8CA4;
- int GL_STENCIL_BACK_WRITEMASK = 0x8CA5;
-
- void glStencilOpSeparate(@GLenum int face, @GLenum int sfail, @GLenum int dpfail, @GLenum int dppass);
-
- void glStencilFuncSeparate(@GLenum int face, @GLenum int func, int ref, @GLuint int mask);
-
- void glStencilMaskSeparate(@GLenum int face, @GLuint int mask);
-
- // -------------------------------------------------------------
- // ----------------------[ EXT_blend_equation_separate ]----------------------
- // -------------------------------------------------------------
-
- int GL_BLEND_EQUATION_RGB = 0x8009;
- int GL_BLEND_EQUATION_ALPHA = 0x883D;
-
- void glBlendEquationSeparate(@GLenum int modeRGB, @GLenum int modeAlpha);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+public interface GL20 {
+ // ------------------------------------------------------------------
+ // -------------------[ ARB_shading_language_100 ]-------------------
+ // ------------------------------------------------------------------
+
+ /** Accepted by the <name> parameter of GetString: */
+ int GL_SHADING_LANGUAGE_VERSION = 0x8B8C;
+
+ // ------------------------------------------------------------------
+ // ----------------------[ ARB_shader_objects ]----------------------
+ // ------------------------------------------------------------------
+
+ /** Accepted by the <pname> argument of GetInteger: */
+ int GL_CURRENT_PROGRAM = 0x8B8D;
+
+ /** Accepted by the <pname> parameter of GetObjectParameter{fi}vARB: */
+ int GL_SHADER_TYPE = 0x8B4F;
+ int GL_DELETE_STATUS = 0x8B80;
+ int GL_COMPILE_STATUS = 0x8B81;
+ int GL_LINK_STATUS = 0x8B82;
+ int GL_VALIDATE_STATUS = 0x8B83;
+ int GL_INFO_LOG_LENGTH = 0x8B84;
+ int GL_ATTACHED_SHADERS = 0x8B85;
+ int GL_ACTIVE_UNIFORMS = 0x8B86;
+ int GL_ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87;
+ int GL_ACTIVE_ATTRIBUTES = 0x8B89;
+ int GL_ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A;
+ int GL_SHADER_SOURCE_LENGTH = 0x8B88;
+
+ /** Returned by the <params> parameter of GetObjectParameter{fi}vARB: */
+ int GL_SHADER_OBJECT = 0x8B48;
+
+ /** Returned by the <type> parameter of GetActiveUniformARB: */
+ int GL_FLOAT_VEC2 = 0x8B50;
+ int GL_FLOAT_VEC3 = 0x8B51;
+ int GL_FLOAT_VEC4 = 0x8B52;
+ int GL_INT_VEC2 = 0x8B53;
+ int GL_INT_VEC3 = 0x8B54;
+ int GL_INT_VEC4 = 0x8B55;
+ int GL_BOOL = 0x8B56;
+ int GL_BOOL_VEC2 = 0x8B57;
+ int GL_BOOL_VEC3 = 0x8B58;
+ int GL_BOOL_VEC4 = 0x8B59;
+ int GL_FLOAT_MAT2 = 0x8B5A;
+ int GL_FLOAT_MAT3 = 0x8B5B;
+ int GL_FLOAT_MAT4 = 0x8B5C;
+ int GL_SAMPLER_1D = 0x8B5D;
+ int GL_SAMPLER_2D = 0x8B5E;
+ int GL_SAMPLER_3D = 0x8B5F;
+ int GL_SAMPLER_CUBE = 0x8B60;
+ int GL_SAMPLER_1D_SHADOW = 0x8B61;
+ int GL_SAMPLER_2D_SHADOW = 0x8B62;
+
+ /**
+ * The ARB_shader_objects extension allows multiple, optionally null-terminated, source strings to define a shader program.
+ * <p/>
+ * This method uses just a single string, that should NOT be null-terminated.
+ *
+ * @param shader
+ * @param string
+ */
+ void glShaderSource(@GLuint int shader, @Constant("1") @GLsizei int count,
+ @Indirect @Const @GLchar @Check ByteBuffer string,
+ @AutoSize("string") @Indirect @Const @GLint int length);
+
+ @Alternate("glShaderSource")
+ void glShaderSource2(@GLuint int shader, @Constant("1") @GLsizei int count, CharSequence string, @Constant("string.length()") @Indirect @Const int length);
+
+ @Alternate(value = "glShaderSource", nativeAlt = true)
+ void glShaderSource3(@GLuint int shader, @Constant("strings.length") @GLsizei int count,
+ @Const @StringList(value = "count", lengths = "length") CharSequence[] strings,
+ @Constant("APIUtils.getLengths(strings), 0") @Const IntBuffer length);
+
+ int glCreateShader(@GLuint int type);
+
+ boolean glIsShader(@GLuint int shader);
+
+ void glCompileShader(@GLuint int shader);
+
+ void glDeleteShader(@GLuint int shader);
+
+ int glCreateProgram();
+
+ boolean glIsProgram(int program);
+
+ void glAttachShader(@GLuint int program, @GLuint int shader);
+
+ void glDetachShader(@GLuint int program, @GLuint int shader);
+
+ void glLinkProgram(@GLuint int program);
+
+ void glUseProgram(@GLuint int program);
+
+ void glValidateProgram(@GLuint int program);
+
+ void glDeleteProgram(@GLuint int program);
+
+ void glUniform1f(int location, float v0);
+
+ void glUniform2f(int location, float v0, float v1);
+
+ void glUniform3f(int location, float v0, float v1, float v2);
+
+ void glUniform4f(int location, float v0, float v1, float v2, float v3);
+
+ void glUniform1i(int location, int v0);
+
+ void glUniform2i(int location, int v0, int v1);
+
+ void glUniform3i(int location, int v0, int v1, int v2);
+
+ void glUniform4i(int location, int v0, int v1, int v2, int v3);
+
+ @StripPostfix("values")
+ void glUniform1fv(int location, @AutoSize("values") @GLsizei int count, @Const FloatBuffer values);
+
+ @StripPostfix("values")
+ void glUniform2fv(int location, @AutoSize(value = "values", expression = " >> 1") @GLsizei int count, @Const FloatBuffer values);
+
+ @StripPostfix("values")
+ void glUniform3fv(int location, @AutoSize(value = "values", expression = " / 3") @GLsizei int count, @Const FloatBuffer values);
+
+ @StripPostfix("values")
+ void glUniform4fv(int location, @AutoSize(value = "values", expression = " >> 2") @GLsizei int count, @Const FloatBuffer values);
+
+ @StripPostfix("values")
+ void glUniform1iv(int location, @AutoSize("values") @GLsizei int count, @Const IntBuffer values);
+
+ @StripPostfix("values")
+ void glUniform2iv(int location, @AutoSize(value = "values", expression = " >> 1") @GLsizei int count, @Const IntBuffer values);
+
+ @StripPostfix("values")
+ void glUniform3iv(int location, @AutoSize(value = "values", expression = " / 3") @GLsizei int count, @Const IntBuffer values);
+
+ @StripPostfix("values")
+ void glUniform4iv(int location, @AutoSize(value = "values", expression = " >> 2") @GLsizei int count, @Const IntBuffer values);
+
+ @StripPostfix("matrices")
+ void glUniformMatrix2fv(int location, @AutoSize(value = "matrices", expression = " >> 2") @GLsizei int count,
+ boolean transpose, @Const FloatBuffer matrices);
+
+ @StripPostfix("matrices")
+ void glUniformMatrix3fv(int location, @AutoSize(value = "matrices", expression = " / (3 * 3)") @GLsizei int count,
+ boolean transpose, @Const FloatBuffer matrices);
+
+ @StripPostfix("matrices")
+ void glUniformMatrix4fv(int location, @AutoSize(value = "matrices", expression = " >> 4") @GLsizei int count,
+ boolean transpose, @Const FloatBuffer matrices);
+
+ @StripPostfix("params")
+ void glGetShaderiv(@GLuint int shader, @GLenum int pname, @OutParameter @Check IntBuffer params);
+
+ @Alternate("glGetShaderiv")
+ @GLreturn("params")
+ @StripPostfix("params")
+ void glGetShaderiv2(@GLuint int shader, @GLenum int pname, @OutParameter IntBuffer params);
+
+ @StripPostfix("params")
+ void glGetProgramiv(@GLuint int program, @GLenum int pname, @OutParameter @Check IntBuffer params);
+
+ @Alternate("glGetProgramiv")
+ @GLreturn("params")
+ @StripPostfix("params")
+ void glGetProgramiv2(@GLuint int program, @GLenum int pname, @OutParameter IntBuffer params);
+
+ void glGetShaderInfoLog(@GLuint int shader, @AutoSize("infoLog") @GLsizei int maxLength,
+ @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
+ @OutParameter @GLchar ByteBuffer infoLog);
+
+ @Alternate("glGetShaderInfoLog")
+ @GLreturn(value = "infoLog", maxLength = "maxLength")
+ void glGetShaderInfoLog2(@GLuint int shader, @GLsizei int maxLength,
+ @OutParameter @GLsizei @Constant("infoLog_length, 0") IntBuffer length,
+ @OutParameter @GLchar ByteBuffer infoLog);
+
+ void glGetProgramInfoLog(@GLuint int program, @AutoSize("infoLog") @GLsizei int maxLength,
+ @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
+ @OutParameter @GLchar ByteBuffer infoLog);
+
+ @Alternate("glGetProgramInfoLog")
+ @GLreturn(value = "infoLog", maxLength = "maxLength")
+ void glGetProgramInfoLog2(@GLuint int program, @GLsizei int maxLength,
+ @OutParameter @GLsizei @Constant("infoLog_length, 0") IntBuffer length,
+ @OutParameter @GLchar ByteBuffer infoLog);
+
+ void glGetAttachedShaders(@GLuint int program, @AutoSize("shaders") @GLsizei int maxCount,
+ @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer count,
+ @OutParameter @GLuint IntBuffer shaders);
+
+ /**
+ * Returns the location of the uniform with the specified name. The ByteBuffer should contain the uniform name as a
+ * <b>null-terminated</b> string.
+ *
+ * @param program
+ * @param name
+ */
+ int glGetUniformLocation(@GLuint int program, @NullTerminated @Check("1") @Const @GLchar ByteBuffer name);
+
+ @Alternate("glGetUniformLocation")
+ int glGetUniformLocation(@GLuint int program, @NullTerminated CharSequence name);
+
+ void glGetActiveUniform(@GLuint int program, @GLuint int index, @AutoSize("name") @GLsizei int maxLength,
+ @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
+ @OutParameter @GLsizei @Check("1") IntBuffer size,
+ @OutParameter @GLenum @Check("1") IntBuffer type,
+ @OutParameter @GLchar ByteBuffer name);
+
+ /** Overloads glGetActiveUniform. This version returns both size and type in the sizeType buffer (at .position() and .position() + 1). */
+ @Alternate("glGetActiveUniform")
+ @GLreturn(value = "name", maxLength = "maxLength")
+ void glGetActiveUniform2(@GLuint int program, @GLuint int index, @GLsizei int maxLength,
+ @OutParameter @GLsizei @Constant("name_length, 0") IntBuffer length,
+ @OutParameter @Check("2") IntBuffer sizeType,
+ @OutParameter @GLenum @Constant("sizeType, sizeType.position() + 1") IntBuffer type,
+ @OutParameter @GLchar ByteBuffer name);
+
+ /** Overloads glGetActiveUniformARB. This version returns only the uniform name. */
+ @Alternate(value = "glGetActiveUniform", javaAlt = true)
+ @GLreturn(value = "name", maxLength = "maxLength")
+ void glGetActiveUniform(@GLuint int program, @GLuint int index, @GLsizei int maxLength,
+ @OutParameter @GLsizei @Constant("name_length, 0, APIUtils.getBufferInt(), 0, APIUtils.getBufferInt(), 1") IntBuffer length,
+ @OutParameter @GLchar ByteBuffer name);
+
+ /** Overloads glGetActiveUniform. This version returns only the uniform size. */
+ @Alternate(value = "glGetActiveUniform", javaAlt = true)
+ @GLreturn(value = "size")
+ void glGetActiveUniformSize(@GLuint int program, @GLuint int index, @Constant("0") @GLsizei int maxLength,
+ @OutParameter @GLsizei @Constant("null, 0") IntBuffer length,
+ @OutParameter IntBuffer size,
+ @OutParameter @GLenum @Constant("size, 1") IntBuffer type, // Reuse size buffer and ignore
+ @OutParameter @GLchar @Constant("APIUtils.getBufferByte(0), 0") ByteBuffer name);
+
+ /** Overloads glGetActiveUniform. This version returns only the uniform type. */
+ @Alternate(value = "glGetActiveUniform", javaAlt = true)
+ @GLreturn(value = "type")
+ void glGetActiveUniformType(@GLuint int program, @GLuint int index, @Constant("0") @GLsizei int maxLength,
+ @OutParameter @GLsizei @Constant("null, 0") IntBuffer length,
+ @OutParameter @Constant("type, 1") IntBuffer size, // Reuse type buffer and ignore
+ @OutParameter @GLenum IntBuffer type,
+ @OutParameter @GLchar @Constant("APIUtils.getBufferByte(0), 0") ByteBuffer name);
+
+ @StripPostfix("params")
+ void glGetUniformfv(@GLuint int program, int location, @OutParameter @Check FloatBuffer params);
+
+ @StripPostfix("params")
+ void glGetUniformiv(@GLuint int program, int location, @OutParameter @Check IntBuffer params);
+
+ void glGetShaderSource(@GLuint int shader, @AutoSize("source") @GLsizei int maxLength,
+ @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
+ @OutParameter @GLchar ByteBuffer source);
+
+ @Alternate("glGetShaderSource")
+ @GLreturn(value = "source", maxLength = "maxLength")
+ void glGetShaderSource2(@GLuint int shader, @GLsizei int maxLength,
+ @OutParameter @GLsizei @Constant("source_length, 0") IntBuffer length,
+ @OutParameter @GLchar ByteBuffer source);
+
+ // ------------------------------------------------------------------
+ // ----------------------[ ARB_vertex_program ]----------------------
+ // ------------------------------------------------------------------
+
+ @NoErrorCheck
+ void glVertexAttrib1s(@GLuint int index, short x);
+
+ @NoErrorCheck
+ void glVertexAttrib1f(@GLuint int index, float x);
+
+ @NoErrorCheck
+ void glVertexAttrib1d(@GLuint int index, double x);
+
+ @NoErrorCheck
+ void glVertexAttrib2s(@GLuint int index, short x, short y);
+
+ @NoErrorCheck
+ void glVertexAttrib2f(@GLuint int index, float x, float y);
+
+ @NoErrorCheck
+ void glVertexAttrib2d(@GLuint int index, double x, double y);
+
+ @NoErrorCheck
+ void glVertexAttrib3s(@GLuint int index, short x, short y, short z);
+
+ @NoErrorCheck
+ void glVertexAttrib3f(@GLuint int index, float x, float y, float z);
+
+ @NoErrorCheck
+ void glVertexAttrib3d(@GLuint int index, double x, double y, double z);
+
+ @NoErrorCheck
+ void glVertexAttrib4s(@GLuint int index, short x, short y, short z, short w);
+
+ @NoErrorCheck
+ void glVertexAttrib4f(@GLuint int index, float x, float y, float z, float w);
+
+ @NoErrorCheck
+ void glVertexAttrib4d(@GLuint int index, double x, double y, double z, double w);
+
+ @NoErrorCheck
+ void glVertexAttrib4Nub(@GLuint int index, @GLubyte byte x, @GLubyte byte y, @GLubyte byte z, @GLubyte byte w);
+
+ void glVertexAttribPointer(@GLuint int index, int size, @AutoType("buffer") @GLenum int type, boolean normalized, @GLsizei int stride,
+ @CachedReference(index = "index", name = "glVertexAttribPointer_buffer")
+ @BufferObject(BufferKind.ArrayVBO)
+ @Check
+ @Const
+ @GLubyte
+ @GLbyte
+ @GLshort
+ @GLushort
+ @GLint
+ @GLuint
+ @GLfloat
+ @GLdouble Buffer buffer);
+
+ void glEnableVertexAttribArray(@GLuint int index);
+
+ void glDisableVertexAttribArray(@GLuint int index);
+
+ @StripPostfix("params")
+ void glGetVertexAttribfv(@GLuint int index, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
+
+ @StripPostfix("params")
+ void glGetVertexAttribdv(@GLuint int index, @GLenum int pname, @OutParameter @Check("4") DoubleBuffer params);
+
+ @StripPostfix("params")
+ void glGetVertexAttribiv(@GLuint int index, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
+
+ @StripPostfix("pointer")
+ void glGetVertexAttribPointerv(@GLuint int index, @GLenum int pname, @Result @GLvoid ByteBuffer pointer);
+
+ // -----------------------------------------------------------------
+ // ----------------------[ ARB_vertex_shader ]----------------------
+ // -----------------------------------------------------------------
+
+ /**
+ * Accepted by the <shaderType> argument of CreateShader and
+ * returned by the <params> parameter of GetShader{if}v:
+ */
+ int GL_VERTEX_SHADER = 0x8B31;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, and GetDoublev:
+ */
+ int GL_MAX_VERTEX_UNIFORM_COMPONENTS = 0x8B4A;
+ int GL_MAX_VARYING_FLOATS = 0x8B4B;
+ int GL_MAX_VERTEX_ATTRIBS = 0x8869;
+ int GL_MAX_TEXTURE_IMAGE_UNITS = 0x8872;
+ int GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C;
+ int GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D;
+ int GL_MAX_TEXTURE_COORDS = 0x8871;
+
+ /**
+ * Accepted by the <cap> parameter of Disable, Enable, and IsEnabled, and
+ * by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
+ * GetDoublev:
+ */
+ int GL_VERTEX_PROGRAM_POINT_SIZE = 0x8642;
+ int GL_VERTEX_PROGRAM_TWO_SIDE = 0x8643;
+
+ /** Accepted by the <pname> parameter of GetVertexAttrib{dfi}vARB: */
+ int GL_VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622;
+ int GL_VERTEX_ATTRIB_ARRAY_SIZE = 0x8623;
+ int GL_VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624;
+ int GL_VERTEX_ATTRIB_ARRAY_TYPE = 0x8625;
+ int GL_VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A;
+ int GL_CURRENT_VERTEX_ATTRIB = 0x8626;
+
+ /** Accepted by the <pname> parameter of GetVertexAttribPointervARB: */
+ int GL_VERTEX_ATTRIB_ARRAY_POINTER = 0x8645;
+
+ void glBindAttribLocation(@GLuint int program, @GLuint int index, @NullTerminated @Const @GLchar ByteBuffer name);
+
+ @Alternate("glBindAttribLocation")
+ void glBindAttribLocation(@GLuint int program, @GLuint int index, @NullTerminated CharSequence name);
+
+ void glGetActiveAttrib(@GLuint int program, @GLuint int index, @AutoSize("name") @GLsizei int maxLength,
+ @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
+ @OutParameter @Check("1") IntBuffer size,
+ @OutParameter @GLenum @Check("1") IntBuffer type,
+ @OutParameter @GLchar ByteBuffer name);
+
+ /** Overloads glGetActiveAttrib. This version returns both size and type in the sizeType buffer (at .position() and .position() + 1). */
+ @Alternate("glGetActiveAttrib")
+ @GLreturn(value = "name", maxLength = "maxLength")
+ void glGetActiveAttrib2(@GLuint int program, @GLuint int index, @GLsizei int maxLength,
+ @OutParameter @GLsizei @Constant("name_length, 0") IntBuffer length,
+ @OutParameter @Check("2") IntBuffer sizeType,
+ @OutParameter @GLenum @Constant("sizeType, sizeType.position() + 1") IntBuffer type,
+ @OutParameter @GLchar ByteBuffer name);
+
+ /** Overloads glGetActiveAttrib. This version returns only the attrib name. */
+ @Alternate(value = "glGetActiveAttrib", javaAlt = true)
+ @GLreturn(value = "name", maxLength = "maxLength")
+ void glGetActiveAttrib(@GLuint int program, @GLuint int index, @GLsizei int maxLength,
+ @OutParameter @GLsizei @Constant("name_length, 0, APIUtils.getBufferInt(), 0, APIUtils.getBufferInt(), 1") IntBuffer length,
+ @OutParameter @GLchar ByteBuffer name);
+
+ /** Overloads glGetActiveAttribARB. This version returns only the attrib size. */
+ @Alternate(value = "glGetActiveAttrib", javaAlt = true)
+ @GLreturn(value = "size")
+ void glGetActiveAttribSize(@GLuint int program, @GLuint int index, @Constant("0") @GLsizei int maxLength,
+ @OutParameter @GLsizei @Constant("null, 0") IntBuffer length,
+ @OutParameter IntBuffer size,
+ @OutParameter @GLenum @Constant("size, 1") IntBuffer type, // Reuse size buffer and ignore
+ @OutParameter @GLchar @Constant("APIUtils.getBufferByte(0), 0") ByteBuffer name);
+
+ /** Overloads glGetActiveAttrib. This version returns only the attrib type. */
+ @Alternate(value = "glGetActiveAttrib", javaAlt = true)
+ @GLreturn(value = "type")
+ void glGetActiveAttribType(@GLuint int program, @GLuint int index, @Constant("0") @GLsizei int maxLength,
+ @OutParameter @GLsizei @Constant("null, 0") IntBuffer length,
+ @OutParameter @Constant("type, 1") IntBuffer size, // Reuse type buffer and ignore
+ @OutParameter @GLenum IntBuffer type,
+ @OutParameter @GLchar @Constant("APIUtils.getBufferByte(0), 0") ByteBuffer name);
+
+ int glGetAttribLocation(@GLuint int program, @NullTerminated @Const @GLchar ByteBuffer name);
+
+ @Alternate("glGetAttribLocation")
+ int glGetAttribLocation(@GLuint int program, @NullTerminated CharSequence name);
+
+ // -------------------------------------------------------------------
+ // ----------------------[ ARB_fragment_shader ]----------------------
+ // -------------------------------------------------------------------
+
+ /**
+ * Accepted by the <shaderType> argument of CreateShader and
+ * returned by the <params> parameter of GetShader{fi}vARB:
+ */
+ int GL_FRAGMENT_SHADER = 0x8B30;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, and GetDoublev:
+ */
+ int GL_MAX_FRAGMENT_UNIFORM_COMPONENTS = 0x8B49;
+
+ /**
+ * Accepted by the <target> parameter of Hint and the <pname> parameter of
+ * GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev:
+ */
+ int GL_FRAGMENT_SHADER_DERIVATIVE_HINT = 0x8B8B;
+
+ // ----------------------------------------------------------------
+ // ----------------------[ ARB_draw_buffers ]----------------------
+ // ----------------------------------------------------------------
+
+ /**
+ * Accepted by the <pname> parameters of GetIntegerv, GetFloatv,
+ * and GetDoublev:
+ */
+ int GL_MAX_DRAW_BUFFERS = 0x8824;
+ int GL_DRAW_BUFFER0 = 0x8825;
+ int GL_DRAW_BUFFER1 = 0x8826;
+ int GL_DRAW_BUFFER2 = 0x8827;
+ int GL_DRAW_BUFFER3 = 0x8828;
+ int GL_DRAW_BUFFER4 = 0x8829;
+ int GL_DRAW_BUFFER5 = 0x882A;
+ int GL_DRAW_BUFFER6 = 0x882B;
+ int GL_DRAW_BUFFER7 = 0x882C;
+ int GL_DRAW_BUFFER8 = 0x882D;
+ int GL_DRAW_BUFFER9 = 0x882E;
+ int GL_DRAW_BUFFER10 = 0x882F;
+ int GL_DRAW_BUFFER11 = 0x8830;
+ int GL_DRAW_BUFFER12 = 0x8831;
+ int GL_DRAW_BUFFER13 = 0x8832;
+ int GL_DRAW_BUFFER14 = 0x8833;
+ int GL_DRAW_BUFFER15 = 0x8834;
+
+ void glDrawBuffers(@AutoSize("buffers") @GLsizei int size, @Const @GLenum IntBuffer buffers);
+
+ @Alternate("glDrawBuffers")
+ void glDrawBuffers(@Constant("1") @GLsizei int size, @Constant(value = "APIUtils.getBufferInt().put(0, buffer), 0", keepParam = true) int buffer);
+
+ // ----------------------------------------------------------------
+ // ----------------------[ ARB_point_sprite ]----------------------
+ // ----------------------------------------------------------------
+
+ /**
+ * Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, by
+ * the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
+ * GetDoublev, and by the <target> parameter of TexEnvi, TexEnviv,
+ * TexEnvf, TexEnvfv, GetTexEnviv, and GetTexEnvfv:
+ */
+ int GL_POINT_SPRITE = 0x8861;
+
+ /**
+ * When the <target> parameter of TexEnvf, TexEnvfv, TexEnvi, TexEnviv,
+ * GetTexEnvfv, or GetTexEnviv is POINT_SPRITE, then the value of
+ * <pname> may be:
+ */
+ int GL_COORD_REPLACE = 0x8862;
+
+ /**
+ * Accepted by the <pname> parameter of PointParameter{if}vARB, and the
+ * <pname> of Get:
+ */
+ int GL_POINT_SPRITE_COORD_ORIGIN = 0x8CA0;
+
+ /** Accepted by the <param> parameter of PointParameter{if}vARB: */
+ int GL_LOWER_LEFT = 0x8CA1;
+ int GL_UPPER_LEFT = 0x8CA2;
+
+ // -----------------------------------------------------------------
+ // ----------------------[ Two-Sided Stencil ]----------------------
+ // -----------------------------------------------------------------
+
+ int GL_STENCIL_BACK_FUNC = 0x8800;
+ int GL_STENCIL_BACK_FAIL = 0x8801;
+ int GL_STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802;
+ int GL_STENCIL_BACK_PASS_DEPTH_PASS = 0x8803;
+ int GL_STENCIL_BACK_REF = 0x8CA3;
+ int GL_STENCIL_BACK_VALUE_MASK = 0x8CA4;
+ int GL_STENCIL_BACK_WRITEMASK = 0x8CA5;
+
+ void glStencilOpSeparate(@GLenum int face, @GLenum int sfail, @GLenum int dpfail, @GLenum int dppass);
+
+ void glStencilFuncSeparate(@GLenum int face, @GLenum int func, int ref, @GLuint int mask);
+
+ void glStencilMaskSeparate(@GLenum int face, @GLuint int mask);
+
+ // -------------------------------------------------------------
+ // ----------------------[ EXT_blend_equation_separate ]----------------------
+ // -------------------------------------------------------------
+
+ int GL_BLEND_EQUATION_RGB = 0x8009;
+ int GL_BLEND_EQUATION_ALPHA = 0x883D;
+
+ void glBlendEquationSeparate(@GLenum int modeRGB, @GLenum int modeAlpha);
+}
diff --git a/src/templates/org/lwjgl/opengl/GL21.java b/src/templates/org/lwjgl/opengl/GL21.java
index 5c84559..aea6179 100644
--- a/src/templates/org/lwjgl/opengl/GL21.java
+++ b/src/templates/org/lwjgl/opengl/GL21.java
@@ -1,125 +1,125 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.AutoSize;
-import org.lwjgl.util.generator.GLsizei;
-import org.lwjgl.util.generator.StripPostfix;
-
-import java.nio.FloatBuffer;
-
-public interface GL21 {
-
- // ------------------------------------------------------------------
- // --------------------------[ GLSL 1.20 ]---------------------------
- // ------------------------------------------------------------------
-
- /** Returned by the <type> parameter of GetActiveAttribARB. */
- int GL_FLOAT_MAT2x3 = 0x8B65;
- int GL_FLOAT_MAT2x4 = 0x8B66;
- int GL_FLOAT_MAT3x2 = 0x8B67;
- int GL_FLOAT_MAT3x4 = 0x8B68;
- int GL_FLOAT_MAT4x2 = 0x8B69;
- int GL_FLOAT_MAT4x3 = 0x8B6A;
-
- @StripPostfix("matrices")
- void glUniformMatrix2x3fv(int location, @AutoSize(value = "matrices", expression = " / (2 * 3)") @GLsizei int count,
- boolean transpose, FloatBuffer matrices);
-
- @StripPostfix("matrices")
- void glUniformMatrix3x2fv(int location, @AutoSize(value = "matrices", expression = " / (3 * 2)") @GLsizei int count,
- boolean transpose, FloatBuffer matrices);
-
- @StripPostfix("matrices")
- void glUniformMatrix2x4fv(int location, @AutoSize(value = "matrices", expression = " >> 3") @GLsizei int count,
- boolean transpose, FloatBuffer matrices);
-
- @StripPostfix("matrices")
- void glUniformMatrix4x2fv(int location, @AutoSize(value = "matrices", expression = " >> 3") @GLsizei int count,
- boolean transpose, FloatBuffer matrices);
-
- @StripPostfix("matrices")
- void glUniformMatrix3x4fv(int location, @AutoSize(value = "matrices", expression = " / (3 * 4)") @GLsizei int count,
- boolean transpose, FloatBuffer matrices);
-
- @StripPostfix("matrices")
- void glUniformMatrix4x3fv(int location, @AutoSize(value = "matrices", expression = " / (4 * 3)") @GLsizei int count,
- boolean transpose, FloatBuffer matrices);
-
- // ------------------------------------------------------------------
- // -------------------[ ARB_pixel_buffer_object ]--------------------
- // ------------------------------------------------------------------
-
- /**
- * Accepted by the <target> parameters of BindBuffer, BufferData,
- * BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData,
- * GetBufferParameteriv, and GetBufferPointerv.
- */
- int GL_PIXEL_PACK_BUFFER = 0x88EB;
- int GL_PIXEL_UNPACK_BUFFER = 0x88EC;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv, and GetDoublev.
- */
- int GL_PIXEL_PACK_BUFFER_BINDING = 0x88ED;
- int GL_PIXEL_UNPACK_BUFFER_BINDING = 0x88EF;
-
- // ------------------------------------------------------------------
- // ----------------------[ EXT_texture_sRGB ]------------------------
- // ------------------------------------------------------------------
-
- /**
- * Accepted by the <internalformat> parameter of TexImage1D, TexImage2D,
- * TexImage3D, CopyTexImage1D, CopyTexImage2D.
- */
- int GL_SRGB = 0x8C40;
- int GL_SRGB8 = 0x8C41;
- int GL_SRGB_ALPHA = 0x8C42;
- int GL_SRGB8_ALPHA8 = 0x8C43;
- int GL_SLUMINANCE_ALPHA = 0x8C44;
- int GL_SLUMINANCE8_ALPHA8 = 0x8C45;
- int GL_SLUMINANCE = 0x8C46;
- int GL_SLUMINANCE8 = 0x8C47;
- int GL_COMPRESSED_SRGB = 0x8C48;
- int GL_COMPRESSED_SRGB_ALPHA = 0x8C49;
- int GL_COMPRESSED_SLUMINANCE = 0x8C4A;
- int GL_COMPRESSED_SLUMINANCE_ALPHA = 0x8C4B;
-
- // ------------------------------------------------------------------
- // -----------------------[ Misc additions ]-------------------------
- // ------------------------------------------------------------------
-
- /** Accepted by the <pname> parameter of GetIntegerv and GetFloatv. */
- int GL_CURRENT_RASTER_SECONDARY_COLOR = 0x845F;
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.AutoSize;
+import org.lwjgl.util.generator.GLsizei;
+import org.lwjgl.util.generator.StripPostfix;
+
+import java.nio.FloatBuffer;
+
+public interface GL21 {
+
+ // ------------------------------------------------------------------
+ // --------------------------[ GLSL 1.20 ]---------------------------
+ // ------------------------------------------------------------------
+
+ /** Returned by the <type> parameter of GetActiveAttribARB. */
+ int GL_FLOAT_MAT2x3 = 0x8B65;
+ int GL_FLOAT_MAT2x4 = 0x8B66;
+ int GL_FLOAT_MAT3x2 = 0x8B67;
+ int GL_FLOAT_MAT3x4 = 0x8B68;
+ int GL_FLOAT_MAT4x2 = 0x8B69;
+ int GL_FLOAT_MAT4x3 = 0x8B6A;
+
+ @StripPostfix("matrices")
+ void glUniformMatrix2x3fv(int location, @AutoSize(value = "matrices", expression = " / (2 * 3)") @GLsizei int count,
+ boolean transpose, FloatBuffer matrices);
+
+ @StripPostfix("matrices")
+ void glUniformMatrix3x2fv(int location, @AutoSize(value = "matrices", expression = " / (3 * 2)") @GLsizei int count,
+ boolean transpose, FloatBuffer matrices);
+
+ @StripPostfix("matrices")
+ void glUniformMatrix2x4fv(int location, @AutoSize(value = "matrices", expression = " >> 3") @GLsizei int count,
+ boolean transpose, FloatBuffer matrices);
+
+ @StripPostfix("matrices")
+ void glUniformMatrix4x2fv(int location, @AutoSize(value = "matrices", expression = " >> 3") @GLsizei int count,
+ boolean transpose, FloatBuffer matrices);
+
+ @StripPostfix("matrices")
+ void glUniformMatrix3x4fv(int location, @AutoSize(value = "matrices", expression = " / (3 * 4)") @GLsizei int count,
+ boolean transpose, FloatBuffer matrices);
+
+ @StripPostfix("matrices")
+ void glUniformMatrix4x3fv(int location, @AutoSize(value = "matrices", expression = " / (4 * 3)") @GLsizei int count,
+ boolean transpose, FloatBuffer matrices);
+
+ // ------------------------------------------------------------------
+ // -------------------[ ARB_pixel_buffer_object ]--------------------
+ // ------------------------------------------------------------------
+
+ /**
+ * Accepted by the <target> parameters of BindBuffer, BufferData,
+ * BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData,
+ * GetBufferParameteriv, and GetBufferPointerv.
+ */
+ int GL_PIXEL_PACK_BUFFER = 0x88EB;
+ int GL_PIXEL_UNPACK_BUFFER = 0x88EC;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, and GetDoublev.
+ */
+ int GL_PIXEL_PACK_BUFFER_BINDING = 0x88ED;
+ int GL_PIXEL_UNPACK_BUFFER_BINDING = 0x88EF;
+
+ // ------------------------------------------------------------------
+ // ----------------------[ EXT_texture_sRGB ]------------------------
+ // ------------------------------------------------------------------
+
+ /**
+ * Accepted by the <internalformat> parameter of TexImage1D, TexImage2D,
+ * TexImage3D, CopyTexImage1D, CopyTexImage2D.
+ */
+ int GL_SRGB = 0x8C40;
+ int GL_SRGB8 = 0x8C41;
+ int GL_SRGB_ALPHA = 0x8C42;
+ int GL_SRGB8_ALPHA8 = 0x8C43;
+ int GL_SLUMINANCE_ALPHA = 0x8C44;
+ int GL_SLUMINANCE8_ALPHA8 = 0x8C45;
+ int GL_SLUMINANCE = 0x8C46;
+ int GL_SLUMINANCE8 = 0x8C47;
+ int GL_COMPRESSED_SRGB = 0x8C48;
+ int GL_COMPRESSED_SRGB_ALPHA = 0x8C49;
+ int GL_COMPRESSED_SLUMINANCE = 0x8C4A;
+ int GL_COMPRESSED_SLUMINANCE_ALPHA = 0x8C4B;
+
+ // ------------------------------------------------------------------
+ // -----------------------[ Misc additions ]-------------------------
+ // ------------------------------------------------------------------
+
+ /** Accepted by the <pname> parameter of GetIntegerv and GetFloatv. */
+ int GL_CURRENT_RASTER_SECONDARY_COLOR = 0x845F;
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/GL30.java b/src/templates/org/lwjgl/opengl/GL30.java
index 2835b30..f75bd1e 100644
--- a/src/templates/org/lwjgl/opengl/GL30.java
+++ b/src/templates/org/lwjgl/opengl/GL30.java
@@ -1,1036 +1,1036 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-public interface GL30 {
-
- // ----------------------------------------------------------
- // ----------------------[ OpenGL 3.0 ]----------------------
- // ----------------------------------------------------------
-
- int GL_MAJOR_VERSION = 0x821B;
- int GL_MINOR_VERSION = 0x821C;
- int GL_NUM_EXTENSIONS = 0x821D;
-
- int GL_CONTEXT_FLAGS = 0x821E;
- int GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT = 0x0001;
-
- int GL_DEPTH_BUFFER = 0x8223;
- int GL_STENCIL_BUFFER = 0x8224;
-
- int GL_COMPRESSED_RED = 0x8225;
- int GL_COMPRESSED_RG = 0x8226;
-
- int GL_COMPARE_REF_TO_TEXTURE = ARB_shadow.GL_COMPARE_R_TO_TEXTURE_ARB;
-
- int GL_CLIP_DISTANCE0 = GL11.GL_CLIP_PLANE0;
- int GL_CLIP_DISTANCE1 = GL11.GL_CLIP_PLANE1;
- int GL_CLIP_DISTANCE2 = GL11.GL_CLIP_PLANE2;
- int GL_CLIP_DISTANCE3 = GL11.GL_CLIP_PLANE3;
- int GL_CLIP_DISTANCE4 = GL11.GL_CLIP_PLANE4;
- int GL_CLIP_DISTANCE5 = GL11.GL_CLIP_PLANE5;
- int GL_CLIP_DISTANCE6 = 0x3006;
- int GL_CLIP_DISTANCE7 = 0x3007;
-
- int GL_MAX_CLIP_DISTANCES = GL11.GL_MAX_CLIP_PLANES;
-
- int GL_MAX_VARYING_COMPONENTS = GL20.GL_MAX_VARYING_FLOATS;
-
- int GL_BUFFER_ACCESS_FLAGS = 0x911F;
- int GL_BUFFER_MAP_LENGTH = 0x9120;
- int GL_BUFFER_MAP_OFFSET = 0x9121;
-
- String glGetStringi(@GLenum int name, @GLuint int index);
-
- @StripPostfix("value")
- void glClearBufferfv(@GLenum int buffer, int drawbuffer, @Const @Check("4") FloatBuffer value);
-
- @StripPostfix("value")
- void glClearBufferiv(@GLenum int buffer, int drawbuffer, @Const @Check("4") IntBuffer value);
-
- @StripPostfix("value")
- void glClearBufferuiv(@GLenum int buffer, int drawbuffer, @Const @Check("4") IntBuffer value);
-
- void glClearBufferfi(@GLenum int buffer, int drawbuffer, float depth, int stencil);
-
- // ---------------------------------------------------------------
- // ----------------------[ EXT_gpu_shader4 ]----------------------
- // ---------------------------------------------------------------
-
- /**
- * Accepted by the <pname> parameters of GetVertexAttribdv,
- * GetVertexAttribfv, GetVertexAttribiv, GetVertexAttribIiv, and
- * GetVertexAttribIuiv:
- */
- int GL_VERTEX_ATTRIB_ARRAY_INTEGER = 0x88FD;
-
- /** Returned by the <type> parameter of GetActiveUniform: */
-
- int GL_SAMPLER_BUFFER = 0x8DC2;
- int GL_SAMPLER_CUBE_SHADOW = 0x8DC5;
- int GL_UNSIGNED_INT_VEC2 = 0x8DC6;
- int GL_UNSIGNED_INT_VEC3 = 0x8DC7;
- int GL_UNSIGNED_INT_VEC4 = 0x8DC8;
- int GL_INT_SAMPLER_1D = 0x8DC9;
- int GL_INT_SAMPLER_2D = 0x8DCA;
- int GL_INT_SAMPLER_3D = 0x8DCB;
- int GL_INT_SAMPLER_CUBE = 0x8DCC;
- int GL_INT_SAMPLER_2D_RECT = 0x8DCD;
- int GL_INT_SAMPLER_1D_ARRAY = 0x8DCE;
- int GL_INT_SAMPLER_2D_ARRAY = 0x8DCF;
- int GL_INT_SAMPLER_BUFFER = 0x8DD0;
-
- int GL_UNSIGNED_INT_SAMPLER_1D = 0x8DD1;
- int GL_UNSIGNED_INT_SAMPLER_2D = 0x8DD2;
- int GL_UNSIGNED_INT_SAMPLER_3D = 0x8DD3;
- int GL_UNSIGNED_INT_SAMPLER_CUBE = 0x8DD4;
- int GL_UNSIGNED_INT_SAMPLER_2D_RECT = 0x8DD5;
- int GL_UNSIGNED_INT_SAMPLER_1D_ARRAY = 0x8DD6;
- int GL_UNSIGNED_INT_SAMPLER_2D_ARRAY = 0x8DD7;
- int GL_UNSIGNED_INT_SAMPLER_BUFFER = 0x8DD8;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
- * and GetDoublev:
- */
- int GL_MIN_PROGRAM_TEXEL_OFFSET = 0x8904;
- int GL_MAX_PROGRAM_TEXEL_OFFSET = 0x8905;
-
- @NoErrorCheck
- void glVertexAttribI1i(@GLuint int index, int x);
-
- @NoErrorCheck
- void glVertexAttribI2i(@GLuint int index, int x, int y);
-
- @NoErrorCheck
- void glVertexAttribI3i(@GLuint int index, int x, int y, int z);
-
- @NoErrorCheck
- void glVertexAttribI4i(@GLuint int index, int x, int y, int z, int w);
-
- @NoErrorCheck
- void glVertexAttribI1ui(@GLuint int index, @GLuint int x);
-
- @NoErrorCheck
- void glVertexAttribI2ui(@GLuint int index, @GLuint int x, @GLuint int y);
-
- @NoErrorCheck
- void glVertexAttribI3ui(@GLuint int index, @GLuint int x, @GLuint int y, @GLuint int z);
-
- @NoErrorCheck
- void glVertexAttribI4ui(@GLuint int index, @GLuint int x, @GLuint int y, @GLuint int z, @GLuint int w);
-
- @NoErrorCheck
- @StripPostfix("v")
- void glVertexAttribI1iv(@GLuint int index, @Check("1") @Const IntBuffer v);
-
- @NoErrorCheck
- @StripPostfix("v")
- void glVertexAttribI2iv(@GLuint int index, @Check("2") @Const IntBuffer v);
-
- @NoErrorCheck
- @StripPostfix("v")
- void glVertexAttribI3iv(@GLuint int index, @Check("3") @Const IntBuffer v);
-
- @NoErrorCheck
- @StripPostfix("v")
- void glVertexAttribI4iv(@GLuint int index, @Check("4") @Const IntBuffer v);
-
- @NoErrorCheck
- @StripPostfix("v")
- void glVertexAttribI1uiv(@GLuint int index, @Check("1") @Const @GLuint IntBuffer v);
-
- @NoErrorCheck
- @StripPostfix("v")
- void glVertexAttribI2uiv(@GLuint int index, @Check("2") @Const @GLuint IntBuffer v);
-
- @NoErrorCheck
- @StripPostfix("v")
- void glVertexAttribI3uiv(@GLuint int index, @Check("3") @Const @GLuint IntBuffer v);
-
- @NoErrorCheck
- @StripPostfix("v")
- void glVertexAttribI4uiv(@GLuint int index, @Check("4") @Const @GLuint IntBuffer v);
-
- @NoErrorCheck
- @StripPostfix("v")
- void glVertexAttribI4bv(@GLuint int index, @Check("4") @Const ByteBuffer v);
-
- @NoErrorCheck
- @StripPostfix("v")
- void glVertexAttribI4sv(@GLuint int index, @Check("4") @Const ShortBuffer v);
-
- @NoErrorCheck
- @StripPostfix("v")
- void glVertexAttribI4ubv(@GLuint int index, @Check("4") @Const @GLubyte ByteBuffer v);
-
- @NoErrorCheck
- @StripPostfix("v")
- void glVertexAttribI4usv(@GLuint int index, @Check("4") @Const @GLushort ShortBuffer v);
-
- void glVertexAttribIPointer(@GLuint int index, int size, @GLenum int type, @GLsizei int stride,
- @CachedReference
- @BufferObject(BufferKind.ArrayVBO)
- @Check
- @Const
- @GLbyte
- @GLubyte
- @GLshort
- @GLushort
- @GLint
- @GLuint Buffer buffer);
-
- @StripPostfix("params")
- void glGetVertexAttribIiv(@GLuint int index, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
-
- @StripPostfix("params")
- void glGetVertexAttribIuiv(@GLuint int index, @GLenum int pname, @OutParameter @Check("4") @GLuint IntBuffer params);
-
- void glUniform1ui(int location, @GLuint int v0);
-
- void glUniform2ui(int location, @GLuint int v0, @GLuint int v1);
-
- void glUniform3ui(int location, @GLuint int v0, @GLuint int v1, @GLuint int v2);
-
- void glUniform4ui(int location, @GLuint int v0, @GLuint int v1, @GLuint int v2, @GLuint int v3);
-
- @StripPostfix("value")
- void glUniform1uiv(int location, @AutoSize("value") @GLsizei int count, @Const @GLuint IntBuffer value);
-
- @StripPostfix("value")
- void glUniform2uiv(int location, @AutoSize(value = "value", expression = " >> 1") @GLsizei int count, @Const @GLuint IntBuffer value);
-
- @StripPostfix("value")
- void glUniform3uiv(int location, @AutoSize(value = "value", expression = " / 3") @GLsizei int count, @Const @GLuint IntBuffer value);
-
- @StripPostfix("value")
- void glUniform4uiv(int location, @AutoSize(value = "value", expression = " >> 2") @GLsizei int count, @Const @GLuint IntBuffer value);
-
- @StripPostfix("params")
- void glGetUniformuiv(@GLuint int program, int location, @OutParameter @Check @GLuint IntBuffer params);
-
- void glBindFragDataLocation(@GLuint int program, @GLuint int colorNumber, @NullTerminated @Const @GLchar ByteBuffer name);
-
- @Alternate("glBindFragDataLocation")
- void glBindFragDataLocation(@GLuint int program, @GLuint int colorNumber, @NullTerminated CharSequence name);
-
- int glGetFragDataLocation(@GLuint int program, @NullTerminated @Const @GLchar ByteBuffer name);
-
- @Alternate("glGetFragDataLocation")
- int glGetFragDataLocation(@GLuint int program, @NullTerminated CharSequence name);
-
- // ---------------------------------------------------------------------
- // ----------------------[ NV_conditional_render ]----------------------
- // ---------------------------------------------------------------------
-
- /** Accepted by the <mode> parameter of BeginConditionalRender: */
- int GL_QUERY_WAIT = 0x8E13;
- int GL_QUERY_NO_WAIT = 0x8E14;
- int GL_QUERY_BY_REGION_WAIT = 0x8E15;
- int GL_QUERY_BY_REGION_NO_WAIT = 0x8E16;
-
- void glBeginConditionalRender(@GLuint int id, @GLenum int mode);
-
- void glEndConditionalRender();
-
- // --------------------------------------------------------------------
- // ----------------------[ ARB_map_buffer_range ]----------------------
- // --------------------------------------------------------------------
-
- /** Accepted by the <access> parameter of MapBufferRange: */
- int GL_MAP_READ_BIT = 0x0001;
- int GL_MAP_WRITE_BIT = 0x0002;
- int GL_MAP_INVALIDATE_RANGE_BIT = 0x0004;
- int GL_MAP_INVALIDATE_BUFFER_BIT = 0x0008;
- int GL_MAP_FLUSH_EXPLICIT_BIT = 0x0010;
- int GL_MAP_UNSYNCHRONIZED_BIT = 0x0020;
-
- /**
- * glMapBufferRange maps a GL buffer object range to a ByteBuffer. The old_buffer argument can be null,
- * in which case a new ByteBuffer will be created, pointing to the returned memory. If old_buffer is non-null,
- * it will be returned if it points to the same mapped memory and has the same capacity as the buffer object,
- * otherwise a new ByteBuffer is created. That way, an application will normally use glMapBufferRange like this:
- * <p/>
- * ByteBuffer mapped_buffer; mapped_buffer = glMapBufferRange(..., ..., ..., ..., null); ... // Another map on the same buffer mapped_buffer = glMapBufferRange(..., ..., ..., ..., mapped_buffer);
- * <p/>
- * Only ByteBuffers returned from this method are to be passed as the old_buffer argument. User-created ByteBuffers cannot be reused.
- *
- * @param old_buffer A ByteBuffer. If this argument points to the same address and has the same capacity as the new mapping, it will be returned and no new buffer will be created.
- *
- * @return A ByteBuffer representing the mapped buffer memory.
- */
- @CachedResult(isRange = true)
- @GLvoid
- @AutoResultSize("length")
- ByteBuffer glMapBufferRange(@GLenum int target, @GLintptr long offset, @GLsizeiptr long length, @GLbitfield int access);
-
- void glFlushMappedBufferRange(@GLenum int target, @GLintptr long offset, @GLsizeiptr long length);
-
- // ----------------------------------------------------------------------
- // ----------------------[ ARB_color_buffer_float ]----------------------
- // ----------------------------------------------------------------------
-
- /**
- * Accepted by the <target> parameter of ClampColor and the <pname>
- * parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.
- */
- int GL_CLAMP_VERTEX_COLOR = 0x891A;
- int GL_CLAMP_FRAGMENT_COLOR = 0x891B;
- int GL_CLAMP_READ_COLOR = 0x891C;
-
- /** Accepted by the <clamp> parameter of ClampColor. */
- int GL_FIXED_ONLY = 0x891D;
-
- void glClampColor(@GLenum int target, @GLenum int clamp);
-
- // ----------------------------------------------------------------------
- // ----------------------[ NV_depth_buffer_float ]----------------------
- // ----------------------------------------------------------------------
-
- /**
- * Accepted by the <internalformat> parameter of TexImage1D, TexImage2D,
- * TexImage3D, CopyTexImage1D, CopyTexImage2D, and RenderbufferStorageEXT,
- * and returned in the <data> parameter of GetTexLevelParameter and
- * GetRenderbufferParameterivEXT:
- */
- int GL_DEPTH_COMPONENT32F = 0x8DAB;
- int GL_DEPTH32F_STENCIL8 = 0x8DAC;
-
- /**
- * Accepted by the <type> parameter of DrawPixels, ReadPixels, TexImage1D,
- * TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D, TexSubImage3D, and
- * GetTexImage:
- */
- int GL_FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD;
-
- // -----------------------------------------------------------------
- // ----------------------[ ARB_texture_float ]----------------------
- // -----------------------------------------------------------------
-
- /** Accepted by the <value> parameter of GetTexLevelParameter: */
- int GL_TEXTURE_RED_TYPE = 0x8C10;
- int GL_TEXTURE_GREEN_TYPE = 0x8C11;
- int GL_TEXTURE_BLUE_TYPE = 0x8C12;
- int GL_TEXTURE_ALPHA_TYPE = 0x8C13;
- int GL_TEXTURE_LUMINANCE_TYPE = 0x8C14;
- int GL_TEXTURE_INTENSITY_TYPE = 0x8C15;
- int GL_TEXTURE_DEPTH_TYPE = 0x8C16;
-
- /** Returned by the <params> parameter of GetTexLevelParameter: */
- int GL_UNSIGNED_NORMALIZED = 0x8C17;
-
- /**
- * Accepted by the <internalFormat> parameter of TexImage1D,
- * TexImage2D, and TexImage3D:
- */
- int GL_RGBA32F = 0x8814;
- int GL_RGB32F = 0x8815;
- int GL_ALPHA32F = 0x8816;
- int GL_RGBA16F = 0x881A;
- int GL_RGB16F = 0x881B;
- int GL_ALPHA16F = 0x881C;
-
- // ----------------------------------------------------------------
- // ----------------------[ EXT_packed_float ]----------------------
- // ----------------------------------------------------------------
-
- /**
- * Accepted by the <internalformat> parameter of TexImage1D,
- * TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D, and
- * RenderbufferStorage:
- */
- int GL_R11F_G11F_B10F = 0x8C3A;
-
- /**
- * Accepted by the <type> parameter of DrawPixels, ReadPixels,
- * TexImage1D, TexImage2D, GetTexImage, TexImage3D, TexSubImage1D,
- * TexSubImage2D, TexSubImage3D, GetHistogram, GetMinmax,
- * ConvolutionFilter1D, ConvolutionFilter2D, ConvolutionFilter3D,
- * GetConvolutionFilter, SeparableFilter2D, GetSeparableFilter,
- * ColorTable, ColorSubTable, and GetColorTable:
- */
- int GL_UNSIGNED_INT_10F_11F_11F_REV = 0x8C3B;
-
- // ---------------------------------------------------------------------------
- // ----------------------[ EXT_texture_shared_exponent ]----------------------
- // ---------------------------------------------------------------------------
-
- /**
- * Accepted by the <internalformat> parameter of TexImage1D,
- * TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D, and
- * RenderbufferStorage:
- */
- int GL_RGB9_E5 = 0x8C3D;
-
- /**
- * Accepted by the <type> parameter of DrawPixels, ReadPixels,
- * TexImage1D, TexImage2D, GetTexImage, TexImage3D, TexSubImage1D,
- * TexSubImage2D, TexSubImage3D, GetHistogram, GetMinmax,
- * ConvolutionFilter1D, ConvolutionFilter2D, ConvolutionFilter3D,
- * GetConvolutionFilter, SeparableFilter2D, GetSeparableFilter,
- * ColorTable, ColorSubTable, and GetColorTable:
- */
- int GL_UNSIGNED_INT_5_9_9_9_REV = 0x8C3E;
-
- /**
- * Accepted by the <pname> parameter of GetTexLevelParameterfv and
- * GetTexLevelParameteriv:
- */
- int GL_TEXTURE_SHARED_SIZE = 0x8C3F;
-
- // ----------------------------------------------------------------------
- // ----------------------[ EXT_framebuffer_object ]----------------------
- // ----------------------------------------------------------------------
-
- /**
- * Accepted by the <target> parameter of BindFramebuffer,
- * CheckFramebufferStatus, FramebufferTexture{1D|2D|3D}, and
- * FramebufferRenderbuffer:
- */
- int GL_FRAMEBUFFER = 0x8D40;
-
- /**
- * Accepted by the <target> parameter of BindRenderbuffer,
- * RenderbufferStorage, and GetRenderbufferParameteriv, and
- * returned by GetFramebufferAttachmentParameteriv:
- */
- int GL_RENDERBUFFER = 0x8D41;
-
- /**
- * Accepted by the <internalformat> parameter of
- * RenderbufferStorage:
- */
- int GL_STENCIL_INDEX1 = 0x8D46;
- int GL_STENCIL_INDEX4 = 0x8D47;
- int GL_STENCIL_INDEX8 = 0x8D48;
- int GL_STENCIL_INDEX16 = 0x8D49;
-
- /** Accepted by the <pname> parameter of GetRenderbufferParameteriv: */
- int GL_RENDERBUFFER_WIDTH = 0x8D42;
- int GL_RENDERBUFFER_HEIGHT = 0x8D43;
- int GL_RENDERBUFFER_INTERNAL_FORMAT = 0x8D44;
- int GL_RENDERBUFFER_RED_SIZE = 0x8D50;
- int GL_RENDERBUFFER_GREEN_SIZE = 0x8D51;
- int GL_RENDERBUFFER_BLUE_SIZE = 0x8D52;
- int GL_RENDERBUFFER_ALPHA_SIZE = 0x8D53;
- int GL_RENDERBUFFER_DEPTH_SIZE = 0x8D54;
- int GL_RENDERBUFFER_STENCIL_SIZE = 0x8D55;
-
- /**
- * Accepted by the <pname> parameter of
- * GetFramebufferAttachmentParameteriv:
- */
- int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0;
- int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1;
- int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2;
- int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3;
- int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET = 0x8CD4;
-
- /**
- * Accepted by the <attachment> parameter of
- * FramebufferTexture{1D|2D|3D}, FramebufferRenderbuffer, and
- * GetFramebufferAttachmentParameteriv
- */
- int GL_COLOR_ATTACHMENT0 = 0x8CE0;
- int GL_COLOR_ATTACHMENT1 = 0x8CE1;
- int GL_COLOR_ATTACHMENT2 = 0x8CE2;
- int GL_COLOR_ATTACHMENT3 = 0x8CE3;
- int GL_COLOR_ATTACHMENT4 = 0x8CE4;
- int GL_COLOR_ATTACHMENT5 = 0x8CE5;
- int GL_COLOR_ATTACHMENT6 = 0x8CE6;
- int GL_COLOR_ATTACHMENT7 = 0x8CE7;
- int GL_COLOR_ATTACHMENT8 = 0x8CE8;
- int GL_COLOR_ATTACHMENT9 = 0x8CE9;
- int GL_COLOR_ATTACHMENT10 = 0x8CEA;
- int GL_COLOR_ATTACHMENT11 = 0x8CEB;
- int GL_COLOR_ATTACHMENT12 = 0x8CEC;
- int GL_COLOR_ATTACHMENT13 = 0x8CED;
- int GL_COLOR_ATTACHMENT14 = 0x8CEE;
- int GL_COLOR_ATTACHMENT15 = 0x8CEF;
- int GL_DEPTH_ATTACHMENT = 0x8D00;
- int GL_STENCIL_ATTACHMENT = 0x8D20;
-
- /** Returned by CheckFramebufferStatus(): */
- int GL_FRAMEBUFFER_COMPLETE = 0x8CD5;
- int GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6;
- int GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7;
- int GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9;
- int GL_FRAMEBUFFER_INCOMPLETE_FORMATS = 0x8CDA;
- int GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER = 0x8CDB;
- int GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER = 0x8CDC;
- int GL_FRAMEBUFFER_UNSUPPORTED = 0x8CDD;
-
- /** Accepted by GetIntegerv(): */
- int GL_FRAMEBUFFER_BINDING = 0x8CA6;
- int GL_RENDERBUFFER_BINDING = 0x8CA7;
- int GL_MAX_COLOR_ATTACHMENTS = 0x8CDF;
- int GL_MAX_RENDERBUFFER_SIZE = 0x84E8;
-
- /** Returned by GetError(): */
- int GL_INVALID_FRAMEBUFFER_OPERATION = 0x0506;
-
- boolean glIsRenderbuffer(@GLuint int renderbuffer);
-
- void glBindRenderbuffer(@GLenum int target, @GLuint int renderbuffer);
-
- void glDeleteRenderbuffers(@AutoSize("renderbuffers") int n, @Const @GLuint IntBuffer renderbuffers);
-
- @Alternate("glDeleteRenderbuffers")
- void glDeleteRenderbuffers(@Constant("1") int n, @Constant(value = "APIUtils.getBufferInt().put(0, renderbuffer), 0", keepParam = true) int renderbuffer);
-
- void glGenRenderbuffers(@AutoSize("renderbuffers") int n, @OutParameter @GLuint IntBuffer renderbuffers);
-
- @Alternate("glGenRenderbuffers")
- @GLreturn("renderbuffers")
- void glGenRenderbuffers2(@Constant("1") int n, @OutParameter @GLuint IntBuffer renderbuffers);
-
- void glRenderbufferStorage(@GLenum int target, @GLenum int internalformat, @GLsizei int width, @GLsizei int height);
-
- @StripPostfix("params")
- void glGetRenderbufferParameteriv(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
-
- @Alternate("glGetRenderbufferParameteriv")
- @GLreturn("params")
- @StripPostfix("params")
- void glGetRenderbufferParameteriv2(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params);
-
- boolean glIsFramebuffer(@GLuint int framebuffer);
-
- void glBindFramebuffer(@GLenum int target, @GLuint int framebuffer);
-
- void glDeleteFramebuffers(@AutoSize("framebuffers") int n, @Const @GLuint IntBuffer framebuffers);
-
- @Alternate("glDeleteFramebuffers")
- void glDeleteFramebuffers(@Constant("1") int n, @Constant(value = "APIUtils.getBufferInt().put(0, framebuffer), 0", keepParam = true) int framebuffer);
-
- void glGenFramebuffers(@AutoSize("framebuffers") int n, @OutParameter @GLuint IntBuffer framebuffers);
-
- @Alternate("glGenFramebuffers")
- @GLreturn("framebuffers")
- void glGenFramebuffers2(@Constant("1") int n, @OutParameter @GLuint IntBuffer framebuffers);
-
- @GLenum
- int glCheckFramebufferStatus(@GLenum int target);
-
- void glFramebufferTexture1D(@GLenum int target, @GLenum int attachment, @GLenum int textarget, @GLuint int texture, int level);
-
- void glFramebufferTexture2D(@GLenum int target, @GLenum int attachment, @GLenum int textarget, @GLuint int texture, int level);
-
- void glFramebufferTexture3D(@GLenum int target, @GLenum int attachment, @GLenum int textarget, @GLuint int texture, int level, int zoffset);
-
- void glFramebufferRenderbuffer(@GLenum int target, @GLenum int attachment, @GLenum int renderbuffertarget, @GLuint int renderbuffer);
-
- @StripPostfix("params")
- void glGetFramebufferAttachmentParameteriv(@GLenum int target, @GLenum int attachment, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
-
- @Alternate("glGetFramebufferAttachmentParameteriv")
- @GLreturn("params")
- @StripPostfix("params")
- void glGetFramebufferAttachmentParameteriv2(@GLenum int target, @GLenum int attachment, @GLenum int pname, @OutParameter IntBuffer params);
-
- void glGenerateMipmap(@GLenum int target);
-
- // --------------------------------------------------------------------------------------------
- // ----------------------[ ARB_half_float_vertex & ARB_half_float_pixel ]----------------------
- // --------------------------------------------------------------------------------------------
-
- /**
- * Accepted by the <type> parameter of DrawPixels, ReadPixels,
- * TexImage1D, TexImage2D, TexImage3D, GetTexImage, TexSubImage1D,
- * TexSubImage2D, TexSubImage3D, GetHistogram, GetMinmax,
- * ConvolutionFilter1D, ConvolutionFilter2D, GetConvolutionFilter,
- * SeparableFilter2D, GetSeparableFilter, ColorTable, ColorSubTable,
- * and GetColorTable:
- * <p/>
- * Accepted by the <type> argument of VertexPointer, NormalPointer,
- * ColorPointer, SecondaryColorPointer, FogCoordPointer, TexCoordPointer,
- * and VertexAttribPointer:
- */
- int GL_HALF_FLOAT = 0x140B;
-
- // ---------------------------------------------------------------------------
- // ----------------------[ EXT_framebuffer_multisample ]----------------------
- // ---------------------------------------------------------------------------
-
- /** Accepted by the <pname> parameter of GetRenderbufferParameteriv. */
- int GL_RENDERBUFFER_SAMPLES = 0x8CAB;
-
- /** Returned by CheckFramebufferStatus. */
- int GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0x8D56;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv, and GetDoublev.
- */
- int GL_MAX_SAMPLES = 0x8D57;
-
- /**
- * Establishes the data storage, format, dimensions, and number of
- * samples of a renderbuffer object's image.
- */
- void glRenderbufferStorageMultisample(
- @GLenum int target, @GLsizei int samples,
- @GLenum int internalformat,
- @GLsizei int width, @GLsizei int height);
-
- // --------------------------------------------------------------------
- // ----------------------[ EXT_framebuffer_blit ]----------------------
- // --------------------------------------------------------------------
-
- /**
- * Accepted by the <target> parameter of BindFramebuffer,
- * CheckFramebufferStatus, FramebufferTexture{1D|2D|3D},
- * FramebufferRenderbuffer, and
- * GetFramebufferAttachmentParameteriv.
- */
- int GL_READ_FRAMEBUFFER = 0x8CA8;
- int GL_DRAW_FRAMEBUFFER = 0x8CA9;
-
- /** Accepted by the <pname> parameters of GetIntegerv, GetFloatv, and GetDoublev. */
- int GL_DRAW_FRAMEBUFFER_BINDING = 0x8CA6; // alias FRAMEBUFFER_BINDING
- int GL_READ_FRAMEBUFFER_BINDING = 0x8CAA;
-
- /**
- * Transfers a rectangle of pixel values from one
- * region of the read framebuffer to another in the draw framebuffer.
- * <mask> is the bitwise OR of a number of values indicating which
- * buffers are to be copied. The values are COLOR_BUFFER_BIT,
- * DEPTH_BUFFER_BIT, and STENCIL_BUFFER_BIT.
- * The pixels corresponding to these buffers are
- * copied from the source rectangle, bound by the locations (srcX0,
- * srcY0) and (srcX1, srcY1) inclusive, to the destination rectangle,
- * bound by the locations (dstX0, dstY0) and (dstX1, dstY1)
- * inclusive.
- * If the source and destination rectangle dimensions do not match,
- * the source image is stretched to fit the destination
- * rectangle. <filter> must be LINEAR or NEAREST and specifies the
- * method of interpolation to be applied if the image is
- * stretched.
- */
- void glBlitFramebuffer(
- @GLint int srcX0, @GLint int srcY0, @GLint int srcX1, @GLint int srcY1,
- @GLint int dstX0, @GLint int dstY0, @GLint int dstX1, @GLint int dstY1,
- @GLbitfield int mask, @GLenum int filter);
-
- // -------------------------------------------------------------------
- // ----------------------[ EXT_texture_integer ]----------------------
- // -------------------------------------------------------------------
-
- /**
- * Accepted by the <pname> parameters of GetBooleanv, GetIntegerv,
- * GetFloatv, and GetDoublev:
- */
- int GL_RGBA_INTEGER_MODE = 0x8D9E;
-
- /**
- * Accepted by the <internalFormat> parameter of TexImage1D,
- * TexImage2D, and TexImage3D:
- */
- int GL_RGBA32UI = 0x8D70;
- int GL_RGB32UI = 0x8D71;
- int GL_ALPHA32UI = 0x8D72;
-
- int GL_RGBA16UI = 0x8D76;
- int GL_RGB16UI = 0x8D77;
- int GL_ALPHA16UI = 0x8D78;
-
- int GL_RGBA8UI = 0x8D7C;
- int GL_RGB8UI = 0x8D7D;
- int GL_ALPHA8UI = 0x8D7E;
-
- int GL_RGBA32I = 0x8D82;
- int GL_RGB32I = 0x8D83;
- int GL_ALPHA32I = 0x8D84;
-
- int GL_RGBA16I = 0x8D88;
- int GL_RGB16I = 0x8D89;
- int GL_ALPHA16I = 0x8D8A;
-
- int GL_RGBA8I = 0x8D8E;
- int GL_RGB8I = 0x8D8F;
- int GL_ALPHA8I = 0x8D90;
-
- /**
- * Accepted by the <format> parameter of TexImage1D, TexImage2D,
- * TexImage3D, TexSubImage1D, TexSubImage2D, TexSubImage3D,
- * DrawPixels and ReadPixels:
- */
- int GL_RED_INTEGER = 0x8D94;
- int GL_GREEN_INTEGER = 0x8D95;
- int GL_BLUE_INTEGER = 0x8D96;
- int GL_ALPHA_INTEGER = 0x8D97;
- int GL_RGB_INTEGER = 0x8D98;
- int GL_RGBA_INTEGER = 0x8D99;
- int GL_BGR_INTEGER = 0x8D9A;
- int GL_BGRA_INTEGER = 0x8D9B;
-
- @StripPostfix("params")
- void glTexParameterIiv(@GLenum int target, @GLenum int pname, @Check("4") IntBuffer params);
-
- @Alternate("glTexParameterIiv")
- @StripPostfix(value = "param", postfix = "v")
- void glTexParameterIiv(@GLenum int target, @GLenum int pname, @Constant(value = "APIUtils.getBufferInt().put(0, param), 0", keepParam = true) int param);
-
- @StripPostfix("params")
- void glTexParameterIuiv(@GLenum int target, @GLenum int pname, @Check("4") @GLuint IntBuffer params);
-
- @Alternate("glTexParameterIuiv")
- @StripPostfix(value = "param", postfix = "v")
- void glTexParameterIuiv(@GLenum int target, @GLenum int pname, @Constant(value = "APIUtils.getBufferInt().put(0, param), 0", keepParam = true) int param);
-
- @StripPostfix("params")
- void glGetTexParameterIiv(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
-
- @Alternate("glGetTexParameterIiv")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- void glGetTexParameterIiv2(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params);
-
- @StripPostfix("params")
- void glGetTexParameterIuiv(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") @GLuint IntBuffer params);
-
- @Alternate("glGetTexParameterIuiv")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- void glGetTexParameterIuiv2(@GLenum int target, @GLenum int pname, @OutParameter @GLuint IntBuffer params);
-
- // -----------------------------------------------------------------
- // ----------------------[ EXT_texture_array ]----------------------
- // -----------------------------------------------------------------
-
- /**
- * Accepted by the <target> parameter of TexParameteri, TexParameteriv,
- * TexParameterf, TexParameterfv, and BindTexture:
- */
- int GL_TEXTURE_1D_ARRAY = 0x8C18;
- int GL_TEXTURE_2D_ARRAY = 0x8C1A;
-
- /**
- * Accepted by the <target> parameter of TexImage3D, TexSubImage3D,
- * CopyTexSubImage3D, CompressedTexImage3D, and CompressedTexSubImage3D:
- */
- int GL_PROXY_TEXTURE_2D_ARRAY = 0x8C1B;
-
- /**
- * Accepted by the <target> parameter of TexImage2D, TexSubImage2D,
- * CopyTexImage2D, CopyTexSubImage2D, CompressedTexImage2D, and
- * CompressedTexSubImage2D:
- */
- int GL_PROXY_TEXTURE_1D_ARRAY = 0x8C19;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetDoublev, GetIntegerv
- * and GetFloatv:
- */
- int GL_TEXTURE_BINDING_1D_ARRAY = 0x8C1C;
- int GL_TEXTURE_BINDING_2D_ARRAY = 0x8C1D;
- int GL_MAX_ARRAY_TEXTURE_LAYERS = 0x88FF;
-
- /**
- * Accepted by the <param> parameter of TexParameterf, TexParameteri,
- * TexParameterfv, and TexParameteriv when the <pname> parameter is
- * TEXTURE_COMPARE_MODE_ARB:
- */
- int GL_COMPARE_REF_DEPTH_TO_TEXTURE = 0x884E;
-
- /**
- * Accepted by the <pname> parameter of
- * GetFramebufferAttachmentParameteriv:
- */
- int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 0x8CD4;
-
- /** Returned by the <type> parameter of GetActiveUniform: */
- int GL_SAMPLER_1D_ARRAY = 0x8DC0;
- int GL_SAMPLER_2D_ARRAY = 0x8DC1;
- int GL_SAMPLER_1D_ARRAY_SHADOW = 0x8DC3;
- int GL_SAMPLER_2D_ARRAY_SHADOW = 0x8DC4;
-
- void glFramebufferTextureLayer(@GLenum int target, @GLenum int attachment, @GLuint int texture, int level, int layer);
-
- // ------------------------------------------------------------------------
- // ----------------------[ EXT_packed_depth_stencil ]----------------------
- // ------------------------------------------------------------------------
-
- /**
- * Accepted by the <format> parameter of DrawPixels, ReadPixels,
- * TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D,
- * TexSubImage3D, and GetTexImage, by the <type> parameter of
- * CopyPixels, by the <internalformat> parameter of TexImage1D,
- * TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D, and
- * RenderbufferStorage, and returned in the <data> parameter of
- * GetTexLevelParameter and GetRenderbufferParameteriv.
- */
- int GL_DEPTH_STENCIL = 0x84F9;
-
- /**
- * Accepted by the <type> parameter of DrawPixels, ReadPixels,
- * TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D,
- * TexSubImage3D, and GetTexImage.
- */
- int GL_UNSIGNED_INT_24_8 = 0x84FA;
-
- /**
- * Accepted by the <internalformat> parameter of TexImage1D,
- * TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D, and
- * RenderbufferStorage, and returned in the <data> parameter of
- * GetTexLevelParameter and GetRenderbufferParameteriv.
- */
- int GL_DEPTH24_STENCIL8 = 0x88F0;
-
- /** Accepted by the <value> parameter of GetTexLevelParameter. */
- int GL_TEXTURE_STENCIL_SIZE = 0x88F1;
-
- // -----------------------------------------------------------------
- // ----------------------[ EXT_draw_buffers2 ]----------------------
- // -----------------------------------------------------------------
-
- void glColorMaski(@GLuint int buf, boolean r, boolean g, boolean b, boolean a);
-
- @StripPostfix(value = "data", hasPostfix = false)
- void glGetBooleani_v(@GLenum int value, @GLuint int index, @OutParameter @Check("4") @GLboolean ByteBuffer data);
-
- @Alternate("glGetBooleani_v")
- @GLreturn("data")
- @StripPostfix(value = "data", hasPostfix = false)
- void glGetBooleani_v2(@GLenum int value, @GLuint int index, @OutParameter @GLboolean ByteBuffer data);
-
- @StripPostfix("data")
- void glGetIntegeri_v(@GLenum int value, @GLuint int index, @OutParameter @Check("4") IntBuffer data);
-
- @Alternate("glGetIntegeri_v")
- @GLreturn("data")
- @StripPostfix("data")
- void glGetIntegeri_v2(@GLenum int value, @GLuint int index, @OutParameter IntBuffer data);
-
- void glEnablei(@GLenum int target, @GLuint int index);
-
- void glDisablei(@GLenum int target, @GLuint int index);
-
- boolean glIsEnabledi(@GLenum int target, @GLuint int index);
-
- // ----------------------------------------------------------------------------
- // ----------------------[ ARB_texture_compression_rgtc ]----------------------
- // ----------------------------------------------------------------------------
-
- /**
- * Accepted by the <internalformat> parameter of TexImage2D,
- * CopyTexImage2D, and CompressedTexImage2D and the <format> parameter
- * of CompressedTexSubImage2D:
- */
- int GL_COMPRESSED_RED_RGTC1 = 0x8DBB;
- int GL_COMPRESSED_SIGNED_RED_RGTC1 = 0x8DBC;
- int GL_COMPRESSED_RED_GREEN_RGTC2 = 0x8DBD;
- int GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2 = 0x8DBE;
-
- // --------------------------------------------------------------
- // ----------------------[ ARB_texture_rg ]----------------------
- // --------------------------------------------------------------
-
- /**
- * Accepted by the <internalFormat> parameter of TexImage1D, TexImage2D,
- * TexImage3D, CopyTexImage1D, and CopyTexImage2D:
- */
- int GL_R8 = 0x8229;
- int GL_R16 = 0x822A;
-
- int GL_RG8 = 0x822B;
- int GL_RG16 = 0x822C;
-
- int GL_R16F = 0x822D;
- int GL_R32F = 0x822E;
-
- int GL_RG16F = 0x822F;
- int GL_RG32F = 0x8230;
-
- int GL_R8I = 0x8231;
- int GL_R8UI = 0x8232;
- int GL_R16I = 0x8233;
- int GL_R16UI = 0x8234;
- int GL_R32I = 0x8235;
- int GL_R32UI = 0x8236;
-
- int GL_RG8I = 0x8237;
- int GL_RG8UI = 0x8238;
- int GL_RG16I = 0x8239;
- int GL_RG16UI = 0x823A;
- int GL_RG32I = 0x823B;
- int GL_RG32UI = 0x823C;
-
- /**
- * Accepted by the <format> parameter of TexImage3D, TexImage2D,
- * TexImage3D, TexSubImage1D, TexSubImage2D, TexSubImage3D,
- * DrawPixels and ReadPixels:
- */
- int GL_RG = 0x8227;
- int GL_RG_INTEGER = 0x8228;
-
- /**
- * Accepted by the <param> parameter of the TexParameter{if}*
- * functions when <pname> is DEPTH_TEXTURE_MODE:
- */
- int GL_RED = 0x1903;
-
- // ----------------------------------------------------------------------
- // ----------------------[ EXT_transform_feedback ]----------------------
- // ----------------------------------------------------------------------
-
- /**
- * Accepted by the <target> parameters of BindBuffer, BufferData,
- * BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData,
- * GetBufferPointerv, BindBufferRange, BindBufferOffset and
- * BindBufferBase:
- */
- int GL_TRANSFORM_FEEDBACK_BUFFER = 0x8C8E;
-
- /**
- * Accepted by the <param> parameter of GetIntegerIndexedv and
- * GetBooleanIndexedv:
- */
- int GL_TRANSFORM_FEEDBACK_BUFFER_START = 0x8C84;
- int GL_TRANSFORM_FEEDBACK_BUFFER_SIZE = 0x8C85;
-
- /**
- * Accepted by the <param> parameter of GetIntegerIndexedv and
- * GetBooleanIndexedv, and by the <pname> parameter of GetBooleanv,
- * GetDoublev, GetIntegerv, and GetFloatv:
- */
- int GL_TRANSFORM_FEEDBACK_BUFFER_BINDING = 0x8C8F;
-
- /** Accepted by the <bufferMode> parameter of TransformFeedbackVaryings: */
- int GL_INTERLEAVED_ATTRIBS = 0x8C8C;
- int GL_SEPARATE_ATTRIBS = 0x8C8D;
-
- /**
- * Accepted by the <target> parameter of BeginQuery, EndQuery, and
- * GetQueryiv:
- */
- int GL_PRIMITIVES_GENERATED = 0x8C87;
- int GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 0x8C88;
-
- /**
- * Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, and by
- * the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
- * GetDoublev:
- */
- int GL_RASTERIZER_DISCARD = 0x8C89;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetDoublev, GetIntegerv,
- * and GetFloatv:
- */
- int GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 0x8C8A;
- int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 0x8C8B;
- int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 0x8C80;
-
- /** Accepted by the <pname> parameter of GetProgramiv: */
- int GL_TRANSFORM_FEEDBACK_VARYINGS = 0x8C83;
- int GL_TRANSFORM_FEEDBACK_BUFFER_MODE = 0x8C7F;
- int GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH = 0x8C76;
-
- void glBindBufferRange(@GLenum int target, @GLuint int index, @GLuint int buffer, @GLintptr long offset, @GLsizeiptr long size);
-
- void glBindBufferBase(@GLenum int target, @GLuint int index, @GLuint int buffer);
-
- void glBeginTransformFeedback(@GLenum int primitiveMode);
-
- void glEndTransformFeedback();
-
- void glTransformFeedbackVaryings(@GLuint int program, @GLsizei int count,
- @Const @NullTerminated("count") @GLchar @StringList("count") ByteBuffer varyings,
- @GLenum int bufferMode);
-
- @Alternate("glTransformFeedbackVaryings")
- void glTransformFeedbackVaryings(@GLuint int program, @Constant("varyings.length") @GLsizei int count,
- @Const @NullTerminated @StringList("count") CharSequence[] varyings,
- @GLenum int bufferMode);
-
- void glGetTransformFeedbackVarying(@GLuint int program, @GLuint int index, @AutoSize("name") @GLsizei int bufSize,
- @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
- @OutParameter @GLsizei @Check("1") IntBuffer size,
- @OutParameter @GLenum @Check("1") IntBuffer type,
- @OutParameter @GLchar ByteBuffer name);
-
- @Alternate("glGetTransformFeedbackVarying")
- @GLreturn(value = "name", maxLength = "bufSize")
- void glGetTransformFeedbackVarying2(@GLuint int program, @GLuint int index, @GLsizei int bufSize,
- @OutParameter @GLsizei @Constant("name_length, 0") IntBuffer length,
- @OutParameter @GLsizei @Check("1") IntBuffer size,
- @OutParameter @GLenum @Check("1") IntBuffer type,
- @OutParameter @GLchar ByteBuffer name);
-
- // -----------------------------------------------------------------------
- // ----------------------[ ARB_vertex_array_object ]----------------------
- // -----------------------------------------------------------------------
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv, and GetDoublev:
- */
- int GL_VERTEX_ARRAY_BINDING = 0x85B5;
-
- void glBindVertexArray(@GLuint int array);
-
- void glDeleteVertexArrays(@AutoSize("arrays") @GLsizei int n, @Const @GLuint IntBuffer arrays);
-
- @Alternate("glDeleteVertexArrays")
- void glDeleteVertexArrays(@Constant("1") @GLsizei int n, @Constant(value = "APIUtils.getBufferInt().put(0, array), 0", keepParam = true) int array);
-
- void glGenVertexArrays(@AutoSize("arrays") @GLsizei int n, @OutParameter @GLuint IntBuffer arrays);
-
- @Alternate("glGenVertexArrays")
- @GLreturn("arrays")
- void glGenVertexArrays2(@Constant("1") @GLsizei int n, @OutParameter @GLuint IntBuffer arrays);
-
- boolean glIsVertexArray(@GLuint int array);
-
- // --------------------------------------------------------------------
- // ----------------------[ ARB_framebuffer_sRGB ]----------------------
- // --------------------------------------------------------------------
-
- /**
- * Accepted by the <cap> parameter of Enable, Disable, and IsEnabled,
- * and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
- * and GetDoublev:
- */
- int GL_FRAMEBUFFER_SRGB = 0x8DB9;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv, and GetDoublev:
- */
- int GL_FRAMEBUFFER_SRGB_CAPABLE = 0x8DBA;
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+public interface GL30 {
+
+ // ----------------------------------------------------------
+ // ----------------------[ OpenGL 3.0 ]----------------------
+ // ----------------------------------------------------------
+
+ int GL_MAJOR_VERSION = 0x821B;
+ int GL_MINOR_VERSION = 0x821C;
+ int GL_NUM_EXTENSIONS = 0x821D;
+
+ int GL_CONTEXT_FLAGS = 0x821E;
+ int GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT = 0x0001;
+
+ int GL_DEPTH_BUFFER = 0x8223;
+ int GL_STENCIL_BUFFER = 0x8224;
+
+ int GL_COMPRESSED_RED = 0x8225;
+ int GL_COMPRESSED_RG = 0x8226;
+
+ int GL_COMPARE_REF_TO_TEXTURE = ARB_shadow.GL_COMPARE_R_TO_TEXTURE_ARB;
+
+ int GL_CLIP_DISTANCE0 = GL11.GL_CLIP_PLANE0;
+ int GL_CLIP_DISTANCE1 = GL11.GL_CLIP_PLANE1;
+ int GL_CLIP_DISTANCE2 = GL11.GL_CLIP_PLANE2;
+ int GL_CLIP_DISTANCE3 = GL11.GL_CLIP_PLANE3;
+ int GL_CLIP_DISTANCE4 = GL11.GL_CLIP_PLANE4;
+ int GL_CLIP_DISTANCE5 = GL11.GL_CLIP_PLANE5;
+ int GL_CLIP_DISTANCE6 = 0x3006;
+ int GL_CLIP_DISTANCE7 = 0x3007;
+
+ int GL_MAX_CLIP_DISTANCES = GL11.GL_MAX_CLIP_PLANES;
+
+ int GL_MAX_VARYING_COMPONENTS = GL20.GL_MAX_VARYING_FLOATS;
+
+ int GL_BUFFER_ACCESS_FLAGS = 0x911F;
+ int GL_BUFFER_MAP_LENGTH = 0x9120;
+ int GL_BUFFER_MAP_OFFSET = 0x9121;
+
+ String glGetStringi(@GLenum int name, @GLuint int index);
+
+ @StripPostfix("value")
+ void glClearBufferfv(@GLenum int buffer, int drawbuffer, @Const @Check("4") FloatBuffer value);
+
+ @StripPostfix("value")
+ void glClearBufferiv(@GLenum int buffer, int drawbuffer, @Const @Check("4") IntBuffer value);
+
+ @StripPostfix("value")
+ void glClearBufferuiv(@GLenum int buffer, int drawbuffer, @Const @Check("4") IntBuffer value);
+
+ void glClearBufferfi(@GLenum int buffer, int drawbuffer, float depth, int stencil);
+
+ // ---------------------------------------------------------------
+ // ----------------------[ EXT_gpu_shader4 ]----------------------
+ // ---------------------------------------------------------------
+
+ /**
+ * Accepted by the <pname> parameters of GetVertexAttribdv,
+ * GetVertexAttribfv, GetVertexAttribiv, GetVertexAttribIiv, and
+ * GetVertexAttribIuiv:
+ */
+ int GL_VERTEX_ATTRIB_ARRAY_INTEGER = 0x88FD;
+
+ /** Returned by the <type> parameter of GetActiveUniform: */
+
+ int GL_SAMPLER_BUFFER = 0x8DC2;
+ int GL_SAMPLER_CUBE_SHADOW = 0x8DC5;
+ int GL_UNSIGNED_INT_VEC2 = 0x8DC6;
+ int GL_UNSIGNED_INT_VEC3 = 0x8DC7;
+ int GL_UNSIGNED_INT_VEC4 = 0x8DC8;
+ int GL_INT_SAMPLER_1D = 0x8DC9;
+ int GL_INT_SAMPLER_2D = 0x8DCA;
+ int GL_INT_SAMPLER_3D = 0x8DCB;
+ int GL_INT_SAMPLER_CUBE = 0x8DCC;
+ int GL_INT_SAMPLER_2D_RECT = 0x8DCD;
+ int GL_INT_SAMPLER_1D_ARRAY = 0x8DCE;
+ int GL_INT_SAMPLER_2D_ARRAY = 0x8DCF;
+ int GL_INT_SAMPLER_BUFFER = 0x8DD0;
+
+ int GL_UNSIGNED_INT_SAMPLER_1D = 0x8DD1;
+ int GL_UNSIGNED_INT_SAMPLER_2D = 0x8DD2;
+ int GL_UNSIGNED_INT_SAMPLER_3D = 0x8DD3;
+ int GL_UNSIGNED_INT_SAMPLER_CUBE = 0x8DD4;
+ int GL_UNSIGNED_INT_SAMPLER_2D_RECT = 0x8DD5;
+ int GL_UNSIGNED_INT_SAMPLER_1D_ARRAY = 0x8DD6;
+ int GL_UNSIGNED_INT_SAMPLER_2D_ARRAY = 0x8DD7;
+ int GL_UNSIGNED_INT_SAMPLER_BUFFER = 0x8DD8;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
+ * and GetDoublev:
+ */
+ int GL_MIN_PROGRAM_TEXEL_OFFSET = 0x8904;
+ int GL_MAX_PROGRAM_TEXEL_OFFSET = 0x8905;
+
+ @NoErrorCheck
+ void glVertexAttribI1i(@GLuint int index, int x);
+
+ @NoErrorCheck
+ void glVertexAttribI2i(@GLuint int index, int x, int y);
+
+ @NoErrorCheck
+ void glVertexAttribI3i(@GLuint int index, int x, int y, int z);
+
+ @NoErrorCheck
+ void glVertexAttribI4i(@GLuint int index, int x, int y, int z, int w);
+
+ @NoErrorCheck
+ void glVertexAttribI1ui(@GLuint int index, @GLuint int x);
+
+ @NoErrorCheck
+ void glVertexAttribI2ui(@GLuint int index, @GLuint int x, @GLuint int y);
+
+ @NoErrorCheck
+ void glVertexAttribI3ui(@GLuint int index, @GLuint int x, @GLuint int y, @GLuint int z);
+
+ @NoErrorCheck
+ void glVertexAttribI4ui(@GLuint int index, @GLuint int x, @GLuint int y, @GLuint int z, @GLuint int w);
+
+ @NoErrorCheck
+ @StripPostfix("v")
+ void glVertexAttribI1iv(@GLuint int index, @Check("1") @Const IntBuffer v);
+
+ @NoErrorCheck
+ @StripPostfix("v")
+ void glVertexAttribI2iv(@GLuint int index, @Check("2") @Const IntBuffer v);
+
+ @NoErrorCheck
+ @StripPostfix("v")
+ void glVertexAttribI3iv(@GLuint int index, @Check("3") @Const IntBuffer v);
+
+ @NoErrorCheck
+ @StripPostfix("v")
+ void glVertexAttribI4iv(@GLuint int index, @Check("4") @Const IntBuffer v);
+
+ @NoErrorCheck
+ @StripPostfix("v")
+ void glVertexAttribI1uiv(@GLuint int index, @Check("1") @Const @GLuint IntBuffer v);
+
+ @NoErrorCheck
+ @StripPostfix("v")
+ void glVertexAttribI2uiv(@GLuint int index, @Check("2") @Const @GLuint IntBuffer v);
+
+ @NoErrorCheck
+ @StripPostfix("v")
+ void glVertexAttribI3uiv(@GLuint int index, @Check("3") @Const @GLuint IntBuffer v);
+
+ @NoErrorCheck
+ @StripPostfix("v")
+ void glVertexAttribI4uiv(@GLuint int index, @Check("4") @Const @GLuint IntBuffer v);
+
+ @NoErrorCheck
+ @StripPostfix("v")
+ void glVertexAttribI4bv(@GLuint int index, @Check("4") @Const ByteBuffer v);
+
+ @NoErrorCheck
+ @StripPostfix("v")
+ void glVertexAttribI4sv(@GLuint int index, @Check("4") @Const ShortBuffer v);
+
+ @NoErrorCheck
+ @StripPostfix("v")
+ void glVertexAttribI4ubv(@GLuint int index, @Check("4") @Const @GLubyte ByteBuffer v);
+
+ @NoErrorCheck
+ @StripPostfix("v")
+ void glVertexAttribI4usv(@GLuint int index, @Check("4") @Const @GLushort ShortBuffer v);
+
+ void glVertexAttribIPointer(@GLuint int index, int size, @GLenum int type, @GLsizei int stride,
+ @CachedReference
+ @BufferObject(BufferKind.ArrayVBO)
+ @Check
+ @Const
+ @GLbyte
+ @GLubyte
+ @GLshort
+ @GLushort
+ @GLint
+ @GLuint Buffer buffer);
+
+ @StripPostfix("params")
+ void glGetVertexAttribIiv(@GLuint int index, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
+
+ @StripPostfix("params")
+ void glGetVertexAttribIuiv(@GLuint int index, @GLenum int pname, @OutParameter @Check("4") @GLuint IntBuffer params);
+
+ void glUniform1ui(int location, @GLuint int v0);
+
+ void glUniform2ui(int location, @GLuint int v0, @GLuint int v1);
+
+ void glUniform3ui(int location, @GLuint int v0, @GLuint int v1, @GLuint int v2);
+
+ void glUniform4ui(int location, @GLuint int v0, @GLuint int v1, @GLuint int v2, @GLuint int v3);
+
+ @StripPostfix("value")
+ void glUniform1uiv(int location, @AutoSize("value") @GLsizei int count, @Const @GLuint IntBuffer value);
+
+ @StripPostfix("value")
+ void glUniform2uiv(int location, @AutoSize(value = "value", expression = " >> 1") @GLsizei int count, @Const @GLuint IntBuffer value);
+
+ @StripPostfix("value")
+ void glUniform3uiv(int location, @AutoSize(value = "value", expression = " / 3") @GLsizei int count, @Const @GLuint IntBuffer value);
+
+ @StripPostfix("value")
+ void glUniform4uiv(int location, @AutoSize(value = "value", expression = " >> 2") @GLsizei int count, @Const @GLuint IntBuffer value);
+
+ @StripPostfix("params")
+ void glGetUniformuiv(@GLuint int program, int location, @OutParameter @Check @GLuint IntBuffer params);
+
+ void glBindFragDataLocation(@GLuint int program, @GLuint int colorNumber, @NullTerminated @Const @GLchar ByteBuffer name);
+
+ @Alternate("glBindFragDataLocation")
+ void glBindFragDataLocation(@GLuint int program, @GLuint int colorNumber, @NullTerminated CharSequence name);
+
+ int glGetFragDataLocation(@GLuint int program, @NullTerminated @Const @GLchar ByteBuffer name);
+
+ @Alternate("glGetFragDataLocation")
+ int glGetFragDataLocation(@GLuint int program, @NullTerminated CharSequence name);
+
+ // ---------------------------------------------------------------------
+ // ----------------------[ NV_conditional_render ]----------------------
+ // ---------------------------------------------------------------------
+
+ /** Accepted by the <mode> parameter of BeginConditionalRender: */
+ int GL_QUERY_WAIT = 0x8E13;
+ int GL_QUERY_NO_WAIT = 0x8E14;
+ int GL_QUERY_BY_REGION_WAIT = 0x8E15;
+ int GL_QUERY_BY_REGION_NO_WAIT = 0x8E16;
+
+ void glBeginConditionalRender(@GLuint int id, @GLenum int mode);
+
+ void glEndConditionalRender();
+
+ // --------------------------------------------------------------------
+ // ----------------------[ ARB_map_buffer_range ]----------------------
+ // --------------------------------------------------------------------
+
+ /** Accepted by the <access> parameter of MapBufferRange: */
+ int GL_MAP_READ_BIT = 0x0001;
+ int GL_MAP_WRITE_BIT = 0x0002;
+ int GL_MAP_INVALIDATE_RANGE_BIT = 0x0004;
+ int GL_MAP_INVALIDATE_BUFFER_BIT = 0x0008;
+ int GL_MAP_FLUSH_EXPLICIT_BIT = 0x0010;
+ int GL_MAP_UNSYNCHRONIZED_BIT = 0x0020;
+
+ /**
+ * glMapBufferRange maps a GL buffer object range to a ByteBuffer. The old_buffer argument can be null,
+ * in which case a new ByteBuffer will be created, pointing to the returned memory. If old_buffer is non-null,
+ * it will be returned if it points to the same mapped memory and has the same capacity as the buffer object,
+ * otherwise a new ByteBuffer is created. That way, an application will normally use glMapBufferRange like this:
+ * <p/>
+ * ByteBuffer mapped_buffer; mapped_buffer = glMapBufferRange(..., ..., ..., ..., null); ... // Another map on the same buffer mapped_buffer = glMapBufferRange(..., ..., ..., ..., mapped_buffer);
+ * <p/>
+ * Only ByteBuffers returned from this method are to be passed as the old_buffer argument. User-created ByteBuffers cannot be reused.
+ *
+ * @param old_buffer A ByteBuffer. If this argument points to the same address and has the same capacity as the new mapping, it will be returned and no new buffer will be created.
+ *
+ * @return A ByteBuffer representing the mapped buffer memory.
+ */
+ @CachedResult(isRange = true)
+ @GLvoid
+ @AutoResultSize("length")
+ ByteBuffer glMapBufferRange(@GLenum int target, @GLintptr long offset, @GLsizeiptr long length, @GLbitfield int access);
+
+ void glFlushMappedBufferRange(@GLenum int target, @GLintptr long offset, @GLsizeiptr long length);
+
+ // ----------------------------------------------------------------------
+ // ----------------------[ ARB_color_buffer_float ]----------------------
+ // ----------------------------------------------------------------------
+
+ /**
+ * Accepted by the <target> parameter of ClampColor and the <pname>
+ * parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.
+ */
+ int GL_CLAMP_VERTEX_COLOR = 0x891A;
+ int GL_CLAMP_FRAGMENT_COLOR = 0x891B;
+ int GL_CLAMP_READ_COLOR = 0x891C;
+
+ /** Accepted by the <clamp> parameter of ClampColor. */
+ int GL_FIXED_ONLY = 0x891D;
+
+ void glClampColor(@GLenum int target, @GLenum int clamp);
+
+ // ----------------------------------------------------------------------
+ // ----------------------[ NV_depth_buffer_float ]----------------------
+ // ----------------------------------------------------------------------
+
+ /**
+ * Accepted by the <internalformat> parameter of TexImage1D, TexImage2D,
+ * TexImage3D, CopyTexImage1D, CopyTexImage2D, and RenderbufferStorageEXT,
+ * and returned in the <data> parameter of GetTexLevelParameter and
+ * GetRenderbufferParameterivEXT:
+ */
+ int GL_DEPTH_COMPONENT32F = 0x8DAB;
+ int GL_DEPTH32F_STENCIL8 = 0x8DAC;
+
+ /**
+ * Accepted by the <type> parameter of DrawPixels, ReadPixels, TexImage1D,
+ * TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D, TexSubImage3D, and
+ * GetTexImage:
+ */
+ int GL_FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD;
+
+ // -----------------------------------------------------------------
+ // ----------------------[ ARB_texture_float ]----------------------
+ // -----------------------------------------------------------------
+
+ /** Accepted by the <value> parameter of GetTexLevelParameter: */
+ int GL_TEXTURE_RED_TYPE = 0x8C10;
+ int GL_TEXTURE_GREEN_TYPE = 0x8C11;
+ int GL_TEXTURE_BLUE_TYPE = 0x8C12;
+ int GL_TEXTURE_ALPHA_TYPE = 0x8C13;
+ int GL_TEXTURE_LUMINANCE_TYPE = 0x8C14;
+ int GL_TEXTURE_INTENSITY_TYPE = 0x8C15;
+ int GL_TEXTURE_DEPTH_TYPE = 0x8C16;
+
+ /** Returned by the <params> parameter of GetTexLevelParameter: */
+ int GL_UNSIGNED_NORMALIZED = 0x8C17;
+
+ /**
+ * Accepted by the <internalFormat> parameter of TexImage1D,
+ * TexImage2D, and TexImage3D:
+ */
+ int GL_RGBA32F = 0x8814;
+ int GL_RGB32F = 0x8815;
+ int GL_ALPHA32F = 0x8816;
+ int GL_RGBA16F = 0x881A;
+ int GL_RGB16F = 0x881B;
+ int GL_ALPHA16F = 0x881C;
+
+ // ----------------------------------------------------------------
+ // ----------------------[ EXT_packed_float ]----------------------
+ // ----------------------------------------------------------------
+
+ /**
+ * Accepted by the <internalformat> parameter of TexImage1D,
+ * TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D, and
+ * RenderbufferStorage:
+ */
+ int GL_R11F_G11F_B10F = 0x8C3A;
+
+ /**
+ * Accepted by the <type> parameter of DrawPixels, ReadPixels,
+ * TexImage1D, TexImage2D, GetTexImage, TexImage3D, TexSubImage1D,
+ * TexSubImage2D, TexSubImage3D, GetHistogram, GetMinmax,
+ * ConvolutionFilter1D, ConvolutionFilter2D, ConvolutionFilter3D,
+ * GetConvolutionFilter, SeparableFilter2D, GetSeparableFilter,
+ * ColorTable, ColorSubTable, and GetColorTable:
+ */
+ int GL_UNSIGNED_INT_10F_11F_11F_REV = 0x8C3B;
+
+ // ---------------------------------------------------------------------------
+ // ----------------------[ EXT_texture_shared_exponent ]----------------------
+ // ---------------------------------------------------------------------------
+
+ /**
+ * Accepted by the <internalformat> parameter of TexImage1D,
+ * TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D, and
+ * RenderbufferStorage:
+ */
+ int GL_RGB9_E5 = 0x8C3D;
+
+ /**
+ * Accepted by the <type> parameter of DrawPixels, ReadPixels,
+ * TexImage1D, TexImage2D, GetTexImage, TexImage3D, TexSubImage1D,
+ * TexSubImage2D, TexSubImage3D, GetHistogram, GetMinmax,
+ * ConvolutionFilter1D, ConvolutionFilter2D, ConvolutionFilter3D,
+ * GetConvolutionFilter, SeparableFilter2D, GetSeparableFilter,
+ * ColorTable, ColorSubTable, and GetColorTable:
+ */
+ int GL_UNSIGNED_INT_5_9_9_9_REV = 0x8C3E;
+
+ /**
+ * Accepted by the <pname> parameter of GetTexLevelParameterfv and
+ * GetTexLevelParameteriv:
+ */
+ int GL_TEXTURE_SHARED_SIZE = 0x8C3F;
+
+ // ----------------------------------------------------------------------
+ // ----------------------[ EXT_framebuffer_object ]----------------------
+ // ----------------------------------------------------------------------
+
+ /**
+ * Accepted by the <target> parameter of BindFramebuffer,
+ * CheckFramebufferStatus, FramebufferTexture{1D|2D|3D}, and
+ * FramebufferRenderbuffer:
+ */
+ int GL_FRAMEBUFFER = 0x8D40;
+
+ /**
+ * Accepted by the <target> parameter of BindRenderbuffer,
+ * RenderbufferStorage, and GetRenderbufferParameteriv, and
+ * returned by GetFramebufferAttachmentParameteriv:
+ */
+ int GL_RENDERBUFFER = 0x8D41;
+
+ /**
+ * Accepted by the <internalformat> parameter of
+ * RenderbufferStorage:
+ */
+ int GL_STENCIL_INDEX1 = 0x8D46;
+ int GL_STENCIL_INDEX4 = 0x8D47;
+ int GL_STENCIL_INDEX8 = 0x8D48;
+ int GL_STENCIL_INDEX16 = 0x8D49;
+
+ /** Accepted by the <pname> parameter of GetRenderbufferParameteriv: */
+ int GL_RENDERBUFFER_WIDTH = 0x8D42;
+ int GL_RENDERBUFFER_HEIGHT = 0x8D43;
+ int GL_RENDERBUFFER_INTERNAL_FORMAT = 0x8D44;
+ int GL_RENDERBUFFER_RED_SIZE = 0x8D50;
+ int GL_RENDERBUFFER_GREEN_SIZE = 0x8D51;
+ int GL_RENDERBUFFER_BLUE_SIZE = 0x8D52;
+ int GL_RENDERBUFFER_ALPHA_SIZE = 0x8D53;
+ int GL_RENDERBUFFER_DEPTH_SIZE = 0x8D54;
+ int GL_RENDERBUFFER_STENCIL_SIZE = 0x8D55;
+
+ /**
+ * Accepted by the <pname> parameter of
+ * GetFramebufferAttachmentParameteriv:
+ */
+ int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0;
+ int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1;
+ int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2;
+ int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3;
+ int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET = 0x8CD4;
+
+ /**
+ * Accepted by the <attachment> parameter of
+ * FramebufferTexture{1D|2D|3D}, FramebufferRenderbuffer, and
+ * GetFramebufferAttachmentParameteriv
+ */
+ int GL_COLOR_ATTACHMENT0 = 0x8CE0;
+ int GL_COLOR_ATTACHMENT1 = 0x8CE1;
+ int GL_COLOR_ATTACHMENT2 = 0x8CE2;
+ int GL_COLOR_ATTACHMENT3 = 0x8CE3;
+ int GL_COLOR_ATTACHMENT4 = 0x8CE4;
+ int GL_COLOR_ATTACHMENT5 = 0x8CE5;
+ int GL_COLOR_ATTACHMENT6 = 0x8CE6;
+ int GL_COLOR_ATTACHMENT7 = 0x8CE7;
+ int GL_COLOR_ATTACHMENT8 = 0x8CE8;
+ int GL_COLOR_ATTACHMENT9 = 0x8CE9;
+ int GL_COLOR_ATTACHMENT10 = 0x8CEA;
+ int GL_COLOR_ATTACHMENT11 = 0x8CEB;
+ int GL_COLOR_ATTACHMENT12 = 0x8CEC;
+ int GL_COLOR_ATTACHMENT13 = 0x8CED;
+ int GL_COLOR_ATTACHMENT14 = 0x8CEE;
+ int GL_COLOR_ATTACHMENT15 = 0x8CEF;
+ int GL_DEPTH_ATTACHMENT = 0x8D00;
+ int GL_STENCIL_ATTACHMENT = 0x8D20;
+
+ /** Returned by CheckFramebufferStatus(): */
+ int GL_FRAMEBUFFER_COMPLETE = 0x8CD5;
+ int GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6;
+ int GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7;
+ int GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9;
+ int GL_FRAMEBUFFER_INCOMPLETE_FORMATS = 0x8CDA;
+ int GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER = 0x8CDB;
+ int GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER = 0x8CDC;
+ int GL_FRAMEBUFFER_UNSUPPORTED = 0x8CDD;
+
+ /** Accepted by GetIntegerv(): */
+ int GL_FRAMEBUFFER_BINDING = 0x8CA6;
+ int GL_RENDERBUFFER_BINDING = 0x8CA7;
+ int GL_MAX_COLOR_ATTACHMENTS = 0x8CDF;
+ int GL_MAX_RENDERBUFFER_SIZE = 0x84E8;
+
+ /** Returned by GetError(): */
+ int GL_INVALID_FRAMEBUFFER_OPERATION = 0x0506;
+
+ boolean glIsRenderbuffer(@GLuint int renderbuffer);
+
+ void glBindRenderbuffer(@GLenum int target, @GLuint int renderbuffer);
+
+ void glDeleteRenderbuffers(@AutoSize("renderbuffers") int n, @Const @GLuint IntBuffer renderbuffers);
+
+ @Alternate("glDeleteRenderbuffers")
+ void glDeleteRenderbuffers(@Constant("1") int n, @Constant(value = "APIUtils.getBufferInt().put(0, renderbuffer), 0", keepParam = true) int renderbuffer);
+
+ void glGenRenderbuffers(@AutoSize("renderbuffers") int n, @OutParameter @GLuint IntBuffer renderbuffers);
+
+ @Alternate("glGenRenderbuffers")
+ @GLreturn("renderbuffers")
+ void glGenRenderbuffers2(@Constant("1") int n, @OutParameter @GLuint IntBuffer renderbuffers);
+
+ void glRenderbufferStorage(@GLenum int target, @GLenum int internalformat, @GLsizei int width, @GLsizei int height);
+
+ @StripPostfix("params")
+ void glGetRenderbufferParameteriv(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
+
+ @Alternate("glGetRenderbufferParameteriv")
+ @GLreturn("params")
+ @StripPostfix("params")
+ void glGetRenderbufferParameteriv2(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params);
+
+ boolean glIsFramebuffer(@GLuint int framebuffer);
+
+ void glBindFramebuffer(@GLenum int target, @GLuint int framebuffer);
+
+ void glDeleteFramebuffers(@AutoSize("framebuffers") int n, @Const @GLuint IntBuffer framebuffers);
+
+ @Alternate("glDeleteFramebuffers")
+ void glDeleteFramebuffers(@Constant("1") int n, @Constant(value = "APIUtils.getBufferInt().put(0, framebuffer), 0", keepParam = true) int framebuffer);
+
+ void glGenFramebuffers(@AutoSize("framebuffers") int n, @OutParameter @GLuint IntBuffer framebuffers);
+
+ @Alternate("glGenFramebuffers")
+ @GLreturn("framebuffers")
+ void glGenFramebuffers2(@Constant("1") int n, @OutParameter @GLuint IntBuffer framebuffers);
+
+ @GLenum
+ int glCheckFramebufferStatus(@GLenum int target);
+
+ void glFramebufferTexture1D(@GLenum int target, @GLenum int attachment, @GLenum int textarget, @GLuint int texture, int level);
+
+ void glFramebufferTexture2D(@GLenum int target, @GLenum int attachment, @GLenum int textarget, @GLuint int texture, int level);
+
+ void glFramebufferTexture3D(@GLenum int target, @GLenum int attachment, @GLenum int textarget, @GLuint int texture, int level, int zoffset);
+
+ void glFramebufferRenderbuffer(@GLenum int target, @GLenum int attachment, @GLenum int renderbuffertarget, @GLuint int renderbuffer);
+
+ @StripPostfix("params")
+ void glGetFramebufferAttachmentParameteriv(@GLenum int target, @GLenum int attachment, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
+
+ @Alternate("glGetFramebufferAttachmentParameteriv")
+ @GLreturn("params")
+ @StripPostfix("params")
+ void glGetFramebufferAttachmentParameteriv2(@GLenum int target, @GLenum int attachment, @GLenum int pname, @OutParameter IntBuffer params);
+
+ void glGenerateMipmap(@GLenum int target);
+
+ // --------------------------------------------------------------------------------------------
+ // ----------------------[ ARB_half_float_vertex & ARB_half_float_pixel ]----------------------
+ // --------------------------------------------------------------------------------------------
+
+ /**
+ * Accepted by the <type> parameter of DrawPixels, ReadPixels,
+ * TexImage1D, TexImage2D, TexImage3D, GetTexImage, TexSubImage1D,
+ * TexSubImage2D, TexSubImage3D, GetHistogram, GetMinmax,
+ * ConvolutionFilter1D, ConvolutionFilter2D, GetConvolutionFilter,
+ * SeparableFilter2D, GetSeparableFilter, ColorTable, ColorSubTable,
+ * and GetColorTable:
+ * <p/>
+ * Accepted by the <type> argument of VertexPointer, NormalPointer,
+ * ColorPointer, SecondaryColorPointer, FogCoordPointer, TexCoordPointer,
+ * and VertexAttribPointer:
+ */
+ int GL_HALF_FLOAT = 0x140B;
+
+ // ---------------------------------------------------------------------------
+ // ----------------------[ EXT_framebuffer_multisample ]----------------------
+ // ---------------------------------------------------------------------------
+
+ /** Accepted by the <pname> parameter of GetRenderbufferParameteriv. */
+ int GL_RENDERBUFFER_SAMPLES = 0x8CAB;
+
+ /** Returned by CheckFramebufferStatus. */
+ int GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0x8D56;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, and GetDoublev.
+ */
+ int GL_MAX_SAMPLES = 0x8D57;
+
+ /**
+ * Establishes the data storage, format, dimensions, and number of
+ * samples of a renderbuffer object's image.
+ */
+ void glRenderbufferStorageMultisample(
+ @GLenum int target, @GLsizei int samples,
+ @GLenum int internalformat,
+ @GLsizei int width, @GLsizei int height);
+
+ // --------------------------------------------------------------------
+ // ----------------------[ EXT_framebuffer_blit ]----------------------
+ // --------------------------------------------------------------------
+
+ /**
+ * Accepted by the <target> parameter of BindFramebuffer,
+ * CheckFramebufferStatus, FramebufferTexture{1D|2D|3D},
+ * FramebufferRenderbuffer, and
+ * GetFramebufferAttachmentParameteriv.
+ */
+ int GL_READ_FRAMEBUFFER = 0x8CA8;
+ int GL_DRAW_FRAMEBUFFER = 0x8CA9;
+
+ /** Accepted by the <pname> parameters of GetIntegerv, GetFloatv, and GetDoublev. */
+ int GL_DRAW_FRAMEBUFFER_BINDING = 0x8CA6; // alias FRAMEBUFFER_BINDING
+ int GL_READ_FRAMEBUFFER_BINDING = 0x8CAA;
+
+ /**
+ * Transfers a rectangle of pixel values from one
+ * region of the read framebuffer to another in the draw framebuffer.
+ * <mask> is the bitwise OR of a number of values indicating which
+ * buffers are to be copied. The values are COLOR_BUFFER_BIT,
+ * DEPTH_BUFFER_BIT, and STENCIL_BUFFER_BIT.
+ * The pixels corresponding to these buffers are
+ * copied from the source rectangle, bound by the locations (srcX0,
+ * srcY0) and (srcX1, srcY1) inclusive, to the destination rectangle,
+ * bound by the locations (dstX0, dstY0) and (dstX1, dstY1)
+ * inclusive.
+ * If the source and destination rectangle dimensions do not match,
+ * the source image is stretched to fit the destination
+ * rectangle. <filter> must be LINEAR or NEAREST and specifies the
+ * method of interpolation to be applied if the image is
+ * stretched.
+ */
+ void glBlitFramebuffer(
+ @GLint int srcX0, @GLint int srcY0, @GLint int srcX1, @GLint int srcY1,
+ @GLint int dstX0, @GLint int dstY0, @GLint int dstX1, @GLint int dstY1,
+ @GLbitfield int mask, @GLenum int filter);
+
+ // -------------------------------------------------------------------
+ // ----------------------[ EXT_texture_integer ]----------------------
+ // -------------------------------------------------------------------
+
+ /**
+ * Accepted by the <pname> parameters of GetBooleanv, GetIntegerv,
+ * GetFloatv, and GetDoublev:
+ */
+ int GL_RGBA_INTEGER_MODE = 0x8D9E;
+
+ /**
+ * Accepted by the <internalFormat> parameter of TexImage1D,
+ * TexImage2D, and TexImage3D:
+ */
+ int GL_RGBA32UI = 0x8D70;
+ int GL_RGB32UI = 0x8D71;
+ int GL_ALPHA32UI = 0x8D72;
+
+ int GL_RGBA16UI = 0x8D76;
+ int GL_RGB16UI = 0x8D77;
+ int GL_ALPHA16UI = 0x8D78;
+
+ int GL_RGBA8UI = 0x8D7C;
+ int GL_RGB8UI = 0x8D7D;
+ int GL_ALPHA8UI = 0x8D7E;
+
+ int GL_RGBA32I = 0x8D82;
+ int GL_RGB32I = 0x8D83;
+ int GL_ALPHA32I = 0x8D84;
+
+ int GL_RGBA16I = 0x8D88;
+ int GL_RGB16I = 0x8D89;
+ int GL_ALPHA16I = 0x8D8A;
+
+ int GL_RGBA8I = 0x8D8E;
+ int GL_RGB8I = 0x8D8F;
+ int GL_ALPHA8I = 0x8D90;
+
+ /**
+ * Accepted by the <format> parameter of TexImage1D, TexImage2D,
+ * TexImage3D, TexSubImage1D, TexSubImage2D, TexSubImage3D,
+ * DrawPixels and ReadPixels:
+ */
+ int GL_RED_INTEGER = 0x8D94;
+ int GL_GREEN_INTEGER = 0x8D95;
+ int GL_BLUE_INTEGER = 0x8D96;
+ int GL_ALPHA_INTEGER = 0x8D97;
+ int GL_RGB_INTEGER = 0x8D98;
+ int GL_RGBA_INTEGER = 0x8D99;
+ int GL_BGR_INTEGER = 0x8D9A;
+ int GL_BGRA_INTEGER = 0x8D9B;
+
+ @StripPostfix("params")
+ void glTexParameterIiv(@GLenum int target, @GLenum int pname, @Check("4") IntBuffer params);
+
+ @Alternate("glTexParameterIiv")
+ @StripPostfix(value = "param", postfix = "v")
+ void glTexParameterIiv(@GLenum int target, @GLenum int pname, @Constant(value = "APIUtils.getBufferInt().put(0, param), 0", keepParam = true) int param);
+
+ @StripPostfix("params")
+ void glTexParameterIuiv(@GLenum int target, @GLenum int pname, @Check("4") @GLuint IntBuffer params);
+
+ @Alternate("glTexParameterIuiv")
+ @StripPostfix(value = "param", postfix = "v")
+ void glTexParameterIuiv(@GLenum int target, @GLenum int pname, @Constant(value = "APIUtils.getBufferInt().put(0, param), 0", keepParam = true) int param);
+
+ @StripPostfix("params")
+ void glGetTexParameterIiv(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
+
+ @Alternate("glGetTexParameterIiv")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetTexParameterIiv2(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params);
+
+ @StripPostfix("params")
+ void glGetTexParameterIuiv(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") @GLuint IntBuffer params);
+
+ @Alternate("glGetTexParameterIuiv")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetTexParameterIuiv2(@GLenum int target, @GLenum int pname, @OutParameter @GLuint IntBuffer params);
+
+ // -----------------------------------------------------------------
+ // ----------------------[ EXT_texture_array ]----------------------
+ // -----------------------------------------------------------------
+
+ /**
+ * Accepted by the <target> parameter of TexParameteri, TexParameteriv,
+ * TexParameterf, TexParameterfv, and BindTexture:
+ */
+ int GL_TEXTURE_1D_ARRAY = 0x8C18;
+ int GL_TEXTURE_2D_ARRAY = 0x8C1A;
+
+ /**
+ * Accepted by the <target> parameter of TexImage3D, TexSubImage3D,
+ * CopyTexSubImage3D, CompressedTexImage3D, and CompressedTexSubImage3D:
+ */
+ int GL_PROXY_TEXTURE_2D_ARRAY = 0x8C1B;
+
+ /**
+ * Accepted by the <target> parameter of TexImage2D, TexSubImage2D,
+ * CopyTexImage2D, CopyTexSubImage2D, CompressedTexImage2D, and
+ * CompressedTexSubImage2D:
+ */
+ int GL_PROXY_TEXTURE_1D_ARRAY = 0x8C19;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetDoublev, GetIntegerv
+ * and GetFloatv:
+ */
+ int GL_TEXTURE_BINDING_1D_ARRAY = 0x8C1C;
+ int GL_TEXTURE_BINDING_2D_ARRAY = 0x8C1D;
+ int GL_MAX_ARRAY_TEXTURE_LAYERS = 0x88FF;
+
+ /**
+ * Accepted by the <param> parameter of TexParameterf, TexParameteri,
+ * TexParameterfv, and TexParameteriv when the <pname> parameter is
+ * TEXTURE_COMPARE_MODE_ARB:
+ */
+ int GL_COMPARE_REF_DEPTH_TO_TEXTURE = 0x884E;
+
+ /**
+ * Accepted by the <pname> parameter of
+ * GetFramebufferAttachmentParameteriv:
+ */
+ int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 0x8CD4;
+
+ /** Returned by the <type> parameter of GetActiveUniform: */
+ int GL_SAMPLER_1D_ARRAY = 0x8DC0;
+ int GL_SAMPLER_2D_ARRAY = 0x8DC1;
+ int GL_SAMPLER_1D_ARRAY_SHADOW = 0x8DC3;
+ int GL_SAMPLER_2D_ARRAY_SHADOW = 0x8DC4;
+
+ void glFramebufferTextureLayer(@GLenum int target, @GLenum int attachment, @GLuint int texture, int level, int layer);
+
+ // ------------------------------------------------------------------------
+ // ----------------------[ EXT_packed_depth_stencil ]----------------------
+ // ------------------------------------------------------------------------
+
+ /**
+ * Accepted by the <format> parameter of DrawPixels, ReadPixels,
+ * TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D,
+ * TexSubImage3D, and GetTexImage, by the <type> parameter of
+ * CopyPixels, by the <internalformat> parameter of TexImage1D,
+ * TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D, and
+ * RenderbufferStorage, and returned in the <data> parameter of
+ * GetTexLevelParameter and GetRenderbufferParameteriv.
+ */
+ int GL_DEPTH_STENCIL = 0x84F9;
+
+ /**
+ * Accepted by the <type> parameter of DrawPixels, ReadPixels,
+ * TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D,
+ * TexSubImage3D, and GetTexImage.
+ */
+ int GL_UNSIGNED_INT_24_8 = 0x84FA;
+
+ /**
+ * Accepted by the <internalformat> parameter of TexImage1D,
+ * TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D, and
+ * RenderbufferStorage, and returned in the <data> parameter of
+ * GetTexLevelParameter and GetRenderbufferParameteriv.
+ */
+ int GL_DEPTH24_STENCIL8 = 0x88F0;
+
+ /** Accepted by the <value> parameter of GetTexLevelParameter. */
+ int GL_TEXTURE_STENCIL_SIZE = 0x88F1;
+
+ // -----------------------------------------------------------------
+ // ----------------------[ EXT_draw_buffers2 ]----------------------
+ // -----------------------------------------------------------------
+
+ void glColorMaski(@GLuint int buf, boolean r, boolean g, boolean b, boolean a);
+
+ @StripPostfix(value = "data", hasPostfix = false)
+ void glGetBooleani_v(@GLenum int value, @GLuint int index, @OutParameter @Check("4") @GLboolean ByteBuffer data);
+
+ @Alternate("glGetBooleani_v")
+ @GLreturn("data")
+ @StripPostfix(value = "data", hasPostfix = false)
+ void glGetBooleani_v2(@GLenum int value, @GLuint int index, @OutParameter @GLboolean ByteBuffer data);
+
+ @StripPostfix("data")
+ void glGetIntegeri_v(@GLenum int value, @GLuint int index, @OutParameter @Check("4") IntBuffer data);
+
+ @Alternate("glGetIntegeri_v")
+ @GLreturn("data")
+ @StripPostfix("data")
+ void glGetIntegeri_v2(@GLenum int value, @GLuint int index, @OutParameter IntBuffer data);
+
+ void glEnablei(@GLenum int target, @GLuint int index);
+
+ void glDisablei(@GLenum int target, @GLuint int index);
+
+ boolean glIsEnabledi(@GLenum int target, @GLuint int index);
+
+ // ----------------------------------------------------------------------------
+ // ----------------------[ ARB_texture_compression_rgtc ]----------------------
+ // ----------------------------------------------------------------------------
+
+ /**
+ * Accepted by the <internalformat> parameter of TexImage2D,
+ * CopyTexImage2D, and CompressedTexImage2D and the <format> parameter
+ * of CompressedTexSubImage2D:
+ */
+ int GL_COMPRESSED_RED_RGTC1 = 0x8DBB;
+ int GL_COMPRESSED_SIGNED_RED_RGTC1 = 0x8DBC;
+ int GL_COMPRESSED_RED_GREEN_RGTC2 = 0x8DBD;
+ int GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2 = 0x8DBE;
+
+ // --------------------------------------------------------------
+ // ----------------------[ ARB_texture_rg ]----------------------
+ // --------------------------------------------------------------
+
+ /**
+ * Accepted by the <internalFormat> parameter of TexImage1D, TexImage2D,
+ * TexImage3D, CopyTexImage1D, and CopyTexImage2D:
+ */
+ int GL_R8 = 0x8229;
+ int GL_R16 = 0x822A;
+
+ int GL_RG8 = 0x822B;
+ int GL_RG16 = 0x822C;
+
+ int GL_R16F = 0x822D;
+ int GL_R32F = 0x822E;
+
+ int GL_RG16F = 0x822F;
+ int GL_RG32F = 0x8230;
+
+ int GL_R8I = 0x8231;
+ int GL_R8UI = 0x8232;
+ int GL_R16I = 0x8233;
+ int GL_R16UI = 0x8234;
+ int GL_R32I = 0x8235;
+ int GL_R32UI = 0x8236;
+
+ int GL_RG8I = 0x8237;
+ int GL_RG8UI = 0x8238;
+ int GL_RG16I = 0x8239;
+ int GL_RG16UI = 0x823A;
+ int GL_RG32I = 0x823B;
+ int GL_RG32UI = 0x823C;
+
+ /**
+ * Accepted by the <format> parameter of TexImage3D, TexImage2D,
+ * TexImage3D, TexSubImage1D, TexSubImage2D, TexSubImage3D,
+ * DrawPixels and ReadPixels:
+ */
+ int GL_RG = 0x8227;
+ int GL_RG_INTEGER = 0x8228;
+
+ /**
+ * Accepted by the <param> parameter of the TexParameter{if}*
+ * functions when <pname> is DEPTH_TEXTURE_MODE:
+ */
+ int GL_RED = 0x1903;
+
+ // ----------------------------------------------------------------------
+ // ----------------------[ EXT_transform_feedback ]----------------------
+ // ----------------------------------------------------------------------
+
+ /**
+ * Accepted by the <target> parameters of BindBuffer, BufferData,
+ * BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData,
+ * GetBufferPointerv, BindBufferRange, BindBufferOffset and
+ * BindBufferBase:
+ */
+ int GL_TRANSFORM_FEEDBACK_BUFFER = 0x8C8E;
+
+ /**
+ * Accepted by the <param> parameter of GetIntegerIndexedv and
+ * GetBooleanIndexedv:
+ */
+ int GL_TRANSFORM_FEEDBACK_BUFFER_START = 0x8C84;
+ int GL_TRANSFORM_FEEDBACK_BUFFER_SIZE = 0x8C85;
+
+ /**
+ * Accepted by the <param> parameter of GetIntegerIndexedv and
+ * GetBooleanIndexedv, and by the <pname> parameter of GetBooleanv,
+ * GetDoublev, GetIntegerv, and GetFloatv:
+ */
+ int GL_TRANSFORM_FEEDBACK_BUFFER_BINDING = 0x8C8F;
+
+ /** Accepted by the <bufferMode> parameter of TransformFeedbackVaryings: */
+ int GL_INTERLEAVED_ATTRIBS = 0x8C8C;
+ int GL_SEPARATE_ATTRIBS = 0x8C8D;
+
+ /**
+ * Accepted by the <target> parameter of BeginQuery, EndQuery, and
+ * GetQueryiv:
+ */
+ int GL_PRIMITIVES_GENERATED = 0x8C87;
+ int GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 0x8C88;
+
+ /**
+ * Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, and by
+ * the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
+ * GetDoublev:
+ */
+ int GL_RASTERIZER_DISCARD = 0x8C89;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetDoublev, GetIntegerv,
+ * and GetFloatv:
+ */
+ int GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 0x8C8A;
+ int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 0x8C8B;
+ int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 0x8C80;
+
+ /** Accepted by the <pname> parameter of GetProgramiv: */
+ int GL_TRANSFORM_FEEDBACK_VARYINGS = 0x8C83;
+ int GL_TRANSFORM_FEEDBACK_BUFFER_MODE = 0x8C7F;
+ int GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH = 0x8C76;
+
+ void glBindBufferRange(@GLenum int target, @GLuint int index, @GLuint int buffer, @GLintptr long offset, @GLsizeiptr long size);
+
+ void glBindBufferBase(@GLenum int target, @GLuint int index, @GLuint int buffer);
+
+ void glBeginTransformFeedback(@GLenum int primitiveMode);
+
+ void glEndTransformFeedback();
+
+ void glTransformFeedbackVaryings(@GLuint int program, @GLsizei int count,
+ @Const @NullTerminated("count") @GLchar @StringList("count") ByteBuffer varyings,
+ @GLenum int bufferMode);
+
+ @Alternate("glTransformFeedbackVaryings")
+ void glTransformFeedbackVaryings(@GLuint int program, @Constant("varyings.length") @GLsizei int count,
+ @Const @NullTerminated @StringList("count") CharSequence[] varyings,
+ @GLenum int bufferMode);
+
+ void glGetTransformFeedbackVarying(@GLuint int program, @GLuint int index, @AutoSize("name") @GLsizei int bufSize,
+ @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
+ @OutParameter @GLsizei @Check("1") IntBuffer size,
+ @OutParameter @GLenum @Check("1") IntBuffer type,
+ @OutParameter @GLchar ByteBuffer name);
+
+ @Alternate("glGetTransformFeedbackVarying")
+ @GLreturn(value = "name", maxLength = "bufSize")
+ void glGetTransformFeedbackVarying2(@GLuint int program, @GLuint int index, @GLsizei int bufSize,
+ @OutParameter @GLsizei @Constant("name_length, 0") IntBuffer length,
+ @OutParameter @GLsizei @Check("1") IntBuffer size,
+ @OutParameter @GLenum @Check("1") IntBuffer type,
+ @OutParameter @GLchar ByteBuffer name);
+
+ // -----------------------------------------------------------------------
+ // ----------------------[ ARB_vertex_array_object ]----------------------
+ // -----------------------------------------------------------------------
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, and GetDoublev:
+ */
+ int GL_VERTEX_ARRAY_BINDING = 0x85B5;
+
+ void glBindVertexArray(@GLuint int array);
+
+ void glDeleteVertexArrays(@AutoSize("arrays") @GLsizei int n, @Const @GLuint IntBuffer arrays);
+
+ @Alternate("glDeleteVertexArrays")
+ void glDeleteVertexArrays(@Constant("1") @GLsizei int n, @Constant(value = "APIUtils.getBufferInt().put(0, array), 0", keepParam = true) int array);
+
+ void glGenVertexArrays(@AutoSize("arrays") @GLsizei int n, @OutParameter @GLuint IntBuffer arrays);
+
+ @Alternate("glGenVertexArrays")
+ @GLreturn("arrays")
+ void glGenVertexArrays2(@Constant("1") @GLsizei int n, @OutParameter @GLuint IntBuffer arrays);
+
+ boolean glIsVertexArray(@GLuint int array);
+
+ // --------------------------------------------------------------------
+ // ----------------------[ ARB_framebuffer_sRGB ]----------------------
+ // --------------------------------------------------------------------
+
+ /**
+ * Accepted by the <cap> parameter of Enable, Disable, and IsEnabled,
+ * and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
+ * and GetDoublev:
+ */
+ int GL_FRAMEBUFFER_SRGB = 0x8DB9;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, and GetDoublev:
+ */
+ int GL_FRAMEBUFFER_SRGB_CAPABLE = 0x8DBA;
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/GL31.java b/src/templates/org/lwjgl/opengl/GL31.java
index 4baaad7..e38cc25 100644
--- a/src/templates/org/lwjgl/opengl/GL31.java
+++ b/src/templates/org/lwjgl/opengl/GL31.java
@@ -1,296 +1,296 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.Buffer;
-import java.nio.ByteBuffer;
-import java.nio.IntBuffer;
-
-public interface GL31 {
-
- // ----------------------------------------------------------
- // ----------------------[ OpenGL 3.1 ]----------------------
- // ----------------------------------------------------------
-
- int GL_RED_SNORM = 0x8F90;
- int GL_RG_SNORM = 0x8F91;
- int GL_RGB_SNORM = 0x8F92;
- int GL_RGBA_SNORM = 0x8F93;
- int GL_R8_SNORM = 0x8F94;
- int GL_RG8_SNORM = 0x8F95;
- int GL_RGB8_SNORM = 0x8F96;
- int GL_RGBA8_SNORM = 0x8F97;
- int GL_R16_SNORM = 0x8F98;
- int GL_RG16_SNORM = 0x8F99;
- int GL_RGB16_SNORM = 0x8F9A;
- int GL_RGBA16_SNORM = 0x8F9B;
- int GL_SIGNED_NORMALIZED = 0x8F9C;
-
- // ------------------------------------------------------------------
- // ----------------------[ ARB_draw_instanced ]----------------------
- // ------------------------------------------------------------------
-
- void glDrawArraysInstanced(@GLenum int mode, int first, @GLsizei int count, @GLsizei int primcount);
-
- void glDrawElementsInstanced(@GLenum int mode, @AutoSize("indices") @GLsizei int count, @AutoType("indices") @GLenum int type,
- @BufferObject(BufferKind.ElementVBO)
- @Const
- @GLubyte
- @GLushort
- @GLuint Buffer indices, @GLsizei int primcount);
-
- // ---------------------------------------------------------------
- // ----------------------[ EXT_copy_buffer ]----------------------
- // ---------------------------------------------------------------
-
- int GL_COPY_READ_BUFFER = 0x8F36;
- int GL_COPY_WRITE_BUFFER = 0x8F37;
-
- void glCopyBufferSubData(@GLenum int readtarget, @GLenum int writetarget, @GLintptr long readoffset, @GLintptr long writeoffset, @GLsizeiptr long size);
-
- // --------------------------------------------------------------------
- // ----------------------[ NV_primitive_restart ]----------------------
- // --------------------------------------------------------------------
-
- /**
- * Accepted by the <cap> parameter of IsEnabled, and by
- * the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
- * GetDoublev:
- */
- int GL_PRIMITIVE_RESTART = 0x8F9D;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv, and GetDoublev:
- */
- int GL_PRIMITIVE_RESTART_INDEX = 0x8F9E;
-
- void glPrimitiveRestartIndex(@GLuint int index);
-
- // -------------------------------------------------------------------------
- // ----------------------[ ARB_texture_buffer_object ]----------------------
- // -------------------------------------------------------------------------
-
- /**
- * Accepted by the <target> parameter of BindBuffer, BufferData,
- * BufferSubData, MapBuffer, MapBufferRange, BindTexture, UnmapBuffer,
- * GetBufferSubData, GetBufferParameteriv, GetBufferPointerv, and TexBuffer,
- * and the <pname> parameter of GetBooleanv, GetDoublev, GetFloatv, and
- * GetIntegerv:
- */
- int GL_TEXTURE_BUFFER = 0x8C2A;
-
- /**
- * Accepted by the <pname> parameters of GetBooleanv, GetDoublev,
- * GetFloatv, and GetIntegerv:
- */
- int GL_MAX_TEXTURE_BUFFER_SIZE = 0x8C2B;
- int GL_TEXTURE_BINDING_BUFFER = 0x8C2C;
- int GL_TEXTURE_BUFFER_DATA_STORE_BINDING = 0x8C2D;
- int GL_TEXTURE_BUFFER_FORMAT = 0x8C2E;
-
- void glTexBuffer(@GLenum int target, @GLenum int internalformat, @GLuint int buffer);
-
- // ---------------------------------------------------------------------
- // ----------------------[ ARB_texture_rectangle ]----------------------
- // ---------------------------------------------------------------------
-
- /**
- * Accepted by the <cap> parameter of Enable, Disable and IsEnabled;
- * by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv
- * and GetDoublev; and by the <target> parameter of BindTexture,
- * GetTexParameterfv, GetTexParameteriv, TexParameterf, TexParameteri,
- * TexParameterfv and TexParameteriv:
- * Accepted by the <target> parameter of GetTexImage,
- * GetTexLevelParameteriv, GetTexLevelParameterfv, TexImage2D,
- * CopyTexImage2D, TexSubImage2D and CopySubTexImage2D:
- */
- int GL_TEXTURE_RECTANGLE = 0x84F5;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv and GetDoublev:
- */
- int GL_TEXTURE_BINDING_RECTANGLE = 0x84F6;
-
- /**
- * Accepted by the <target> parameter of GetTexLevelParameteriv,
- * GetTexLevelParameterfv, GetTexParameteriv and TexImage2D:
- */
- int GL_PROXY_TEXTURE_RECTANGLE = 0x84F7;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetDoublev,
- * GetIntegerv and GetFloatv:
- */
- int GL_MAX_RECTANGLE_TEXTURE_SIZE = 0x84F8;
-
- /**
- * Returned by <type> parameter of GetActiveUniform when the location
- * <index> for program object <program> is of type sampler2DRect:
- */
- int GL_SAMPLER_2D_RECT = 0x8B63;
-
- /**
- * Returned by <type> parameter of GetActiveUniform when the location
- * <index> for program object <program> is of type sampler2DRectShadow:
- */
- int GL_SAMPLER_2D_RECT_SHADOW = 0x8B64;
-
- // -------------------------------------------------------------------------
- // ----------------------[ ARB_uniform_buffer_object ]----------------------
- // -------------------------------------------------------------------------
-
- /**
- * Accepted by the <target> parameters of BindBuffer, BufferData,
- * BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, and
- * GetBufferPointerv:
- */
- int GL_UNIFORM_BUFFER = 0x8A11;
-
- /**
- * Accepted by the <pname> parameter of GetIntegeri_v, GetBooleanv,
- * GetIntegerv, GetFloatv, and GetDoublev:
- */
- int GL_UNIFORM_BUFFER_BINDING = 0x8A28;
-
- /** Accepted by the <pname> parameter of GetIntegeri_v: */
- int GL_UNIFORM_BUFFER_START = 0x8A29;
- int GL_UNIFORM_BUFFER_SIZE = 0x8A2A;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv, and GetDoublev:
- */
- int GL_MAX_VERTEX_UNIFORM_BLOCKS = 0x8A2B;
- int GL_MAX_GEOMETRY_UNIFORM_BLOCKS = 0x8A2C;
- int GL_MAX_FRAGMENT_UNIFORM_BLOCKS = 0x8A2D;
- int GL_MAX_COMBINED_UNIFORM_BLOCKS = 0x8A2E;
- int GL_MAX_UNIFORM_BUFFER_BINDINGS = 0x8A2F;
- int GL_MAX_UNIFORM_BLOCK_SIZE = 0x8A30;
- int GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 0x8A31;
- int GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS = 0x8A32;
- int GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 0x8A33;
- int GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT = 0x8A34;
-
- /** Accepted by the <pname> parameter of GetProgramiv: */
- int GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH = 0x8A35;
- int GL_ACTIVE_UNIFORM_BLOCKS = 0x8A36;
-
- /** Accepted by the <pname> parameter of GetActiveUniformsiv: */
- int GL_UNIFORM_TYPE = 0x8A37;
- int GL_UNIFORM_SIZE = 0x8A38;
- int GL_UNIFORM_NAME_LENGTH = 0x8A39;
- int GL_UNIFORM_BLOCK_INDEX = 0x8A3A;
- int GL_UNIFORM_OFFSET = 0x8A3B;
- int GL_UNIFORM_ARRAY_STRIDE = 0x8A3C;
- int GL_UNIFORM_MATRIX_STRIDE = 0x8A3D;
- int GL_UNIFORM_IS_ROW_MAJOR = 0x8A3E;
-
- /** Accepted by the <pname> parameter of GetActiveUniformBlockiv: */
- int GL_UNIFORM_BLOCK_BINDING = 0x8A3F;
- int GL_UNIFORM_BLOCK_DATA_SIZE = 0x8A40;
- int GL_UNIFORM_BLOCK_NAME_LENGTH = 0x8A41;
- int GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS = 0x8A42;
- int GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 0x8A43;
- int GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 0x8A44;
- int GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER = 0x8A45;
- int GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 0x8A46;
-
- /** Returned by GetActiveUniformsiv and GetUniformBlockIndex */
- int GL_INVALID_INDEX = 0xFFFFFFFF;
-
- void glGetUniformIndices(@GLuint int program, @AutoSize("uniformIndices") @GLsizei int uniformCount,
- @Const @NullTerminated("uniformIndices.remaining()") @GLchar @StringList("uniformCount") ByteBuffer uniformNames,
- @OutParameter @GLuint IntBuffer uniformIndices);
-
- @Alternate("glGetUniformIndices")
- void glGetUniformIndices(@GLuint int program, @Constant("uniformNames.length") @GLsizei int uniformCount,
- @Const @NullTerminated @StringList("uniformCount") CharSequence[] uniformNames,
- @OutParameter @Check("uniformNames.length") @GLuint IntBuffer uniformIndices);
-
- @StripPostfix("params")
- void glGetActiveUniformsiv(@GLuint int program, @AutoSize("uniformIndices") @GLsizei int uniformCount,
- @Const @GLuint IntBuffer uniformIndices,
- @GLenum int pname,
- @OutParameter @Check("uniformIndices.remaining()") @GLint IntBuffer params);
-
- @Alternate("glGetActiveUniformsiv")
- @GLreturn("params")
- @StripPostfix("params")
- void glGetActiveUniformsiv(@GLuint int program, @Constant("1") @GLsizei int uniformCount,
- @Constant(value = "params.put(1, uniformIndex), 1", keepParam = true) int uniformIndex, // Reuse params buffer
- @GLenum int pname,
- @OutParameter @GLint IntBuffer params);
-
- void glGetActiveUniformName(@GLuint int program, @GLuint int uniformIndex, @AutoSize("uniformName") @GLsizei int bufSize,
- @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
- @OutParameter @GLchar ByteBuffer uniformName);
-
- @Alternate("glGetActiveUniformName")
- @GLreturn(value = "uniformName", maxLength = "bufSize")
- void glGetActiveUniformName2(@GLuint int program, @GLuint int uniformIndex, @GLsizei int bufSize,
- @OutParameter @GLsizei @Constant("uniformName_length, 0") IntBuffer length,
- @OutParameter @GLchar ByteBuffer uniformName);
-
- @GLuint
- int glGetUniformBlockIndex(@GLuint int program, @Const @NullTerminated @GLchar ByteBuffer uniformBlockName);
-
- @Alternate("glGetUniformBlockIndex")
- @GLuint
- int glGetUniformBlockIndex(@GLuint int program, @NullTerminated CharSequence uniformBlockName);
-
- @StripPostfix("params")
- void glGetActiveUniformBlockiv(@GLuint int program, @GLuint int uniformBlockIndex, @GLenum int pname,
- @OutParameter @Check(value = "16") @GLint IntBuffer params);
-
- @Alternate("glGetActiveUniformBlockiv")
- @GLreturn("params")
- @StripPostfix("params")
- void glGetActiveUniformBlockiv2(@GLuint int program, @GLuint int uniformBlockIndex, @GLenum int pname,
- @OutParameter @GLint IntBuffer params);
-
- void glGetActiveUniformBlockName(@GLuint int program, @GLuint int uniformBlockIndex, @AutoSize("uniformBlockName") @GLsizei int bufSize,
- @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
- @OutParameter @GLchar ByteBuffer uniformBlockName);
-
- @Alternate("glGetActiveUniformBlockName")
- @GLreturn(value = "uniformBlockName", maxLength = "bufSize")
- void glGetActiveUniformBlockName2(@GLuint int program, @GLuint int uniformBlockIndex, @GLsizei int bufSize,
- @OutParameter @GLsizei @Constant("uniformBlockName_length, 0") IntBuffer length,
- @OutParameter @GLchar ByteBuffer uniformBlockName);
-
- void glUniformBlockBinding(@GLuint int program, @GLuint int uniformBlockIndex, @GLuint int uniformBlockBinding);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.Buffer;
+import java.nio.ByteBuffer;
+import java.nio.IntBuffer;
+
+public interface GL31 {
+
+ // ----------------------------------------------------------
+ // ----------------------[ OpenGL 3.1 ]----------------------
+ // ----------------------------------------------------------
+
+ int GL_RED_SNORM = 0x8F90;
+ int GL_RG_SNORM = 0x8F91;
+ int GL_RGB_SNORM = 0x8F92;
+ int GL_RGBA_SNORM = 0x8F93;
+ int GL_R8_SNORM = 0x8F94;
+ int GL_RG8_SNORM = 0x8F95;
+ int GL_RGB8_SNORM = 0x8F96;
+ int GL_RGBA8_SNORM = 0x8F97;
+ int GL_R16_SNORM = 0x8F98;
+ int GL_RG16_SNORM = 0x8F99;
+ int GL_RGB16_SNORM = 0x8F9A;
+ int GL_RGBA16_SNORM = 0x8F9B;
+ int GL_SIGNED_NORMALIZED = 0x8F9C;
+
+ // ------------------------------------------------------------------
+ // ----------------------[ ARB_draw_instanced ]----------------------
+ // ------------------------------------------------------------------
+
+ void glDrawArraysInstanced(@GLenum int mode, int first, @GLsizei int count, @GLsizei int primcount);
+
+ void glDrawElementsInstanced(@GLenum int mode, @AutoSize("indices") @GLsizei int count, @AutoType("indices") @GLenum int type,
+ @BufferObject(BufferKind.ElementVBO)
+ @Const
+ @GLubyte
+ @GLushort
+ @GLuint Buffer indices, @GLsizei int primcount);
+
+ // ---------------------------------------------------------------
+ // ----------------------[ EXT_copy_buffer ]----------------------
+ // ---------------------------------------------------------------
+
+ int GL_COPY_READ_BUFFER = 0x8F36;
+ int GL_COPY_WRITE_BUFFER = 0x8F37;
+
+ void glCopyBufferSubData(@GLenum int readtarget, @GLenum int writetarget, @GLintptr long readoffset, @GLintptr long writeoffset, @GLsizeiptr long size);
+
+ // --------------------------------------------------------------------
+ // ----------------------[ NV_primitive_restart ]----------------------
+ // --------------------------------------------------------------------
+
+ /**
+ * Accepted by the <cap> parameter of IsEnabled, and by
+ * the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
+ * GetDoublev:
+ */
+ int GL_PRIMITIVE_RESTART = 0x8F9D;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, and GetDoublev:
+ */
+ int GL_PRIMITIVE_RESTART_INDEX = 0x8F9E;
+
+ void glPrimitiveRestartIndex(@GLuint int index);
+
+ // -------------------------------------------------------------------------
+ // ----------------------[ ARB_texture_buffer_object ]----------------------
+ // -------------------------------------------------------------------------
+
+ /**
+ * Accepted by the <target> parameter of BindBuffer, BufferData,
+ * BufferSubData, MapBuffer, MapBufferRange, BindTexture, UnmapBuffer,
+ * GetBufferSubData, GetBufferParameteriv, GetBufferPointerv, and TexBuffer,
+ * and the <pname> parameter of GetBooleanv, GetDoublev, GetFloatv, and
+ * GetIntegerv:
+ */
+ int GL_TEXTURE_BUFFER = 0x8C2A;
+
+ /**
+ * Accepted by the <pname> parameters of GetBooleanv, GetDoublev,
+ * GetFloatv, and GetIntegerv:
+ */
+ int GL_MAX_TEXTURE_BUFFER_SIZE = 0x8C2B;
+ int GL_TEXTURE_BINDING_BUFFER = 0x8C2C;
+ int GL_TEXTURE_BUFFER_DATA_STORE_BINDING = 0x8C2D;
+ int GL_TEXTURE_BUFFER_FORMAT = 0x8C2E;
+
+ void glTexBuffer(@GLenum int target, @GLenum int internalformat, @GLuint int buffer);
+
+ // ---------------------------------------------------------------------
+ // ----------------------[ ARB_texture_rectangle ]----------------------
+ // ---------------------------------------------------------------------
+
+ /**
+ * Accepted by the <cap> parameter of Enable, Disable and IsEnabled;
+ * by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv
+ * and GetDoublev; and by the <target> parameter of BindTexture,
+ * GetTexParameterfv, GetTexParameteriv, TexParameterf, TexParameteri,
+ * TexParameterfv and TexParameteriv:
+ * Accepted by the <target> parameter of GetTexImage,
+ * GetTexLevelParameteriv, GetTexLevelParameterfv, TexImage2D,
+ * CopyTexImage2D, TexSubImage2D and CopySubTexImage2D:
+ */
+ int GL_TEXTURE_RECTANGLE = 0x84F5;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv and GetDoublev:
+ */
+ int GL_TEXTURE_BINDING_RECTANGLE = 0x84F6;
+
+ /**
+ * Accepted by the <target> parameter of GetTexLevelParameteriv,
+ * GetTexLevelParameterfv, GetTexParameteriv and TexImage2D:
+ */
+ int GL_PROXY_TEXTURE_RECTANGLE = 0x84F7;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetDoublev,
+ * GetIntegerv and GetFloatv:
+ */
+ int GL_MAX_RECTANGLE_TEXTURE_SIZE = 0x84F8;
+
+ /**
+ * Returned by <type> parameter of GetActiveUniform when the location
+ * <index> for program object <program> is of type sampler2DRect:
+ */
+ int GL_SAMPLER_2D_RECT = 0x8B63;
+
+ /**
+ * Returned by <type> parameter of GetActiveUniform when the location
+ * <index> for program object <program> is of type sampler2DRectShadow:
+ */
+ int GL_SAMPLER_2D_RECT_SHADOW = 0x8B64;
+
+ // -------------------------------------------------------------------------
+ // ----------------------[ ARB_uniform_buffer_object ]----------------------
+ // -------------------------------------------------------------------------
+
+ /**
+ * Accepted by the <target> parameters of BindBuffer, BufferData,
+ * BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, and
+ * GetBufferPointerv:
+ */
+ int GL_UNIFORM_BUFFER = 0x8A11;
+
+ /**
+ * Accepted by the <pname> parameter of GetIntegeri_v, GetBooleanv,
+ * GetIntegerv, GetFloatv, and GetDoublev:
+ */
+ int GL_UNIFORM_BUFFER_BINDING = 0x8A28;
+
+ /** Accepted by the <pname> parameter of GetIntegeri_v: */
+ int GL_UNIFORM_BUFFER_START = 0x8A29;
+ int GL_UNIFORM_BUFFER_SIZE = 0x8A2A;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, and GetDoublev:
+ */
+ int GL_MAX_VERTEX_UNIFORM_BLOCKS = 0x8A2B;
+ int GL_MAX_GEOMETRY_UNIFORM_BLOCKS = 0x8A2C;
+ int GL_MAX_FRAGMENT_UNIFORM_BLOCKS = 0x8A2D;
+ int GL_MAX_COMBINED_UNIFORM_BLOCKS = 0x8A2E;
+ int GL_MAX_UNIFORM_BUFFER_BINDINGS = 0x8A2F;
+ int GL_MAX_UNIFORM_BLOCK_SIZE = 0x8A30;
+ int GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 0x8A31;
+ int GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS = 0x8A32;
+ int GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 0x8A33;
+ int GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT = 0x8A34;
+
+ /** Accepted by the <pname> parameter of GetProgramiv: */
+ int GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH = 0x8A35;
+ int GL_ACTIVE_UNIFORM_BLOCKS = 0x8A36;
+
+ /** Accepted by the <pname> parameter of GetActiveUniformsiv: */
+ int GL_UNIFORM_TYPE = 0x8A37;
+ int GL_UNIFORM_SIZE = 0x8A38;
+ int GL_UNIFORM_NAME_LENGTH = 0x8A39;
+ int GL_UNIFORM_BLOCK_INDEX = 0x8A3A;
+ int GL_UNIFORM_OFFSET = 0x8A3B;
+ int GL_UNIFORM_ARRAY_STRIDE = 0x8A3C;
+ int GL_UNIFORM_MATRIX_STRIDE = 0x8A3D;
+ int GL_UNIFORM_IS_ROW_MAJOR = 0x8A3E;
+
+ /** Accepted by the <pname> parameter of GetActiveUniformBlockiv: */
+ int GL_UNIFORM_BLOCK_BINDING = 0x8A3F;
+ int GL_UNIFORM_BLOCK_DATA_SIZE = 0x8A40;
+ int GL_UNIFORM_BLOCK_NAME_LENGTH = 0x8A41;
+ int GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS = 0x8A42;
+ int GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 0x8A43;
+ int GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 0x8A44;
+ int GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER = 0x8A45;
+ int GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 0x8A46;
+
+ /** Returned by GetActiveUniformsiv and GetUniformBlockIndex */
+ int GL_INVALID_INDEX = 0xFFFFFFFF;
+
+ void glGetUniformIndices(@GLuint int program, @AutoSize("uniformIndices") @GLsizei int uniformCount,
+ @Const @NullTerminated("uniformIndices.remaining()") @GLchar @StringList("uniformCount") ByteBuffer uniformNames,
+ @OutParameter @GLuint IntBuffer uniformIndices);
+
+ @Alternate("glGetUniformIndices")
+ void glGetUniformIndices(@GLuint int program, @Constant("uniformNames.length") @GLsizei int uniformCount,
+ @Const @NullTerminated @StringList("uniformCount") CharSequence[] uniformNames,
+ @OutParameter @Check("uniformNames.length") @GLuint IntBuffer uniformIndices);
+
+ @StripPostfix("params")
+ void glGetActiveUniformsiv(@GLuint int program, @AutoSize("uniformIndices") @GLsizei int uniformCount,
+ @Const @GLuint IntBuffer uniformIndices,
+ @GLenum int pname,
+ @OutParameter @Check("uniformIndices.remaining()") @GLint IntBuffer params);
+
+ @Alternate("glGetActiveUniformsiv")
+ @GLreturn("params")
+ @StripPostfix("params")
+ void glGetActiveUniformsiv(@GLuint int program, @Constant("1") @GLsizei int uniformCount,
+ @Constant(value = "params.put(1, uniformIndex), 1", keepParam = true) int uniformIndex, // Reuse params buffer
+ @GLenum int pname,
+ @OutParameter @GLint IntBuffer params);
+
+ void glGetActiveUniformName(@GLuint int program, @GLuint int uniformIndex, @AutoSize("uniformName") @GLsizei int bufSize,
+ @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
+ @OutParameter @GLchar ByteBuffer uniformName);
+
+ @Alternate("glGetActiveUniformName")
+ @GLreturn(value = "uniformName", maxLength = "bufSize")
+ void glGetActiveUniformName2(@GLuint int program, @GLuint int uniformIndex, @GLsizei int bufSize,
+ @OutParameter @GLsizei @Constant("uniformName_length, 0") IntBuffer length,
+ @OutParameter @GLchar ByteBuffer uniformName);
+
+ @GLuint
+ int glGetUniformBlockIndex(@GLuint int program, @Const @NullTerminated @GLchar ByteBuffer uniformBlockName);
+
+ @Alternate("glGetUniformBlockIndex")
+ @GLuint
+ int glGetUniformBlockIndex(@GLuint int program, @NullTerminated CharSequence uniformBlockName);
+
+ @StripPostfix("params")
+ void glGetActiveUniformBlockiv(@GLuint int program, @GLuint int uniformBlockIndex, @GLenum int pname,
+ @OutParameter @Check(value = "16") @GLint IntBuffer params);
+
+ @Alternate("glGetActiveUniformBlockiv")
+ @GLreturn("params")
+ @StripPostfix("params")
+ void glGetActiveUniformBlockiv2(@GLuint int program, @GLuint int uniformBlockIndex, @GLenum int pname,
+ @OutParameter @GLint IntBuffer params);
+
+ void glGetActiveUniformBlockName(@GLuint int program, @GLuint int uniformBlockIndex, @AutoSize("uniformBlockName") @GLsizei int bufSize,
+ @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
+ @OutParameter @GLchar ByteBuffer uniformBlockName);
+
+ @Alternate("glGetActiveUniformBlockName")
+ @GLreturn(value = "uniformBlockName", maxLength = "bufSize")
+ void glGetActiveUniformBlockName2(@GLuint int program, @GLuint int uniformBlockIndex, @GLsizei int bufSize,
+ @OutParameter @GLsizei @Constant("uniformBlockName_length, 0") IntBuffer length,
+ @OutParameter @GLchar ByteBuffer uniformBlockName);
+
+ void glUniformBlockBinding(@GLuint int program, @GLuint int uniformBlockIndex, @GLuint int uniformBlockBinding);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/GL32.java b/src/templates/org/lwjgl/opengl/GL32.java
index d823725..ce2085e 100644
--- a/src/templates/org/lwjgl/opengl/GL32.java
+++ b/src/templates/org/lwjgl/opengl/GL32.java
@@ -1,339 +1,339 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.Buffer;
-import java.nio.FloatBuffer;
-import java.nio.IntBuffer;
-import java.nio.LongBuffer;
-
-public interface GL32 {
-
- // ----------------------------------------------------------
- // ----------------------[ OpenGL 3.2 ]----------------------
- // ----------------------------------------------------------
-
- int GL_CONTEXT_PROFILE_MASK = 0x9126;
- int GL_CONTEXT_CORE_PROFILE_BIT = 0x00000001;
- int GL_CONTEXT_COMPATIBILITY_PROFILE_BIT = 0x00000002;
-
- int GL_MAX_VERTEX_OUTPUT_COMPONENTS = 0x9122;
- int GL_MAX_GEOMETRY_INPUT_COMPONENTS = 0x9123;
- int GL_MAX_GEOMETRY_OUTPUT_COMPONENTS = 0x9124;
- int GL_MAX_FRAGMENT_INPUT_COMPONENTS = 0x9125;
-
- // ---------------------------------------------------------------------
- // ----------------------[ ARB_vertex_array_bgra ]----------------------
- // ---------------------------------------------------------------------
-
- int GL_BGRA = 0x80E1;
-
- // -----------------------------------------------------------------------------
- // ----------------------[ ARB_draw_elements_base_vertex ]----------------------
- // -----------------------------------------------------------------------------
-
- void glDrawElementsBaseVertex(@GLenum int mode, @AutoSize("indices") @GLsizei int count, @AutoType("indices") @GLenum int type,
- @BufferObject(BufferKind.ElementVBO)
- @Const
- @GLubyte
- @GLushort
- @GLuint Buffer indices, int basevertex);
-
- void glDrawRangeElementsBaseVertex(@GLenum int mode, @GLuint int start, @GLuint int end, @AutoSize("indices") @GLsizei int count, @AutoType("indices") @GLenum int type,
- @BufferObject(BufferKind.ElementVBO)
- @Const
- @GLubyte
- @GLushort
- @GLuint Buffer indices, int basevertex);
-
- void glDrawElementsInstancedBaseVertex(@GLenum int mode, @AutoSize("indices") @GLsizei int count, @AutoType("indices") @GLenum int type,
- @BufferObject(BufferKind.ElementVBO)
- @Const
- @GLubyte
- @GLushort
- @GLuint Buffer indices, @GLsizei int primcount, int basevertex);
-
- //void glMultiDrawElementsBaseVertex(@GLenum int mode, @GLsizei*count, @GLenum int type, void**indices, @GLsizei int primcount, int*basevertex)
-
- // --------------------------------------------------------------------
- // ----------------------[ ARB_provoking_vertex ]----------------------
- // --------------------------------------------------------------------
-
- /** Accepted by the <mode> parameter of ProvokingVertex: */
- int GL_FIRST_VERTEX_CONVENTION = 0x8E4D;
- int GL_LAST_VERTEX_CONVENTION = 0x8E4E;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv, and GetDoublev:
- */
- int GL_PROVOKING_VERTEX = 0x8E4F;
- int GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION = 0x8E4C;
-
- void glProvokingVertex(@GLenum int mode);
-
- // ---------------------------------------------------------------------
- // ----------------------[ ARB_seamless_cube_map ]----------------------
- // ---------------------------------------------------------------------
-
- /**
- * Accepted by the <cap> parameter of Enable, Disable and IsEnabled,
- * and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv
- * and GetDoublev:
- */
- int GL_TEXTURE_CUBE_MAP_SEAMLESS = 0x884F;
-
- // -----------------------------------------------------------------------
- // ----------------------[ ARB_texture_multisample ]----------------------
- // -----------------------------------------------------------------------
-
- /** Accepted by the <pname> parameter of GetMultisamplefv: */
- int GL_SAMPLE_POSITION = 0x8E50;
-
- /**
- * Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, and by
- * the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
- * GetDoublev:
- */
- int GL_SAMPLE_MASK = 0x8E51;
-
- /**
- * Accepted by the <target> parameter of GetBooleani_v and
- * GetIntegeri_v:
- */
- int GL_SAMPLE_MASK_VALUE = 0x8E52;
-
- /**
- * Accepted by the <target> parameter of BindTexture and
- * TexImage2DMultisample:
- */
- int GL_TEXTURE_2D_MULTISAMPLE = 0x9100;
-
- /** Accepted by the <target> parameter of TexImage2DMultisample: */
- int GL_PROXY_TEXTURE_2D_MULTISAMPLE = 0x9101;
-
- /**
- * Accepted by the <target> parameter of BindTexture and
- * TexImage3DMultisample:
- */
- int GL_TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9102;
-
- /** Accepted by the <target> parameter of TexImage3DMultisample: */
- int GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9103;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetDoublev, GetIntegerv,
- * and GetFloatv:
- */
- int GL_MAX_SAMPLE_MASK_WORDS = 0x8E59;
- int GL_MAX_COLOR_TEXTURE_SAMPLES = 0x910E;
- int GL_MAX_DEPTH_TEXTURE_SAMPLES = 0x910F;
- int GL_MAX_INTEGER_SAMPLES = 0x9110;
- int GL_TEXTURE_BINDING_2D_MULTISAMPLE = 0x9104;
- int GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY = 0x9105;
-
- /** Accepted by the <pname> parameter of GetTexLevelParameter */
- int GL_TEXTURE_SAMPLES = 0x9106;
- int GL_TEXTURE_FIXED_SAMPLE_LOCATIONS = 0x9107;
-
- /** Returned by the <type> parameter of GetActiveUniform: */
- int GL_SAMPLER_2D_MULTISAMPLE = 0x9108;
- int GL_INT_SAMPLER_2D_MULTISAMPLE = 0x9109;
- int GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE = 0x910A;
- int GL_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910B;
- int GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910C;
- int GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910D;
-
- void glTexImage2DMultisample(@GLenum int target, @GLsizei int samples, int internalformat,
- @GLsizei int width, @GLsizei int height,
- boolean fixedsamplelocations);
-
- void glTexImage3DMultisample(@GLenum int target, @GLsizei int samples, int internalformat,
- @GLsizei int width, @GLsizei int height, @GLsizei int depth,
- boolean fixedsamplelocations);
-
- @StripPostfix("val")
- void glGetMultisamplefv(@GLenum int pname, @GLuint int index, @OutParameter @Check("2") FloatBuffer val);
-
- void glSampleMaski(@GLuint int index, @GLbitfield int mask);
-
- // ---------------------------------------------------------------
- // ----------------------[ ARB_depth_clamp ]----------------------
- // ---------------------------------------------------------------
-
- /**
- * Accepted by the <cap> parameter of Enable, Disable, and IsEnabled,
- * and by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv, and GetDoublev:
- */
- int GL_DEPTH_CLAMP = 0x864F;
-
- // --------------------------------------------------------------------
- // ----------------------[ ARB_geometry_shader4 ]----------------------
- // --------------------------------------------------------------------
-
- /**
- * Accepted by the <type> parameter of CreateShader and returned by the
- * <params> parameter of GetShaderiv:
- */
- int GL_GEOMETRY_SHADER = 0x8DD9;
-
- /**
- * Accepted by the <pname> parameter of ProgramParameteriEXT and
- * GetProgramiv:
- */
- int GL_GEOMETRY_VERTICES_OUT = 0x8DDA;
- int GL_GEOMETRY_INPUT_TYPE = 0x8DDB;
- int GL_GEOMETRY_OUTPUT_TYPE = 0x8DDC;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv, and GetDoublev:
- */
- int GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS = 0x8C29;
- //int GL_MAX_GEOMETRY_VARYING_COMPONENTS = 0x8DDD; -- Missing from 3.2 spec
- //int GL_MAX_VERTEX_VARYING_COMPONENTS = 0x8DDE; -- Missing from 3.2 spec
- int GL_MAX_VARYING_COMPONENTS = 0x8B4B;
- int GL_MAX_GEOMETRY_UNIFORM_COMPONENTS = 0x8DDF;
- int GL_MAX_GEOMETRY_OUTPUT_VERTICES = 0x8DE0;
- int GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS = 0x8DE1;
-
- /**
- * Accepted by the <mode> parameter of Begin, DrawArrays,
- * MultiDrawArrays, DrawElements, MultiDrawElements, and
- * DrawRangeElements:
- */
- int GL_LINES_ADJACENCY = 0xA;
- int GL_LINE_STRIP_ADJACENCY = 0xB;
- int GL_TRIANGLES_ADJACENCY = 0xC;
- int GL_TRIANGLE_STRIP_ADJACENCY = 0xD;
-
- /** Returned by CheckFramebufferStatusEXT: */
- int GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS = 0x8DA8;
- int GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT = 0x8DA9;
-
- /**
- * Accepted by the <pname> parameter of GetFramebufferAttachment-
- * ParameterivEXT:
- */
- int GL_FRAMEBUFFER_ATTACHMENT_LAYERED = 0x8DA7;
- int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 0x8CD4;
-
- /**
- * Accepted by the <cap> parameter of Enable, Disable, and IsEnabled,
- * and by the <pname> parameter of GetIntegerv, GetFloatv, GetDoublev,
- * and GetBooleanv:
- */
- int GL_PROGRAM_POINT_SIZE = 0x8642;
-
- void glFramebufferTexture(@GLenum int target, @GLenum int attachment, @GLuint int texture, int level);
-
- void glFramebufferTextureLayer(@GLenum int target, @GLenum int attachment, @GLuint int texture, int level, int layer);
-
- // --------------------------------------------------------
- // ----------------------[ ARB_sync ]----------------------
- // --------------------------------------------------------
-
- /** Accepted as the <pname> parameter of GetInteger64v: */
- int GL_MAX_SERVER_WAIT_TIMEOUT = 0x9111;
-
- /** Accepted as the <pname> parameter of GetSynciv: */
- int GL_OBJECT_TYPE = 0x9112;
- int GL_SYNC_CONDITION = 0x9113;
- int GL_SYNC_STATUS = 0x9114;
- int GL_SYNC_FLAGS = 0x9115;
-
- /** Returned in <values> for GetSynciv <pname> OBJECT_TYPE: */
- int GL_SYNC_FENCE = 0x9116;
-
- /** Returned in <values> for GetSynciv <pname> SYNC_CONDITION: */
- int GL_SYNC_GPU_COMMANDS_COMPLETE = 0x9117;
-
- /** Returned in <values> for GetSynciv <pname> SYNC_STATUS: */
- int GL_UNSIGNALED = 0x9118;
- int GL_SIGNALED = 0x9119;
-
- /** Accepted in the <flags> parameter of ClientWaitSync: */
- int GL_SYNC_FLUSH_COMMANDS_BIT = 0x00000001;
-
- /** Accepted in the <timeout> parameter of WaitSync: */
- long GL_TIMEOUT_IGNORED = 0xFFFFFFFFFFFFFFFFl;
-
- /** Returned by ClientWaitSync: */
- int GL_ALREADY_SIGNALED = 0x911A;
- int GL_TIMEOUT_EXPIRED = 0x911B;
- int GL_CONDITION_SATISFIED = 0x911C;
- int GL_WAIT_FAILED = 0x911D;
-
- @GLpointer("GLsync")
- GLSync glFenceSync(@GLenum int condition, @GLbitfield int flags);
-
- boolean glIsSync(@GLpointer("GLsync") GLSync sync);
-
- void glDeleteSync(@GLpointer("GLsync") GLSync sync);
-
- @GLenum
- int glClientWaitSync(@GLpointer("GLsync") GLSync sync, @GLbitfield int flags, @GLuint64 long timeout);
-
- void glWaitSync(@GLpointer("GLsync") GLSync sync, @GLbitfield int flags, @GLuint64 long timeout);
-
- @StripPostfix(value = "data", postfix = "64")
- void glGetInteger64v(@GLenum int pname, @OutParameter @Check("1") @GLint64 LongBuffer data);
-
- @Alternate("glGetInteger64v")
- @GLreturn("data")
- @StripPostfix(value = "data", postfix = "64")
- void glGetInteger64v2(@GLenum int pname, @OutParameter @GLint64 LongBuffer data);
-
- @StripPostfix(value = "data", postfix = "64")
- @Optional(reason = "NV's 3.2 implementation does not expose this (last driver checked: 19?.??)")
- void glGetInteger64i_v(@GLenum int value, @GLuint int index, @OutParameter @Check("4") @GLint64 LongBuffer data);
-
- @Alternate("glGetInteger64i_v")
- @GLreturn("data")
- @StripPostfix(value = "data", postfix = "64")
- void glGetInteger64i_v2(@GLenum int value, @GLuint int index, @OutParameter @GLint64 LongBuffer data);
-
- @StripPostfix("values")
- void glGetSynciv(@GLpointer("GLsync") GLSync sync, @GLenum int pname, @AutoSize("values") @GLsizei int bufSize,
- @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
- @OutParameter IntBuffer values);
-
- @Alternate("glGetSynciv")
- @GLreturn("values")
- @StripPostfix("values")
- void glGetSynciv2(@GLpointer("GLsync") GLSync sync, @GLenum int pname, @Constant("1") @GLsizei int bufSize,
- @OutParameter @GLsizei @Constant("null, 0") IntBuffer length,
- @OutParameter IntBuffer values);
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.Buffer;
+import java.nio.FloatBuffer;
+import java.nio.IntBuffer;
+import java.nio.LongBuffer;
+
+public interface GL32 {
+
+ // ----------------------------------------------------------
+ // ----------------------[ OpenGL 3.2 ]----------------------
+ // ----------------------------------------------------------
+
+ int GL_CONTEXT_PROFILE_MASK = 0x9126;
+ int GL_CONTEXT_CORE_PROFILE_BIT = 0x00000001;
+ int GL_CONTEXT_COMPATIBILITY_PROFILE_BIT = 0x00000002;
+
+ int GL_MAX_VERTEX_OUTPUT_COMPONENTS = 0x9122;
+ int GL_MAX_GEOMETRY_INPUT_COMPONENTS = 0x9123;
+ int GL_MAX_GEOMETRY_OUTPUT_COMPONENTS = 0x9124;
+ int GL_MAX_FRAGMENT_INPUT_COMPONENTS = 0x9125;
+
+ // ---------------------------------------------------------------------
+ // ----------------------[ ARB_vertex_array_bgra ]----------------------
+ // ---------------------------------------------------------------------
+
+ int GL_BGRA = 0x80E1;
+
+ // -----------------------------------------------------------------------------
+ // ----------------------[ ARB_draw_elements_base_vertex ]----------------------
+ // -----------------------------------------------------------------------------
+
+ void glDrawElementsBaseVertex(@GLenum int mode, @AutoSize("indices") @GLsizei int count, @AutoType("indices") @GLenum int type,
+ @BufferObject(BufferKind.ElementVBO)
+ @Const
+ @GLubyte
+ @GLushort
+ @GLuint Buffer indices, int basevertex);
+
+ void glDrawRangeElementsBaseVertex(@GLenum int mode, @GLuint int start, @GLuint int end, @AutoSize("indices") @GLsizei int count, @AutoType("indices") @GLenum int type,
+ @BufferObject(BufferKind.ElementVBO)
+ @Const
+ @GLubyte
+ @GLushort
+ @GLuint Buffer indices, int basevertex);
+
+ void glDrawElementsInstancedBaseVertex(@GLenum int mode, @AutoSize("indices") @GLsizei int count, @AutoType("indices") @GLenum int type,
+ @BufferObject(BufferKind.ElementVBO)
+ @Const
+ @GLubyte
+ @GLushort
+ @GLuint Buffer indices, @GLsizei int primcount, int basevertex);
+
+ //void glMultiDrawElementsBaseVertex(@GLenum int mode, @GLsizei*count, @GLenum int type, void**indices, @GLsizei int primcount, int*basevertex)
+
+ // --------------------------------------------------------------------
+ // ----------------------[ ARB_provoking_vertex ]----------------------
+ // --------------------------------------------------------------------
+
+ /** Accepted by the <mode> parameter of ProvokingVertex: */
+ int GL_FIRST_VERTEX_CONVENTION = 0x8E4D;
+ int GL_LAST_VERTEX_CONVENTION = 0x8E4E;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, and GetDoublev:
+ */
+ int GL_PROVOKING_VERTEX = 0x8E4F;
+ int GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION = 0x8E4C;
+
+ void glProvokingVertex(@GLenum int mode);
+
+ // ---------------------------------------------------------------------
+ // ----------------------[ ARB_seamless_cube_map ]----------------------
+ // ---------------------------------------------------------------------
+
+ /**
+ * Accepted by the <cap> parameter of Enable, Disable and IsEnabled,
+ * and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv
+ * and GetDoublev:
+ */
+ int GL_TEXTURE_CUBE_MAP_SEAMLESS = 0x884F;
+
+ // -----------------------------------------------------------------------
+ // ----------------------[ ARB_texture_multisample ]----------------------
+ // -----------------------------------------------------------------------
+
+ /** Accepted by the <pname> parameter of GetMultisamplefv: */
+ int GL_SAMPLE_POSITION = 0x8E50;
+
+ /**
+ * Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, and by
+ * the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
+ * GetDoublev:
+ */
+ int GL_SAMPLE_MASK = 0x8E51;
+
+ /**
+ * Accepted by the <target> parameter of GetBooleani_v and
+ * GetIntegeri_v:
+ */
+ int GL_SAMPLE_MASK_VALUE = 0x8E52;
+
+ /**
+ * Accepted by the <target> parameter of BindTexture and
+ * TexImage2DMultisample:
+ */
+ int GL_TEXTURE_2D_MULTISAMPLE = 0x9100;
+
+ /** Accepted by the <target> parameter of TexImage2DMultisample: */
+ int GL_PROXY_TEXTURE_2D_MULTISAMPLE = 0x9101;
+
+ /**
+ * Accepted by the <target> parameter of BindTexture and
+ * TexImage3DMultisample:
+ */
+ int GL_TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9102;
+
+ /** Accepted by the <target> parameter of TexImage3DMultisample: */
+ int GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9103;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetDoublev, GetIntegerv,
+ * and GetFloatv:
+ */
+ int GL_MAX_SAMPLE_MASK_WORDS = 0x8E59;
+ int GL_MAX_COLOR_TEXTURE_SAMPLES = 0x910E;
+ int GL_MAX_DEPTH_TEXTURE_SAMPLES = 0x910F;
+ int GL_MAX_INTEGER_SAMPLES = 0x9110;
+ int GL_TEXTURE_BINDING_2D_MULTISAMPLE = 0x9104;
+ int GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY = 0x9105;
+
+ /** Accepted by the <pname> parameter of GetTexLevelParameter */
+ int GL_TEXTURE_SAMPLES = 0x9106;
+ int GL_TEXTURE_FIXED_SAMPLE_LOCATIONS = 0x9107;
+
+ /** Returned by the <type> parameter of GetActiveUniform: */
+ int GL_SAMPLER_2D_MULTISAMPLE = 0x9108;
+ int GL_INT_SAMPLER_2D_MULTISAMPLE = 0x9109;
+ int GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE = 0x910A;
+ int GL_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910B;
+ int GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910C;
+ int GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910D;
+
+ void glTexImage2DMultisample(@GLenum int target, @GLsizei int samples, int internalformat,
+ @GLsizei int width, @GLsizei int height,
+ boolean fixedsamplelocations);
+
+ void glTexImage3DMultisample(@GLenum int target, @GLsizei int samples, int internalformat,
+ @GLsizei int width, @GLsizei int height, @GLsizei int depth,
+ boolean fixedsamplelocations);
+
+ @StripPostfix("val")
+ void glGetMultisamplefv(@GLenum int pname, @GLuint int index, @OutParameter @Check("2") FloatBuffer val);
+
+ void glSampleMaski(@GLuint int index, @GLbitfield int mask);
+
+ // ---------------------------------------------------------------
+ // ----------------------[ ARB_depth_clamp ]----------------------
+ // ---------------------------------------------------------------
+
+ /**
+ * Accepted by the <cap> parameter of Enable, Disable, and IsEnabled,
+ * and by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, and GetDoublev:
+ */
+ int GL_DEPTH_CLAMP = 0x864F;
+
+ // --------------------------------------------------------------------
+ // ----------------------[ ARB_geometry_shader4 ]----------------------
+ // --------------------------------------------------------------------
+
+ /**
+ * Accepted by the <type> parameter of CreateShader and returned by the
+ * <params> parameter of GetShaderiv:
+ */
+ int GL_GEOMETRY_SHADER = 0x8DD9;
+
+ /**
+ * Accepted by the <pname> parameter of ProgramParameteriEXT and
+ * GetProgramiv:
+ */
+ int GL_GEOMETRY_VERTICES_OUT = 0x8DDA;
+ int GL_GEOMETRY_INPUT_TYPE = 0x8DDB;
+ int GL_GEOMETRY_OUTPUT_TYPE = 0x8DDC;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, and GetDoublev:
+ */
+ int GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS = 0x8C29;
+ //int GL_MAX_GEOMETRY_VARYING_COMPONENTS = 0x8DDD; -- Missing from 3.2 spec
+ //int GL_MAX_VERTEX_VARYING_COMPONENTS = 0x8DDE; -- Missing from 3.2 spec
+ int GL_MAX_VARYING_COMPONENTS = 0x8B4B;
+ int GL_MAX_GEOMETRY_UNIFORM_COMPONENTS = 0x8DDF;
+ int GL_MAX_GEOMETRY_OUTPUT_VERTICES = 0x8DE0;
+ int GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS = 0x8DE1;
+
+ /**
+ * Accepted by the <mode> parameter of Begin, DrawArrays,
+ * MultiDrawArrays, DrawElements, MultiDrawElements, and
+ * DrawRangeElements:
+ */
+ int GL_LINES_ADJACENCY = 0xA;
+ int GL_LINE_STRIP_ADJACENCY = 0xB;
+ int GL_TRIANGLES_ADJACENCY = 0xC;
+ int GL_TRIANGLE_STRIP_ADJACENCY = 0xD;
+
+ /** Returned by CheckFramebufferStatusEXT: */
+ int GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS = 0x8DA8;
+ int GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT = 0x8DA9;
+
+ /**
+ * Accepted by the <pname> parameter of GetFramebufferAttachment-
+ * ParameterivEXT:
+ */
+ int GL_FRAMEBUFFER_ATTACHMENT_LAYERED = 0x8DA7;
+ int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 0x8CD4;
+
+ /**
+ * Accepted by the <cap> parameter of Enable, Disable, and IsEnabled,
+ * and by the <pname> parameter of GetIntegerv, GetFloatv, GetDoublev,
+ * and GetBooleanv:
+ */
+ int GL_PROGRAM_POINT_SIZE = 0x8642;
+
+ void glFramebufferTexture(@GLenum int target, @GLenum int attachment, @GLuint int texture, int level);
+
+ void glFramebufferTextureLayer(@GLenum int target, @GLenum int attachment, @GLuint int texture, int level, int layer);
+
+ // --------------------------------------------------------
+ // ----------------------[ ARB_sync ]----------------------
+ // --------------------------------------------------------
+
+ /** Accepted as the <pname> parameter of GetInteger64v: */
+ int GL_MAX_SERVER_WAIT_TIMEOUT = 0x9111;
+
+ /** Accepted as the <pname> parameter of GetSynciv: */
+ int GL_OBJECT_TYPE = 0x9112;
+ int GL_SYNC_CONDITION = 0x9113;
+ int GL_SYNC_STATUS = 0x9114;
+ int GL_SYNC_FLAGS = 0x9115;
+
+ /** Returned in <values> for GetSynciv <pname> OBJECT_TYPE: */
+ int GL_SYNC_FENCE = 0x9116;
+
+ /** Returned in <values> for GetSynciv <pname> SYNC_CONDITION: */
+ int GL_SYNC_GPU_COMMANDS_COMPLETE = 0x9117;
+
+ /** Returned in <values> for GetSynciv <pname> SYNC_STATUS: */
+ int GL_UNSIGNALED = 0x9118;
+ int GL_SIGNALED = 0x9119;
+
+ /** Accepted in the <flags> parameter of ClientWaitSync: */
+ int GL_SYNC_FLUSH_COMMANDS_BIT = 0x00000001;
+
+ /** Accepted in the <timeout> parameter of WaitSync: */
+ long GL_TIMEOUT_IGNORED = 0xFFFFFFFFFFFFFFFFl;
+
+ /** Returned by ClientWaitSync: */
+ int GL_ALREADY_SIGNALED = 0x911A;
+ int GL_TIMEOUT_EXPIRED = 0x911B;
+ int GL_CONDITION_SATISFIED = 0x911C;
+ int GL_WAIT_FAILED = 0x911D;
+
+ @GLpointer("GLsync")
+ GLSync glFenceSync(@GLenum int condition, @GLbitfield int flags);
+
+ boolean glIsSync(@GLpointer("GLsync") GLSync sync);
+
+ void glDeleteSync(@GLpointer("GLsync") GLSync sync);
+
+ @GLenum
+ int glClientWaitSync(@GLpointer("GLsync") GLSync sync, @GLbitfield int flags, @GLuint64 long timeout);
+
+ void glWaitSync(@GLpointer("GLsync") GLSync sync, @GLbitfield int flags, @GLuint64 long timeout);
+
+ @StripPostfix(value = "data", postfix = "64")
+ void glGetInteger64v(@GLenum int pname, @OutParameter @Check("1") @GLint64 LongBuffer data);
+
+ @Alternate("glGetInteger64v")
+ @GLreturn("data")
+ @StripPostfix(value = "data", postfix = "64")
+ void glGetInteger64v2(@GLenum int pname, @OutParameter @GLint64 LongBuffer data);
+
+ @StripPostfix(value = "data", postfix = "64")
+ @Optional(reason = "NV's 3.2 implementation does not expose this (last driver checked: 19?.??)")
+ void glGetInteger64i_v(@GLenum int value, @GLuint int index, @OutParameter @Check("4") @GLint64 LongBuffer data);
+
+ @Alternate("glGetInteger64i_v")
+ @GLreturn("data")
+ @StripPostfix(value = "data", postfix = "64")
+ void glGetInteger64i_v2(@GLenum int value, @GLuint int index, @OutParameter @GLint64 LongBuffer data);
+
+ @StripPostfix("values")
+ void glGetSynciv(@GLpointer("GLsync") GLSync sync, @GLenum int pname, @AutoSize("values") @GLsizei int bufSize,
+ @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
+ @OutParameter IntBuffer values);
+
+ @Alternate("glGetSynciv")
+ @GLreturn("values")
+ @StripPostfix("values")
+ void glGetSynciv2(@GLpointer("GLsync") GLSync sync, @GLenum int pname, @Constant("1") @GLsizei int bufSize,
+ @OutParameter @GLsizei @Constant("null, 0") IntBuffer length,
+ @OutParameter IntBuffer values);
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/GL33.java b/src/templates/org/lwjgl/opengl/GL33.java
index 0a6330f..64d1879 100644
--- a/src/templates/org/lwjgl/opengl/GL33.java
+++ b/src/templates/org/lwjgl/opengl/GL33.java
@@ -1,418 +1,418 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.ByteBuffer;
-import java.nio.FloatBuffer;
-import java.nio.IntBuffer;
-import java.nio.LongBuffer;
-
- at DeprecatedGL
-public interface GL33 {
-
- // -----------------------------------------------------------------------
- // ----------------------[ ARB_blend_func_extended ]----------------------
- // -----------------------------------------------------------------------
-
- /**
- * Accepted by the <src> and <dst> parameters of BlendFunc and
- * BlendFunci, and by the <srcRGB>, <dstRGB>, <srcAlpha> and <dstAlpha>
- * parameters of BlendFuncSeparate and BlendFuncSeparatei:
- */
- int GL_SRC1_COLOR = 0x88F9;
- int GL_SRC1_ALPHA = GL15.GL_SRC1_ALPHA;
- int GL_ONE_MINUS_SRC1_COLOR = 0x88FA;
- int GL_ONE_MINUS_SRC1_ALPHA = 0x88FB;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv
- * and GetDoublev:
- */
- int GL_MAX_DUAL_SOURCE_DRAW_BUFFERS = 0x88FC;
-
- void glBindFragDataLocationIndexed(@GLuint int program, @GLuint int colorNumber, @GLuint int index, @NullTerminated @Const @GLchar ByteBuffer name);
-
- @Alternate("glBindFragDataLocationIndexed")
- void glBindFragDataLocationIndexed(@GLuint int program, @GLuint int colorNumber, @GLuint int index, @NullTerminated CharSequence name);
-
- int glGetFragDataIndex(@GLuint int program, @NullTerminated @Const @GLchar ByteBuffer name);
-
- @Alternate("glGetFragDataIndex")
- int glGetFragDataIndex(@GLuint int program, @NullTerminated CharSequence name);
-
- // --------------------------------------------------------------------
- // ----------------------[ ARB_occlusion_query2 ]----------------------
- // --------------------------------------------------------------------
-
- /**
- * Accepted by the <target> parameter of BeginQuery, EndQuery,
- * and GetQueryiv:
- */
- int GL_ANY_SAMPLES_PASSED = 0x8C2F;
-
- // -------------------------------------------------------------------
- // ----------------------[ ARB_sampler_objects ]----------------------
- // -------------------------------------------------------------------
-
- /**
- * Accepted by the <value> parameter of the GetBooleanv, GetIntegerv,
- * GetInteger64v, GetFloatv and GetDoublev functions:
- */
- int GL_SAMPLER_BINDING = 0x8919;
-
- void glGenSamplers(@AutoSize("samplers") @GLsizei int count, @OutParameter @GLuint IntBuffer samplers);
-
- @Alternate("glGenSamplers")
- @GLreturn("samplers")
- void glGenSamplers2(@Constant("1") @GLsizei int count, @OutParameter @GLuint IntBuffer samplers);
-
- void glDeleteSamplers(@AutoSize("samplers") @GLsizei int count, @Const @GLuint IntBuffer samplers);
-
- @Alternate("glDeleteSamplers")
- void glDeleteSamplers(@Constant("1") @GLsizei int count, @Constant(value = "APIUtils.getBufferInt().put(0, sampler), 0", keepParam = true) int sampler);
-
- boolean glIsSampler(@GLuint int sampler);
-
- void glBindSampler(@GLenum int unit, @GLuint int sampler);
-
- void glSamplerParameteri(@GLuint int sampler, @GLenum int pname, int param);
-
- void glSamplerParameterf(@GLuint int sampler, @GLenum int pname, float param);
-
- @StripPostfix("params")
- void glSamplerParameteriv(@GLuint int sampler, @GLenum int pname, @Check("4") @Const IntBuffer params);
-
- @StripPostfix("params")
- void glSamplerParameterfv(@GLuint int sampler, @GLenum int pname, @Check("4") @Const FloatBuffer params);
-
- @StripPostfix("params")
- void glSamplerParameterIiv(@GLuint int sampler, @GLenum int pname, @Check("4") @Const IntBuffer params);
-
- @StripPostfix("params")
- void glSamplerParameterIuiv(@GLuint int sampler, @GLenum int pname, @Check("4") @Const @GLuint IntBuffer params);
-
- @StripPostfix("params")
- void glGetSamplerParameteriv(@GLuint int sampler, @GLenum int pname, @Check("4") @OutParameter IntBuffer params);
-
- @Alternate("glGetSamplerParameteriv")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- void glGetSamplerParameteriv2(@GLuint int sampler, @GLenum int pname, @OutParameter IntBuffer params);
-
- @StripPostfix("params")
- void glGetSamplerParameterfv(@GLuint int sampler, @GLenum int pname, @Check("4") @OutParameter FloatBuffer params);
-
- @Alternate("glGetSamplerParameterfv")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- void glGetSamplerParameterfv2(@GLuint int sampler, @GLenum int pname, @OutParameter FloatBuffer params);
-
- @StripPostfix("params")
- void glGetSamplerParameterIiv(@GLuint int sampler, @GLenum int pname, @Check("4") @OutParameter IntBuffer params);
-
- @Alternate("glGetSamplerParameterIiv")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- void glGetSamplerParameterIiv2(@GLuint int sampler, @GLenum int pname, @OutParameter IntBuffer params);
-
- @StripPostfix("params")
- void glGetSamplerParameterIuiv(@GLuint int sampler, @GLenum int pname, @Check("4") @OutParameter IntBuffer params);
-
- @Alternate("glGetSamplerParameterIuiv")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- void glGetSamplerParameterIuiv2(@GLuint int sampler, @GLenum int pname, @OutParameter IntBuffer params);
-
- // -------------------------------------------------------------------
- // ----------------------[ ARB_texture_rgb10_a2ui ]----------------------
- // -------------------------------------------------------------------
-
- /**
- * Accepted by the <internalFormat> parameter of TexImage1D, TexImage2D,
- * TexImage3D, CopyTexImage1D, CopyTexImage2D, RenderbufferStorage and
- * RenderbufferStorageMultisample:
- */
- int GL_RGB10_A2UI = 0x906F;
-
- // -------------------------------------------------------------------
- // ----------------------[ ARB_texture_swizzle ]----------------------
- // -------------------------------------------------------------------
-
- /**
- * Accepted by the <pname> parameters of TexParameteri,
- * TexParameterf, TexParameteriv, TexParameterfv,
- * GetTexParameterfv, and GetTexParameteriv:
- */
- int GL_TEXTURE_SWIZZLE_R = 0x8E42;
- int GL_TEXTURE_SWIZZLE_G = 0x8E43;
- int GL_TEXTURE_SWIZZLE_B = 0x8E44;
- int GL_TEXTURE_SWIZZLE_A = 0x8E45;
-
- /**
- * Accepted by the <pname> parameters of TexParameteriv,
- * TexParameterfv, GetTexParameterfv, and GetTexParameteriv:
- */
- int GL_TEXTURE_SWIZZLE_RGBA = 0x8E46;
-
- // ---------------------------------------------------------------
- // ----------------------[ ARB_timer_query ]----------------------
- // ---------------------------------------------------------------
-
- /**
- * Accepted by the <target> parameter of BeginQuery, EndQuery, and
- * GetQueryiv:
- */
- int GL_TIME_ELAPSED = 0x88BF;
-
- /**
- * Accepted by the <target> parameter of GetQueryiv and QueryCounter.
- * Accepted by the <value> parameter of GetBooleanv, GetIntegerv,
- * GetInteger64v, GetFloatv, and GetDoublev:
- */
- int GL_TIMESTAMP = 0x8E28;
-
- void glQueryCounter(@GLuint int id, @GLenum int target);
-
- @StripPostfix("params")
- void glGetQueryObjecti64v(@GLuint int id, @GLenum int pname, @OutParameter @Check("1") @GLint64 LongBuffer params);
-
- @Alternate("glGetQueryObjecti64v")
- @GLreturn("params")
- @StripPostfix("params")
- void glGetQueryObjecti64v2(@GLuint int id, @GLenum int pname, @OutParameter @GLint64 LongBuffer params);
-
- @StripPostfix("params")
- void glGetQueryObjectui64v(@GLuint int id, @GLenum int pname, @OutParameter @Check("1") @GLuint64 LongBuffer params);
-
- @Alternate("glGetQueryObjectui64v")
- @GLreturn("params")
- @StripPostfix("params")
- void glGetQueryObjectui64v2(@GLuint int id, @GLenum int pname, @OutParameter @GLuint64 LongBuffer params);
-
- // --------------------------------------------------------------------
- // ----------------------[ ARB_instanced_arrays ]----------------------
- // --------------------------------------------------------------------
-
- /**
- * Accepted by the <pname> parameters of GetVertexAttribdv,
- * GetVertexAttribfv, and GetVertexAttribiv:
- */
- int GL_VERTEX_ATTRIB_ARRAY_DIVISOR = 0x88FE;
-
- void glVertexAttribDivisor(@GLuint int index, @GLuint int divisor);
-
- // ------------------------------------------------------------------------------
- // ----------------------[ ARB_vertex_type_2_10_10_10_rev ]----------------------
- // ------------------------------------------------------------------------------
-
- /**
- * Accepted by the <type> parameter of VertexAttribPointer, VertexPointer,
- * NormalPointer, ColorPointer, SecondaryColorPointer, TexCoordPointer,
- * VertexAttribP{1234}ui, VertexP*, TexCoordP*, MultiTexCoordP*, NormalP3ui,
- * ColorP*, SecondaryColorP* and VertexAttribP*
- */
- int GL_INT_2_10_10_10_REV = 0x8D9F;
-
- @NoErrorCheck
- @DeprecatedGL
- void glVertexP2ui(@GLenum int type, @GLuint int value);
-
- @NoErrorCheck
- @DeprecatedGL
- void glVertexP3ui(@GLenum int type, @GLuint int value);
-
- @NoErrorCheck
- @DeprecatedGL
- void glVertexP4ui(@GLenum int type, @GLuint int value);
-
- @NoErrorCheck
- @DeprecatedGL
- @StripPostfix("value")
- void glVertexP2uiv(@GLenum int type, @Check("2") @Const @GLuint IntBuffer value);
-
- @NoErrorCheck
- @DeprecatedGL
- @StripPostfix("value")
- void glVertexP3uiv(@GLenum int type, @Check("3") @Const @GLuint IntBuffer value);
-
- @NoErrorCheck
- @DeprecatedGL
- @StripPostfix("value")
- void glVertexP4uiv(@GLenum int type, @Check("4") @Const @GLuint IntBuffer value);
-
- @NoErrorCheck
- @DeprecatedGL
- void glTexCoordP1ui(@GLenum int type, @GLuint int coords);
-
- @NoErrorCheck
- @DeprecatedGL
- void glTexCoordP2ui(@GLenum int type, @GLuint int coords);
-
- @NoErrorCheck
- @DeprecatedGL
- void glTexCoordP3ui(@GLenum int type, @GLuint int coords);
-
- @NoErrorCheck
- @DeprecatedGL
- void glTexCoordP4ui(@GLenum int type, @GLuint int coords);
-
- @NoErrorCheck
- @DeprecatedGL
- @StripPostfix("coords")
- void glTexCoordP1uiv(@GLenum int type, @Check("1") @Const @GLuint IntBuffer coords);
-
- @NoErrorCheck
- @DeprecatedGL
- @StripPostfix("coords")
- void glTexCoordP2uiv(@GLenum int type, @Check("2") @Const @GLuint IntBuffer coords);
-
- @NoErrorCheck
- @DeprecatedGL
- @StripPostfix("coords")
- void glTexCoordP3uiv(@GLenum int type, @Check("3") @Const @GLuint IntBuffer coords);
-
- @NoErrorCheck
- @DeprecatedGL
- @StripPostfix("coords")
- void glTexCoordP4uiv(@GLenum int type, @Check("4") @Const @GLuint IntBuffer coords);
-
- @NoErrorCheck
- @DeprecatedGL
- void glMultiTexCoordP1ui(@GLenum int texture, @GLenum int type, @GLuint int coords);
-
- @NoErrorCheck
- @DeprecatedGL
- void glMultiTexCoordP2ui(@GLenum int texture, @GLenum int type, @GLuint int coords);
-
- @NoErrorCheck
- @DeprecatedGL
- void glMultiTexCoordP3ui(@GLenum int texture, @GLenum int type, @GLuint int coords);
-
- @NoErrorCheck
- @DeprecatedGL
- void glMultiTexCoordP4ui(@GLenum int texture, @GLenum int type, @GLuint int coords);
-
- @NoErrorCheck
- @DeprecatedGL
- @StripPostfix("coords")
- void glMultiTexCoordP1uiv(@GLenum int texture, @GLenum int type, @Check("1") @Const @GLuint IntBuffer coords);
-
- @NoErrorCheck
- @DeprecatedGL
- @StripPostfix("coords")
- void glMultiTexCoordP2uiv(@GLenum int texture, @GLenum int type, @Check("2") @Const @GLuint IntBuffer coords);
-
- @NoErrorCheck
- @DeprecatedGL
- @StripPostfix("coords")
- void glMultiTexCoordP3uiv(@GLenum int texture, @GLenum int type, @Check("3") @Const @GLuint IntBuffer coords);
-
- @NoErrorCheck
- @DeprecatedGL
- @StripPostfix("coords")
- void glMultiTexCoordP4uiv(@GLenum int texture, @GLenum int type, @Check("4") @Const @GLuint IntBuffer coords);
-
- @NoErrorCheck
- @DeprecatedGL
- void glNormalP3ui(@GLenum int type, @GLuint int coords);
-
- @NoErrorCheck
- @DeprecatedGL
- @StripPostfix("coords")
- void glNormalP3uiv(@GLenum int type, @Check("3") @Const @GLuint IntBuffer coords);
-
- @NoErrorCheck
- @DeprecatedGL
- void glColorP3ui(@GLenum int type, @GLuint int color);
-
- @NoErrorCheck
- @DeprecatedGL
- void glColorP4ui(@GLenum int type, @GLuint int color);
-
- @NoErrorCheck
- @DeprecatedGL
- @StripPostfix("color")
- void glColorP3uiv(@GLenum int type, @Check("3") @Const @GLuint IntBuffer color);
-
- @NoErrorCheck
- @DeprecatedGL
- @StripPostfix("color")
- void glColorP4uiv(@GLenum int type, @Check("4") @Const @GLuint IntBuffer color);
-
- @NoErrorCheck
- @DeprecatedGL
- void glSecondaryColorP3ui(@GLenum int type, @GLuint int color);
-
- @NoErrorCheck
- @DeprecatedGL
- @StripPostfix("color")
- void glSecondaryColorP3uiv(@GLenum int type, @Check("3") @Const @GLuint IntBuffer color);
-
- @NoErrorCheck
- @DeprecatedGL
- void glVertexAttribP1ui(@GLuint int index, @GLenum int type, boolean normalized, @GLuint int value);
-
- @NoErrorCheck
- @DeprecatedGL
- void glVertexAttribP2ui(@GLuint int index, @GLenum int type, boolean normalized, @GLuint int value);
-
- @NoErrorCheck
- @DeprecatedGL
- void glVertexAttribP3ui(@GLuint int index, @GLenum int type, boolean normalized, @GLuint int value);
-
- @NoErrorCheck
- @DeprecatedGL
- void glVertexAttribP4ui(@GLuint int index, @GLenum int type, boolean normalized, @GLuint int value);
-
- @NoErrorCheck
- @DeprecatedGL
- @StripPostfix("value")
- void glVertexAttribP1uiv(@GLuint int index, @GLenum int type, boolean normalized, @Check("1") @Const @GLuint IntBuffer value);
-
- @NoErrorCheck
- @DeprecatedGL
- @StripPostfix("value")
- void glVertexAttribP2uiv(@GLuint int index, @GLenum int type, boolean normalized, @Check("2") @Const @GLuint IntBuffer value);
-
- @NoErrorCheck
- @DeprecatedGL
- @StripPostfix("value")
- void glVertexAttribP3uiv(@GLuint int index, @GLenum int type, boolean normalized, @Check("3") @Const @GLuint IntBuffer value);
-
- @NoErrorCheck
- @DeprecatedGL
- @StripPostfix("value")
- void glVertexAttribP4uiv(@GLuint int index, @GLenum int type, boolean normalized, @Check("4") @Const @GLuint IntBuffer value);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.ByteBuffer;
+import java.nio.FloatBuffer;
+import java.nio.IntBuffer;
+import java.nio.LongBuffer;
+
+ at DeprecatedGL
+public interface GL33 {
+
+ // -----------------------------------------------------------------------
+ // ----------------------[ ARB_blend_func_extended ]----------------------
+ // -----------------------------------------------------------------------
+
+ /**
+ * Accepted by the <src> and <dst> parameters of BlendFunc and
+ * BlendFunci, and by the <srcRGB>, <dstRGB>, <srcAlpha> and <dstAlpha>
+ * parameters of BlendFuncSeparate and BlendFuncSeparatei:
+ */
+ int GL_SRC1_COLOR = 0x88F9;
+ int GL_SRC1_ALPHA = GL15.GL_SRC1_ALPHA;
+ int GL_ONE_MINUS_SRC1_COLOR = 0x88FA;
+ int GL_ONE_MINUS_SRC1_ALPHA = 0x88FB;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv
+ * and GetDoublev:
+ */
+ int GL_MAX_DUAL_SOURCE_DRAW_BUFFERS = 0x88FC;
+
+ void glBindFragDataLocationIndexed(@GLuint int program, @GLuint int colorNumber, @GLuint int index, @NullTerminated @Const @GLchar ByteBuffer name);
+
+ @Alternate("glBindFragDataLocationIndexed")
+ void glBindFragDataLocationIndexed(@GLuint int program, @GLuint int colorNumber, @GLuint int index, @NullTerminated CharSequence name);
+
+ int glGetFragDataIndex(@GLuint int program, @NullTerminated @Const @GLchar ByteBuffer name);
+
+ @Alternate("glGetFragDataIndex")
+ int glGetFragDataIndex(@GLuint int program, @NullTerminated CharSequence name);
+
+ // --------------------------------------------------------------------
+ // ----------------------[ ARB_occlusion_query2 ]----------------------
+ // --------------------------------------------------------------------
+
+ /**
+ * Accepted by the <target> parameter of BeginQuery, EndQuery,
+ * and GetQueryiv:
+ */
+ int GL_ANY_SAMPLES_PASSED = 0x8C2F;
+
+ // -------------------------------------------------------------------
+ // ----------------------[ ARB_sampler_objects ]----------------------
+ // -------------------------------------------------------------------
+
+ /**
+ * Accepted by the <value> parameter of the GetBooleanv, GetIntegerv,
+ * GetInteger64v, GetFloatv and GetDoublev functions:
+ */
+ int GL_SAMPLER_BINDING = 0x8919;
+
+ void glGenSamplers(@AutoSize("samplers") @GLsizei int count, @OutParameter @GLuint IntBuffer samplers);
+
+ @Alternate("glGenSamplers")
+ @GLreturn("samplers")
+ void glGenSamplers2(@Constant("1") @GLsizei int count, @OutParameter @GLuint IntBuffer samplers);
+
+ void glDeleteSamplers(@AutoSize("samplers") @GLsizei int count, @Const @GLuint IntBuffer samplers);
+
+ @Alternate("glDeleteSamplers")
+ void glDeleteSamplers(@Constant("1") @GLsizei int count, @Constant(value = "APIUtils.getBufferInt().put(0, sampler), 0", keepParam = true) int sampler);
+
+ boolean glIsSampler(@GLuint int sampler);
+
+ void glBindSampler(@GLenum int unit, @GLuint int sampler);
+
+ void glSamplerParameteri(@GLuint int sampler, @GLenum int pname, int param);
+
+ void glSamplerParameterf(@GLuint int sampler, @GLenum int pname, float param);
+
+ @StripPostfix("params")
+ void glSamplerParameteriv(@GLuint int sampler, @GLenum int pname, @Check("4") @Const IntBuffer params);
+
+ @StripPostfix("params")
+ void glSamplerParameterfv(@GLuint int sampler, @GLenum int pname, @Check("4") @Const FloatBuffer params);
+
+ @StripPostfix("params")
+ void glSamplerParameterIiv(@GLuint int sampler, @GLenum int pname, @Check("4") @Const IntBuffer params);
+
+ @StripPostfix("params")
+ void glSamplerParameterIuiv(@GLuint int sampler, @GLenum int pname, @Check("4") @Const @GLuint IntBuffer params);
+
+ @StripPostfix("params")
+ void glGetSamplerParameteriv(@GLuint int sampler, @GLenum int pname, @Check("4") @OutParameter IntBuffer params);
+
+ @Alternate("glGetSamplerParameteriv")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetSamplerParameteriv2(@GLuint int sampler, @GLenum int pname, @OutParameter IntBuffer params);
+
+ @StripPostfix("params")
+ void glGetSamplerParameterfv(@GLuint int sampler, @GLenum int pname, @Check("4") @OutParameter FloatBuffer params);
+
+ @Alternate("glGetSamplerParameterfv")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetSamplerParameterfv2(@GLuint int sampler, @GLenum int pname, @OutParameter FloatBuffer params);
+
+ @StripPostfix("params")
+ void glGetSamplerParameterIiv(@GLuint int sampler, @GLenum int pname, @Check("4") @OutParameter IntBuffer params);
+
+ @Alternate("glGetSamplerParameterIiv")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetSamplerParameterIiv2(@GLuint int sampler, @GLenum int pname, @OutParameter IntBuffer params);
+
+ @StripPostfix("params")
+ void glGetSamplerParameterIuiv(@GLuint int sampler, @GLenum int pname, @Check("4") @OutParameter IntBuffer params);
+
+ @Alternate("glGetSamplerParameterIuiv")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetSamplerParameterIuiv2(@GLuint int sampler, @GLenum int pname, @OutParameter IntBuffer params);
+
+ // -------------------------------------------------------------------
+ // ----------------------[ ARB_texture_rgb10_a2ui ]----------------------
+ // -------------------------------------------------------------------
+
+ /**
+ * Accepted by the <internalFormat> parameter of TexImage1D, TexImage2D,
+ * TexImage3D, CopyTexImage1D, CopyTexImage2D, RenderbufferStorage and
+ * RenderbufferStorageMultisample:
+ */
+ int GL_RGB10_A2UI = 0x906F;
+
+ // -------------------------------------------------------------------
+ // ----------------------[ ARB_texture_swizzle ]----------------------
+ // -------------------------------------------------------------------
+
+ /**
+ * Accepted by the <pname> parameters of TexParameteri,
+ * TexParameterf, TexParameteriv, TexParameterfv,
+ * GetTexParameterfv, and GetTexParameteriv:
+ */
+ int GL_TEXTURE_SWIZZLE_R = 0x8E42;
+ int GL_TEXTURE_SWIZZLE_G = 0x8E43;
+ int GL_TEXTURE_SWIZZLE_B = 0x8E44;
+ int GL_TEXTURE_SWIZZLE_A = 0x8E45;
+
+ /**
+ * Accepted by the <pname> parameters of TexParameteriv,
+ * TexParameterfv, GetTexParameterfv, and GetTexParameteriv:
+ */
+ int GL_TEXTURE_SWIZZLE_RGBA = 0x8E46;
+
+ // ---------------------------------------------------------------
+ // ----------------------[ ARB_timer_query ]----------------------
+ // ---------------------------------------------------------------
+
+ /**
+ * Accepted by the <target> parameter of BeginQuery, EndQuery, and
+ * GetQueryiv:
+ */
+ int GL_TIME_ELAPSED = 0x88BF;
+
+ /**
+ * Accepted by the <target> parameter of GetQueryiv and QueryCounter.
+ * Accepted by the <value> parameter of GetBooleanv, GetIntegerv,
+ * GetInteger64v, GetFloatv, and GetDoublev:
+ */
+ int GL_TIMESTAMP = 0x8E28;
+
+ void glQueryCounter(@GLuint int id, @GLenum int target);
+
+ @StripPostfix("params")
+ void glGetQueryObjecti64v(@GLuint int id, @GLenum int pname, @OutParameter @Check("1") @GLint64 LongBuffer params);
+
+ @Alternate("glGetQueryObjecti64v")
+ @GLreturn("params")
+ @StripPostfix("params")
+ void glGetQueryObjecti64v2(@GLuint int id, @GLenum int pname, @OutParameter @GLint64 LongBuffer params);
+
+ @StripPostfix("params")
+ void glGetQueryObjectui64v(@GLuint int id, @GLenum int pname, @OutParameter @Check("1") @GLuint64 LongBuffer params);
+
+ @Alternate("glGetQueryObjectui64v")
+ @GLreturn("params")
+ @StripPostfix("params")
+ void glGetQueryObjectui64v2(@GLuint int id, @GLenum int pname, @OutParameter @GLuint64 LongBuffer params);
+
+ // --------------------------------------------------------------------
+ // ----------------------[ ARB_instanced_arrays ]----------------------
+ // --------------------------------------------------------------------
+
+ /**
+ * Accepted by the <pname> parameters of GetVertexAttribdv,
+ * GetVertexAttribfv, and GetVertexAttribiv:
+ */
+ int GL_VERTEX_ATTRIB_ARRAY_DIVISOR = 0x88FE;
+
+ void glVertexAttribDivisor(@GLuint int index, @GLuint int divisor);
+
+ // ------------------------------------------------------------------------------
+ // ----------------------[ ARB_vertex_type_2_10_10_10_rev ]----------------------
+ // ------------------------------------------------------------------------------
+
+ /**
+ * Accepted by the <type> parameter of VertexAttribPointer, VertexPointer,
+ * NormalPointer, ColorPointer, SecondaryColorPointer, TexCoordPointer,
+ * VertexAttribP{1234}ui, VertexP*, TexCoordP*, MultiTexCoordP*, NormalP3ui,
+ * ColorP*, SecondaryColorP* and VertexAttribP*
+ */
+ int GL_INT_2_10_10_10_REV = 0x8D9F;
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glVertexP2ui(@GLenum int type, @GLuint int value);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glVertexP3ui(@GLenum int type, @GLuint int value);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glVertexP4ui(@GLenum int type, @GLuint int value);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ @StripPostfix("value")
+ void glVertexP2uiv(@GLenum int type, @Check("2") @Const @GLuint IntBuffer value);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ @StripPostfix("value")
+ void glVertexP3uiv(@GLenum int type, @Check("3") @Const @GLuint IntBuffer value);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ @StripPostfix("value")
+ void glVertexP4uiv(@GLenum int type, @Check("4") @Const @GLuint IntBuffer value);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glTexCoordP1ui(@GLenum int type, @GLuint int coords);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glTexCoordP2ui(@GLenum int type, @GLuint int coords);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glTexCoordP3ui(@GLenum int type, @GLuint int coords);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glTexCoordP4ui(@GLenum int type, @GLuint int coords);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ @StripPostfix("coords")
+ void glTexCoordP1uiv(@GLenum int type, @Check("1") @Const @GLuint IntBuffer coords);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ @StripPostfix("coords")
+ void glTexCoordP2uiv(@GLenum int type, @Check("2") @Const @GLuint IntBuffer coords);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ @StripPostfix("coords")
+ void glTexCoordP3uiv(@GLenum int type, @Check("3") @Const @GLuint IntBuffer coords);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ @StripPostfix("coords")
+ void glTexCoordP4uiv(@GLenum int type, @Check("4") @Const @GLuint IntBuffer coords);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glMultiTexCoordP1ui(@GLenum int texture, @GLenum int type, @GLuint int coords);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glMultiTexCoordP2ui(@GLenum int texture, @GLenum int type, @GLuint int coords);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glMultiTexCoordP3ui(@GLenum int texture, @GLenum int type, @GLuint int coords);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glMultiTexCoordP4ui(@GLenum int texture, @GLenum int type, @GLuint int coords);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ @StripPostfix("coords")
+ void glMultiTexCoordP1uiv(@GLenum int texture, @GLenum int type, @Check("1") @Const @GLuint IntBuffer coords);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ @StripPostfix("coords")
+ void glMultiTexCoordP2uiv(@GLenum int texture, @GLenum int type, @Check("2") @Const @GLuint IntBuffer coords);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ @StripPostfix("coords")
+ void glMultiTexCoordP3uiv(@GLenum int texture, @GLenum int type, @Check("3") @Const @GLuint IntBuffer coords);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ @StripPostfix("coords")
+ void glMultiTexCoordP4uiv(@GLenum int texture, @GLenum int type, @Check("4") @Const @GLuint IntBuffer coords);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glNormalP3ui(@GLenum int type, @GLuint int coords);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ @StripPostfix("coords")
+ void glNormalP3uiv(@GLenum int type, @Check("3") @Const @GLuint IntBuffer coords);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glColorP3ui(@GLenum int type, @GLuint int color);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glColorP4ui(@GLenum int type, @GLuint int color);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ @StripPostfix("color")
+ void glColorP3uiv(@GLenum int type, @Check("3") @Const @GLuint IntBuffer color);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ @StripPostfix("color")
+ void glColorP4uiv(@GLenum int type, @Check("4") @Const @GLuint IntBuffer color);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glSecondaryColorP3ui(@GLenum int type, @GLuint int color);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ @StripPostfix("color")
+ void glSecondaryColorP3uiv(@GLenum int type, @Check("3") @Const @GLuint IntBuffer color);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glVertexAttribP1ui(@GLuint int index, @GLenum int type, boolean normalized, @GLuint int value);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glVertexAttribP2ui(@GLuint int index, @GLenum int type, boolean normalized, @GLuint int value);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glVertexAttribP3ui(@GLuint int index, @GLenum int type, boolean normalized, @GLuint int value);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ void glVertexAttribP4ui(@GLuint int index, @GLenum int type, boolean normalized, @GLuint int value);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ @StripPostfix("value")
+ void glVertexAttribP1uiv(@GLuint int index, @GLenum int type, boolean normalized, @Check("1") @Const @GLuint IntBuffer value);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ @StripPostfix("value")
+ void glVertexAttribP2uiv(@GLuint int index, @GLenum int type, boolean normalized, @Check("2") @Const @GLuint IntBuffer value);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ @StripPostfix("value")
+ void glVertexAttribP3uiv(@GLuint int index, @GLenum int type, boolean normalized, @Check("3") @Const @GLuint IntBuffer value);
+
+ @NoErrorCheck
+ @DeprecatedGL
+ @StripPostfix("value")
+ void glVertexAttribP4uiv(@GLuint int index, @GLenum int type, boolean normalized, @Check("4") @Const @GLuint IntBuffer value);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/GL40.java b/src/templates/org/lwjgl/opengl/GL40.java
index c899798..4c455e1 100644
--- a/src/templates/org/lwjgl/opengl/GL40.java
+++ b/src/templates/org/lwjgl/opengl/GL40.java
@@ -1,449 +1,449 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.ByteBuffer;
-import java.nio.DoubleBuffer;
-import java.nio.FloatBuffer;
-import java.nio.IntBuffer;
-
-import com.sun.mirror.type.PrimitiveType;
-
-public interface GL40 {
-
- // ----------------------------------------------------------------------
- // ----------------------[ ARB_draw_buffers_blend ]----------------------
- // ----------------------------------------------------------------------
-
- @Optional(reason = "AMD's 4.0 implementation does not expose this (last driver checked: 10.3)")
- void glBlendEquationi(@GLuint int buf, @GLenum int mode);
-
- @Optional(reason = "AMD's 4.0 implementation does not expose this (last driver checked: 10.3)")
- void glBlendEquationSeparatei(@GLuint int buf, @GLenum int modeRGB, @GLenum int modeAlpha);
-
- @Optional(reason = "AMD's 4.0 implementation does not expose this (last driver checked: 10.3)")
- void glBlendFunci(@GLuint int buf, @GLenum int src, @GLenum int dst);
-
- @Optional(reason = "AMD's 4.0 implementation does not expose this (last driver checked: 10.3)")
- void glBlendFuncSeparatei(@GLuint int buf, @GLenum int srcRGB, @GLenum int dstRGB, @GLenum int srcAlpha, @GLenum int dstAlpha);
-
- // -----------------------------------------------------------------
- // ----------------------[ ARB_draw_indirect ]----------------------
- // -----------------------------------------------------------------
-
- /**
- * Accepted by the <target> parameters of BindBuffer, BufferData,
- * BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData,
- * GetBufferPointerv, MapBufferRange, FlushMappedBufferRange,
- * GetBufferParameteriv, BindBufferRange, BindBufferBase, and
- * CopyBufferSubData:
- */
- int GL_DRAW_INDIRECT_BUFFER = 0x8F3F;
-
- /**
- * Accepted by the <value> parameter of GetIntegerv, GetBooleanv, GetFloatv,
- * and GetDoublev:
- */
- int GL_DRAW_INDIRECT_BUFFER_BINDING = 0x8F43;
-
- void glDrawArraysIndirect(@GLenum int mode, @BufferObject(BufferKind.IndirectBO) @Check("4") @NullTerminated @Const @GLvoid(PrimitiveType.Kind.INT) IntBuffer indirect);
-
- void glDrawElementsIndirect(@GLenum int mode, @GLenum int type, @BufferObject(BufferKind.IndirectBO) @Check("5") @NullTerminated @Const @GLvoid(PrimitiveType.Kind.INT) IntBuffer indirect);
-
- // ---------------------------------------------------------------
- // ----------------------[ ARB_gpu_shader5 ]----------------------
- // ---------------------------------------------------------------
-
- /** Accepted by the <pname> parameter of GetProgramiv: */
- int GL_GEOMETRY_SHADER_INVOCATIONS = 0x887F;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
- * GetDoublev, and GetInteger64v:
- */
- int GL_MAX_GEOMETRY_SHADER_INVOCATIONS = 0x8E5A;
- int GL_MIN_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5B;
- int GL_MAX_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5C;
- int GL_FRAGMENT_INTERPOLATION_OFFSET_BITS = 0x8E5D;
- int GL_MAX_VERTEX_STREAMS = 0x8E71;
-
- // -------------------------------------------------------------------
- // ----------------------[ ARB_gpu_shader_fp64 ]----------------------
- // -------------------------------------------------------------------
-
- /**
- * Returned in the <type> parameter of GetActiveUniform, and
- * GetTransformFeedbackVarying:
- */
- int GL_DOUBLE_VEC2 = 0x8FFC;
- int GL_DOUBLE_VEC3 = 0x8FFD;
- int GL_DOUBLE_VEC4 = 0x8FFE;
- int GL_DOUBLE_MAT2 = 0x8F46;
- int GL_DOUBLE_MAT3 = 0x8F47;
- int GL_DOUBLE_MAT4 = 0x8F48;
- int GL_DOUBLE_MAT2x3 = 0x8F49;
- int GL_DOUBLE_MAT2x4 = 0x8F4A;
- int GL_DOUBLE_MAT3x2 = 0x8F4B;
- int GL_DOUBLE_MAT3x4 = 0x8F4C;
- int GL_DOUBLE_MAT4x2 = 0x8F4D;
- int GL_DOUBLE_MAT4x3 = 0x8F4E;
-
- void glUniform1d(int location, double x);
-
- void glUniform2d(int location, double x, double y);
-
- void glUniform3d(int location, double x, double y, double z);
-
- void glUniform4d(int location, double x, double y, double z, double w);
-
- @StripPostfix("value")
- void glUniform1dv(int location, @AutoSize("value") @GLsizei int count, @Const DoubleBuffer value);
-
- @StripPostfix("value")
- void glUniform2dv(int location, @AutoSize(value = "value", expression = " >> 1") @GLsizei int count, @Const DoubleBuffer value);
-
- @StripPostfix("value")
- void glUniform3dv(int location, @AutoSize(value = "value", expression = " / 3") @GLsizei int count, @Const DoubleBuffer value);
-
- @StripPostfix("value")
- void glUniform4dv(int location, @AutoSize(value = "value", expression = " >> 2") @GLsizei int count, @Const DoubleBuffer value);
-
- @StripPostfix("value")
- void glUniformMatrix2dv(int location, @AutoSize(value = "value", expression = " >> 2") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
-
- @StripPostfix("value")
- void glUniformMatrix3dv(int location, @AutoSize(value = "value", expression = " / (3 * 3)") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
-
- @StripPostfix("value")
- void glUniformMatrix4dv(int location, @AutoSize(value = "value", expression = " >> 4") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
-
- @StripPostfix("value")
- void glUniformMatrix2x3dv(int location, @AutoSize(value = "value", expression = " / (2 * 3)") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
-
- @StripPostfix("value")
- void glUniformMatrix2x4dv(int location, @AutoSize(value = "value", expression = " >> 3") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
-
- @StripPostfix("value")
- void glUniformMatrix3x2dv(int location, @AutoSize(value = "value", expression = " / (3 * 2)") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
-
- @StripPostfix("value")
- void glUniformMatrix3x4dv(int location, @AutoSize(value = "value", expression = " / (3 * 4)") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
-
- @StripPostfix("value")
- void glUniformMatrix4x2dv(int location, @AutoSize(value = "value", expression = " >> 3") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
-
- @StripPostfix("value")
- void glUniformMatrix4x3dv(int location, @AutoSize(value = "value", expression = " / (4 * 3)") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
-
- @StripPostfix("params")
- void glGetUniformdv(@GLuint int program, int location, @OutParameter @Check DoubleBuffer params);
-
- // ------------------------------------------------------------------
- // ----------------------[ ARB_sample_shading ]----------------------
- // ------------------------------------------------------------------
-
- /**
- * Accepted by the <cap> parameter of Enable, Disable, and IsEnabled,
- * and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
- * and GetDoublev:
- */
- int GL_SAMPLE_SHADING = 0x8C36;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetDoublev,
- * GetIntegerv, and GetFloatv:
- */
- int GL_MIN_SAMPLE_SHADING_VALUE = 0x8C37;
-
- @Optional(reason = "AMD's 4.0 implementation does not expose this (last driver checked: 10.3)")
- void glMinSampleShading(@GLclampf float value);
-
- // ---------------------------------------------------------------------
- // ----------------------[ ARB_shader_subroutine ]----------------------
- // ---------------------------------------------------------------------
-
- /** Accepted by the <pname> parameter of GetProgramStageiv: */
- int GL_ACTIVE_SUBROUTINES = 0x8DE5;
- int GL_ACTIVE_SUBROUTINE_UNIFORMS = 0x8DE6;
- int GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS = 0x8E47;
- int GL_ACTIVE_SUBROUTINE_MAX_LENGTH = 0x8E48;
- int GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH = 0x8E49;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv, GetDoublev, and GetInteger64v:
- */
- int GL_MAX_SUBROUTINES = 0x8DE7;
- int GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS = 0x8DE8;
-
- /** Accepted by the <pname> parameter of GetActiveSubroutineUniformiv: */
- int GL_NUM_COMPATIBLE_SUBROUTINES = 0x8E4A;
- int GL_COMPATIBLE_SUBROUTINES = 0x8E4B;
- int GL_UNIFORM_SIZE = GL31.GL_UNIFORM_SIZE;
- int GL_UNIFORM_NAME_LENGTH = GL31.GL_UNIFORM_NAME_LENGTH;
-
- int glGetSubroutineUniformLocation(@GLuint int program, @GLenum int shadertype, @Const @NullTerminated ByteBuffer name);
-
- @GLuint
- int glGetSubroutineIndex(@GLuint int program, @GLenum int shadertype, @Const @NullTerminated ByteBuffer name);
-
- @StripPostfix("values")
- void glGetActiveSubroutineUniformiv(@GLuint int program, @GLenum int shadertype, @GLuint int index, @GLenum int pname,
- @OutParameter @Check("1") IntBuffer values);
-
- @Alternate("glGetActiveSubroutineUniformiv")
- @GLreturn("values")
- @StripPostfix("values")
- void glGetActiveSubroutineUniformiv2(@GLuint int program, @GLenum int shadertype, @GLuint int index, @GLenum int pname,
- @OutParameter IntBuffer values);
-
- void glGetActiveSubroutineUniformName(@GLuint int program, @GLenum int shadertype, @GLuint int index, @AutoSize("name") @GLsizei int bufsize,
- @OutParameter @Check(value = "1", canBeNull = true) @GLsizei IntBuffer length,
- @OutParameter @GLchar ByteBuffer name);
-
- @Alternate("glGetActiveSubroutineUniformName")
- @GLreturn(value = "name", maxLength = "bufsize")
- void glGetActiveSubroutineUniformName2(@GLuint int program, @GLenum int shadertype, @GLuint int index, @GLsizei int bufsize,
- @OutParameter @Constant("name_length, 0") @GLsizei IntBuffer length,
- @OutParameter @GLchar ByteBuffer name);
-
- void glGetActiveSubroutineName(@GLuint int program, @GLenum int shadertype, @GLuint int index, @AutoSize("name") @GLsizei int bufsize,
- @OutParameter @Check(value = "1", canBeNull = true) @GLsizei IntBuffer length,
- @OutParameter @GLchar ByteBuffer name);
-
- @Alternate("glGetActiveSubroutineName")
- @GLreturn(value = "name", maxLength = "bufsize")
- void glGetActiveSubroutineName2(@GLuint int program, @GLenum int shadertype, @GLuint int index, @GLsizei int bufsize,
- @OutParameter @Constant("name_length, 0") @GLsizei IntBuffer length,
- @OutParameter @GLchar ByteBuffer name);
-
- @StripPostfix("indices")
- void glUniformSubroutinesuiv(@GLenum int shadertype, @AutoSize("indices") @GLsizei int count, @Const @GLuint IntBuffer indices);
-
- @StripPostfix("params")
- void glGetUniformSubroutineuiv(@GLenum int shadertype, int location, @Check("1") @OutParameter @GLuint IntBuffer params);
-
- @Alternate("glGetUniformSubroutineuiv")
- @GLreturn("params")
- @StripPostfix("params")
- void glGetUniformSubroutineuiv2(@GLenum int shadertype, int location, @OutParameter @GLuint IntBuffer params);
-
- @StripPostfix("values")
- void glGetProgramStageiv(@GLuint int program, @GLenum int shadertype, @GLenum int pname, @Check("1") @OutParameter IntBuffer values);
-
- @Alternate("glGetProgramStageiv")
- @GLreturn("values")
- @StripPostfix("values")
- void glGetProgramStageiv2(@GLuint int program, @GLenum int shadertype, @GLenum int pname, @OutParameter IntBuffer values);
-
- // -----------------------------------------------------------------------
- // ----------------------[ ARB_tessellation_shader ]----------------------
- // -----------------------------------------------------------------------
-
- /**
- * Accepted by the <mode> parameter of Begin and all vertex array functions
- * that implicitly call Begin:
- */
- int GL_PATCHES = 0xE;
-
- /**
- * Accepted by the <pname> parameter of PatchParameteri, GetBooleanv,
- * GetDoublev, GetFloatv, GetIntegerv, and GetInteger64v:
- */
- int GL_PATCH_VERTICES = 0x8E72;
-
- /**
- * Accepted by the <pname> parameter of PatchParameterfv, GetBooleanv,
- * GetDoublev, GetFloatv, and GetIntegerv, and GetInteger64v:
- */
- int GL_PATCH_DEFAULT_INNER_LEVEL = 0x8E73;
- int GL_PATCH_DEFAULT_OUTER_LEVEL = 0x8E74;
-
- /** Accepted by the <pname> parameter of GetProgramiv: */
- int GL_TESS_CONTROL_OUTPUT_VERTICES = 0x8E75;
- int GL_TESS_GEN_MODE = 0x8E76;
- int GL_TESS_GEN_SPACING = 0x8E77;
- int GL_TESS_GEN_VERTEX_ORDER = 0x8E78;
- int GL_TESS_GEN_POINT_MODE = 0x8E79;
-
- /** Returned by GetProgramiv when <pname> is TESS_GEN_MODE: */
- int GL_ISOLINES = 0x8E7A;
-
- /** Returned by GetProgramiv when <pname> is TESS_GEN_SPACING: */
- int GL_FRACTIONAL_ODD = 0x8E7B;
- int GL_FRACTIONAL_EVEN = 0x8E7C;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetDoublev, GetFloatv,
- * GetIntegerv, and GetInteger64v:
- */
- int GL_MAX_PATCH_VERTICES = 0x8E7D;
- int GL_MAX_TESS_GEN_LEVEL = 0x8E7E;
- int GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E7F;
- int GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E80;
- int GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS = 0x8E81;
- int GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS = 0x8E82;
- int GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS = 0x8E83;
- int GL_MAX_TESS_PATCH_COMPONENTS = 0x8E84;
- int GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS = 0x8E85;
- int GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS = 0x8E86;
- int GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS = 0x8E89;
- int GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS = 0x8E8A;
- int GL_MAX_TESS_CONTROL_INPUT_COMPONENTS = 0x886C;
- int GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS = 0x886D;
- int GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E1E;
- int GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E1F;
-
- /** Accepted by the <pname> parameter of GetActiveUniformBlockiv: */
- int GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER = 0x84F0;
- int GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x84F1;
-
- /**
- * Accepted by the <type> parameter of CreateShader and returned by the
- * <params> parameter of GetShaderiv:
- */
- int GL_TESS_EVALUATION_SHADER = 0x8E87;
- int GL_TESS_CONTROL_SHADER = 0x8E88;
-
- void glPatchParameteri(@GLenum int pname, int value);
-
- @StripPostfix("values")
- void glPatchParameterfv(@GLenum int pname, @Check("4") @Const FloatBuffer values);
-
- // --------------------------------------------------------------------------
- // ----------------------[ ARB_texture_cube_map_array ]----------------------
- // --------------------------------------------------------------------------
-
- /**
- * Accepted by the <target> parameter of TexParameteri, TexParameteriv,
- * TexParameterf, TexParameterfv, BindTexture, and GenerateMipmap:
- * <p/>
- * Accepted by the <target> parameter of TexImage3D, TexSubImage3D,
- * CompressedTeximage3D, CompressedTexSubImage3D and CopyTexSubImage3D:
- * <p/>
- * Accepted by the <tex> parameter of GetTexImage:
- */
- int GL_TEXTURE_CUBE_MAP_ARRAY = 0x9009;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetDoublev,
- * GetIntegerv and GetFloatv:
- */
- int GL_TEXTURE_BINDING_CUBE_MAP_ARRAY = 0x900A;
-
- /**
- * Accepted by the <target> parameter of TexImage3D, TexSubImage3D,
- * CompressedTeximage3D, CompressedTexSubImage3D and CopyTexSubImage3D:
- */
- int GL_PROXY_TEXTURE_CUBE_MAP_ARRAY = 0x900B;
-
- /** Returned by the <type> parameter of GetActiveUniform: */
- int GL_SAMPLER_CUBE_MAP_ARRAY = 0x900C;
- int GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW = 0x900D;
- int GL_INT_SAMPLER_CUBE_MAP_ARRAY = 0x900E;
- int GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY = 0x900F;
-
- // ------------------------------------------------------------------
- // ----------------------[ ARB_texture_gather ]----------------------
- // ------------------------------------------------------------------
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv, and GetDoublev:
- */
- int GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB = 0x8E5E;
- int GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB = 0x8E5F;
- int GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB = 0x8F9F;
-
- // -----------------------------------------------------------------------
- // ----------------------[ ARB_transform_feedback2 ]----------------------
- // -----------------------------------------------------------------------
-
- /** Accepted by the <target> parameter of BindTransformFeedback: */
- int GL_TRANSFORM_FEEDBACK = 0x8E22;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetDoublev, GetIntegerv,
- * and GetFloatv:
- */
- int GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED = 0x8E23;
- int GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE = 0x8E24;
- int GL_TRANSFORM_FEEDBACK_BINDING = 0x8E25;
-
- void glBindTransformFeedback(@GLenum int target, @GLuint int id);
-
- void glDeleteTransformFeedbacks(@AutoSize("ids") @GLsizei int n, @Const @GLuint IntBuffer ids);
-
- @Alternate("glDeleteTransformFeedbacks")
- void glDeleteTransformFeedbacks(@Constant("1") @GLsizei int n, @Constant(value = "APIUtils.getBufferInt().put(0, id), 0", keepParam = true) int id);
-
- void glGenTransformFeedbacks(@AutoSize("ids") @GLsizei int n, @OutParameter @GLuint IntBuffer ids);
-
- @Alternate("glGenTransformFeedbacks")
- @GLreturn("ids")
- void glGenTransformFeedbacks2(@Constant("1") @GLsizei int n, @OutParameter @GLuint IntBuffer ids);
-
- boolean glIsTransformFeedback(@GLuint int id);
-
- void glPauseTransformFeedback();
-
- void glResumeTransformFeedback();
-
- void glDrawTransformFeedback(@GLenum int mode, @GLuint int id);
-
- // -----------------------------------------------------------------------
- // ----------------------[ ARB_transform_feedback3 ]----------------------
- // -----------------------------------------------------------------------
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetDoublev, GetIntegerv,
- * and GetFloatv:
- */
- int GL_MAX_TRANSFORM_FEEDBACK_BUFFERS = 0x8E70;
-
- void glDrawTransformFeedbackStream(@GLenum int mode, @GLuint int id, @GLuint int stream);
-
- void glBeginQueryIndexed(@GLenum int target, @GLuint int index, @GLuint int id);
-
- void glEndQueryIndexed(@GLenum int target, @GLuint int index);
-
- @StripPostfix("params")
- void glGetQueryIndexediv(@GLenum int target, @GLuint int index, @GLenum int pname, @OutParameter @Check("1") IntBuffer params);
-
- @Alternate("glGetQueryIndexediv")
- @GLreturn("params")
- @StripPostfix("params")
- void glGetQueryIndexediv2(@GLenum int target, @GLuint int index, @GLenum int pname, @OutParameter IntBuffer params);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.ByteBuffer;
+import java.nio.DoubleBuffer;
+import java.nio.FloatBuffer;
+import java.nio.IntBuffer;
+
+import com.sun.mirror.type.PrimitiveType;
+
+public interface GL40 {
+
+ // ----------------------------------------------------------------------
+ // ----------------------[ ARB_draw_buffers_blend ]----------------------
+ // ----------------------------------------------------------------------
+
+ @Optional(reason = "AMD's 4.0 implementation does not expose this (last driver checked: 10.3)")
+ void glBlendEquationi(@GLuint int buf, @GLenum int mode);
+
+ @Optional(reason = "AMD's 4.0 implementation does not expose this (last driver checked: 10.3)")
+ void glBlendEquationSeparatei(@GLuint int buf, @GLenum int modeRGB, @GLenum int modeAlpha);
+
+ @Optional(reason = "AMD's 4.0 implementation does not expose this (last driver checked: 10.3)")
+ void glBlendFunci(@GLuint int buf, @GLenum int src, @GLenum int dst);
+
+ @Optional(reason = "AMD's 4.0 implementation does not expose this (last driver checked: 10.3)")
+ void glBlendFuncSeparatei(@GLuint int buf, @GLenum int srcRGB, @GLenum int dstRGB, @GLenum int srcAlpha, @GLenum int dstAlpha);
+
+ // -----------------------------------------------------------------
+ // ----------------------[ ARB_draw_indirect ]----------------------
+ // -----------------------------------------------------------------
+
+ /**
+ * Accepted by the <target> parameters of BindBuffer, BufferData,
+ * BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData,
+ * GetBufferPointerv, MapBufferRange, FlushMappedBufferRange,
+ * GetBufferParameteriv, BindBufferRange, BindBufferBase, and
+ * CopyBufferSubData:
+ */
+ int GL_DRAW_INDIRECT_BUFFER = 0x8F3F;
+
+ /**
+ * Accepted by the <value> parameter of GetIntegerv, GetBooleanv, GetFloatv,
+ * and GetDoublev:
+ */
+ int GL_DRAW_INDIRECT_BUFFER_BINDING = 0x8F43;
+
+ void glDrawArraysIndirect(@GLenum int mode, @BufferObject(BufferKind.IndirectBO) @Check("4") @NullTerminated @Const @GLvoid(PrimitiveType.Kind.INT) IntBuffer indirect);
+
+ void glDrawElementsIndirect(@GLenum int mode, @GLenum int type, @BufferObject(BufferKind.IndirectBO) @Check("5") @NullTerminated @Const @GLvoid(PrimitiveType.Kind.INT) IntBuffer indirect);
+
+ // ---------------------------------------------------------------
+ // ----------------------[ ARB_gpu_shader5 ]----------------------
+ // ---------------------------------------------------------------
+
+ /** Accepted by the <pname> parameter of GetProgramiv: */
+ int GL_GEOMETRY_SHADER_INVOCATIONS = 0x887F;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
+ * GetDoublev, and GetInteger64v:
+ */
+ int GL_MAX_GEOMETRY_SHADER_INVOCATIONS = 0x8E5A;
+ int GL_MIN_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5B;
+ int GL_MAX_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5C;
+ int GL_FRAGMENT_INTERPOLATION_OFFSET_BITS = 0x8E5D;
+ int GL_MAX_VERTEX_STREAMS = 0x8E71;
+
+ // -------------------------------------------------------------------
+ // ----------------------[ ARB_gpu_shader_fp64 ]----------------------
+ // -------------------------------------------------------------------
+
+ /**
+ * Returned in the <type> parameter of GetActiveUniform, and
+ * GetTransformFeedbackVarying:
+ */
+ int GL_DOUBLE_VEC2 = 0x8FFC;
+ int GL_DOUBLE_VEC3 = 0x8FFD;
+ int GL_DOUBLE_VEC4 = 0x8FFE;
+ int GL_DOUBLE_MAT2 = 0x8F46;
+ int GL_DOUBLE_MAT3 = 0x8F47;
+ int GL_DOUBLE_MAT4 = 0x8F48;
+ int GL_DOUBLE_MAT2x3 = 0x8F49;
+ int GL_DOUBLE_MAT2x4 = 0x8F4A;
+ int GL_DOUBLE_MAT3x2 = 0x8F4B;
+ int GL_DOUBLE_MAT3x4 = 0x8F4C;
+ int GL_DOUBLE_MAT4x2 = 0x8F4D;
+ int GL_DOUBLE_MAT4x3 = 0x8F4E;
+
+ void glUniform1d(int location, double x);
+
+ void glUniform2d(int location, double x, double y);
+
+ void glUniform3d(int location, double x, double y, double z);
+
+ void glUniform4d(int location, double x, double y, double z, double w);
+
+ @StripPostfix("value")
+ void glUniform1dv(int location, @AutoSize("value") @GLsizei int count, @Const DoubleBuffer value);
+
+ @StripPostfix("value")
+ void glUniform2dv(int location, @AutoSize(value = "value", expression = " >> 1") @GLsizei int count, @Const DoubleBuffer value);
+
+ @StripPostfix("value")
+ void glUniform3dv(int location, @AutoSize(value = "value", expression = " / 3") @GLsizei int count, @Const DoubleBuffer value);
+
+ @StripPostfix("value")
+ void glUniform4dv(int location, @AutoSize(value = "value", expression = " >> 2") @GLsizei int count, @Const DoubleBuffer value);
+
+ @StripPostfix("value")
+ void glUniformMatrix2dv(int location, @AutoSize(value = "value", expression = " >> 2") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
+
+ @StripPostfix("value")
+ void glUniformMatrix3dv(int location, @AutoSize(value = "value", expression = " / (3 * 3)") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
+
+ @StripPostfix("value")
+ void glUniformMatrix4dv(int location, @AutoSize(value = "value", expression = " >> 4") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
+
+ @StripPostfix("value")
+ void glUniformMatrix2x3dv(int location, @AutoSize(value = "value", expression = " / (2 * 3)") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
+
+ @StripPostfix("value")
+ void glUniformMatrix2x4dv(int location, @AutoSize(value = "value", expression = " >> 3") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
+
+ @StripPostfix("value")
+ void glUniformMatrix3x2dv(int location, @AutoSize(value = "value", expression = " / (3 * 2)") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
+
+ @StripPostfix("value")
+ void glUniformMatrix3x4dv(int location, @AutoSize(value = "value", expression = " / (3 * 4)") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
+
+ @StripPostfix("value")
+ void glUniformMatrix4x2dv(int location, @AutoSize(value = "value", expression = " >> 3") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
+
+ @StripPostfix("value")
+ void glUniformMatrix4x3dv(int location, @AutoSize(value = "value", expression = " / (4 * 3)") @GLsizei int count, boolean transpose, @Const DoubleBuffer value);
+
+ @StripPostfix("params")
+ void glGetUniformdv(@GLuint int program, int location, @OutParameter @Check DoubleBuffer params);
+
+ // ------------------------------------------------------------------
+ // ----------------------[ ARB_sample_shading ]----------------------
+ // ------------------------------------------------------------------
+
+ /**
+ * Accepted by the <cap> parameter of Enable, Disable, and IsEnabled,
+ * and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
+ * and GetDoublev:
+ */
+ int GL_SAMPLE_SHADING = 0x8C36;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetDoublev,
+ * GetIntegerv, and GetFloatv:
+ */
+ int GL_MIN_SAMPLE_SHADING_VALUE = 0x8C37;
+
+ @Optional(reason = "AMD's 4.0 implementation does not expose this (last driver checked: 10.3)")
+ void glMinSampleShading(@GLclampf float value);
+
+ // ---------------------------------------------------------------------
+ // ----------------------[ ARB_shader_subroutine ]----------------------
+ // ---------------------------------------------------------------------
+
+ /** Accepted by the <pname> parameter of GetProgramStageiv: */
+ int GL_ACTIVE_SUBROUTINES = 0x8DE5;
+ int GL_ACTIVE_SUBROUTINE_UNIFORMS = 0x8DE6;
+ int GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS = 0x8E47;
+ int GL_ACTIVE_SUBROUTINE_MAX_LENGTH = 0x8E48;
+ int GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH = 0x8E49;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, GetDoublev, and GetInteger64v:
+ */
+ int GL_MAX_SUBROUTINES = 0x8DE7;
+ int GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS = 0x8DE8;
+
+ /** Accepted by the <pname> parameter of GetActiveSubroutineUniformiv: */
+ int GL_NUM_COMPATIBLE_SUBROUTINES = 0x8E4A;
+ int GL_COMPATIBLE_SUBROUTINES = 0x8E4B;
+ int GL_UNIFORM_SIZE = GL31.GL_UNIFORM_SIZE;
+ int GL_UNIFORM_NAME_LENGTH = GL31.GL_UNIFORM_NAME_LENGTH;
+
+ int glGetSubroutineUniformLocation(@GLuint int program, @GLenum int shadertype, @Const @NullTerminated ByteBuffer name);
+
+ @GLuint
+ int glGetSubroutineIndex(@GLuint int program, @GLenum int shadertype, @Const @NullTerminated ByteBuffer name);
+
+ @StripPostfix("values")
+ void glGetActiveSubroutineUniformiv(@GLuint int program, @GLenum int shadertype, @GLuint int index, @GLenum int pname,
+ @OutParameter @Check("1") IntBuffer values);
+
+ @Alternate("glGetActiveSubroutineUniformiv")
+ @GLreturn("values")
+ @StripPostfix("values")
+ void glGetActiveSubroutineUniformiv2(@GLuint int program, @GLenum int shadertype, @GLuint int index, @GLenum int pname,
+ @OutParameter IntBuffer values);
+
+ void glGetActiveSubroutineUniformName(@GLuint int program, @GLenum int shadertype, @GLuint int index, @AutoSize("name") @GLsizei int bufsize,
+ @OutParameter @Check(value = "1", canBeNull = true) @GLsizei IntBuffer length,
+ @OutParameter @GLchar ByteBuffer name);
+
+ @Alternate("glGetActiveSubroutineUniformName")
+ @GLreturn(value = "name", maxLength = "bufsize")
+ void glGetActiveSubroutineUniformName2(@GLuint int program, @GLenum int shadertype, @GLuint int index, @GLsizei int bufsize,
+ @OutParameter @Constant("name_length, 0") @GLsizei IntBuffer length,
+ @OutParameter @GLchar ByteBuffer name);
+
+ void glGetActiveSubroutineName(@GLuint int program, @GLenum int shadertype, @GLuint int index, @AutoSize("name") @GLsizei int bufsize,
+ @OutParameter @Check(value = "1", canBeNull = true) @GLsizei IntBuffer length,
+ @OutParameter @GLchar ByteBuffer name);
+
+ @Alternate("glGetActiveSubroutineName")
+ @GLreturn(value = "name", maxLength = "bufsize")
+ void glGetActiveSubroutineName2(@GLuint int program, @GLenum int shadertype, @GLuint int index, @GLsizei int bufsize,
+ @OutParameter @Constant("name_length, 0") @GLsizei IntBuffer length,
+ @OutParameter @GLchar ByteBuffer name);
+
+ @StripPostfix("indices")
+ void glUniformSubroutinesuiv(@GLenum int shadertype, @AutoSize("indices") @GLsizei int count, @Const @GLuint IntBuffer indices);
+
+ @StripPostfix("params")
+ void glGetUniformSubroutineuiv(@GLenum int shadertype, int location, @Check("1") @OutParameter @GLuint IntBuffer params);
+
+ @Alternate("glGetUniformSubroutineuiv")
+ @GLreturn("params")
+ @StripPostfix("params")
+ void glGetUniformSubroutineuiv2(@GLenum int shadertype, int location, @OutParameter @GLuint IntBuffer params);
+
+ @StripPostfix("values")
+ void glGetProgramStageiv(@GLuint int program, @GLenum int shadertype, @GLenum int pname, @Check("1") @OutParameter IntBuffer values);
+
+ @Alternate("glGetProgramStageiv")
+ @GLreturn("values")
+ @StripPostfix("values")
+ void glGetProgramStageiv2(@GLuint int program, @GLenum int shadertype, @GLenum int pname, @OutParameter IntBuffer values);
+
+ // -----------------------------------------------------------------------
+ // ----------------------[ ARB_tessellation_shader ]----------------------
+ // -----------------------------------------------------------------------
+
+ /**
+ * Accepted by the <mode> parameter of Begin and all vertex array functions
+ * that implicitly call Begin:
+ */
+ int GL_PATCHES = 0xE;
+
+ /**
+ * Accepted by the <pname> parameter of PatchParameteri, GetBooleanv,
+ * GetDoublev, GetFloatv, GetIntegerv, and GetInteger64v:
+ */
+ int GL_PATCH_VERTICES = 0x8E72;
+
+ /**
+ * Accepted by the <pname> parameter of PatchParameterfv, GetBooleanv,
+ * GetDoublev, GetFloatv, and GetIntegerv, and GetInteger64v:
+ */
+ int GL_PATCH_DEFAULT_INNER_LEVEL = 0x8E73;
+ int GL_PATCH_DEFAULT_OUTER_LEVEL = 0x8E74;
+
+ /** Accepted by the <pname> parameter of GetProgramiv: */
+ int GL_TESS_CONTROL_OUTPUT_VERTICES = 0x8E75;
+ int GL_TESS_GEN_MODE = 0x8E76;
+ int GL_TESS_GEN_SPACING = 0x8E77;
+ int GL_TESS_GEN_VERTEX_ORDER = 0x8E78;
+ int GL_TESS_GEN_POINT_MODE = 0x8E79;
+
+ /** Returned by GetProgramiv when <pname> is TESS_GEN_MODE: */
+ int GL_ISOLINES = 0x8E7A;
+
+ /** Returned by GetProgramiv when <pname> is TESS_GEN_SPACING: */
+ int GL_FRACTIONAL_ODD = 0x8E7B;
+ int GL_FRACTIONAL_EVEN = 0x8E7C;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetDoublev, GetFloatv,
+ * GetIntegerv, and GetInteger64v:
+ */
+ int GL_MAX_PATCH_VERTICES = 0x8E7D;
+ int GL_MAX_TESS_GEN_LEVEL = 0x8E7E;
+ int GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E7F;
+ int GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E80;
+ int GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS = 0x8E81;
+ int GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS = 0x8E82;
+ int GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS = 0x8E83;
+ int GL_MAX_TESS_PATCH_COMPONENTS = 0x8E84;
+ int GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS = 0x8E85;
+ int GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS = 0x8E86;
+ int GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS = 0x8E89;
+ int GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS = 0x8E8A;
+ int GL_MAX_TESS_CONTROL_INPUT_COMPONENTS = 0x886C;
+ int GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS = 0x886D;
+ int GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E1E;
+ int GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E1F;
+
+ /** Accepted by the <pname> parameter of GetActiveUniformBlockiv: */
+ int GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER = 0x84F0;
+ int GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x84F1;
+
+ /**
+ * Accepted by the <type> parameter of CreateShader and returned by the
+ * <params> parameter of GetShaderiv:
+ */
+ int GL_TESS_EVALUATION_SHADER = 0x8E87;
+ int GL_TESS_CONTROL_SHADER = 0x8E88;
+
+ void glPatchParameteri(@GLenum int pname, int value);
+
+ @StripPostfix("values")
+ void glPatchParameterfv(@GLenum int pname, @Check("4") @Const FloatBuffer values);
+
+ // --------------------------------------------------------------------------
+ // ----------------------[ ARB_texture_cube_map_array ]----------------------
+ // --------------------------------------------------------------------------
+
+ /**
+ * Accepted by the <target> parameter of TexParameteri, TexParameteriv,
+ * TexParameterf, TexParameterfv, BindTexture, and GenerateMipmap:
+ * <p/>
+ * Accepted by the <target> parameter of TexImage3D, TexSubImage3D,
+ * CompressedTeximage3D, CompressedTexSubImage3D and CopyTexSubImage3D:
+ * <p/>
+ * Accepted by the <tex> parameter of GetTexImage:
+ */
+ int GL_TEXTURE_CUBE_MAP_ARRAY = 0x9009;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetDoublev,
+ * GetIntegerv and GetFloatv:
+ */
+ int GL_TEXTURE_BINDING_CUBE_MAP_ARRAY = 0x900A;
+
+ /**
+ * Accepted by the <target> parameter of TexImage3D, TexSubImage3D,
+ * CompressedTeximage3D, CompressedTexSubImage3D and CopyTexSubImage3D:
+ */
+ int GL_PROXY_TEXTURE_CUBE_MAP_ARRAY = 0x900B;
+
+ /** Returned by the <type> parameter of GetActiveUniform: */
+ int GL_SAMPLER_CUBE_MAP_ARRAY = 0x900C;
+ int GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW = 0x900D;
+ int GL_INT_SAMPLER_CUBE_MAP_ARRAY = 0x900E;
+ int GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY = 0x900F;
+
+ // ------------------------------------------------------------------
+ // ----------------------[ ARB_texture_gather ]----------------------
+ // ------------------------------------------------------------------
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, and GetDoublev:
+ */
+ int GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB = 0x8E5E;
+ int GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB = 0x8E5F;
+ int GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB = 0x8F9F;
+
+ // -----------------------------------------------------------------------
+ // ----------------------[ ARB_transform_feedback2 ]----------------------
+ // -----------------------------------------------------------------------
+
+ /** Accepted by the <target> parameter of BindTransformFeedback: */
+ int GL_TRANSFORM_FEEDBACK = 0x8E22;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetDoublev, GetIntegerv,
+ * and GetFloatv:
+ */
+ int GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED = 0x8E23;
+ int GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE = 0x8E24;
+ int GL_TRANSFORM_FEEDBACK_BINDING = 0x8E25;
+
+ void glBindTransformFeedback(@GLenum int target, @GLuint int id);
+
+ void glDeleteTransformFeedbacks(@AutoSize("ids") @GLsizei int n, @Const @GLuint IntBuffer ids);
+
+ @Alternate("glDeleteTransformFeedbacks")
+ void glDeleteTransformFeedbacks(@Constant("1") @GLsizei int n, @Constant(value = "APIUtils.getBufferInt().put(0, id), 0", keepParam = true) int id);
+
+ void glGenTransformFeedbacks(@AutoSize("ids") @GLsizei int n, @OutParameter @GLuint IntBuffer ids);
+
+ @Alternate("glGenTransformFeedbacks")
+ @GLreturn("ids")
+ void glGenTransformFeedbacks2(@Constant("1") @GLsizei int n, @OutParameter @GLuint IntBuffer ids);
+
+ boolean glIsTransformFeedback(@GLuint int id);
+
+ void glPauseTransformFeedback();
+
+ void glResumeTransformFeedback();
+
+ void glDrawTransformFeedback(@GLenum int mode, @GLuint int id);
+
+ // -----------------------------------------------------------------------
+ // ----------------------[ ARB_transform_feedback3 ]----------------------
+ // -----------------------------------------------------------------------
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetDoublev, GetIntegerv,
+ * and GetFloatv:
+ */
+ int GL_MAX_TRANSFORM_FEEDBACK_BUFFERS = 0x8E70;
+
+ void glDrawTransformFeedbackStream(@GLenum int mode, @GLuint int id, @GLuint int stream);
+
+ void glBeginQueryIndexed(@GLenum int target, @GLuint int index, @GLuint int id);
+
+ void glEndQueryIndexed(@GLenum int target, @GLuint int index);
+
+ @StripPostfix("params")
+ void glGetQueryIndexediv(@GLenum int target, @GLuint int index, @GLenum int pname, @OutParameter @Check("1") IntBuffer params);
+
+ @Alternate("glGetQueryIndexediv")
+ @GLreturn("params")
+ @StripPostfix("params")
+ void glGetQueryIndexediv2(@GLenum int target, @GLuint int index, @GLenum int pname, @OutParameter IntBuffer params);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/HP_occlusion_test.java b/src/templates/org/lwjgl/opengl/HP_occlusion_test.java
index f919519..cc828bf 100644
--- a/src/templates/org/lwjgl/opengl/HP_occlusion_test.java
+++ b/src/templates/org/lwjgl/opengl/HP_occlusion_test.java
@@ -1,48 +1,48 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface HP_occlusion_test {
-
- /**
- * Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, by
- * the <pname> of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev :
- */
- int GL_OCCLUSION_TEST_HP = 0x8165;
-
- /**
- * Accepted by the <pname> of GetBooleanv, GetIntegerv, GetFloatv, and
- * GetDoublev :
- */
- int GL_OCCLUSION_TEST_RESULT_HP = 0x8166;
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface HP_occlusion_test {
+
+ /**
+ * Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, by
+ * the <pname> of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev :
+ */
+ int GL_OCCLUSION_TEST_HP = 0x8165;
+
+ /**
+ * Accepted by the <pname> of GetBooleanv, GetIntegerv, GetFloatv, and
+ * GetDoublev :
+ */
+ int GL_OCCLUSION_TEST_RESULT_HP = 0x8166;
+
+}
diff --git a/src/templates/org/lwjgl/opengl/IBM_rasterpos_clip.java b/src/templates/org/lwjgl/opengl/IBM_rasterpos_clip.java
index a88cbee..ea98986 100644
--- a/src/templates/org/lwjgl/opengl/IBM_rasterpos_clip.java
+++ b/src/templates/org/lwjgl/opengl/IBM_rasterpos_clip.java
@@ -1,42 +1,42 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface IBM_rasterpos_clip {
-
- /**
- * Accepted by the <target> parameter of Enable and Disable and the <value>
- * parameter of IsEnabled, GetBooleanv, GetIntegerv, GetFloatv, GetDoublev:
- */
- int GL_RASTER_POSITION_UNCLIPPED_IBM = 103010;
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface IBM_rasterpos_clip {
+
+ /**
+ * Accepted by the <target> parameter of Enable and Disable and the <value>
+ * parameter of IsEnabled, GetBooleanv, GetIntegerv, GetFloatv, GetDoublev:
+ */
+ int GL_RASTER_POSITION_UNCLIPPED_IBM = 103010;
+
+}
diff --git a/src/templates/org/lwjgl/opengl/NVX_gpu_memory_info.java b/src/templates/org/lwjgl/opengl/NVX_gpu_memory_info.java
index 694e719..95edc4f 100644
--- a/src/templates/org/lwjgl/opengl/NVX_gpu_memory_info.java
+++ b/src/templates/org/lwjgl/opengl/NVX_gpu_memory_info.java
@@ -1,44 +1,44 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-/** Experimental extension, may be removed/changed in the future. */
-public interface NVX_gpu_memory_info {
-
- /** Accepted by the <pname> parameter of GetIntegerv: */
- int GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX = 0x9047;
- int GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX = 0x9048;
- int GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX = 0x9049;
- int GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX = 0x904A;
- int GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX = 0x904B;
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+/** Experimental extension, may be removed/changed in the future. */
+public interface NVX_gpu_memory_info {
+
+ /** Accepted by the <pname> parameter of GetIntegerv: */
+ int GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX = 0x9047;
+ int GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX = 0x9048;
+ int GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX = 0x9049;
+ int GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX = 0x904A;
+ int GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX = 0x904B;
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/NV_blend_square.java b/src/templates/org/lwjgl/opengl/NV_blend_square.java
index fc61d50..bed2759 100644
--- a/src/templates/org/lwjgl/opengl/NV_blend_square.java
+++ b/src/templates/org/lwjgl/opengl/NV_blend_square.java
@@ -1,35 +1,35 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface NV_blend_square {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface NV_blend_square {
+}
diff --git a/src/templates/org/lwjgl/opengl/NV_conditional_render.java b/src/templates/org/lwjgl/opengl/NV_conditional_render.java
index 61c1394..4dbc6aa 100644
--- a/src/templates/org/lwjgl/opengl/NV_conditional_render.java
+++ b/src/templates/org/lwjgl/opengl/NV_conditional_render.java
@@ -1,50 +1,50 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.GLenum;
-import org.lwjgl.util.generator.GLuint;
-
-public interface NV_conditional_render {
-
- /**
- * Accepted by the <mode> parameter of BeginConditionalRenderNV:
- */
- int GL_QUERY_WAIT_NV = 0x8E13;
- int GL_QUERY_NO_WAIT_NV = 0x8E14;
- int GL_QUERY_BY_REGION_WAIT_NV = 0x8E15;
- int GL_QUERY_BY_REGION_NO_WAIT_NV = 0x8E16;
-
- void glBeginConditionalRenderNV(@GLuint int id, @GLenum int mode);
- void glEndConditionalRenderNV();
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.GLenum;
+import org.lwjgl.util.generator.GLuint;
+
+public interface NV_conditional_render {
+
+ /**
+ * Accepted by the <mode> parameter of BeginConditionalRenderNV:
+ */
+ int GL_QUERY_WAIT_NV = 0x8E13;
+ int GL_QUERY_NO_WAIT_NV = 0x8E14;
+ int GL_QUERY_BY_REGION_WAIT_NV = 0x8E15;
+ int GL_QUERY_BY_REGION_NO_WAIT_NV = 0x8E16;
+
+ void glBeginConditionalRenderNV(@GLuint int id, @GLenum int mode);
+ void glEndConditionalRenderNV();
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/NV_copy_depth_to_color.java b/src/templates/org/lwjgl/opengl/NV_copy_depth_to_color.java
index 4c9acb2..500c8f5 100644
--- a/src/templates/org/lwjgl/opengl/NV_copy_depth_to_color.java
+++ b/src/templates/org/lwjgl/opengl/NV_copy_depth_to_color.java
@@ -1,37 +1,37 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface NV_copy_depth_to_color {
- int GL_DEPTH_STENCIL_TO_RGBA_NV = 0x886E;
- int GL_DEPTH_STENCIL_TO_BGRA_NV = 0x886F;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface NV_copy_depth_to_color {
+ int GL_DEPTH_STENCIL_TO_RGBA_NV = 0x886E;
+ int GL_DEPTH_STENCIL_TO_BGRA_NV = 0x886F;
+}
diff --git a/src/templates/org/lwjgl/opengl/NV_copy_image.java b/src/templates/org/lwjgl/opengl/NV_copy_image.java
index c70f47b..62fad62 100644
--- a/src/templates/org/lwjgl/opengl/NV_copy_image.java
+++ b/src/templates/org/lwjgl/opengl/NV_copy_image.java
@@ -1,49 +1,49 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.GLenum;
-import org.lwjgl.util.generator.GLsizei;
-import org.lwjgl.util.generator.GLuint;
-
-public interface NV_copy_image {
-
- void glCopyImageSubDataNV(
- @GLuint int srcName, @GLenum int srcTarget, int srcLevel,
- int srcX, int srcY, int srcZ,
- @GLuint int dstName, @GLenum int dstTarget, int dstLevel,
- int dstX, int dstY, int dstZ,
- @GLsizei int width, @GLsizei int height, @GLsizei int depth);
-
- // TODO: Implement WGL and GLX cross-context copying.
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.GLenum;
+import org.lwjgl.util.generator.GLsizei;
+import org.lwjgl.util.generator.GLuint;
+
+public interface NV_copy_image {
+
+ void glCopyImageSubDataNV(
+ @GLuint int srcName, @GLenum int srcTarget, int srcLevel,
+ int srcX, int srcY, int srcZ,
+ @GLuint int dstName, @GLenum int dstTarget, int dstLevel,
+ int dstX, int dstY, int dstZ,
+ @GLsizei int width, @GLsizei int height, @GLsizei int depth);
+
+ // TODO: Implement WGL and GLX cross-context copying.
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/NV_depth_clamp.java b/src/templates/org/lwjgl/opengl/NV_depth_clamp.java
index 33b81d6..0e974e2 100644
--- a/src/templates/org/lwjgl/opengl/NV_depth_clamp.java
+++ b/src/templates/org/lwjgl/opengl/NV_depth_clamp.java
@@ -1,36 +1,36 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface NV_depth_clamp {
- int GL_DEPTH_CLAMP_NV = 0x864F;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface NV_depth_clamp {
+ int GL_DEPTH_CLAMP_NV = 0x864F;
+}
diff --git a/src/templates/org/lwjgl/opengl/NV_evaluators.java b/src/templates/org/lwjgl/opengl/NV_evaluators.java
index f690c78..9745500 100644
--- a/src/templates/org/lwjgl/opengl/NV_evaluators.java
+++ b/src/templates/org/lwjgl/opengl/NV_evaluators.java
@@ -1,91 +1,91 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-public interface NV_evaluators {
- int GL_EVAL_2D_NV = 0x86C0;
- int GL_EVAL_TRIANGULAR_2D_NV = 0x86C1;
- int GL_MAP_TESSELLATION_NV = 0x86C2;
- int GL_MAP_ATTRIB_U_ORDER_NV = 0x86C3;
- int GL_MAP_ATTRIB_V_ORDER_NV = 0x86C4;
- int GL_EVAL_FRACTIONAL_TESSELLATION_NV = 0x86C5;
- int GL_EVAL_VERTEX_ATTRIB0_NV = 0x86C6;
- int GL_EVAL_VERTEX_ATTRIB1_NV = 0x86C7;
- int GL_EVAL_VERTEX_ATTRIB2_NV = 0x86C8;
- int GL_EVAL_VERTEX_ATTRIB3_NV = 0x86C9;
- int GL_EVAL_VERTEX_ATTRIB4_NV = 0x86CA;
- int GL_EVAL_VERTEX_ATTRIB5_NV = 0x86CB;
- int GL_EVAL_VERTEX_ATTRIB6_NV = 0x86CC;
- int GL_EVAL_VERTEX_ATTRIB7_NV = 0x86CD;
- int GL_EVAL_VERTEX_ATTRIB8_NV = 0x86CE;
- int GL_EVAL_VERTEX_ATTRIB9_NV = 0x86CF;
- int GL_EVAL_VERTEX_ATTRIB10_NV = 0x86D0;
- int GL_EVAL_VERTEX_ATTRIB11_NV = 0x86D1;
- int GL_EVAL_VERTEX_ATTRIB12_NV = 0x86D2;
- int GL_EVAL_VERTEX_ATTRIB13_NV = 0x86D3;
- int GL_EVAL_VERTEX_ATTRIB14_NV = 0x86D4;
- int GL_EVAL_VERTEX_ATTRIB15_NV = 0x86D5;
- int GL_MAX_MAP_TESSELLATION_NV = 0x86D6;
- int GL_MAX_RATIONAL_EVAL_ORDER_NV = 0x86D7;
-
- void glGetMapControlPointsNV(@GLenum int target, @GLuint int index, @GLenum int type, @GLsizei int ustride, @GLsizei int vstride, boolean packed,
- @OutParameter
- @Check
- @Const
- @GLfloat Buffer pPoints);
-
- void glMapControlPointsNV(@GLenum int target, @GLuint int index, @GLenum int type, @GLsizei int ustride, @GLsizei int vstride, int uorder, int vorder, boolean packed, @Check @Const @GLfloat Buffer pPoints);
-
- @StripPostfix("params")
- void glMapParameterfvNV(@GLenum int target, @GLenum int pname, @Check("4") @Const FloatBuffer params);
-
- @StripPostfix("params")
- void glMapParameterivNV(@GLenum int target, @GLenum int pname, @Check("4") @Const IntBuffer params);
-
- @StripPostfix("params")
- void glGetMapParameterfvNV(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") @Const FloatBuffer params);
-
- @StripPostfix("params")
- void glGetMapParameterivNV(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") @Const IntBuffer params);
-
- @StripPostfix("params")
- void glGetMapAttribParameterfvNV(@GLenum int target, @GLuint int index, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
-
- @StripPostfix("params")
- void glGetMapAttribParameterivNV(@GLenum int target, @GLuint int index, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
-
- void glEvalMapsNV(@GLenum int target, @GLenum int mode);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+public interface NV_evaluators {
+ int GL_EVAL_2D_NV = 0x86C0;
+ int GL_EVAL_TRIANGULAR_2D_NV = 0x86C1;
+ int GL_MAP_TESSELLATION_NV = 0x86C2;
+ int GL_MAP_ATTRIB_U_ORDER_NV = 0x86C3;
+ int GL_MAP_ATTRIB_V_ORDER_NV = 0x86C4;
+ int GL_EVAL_FRACTIONAL_TESSELLATION_NV = 0x86C5;
+ int GL_EVAL_VERTEX_ATTRIB0_NV = 0x86C6;
+ int GL_EVAL_VERTEX_ATTRIB1_NV = 0x86C7;
+ int GL_EVAL_VERTEX_ATTRIB2_NV = 0x86C8;
+ int GL_EVAL_VERTEX_ATTRIB3_NV = 0x86C9;
+ int GL_EVAL_VERTEX_ATTRIB4_NV = 0x86CA;
+ int GL_EVAL_VERTEX_ATTRIB5_NV = 0x86CB;
+ int GL_EVAL_VERTEX_ATTRIB6_NV = 0x86CC;
+ int GL_EVAL_VERTEX_ATTRIB7_NV = 0x86CD;
+ int GL_EVAL_VERTEX_ATTRIB8_NV = 0x86CE;
+ int GL_EVAL_VERTEX_ATTRIB9_NV = 0x86CF;
+ int GL_EVAL_VERTEX_ATTRIB10_NV = 0x86D0;
+ int GL_EVAL_VERTEX_ATTRIB11_NV = 0x86D1;
+ int GL_EVAL_VERTEX_ATTRIB12_NV = 0x86D2;
+ int GL_EVAL_VERTEX_ATTRIB13_NV = 0x86D3;
+ int GL_EVAL_VERTEX_ATTRIB14_NV = 0x86D4;
+ int GL_EVAL_VERTEX_ATTRIB15_NV = 0x86D5;
+ int GL_MAX_MAP_TESSELLATION_NV = 0x86D6;
+ int GL_MAX_RATIONAL_EVAL_ORDER_NV = 0x86D7;
+
+ void glGetMapControlPointsNV(@GLenum int target, @GLuint int index, @GLenum int type, @GLsizei int ustride, @GLsizei int vstride, boolean packed,
+ @OutParameter
+ @Check
+ @Const
+ @GLfloat Buffer pPoints);
+
+ void glMapControlPointsNV(@GLenum int target, @GLuint int index, @GLenum int type, @GLsizei int ustride, @GLsizei int vstride, int uorder, int vorder, boolean packed, @Check @Const @GLfloat Buffer pPoints);
+
+ @StripPostfix("params")
+ void glMapParameterfvNV(@GLenum int target, @GLenum int pname, @Check("4") @Const FloatBuffer params);
+
+ @StripPostfix("params")
+ void glMapParameterivNV(@GLenum int target, @GLenum int pname, @Check("4") @Const IntBuffer params);
+
+ @StripPostfix("params")
+ void glGetMapParameterfvNV(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") @Const FloatBuffer params);
+
+ @StripPostfix("params")
+ void glGetMapParameterivNV(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") @Const IntBuffer params);
+
+ @StripPostfix("params")
+ void glGetMapAttribParameterfvNV(@GLenum int target, @GLuint int index, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
+
+ @StripPostfix("params")
+ void glGetMapAttribParameterivNV(@GLenum int target, @GLuint int index, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
+
+ void glEvalMapsNV(@GLenum int target, @GLenum int mode);
+}
diff --git a/src/templates/org/lwjgl/opengl/NV_explicit_multisample.java b/src/templates/org/lwjgl/opengl/NV_explicit_multisample.java
index 4e12545..d23dab9 100644
--- a/src/templates/org/lwjgl/opengl/NV_explicit_multisample.java
+++ b/src/templates/org/lwjgl/opengl/NV_explicit_multisample.java
@@ -1,101 +1,101 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.ByteBuffer;
-import java.nio.FloatBuffer;
-import java.nio.IntBuffer;
-
-public interface NV_explicit_multisample {
-
- /** Accepted by the <pname> parameter of GetMultisamplefvNV: */
- int GL_SAMPLE_POSITION_NV = 0x8E50;
-
- /**
- * Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, and by
- * the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
- * GetDoublev:
- */
-
- int GL_SAMPLE_MASK_NV = 0x8E51;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanIndexedvEXT and
- * GetIntegerIndexedvEXT:
- */
-
- int GL_SAMPLE_MASK_VALUE_NV = 0x8E52;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetDoublev, GetIntegerv,
- * and GetFloatv:
- */
-
- int GL_TEXTURE_BINDING_RENDERBUFFER_NV = 0x8E53;
- int GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV = 0x8E54;
- int GL_MAX_SAMPLE_MASK_WORDS_NV = 0x8E59;
-
- /** Accepted by the <target> parameter of BindTexture, and TexRenderbufferNV: */
-
- int GL_TEXTURE_RENDERBUFFER_NV = 0x8E55;
-
- /** Returned by the <type> parameter of GetActiveUniform: */
- int GL_SAMPLER_RENDERBUFFER_NV = 0x8E56;
- int GL_INT_SAMPLER_RENDERBUFFER_NV = 0x8E57;
- int GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV = 0x8E58;
-
- @StripPostfix(value = "data", extension = "EXT")
- void glGetBooleanIndexedvEXT(@GLenum int pname, @GLuint int index, @OutParameter @Check("16") @GLboolean ByteBuffer data);
-
- @Alternate("glGetBooleanIndexedvEXT")
- @GLreturn("data")
- @StripPostfix(value = "data", extension = "EXT")
- void glGetBooleanIndexedvEXT2(@GLenum int pname, @GLuint int index, @OutParameter @GLboolean ByteBuffer data);
-
- @StripPostfix(value = "data", extension = "EXT")
- void glGetIntegerIndexedvEXT(@GLenum int pname, @GLuint int index, @OutParameter @Check("16") IntBuffer data);
-
- @Alternate("glGetIntegerIndexedvEXT")
- @GLreturn("data")
- @StripPostfix(value = "data", extension = "EXT")
- void glGetIntegerIndexedvEXT2(@GLenum int pname, @GLuint int index, @OutParameter IntBuffer data);
-
- @StripPostfix("val")
- void glGetMultisamplefvNV(@GLenum int pname, @GLuint int index, @OutParameter @Check("2") FloatBuffer val);
-
- void glSampleMaskIndexedNV(@GLuint int index, @GLbitfield int mask);
-
- void glTexRenderbufferNV(@GLenum int target, @GLuint int renderbuffer);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.ByteBuffer;
+import java.nio.FloatBuffer;
+import java.nio.IntBuffer;
+
+public interface NV_explicit_multisample {
+
+ /** Accepted by the <pname> parameter of GetMultisamplefvNV: */
+ int GL_SAMPLE_POSITION_NV = 0x8E50;
+
+ /**
+ * Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, and by
+ * the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
+ * GetDoublev:
+ */
+
+ int GL_SAMPLE_MASK_NV = 0x8E51;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanIndexedvEXT and
+ * GetIntegerIndexedvEXT:
+ */
+
+ int GL_SAMPLE_MASK_VALUE_NV = 0x8E52;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetDoublev, GetIntegerv,
+ * and GetFloatv:
+ */
+
+ int GL_TEXTURE_BINDING_RENDERBUFFER_NV = 0x8E53;
+ int GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV = 0x8E54;
+ int GL_MAX_SAMPLE_MASK_WORDS_NV = 0x8E59;
+
+ /** Accepted by the <target> parameter of BindTexture, and TexRenderbufferNV: */
+
+ int GL_TEXTURE_RENDERBUFFER_NV = 0x8E55;
+
+ /** Returned by the <type> parameter of GetActiveUniform: */
+ int GL_SAMPLER_RENDERBUFFER_NV = 0x8E56;
+ int GL_INT_SAMPLER_RENDERBUFFER_NV = 0x8E57;
+ int GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV = 0x8E58;
+
+ @StripPostfix(value = "data", extension = "EXT")
+ void glGetBooleanIndexedvEXT(@GLenum int pname, @GLuint int index, @OutParameter @Check("16") @GLboolean ByteBuffer data);
+
+ @Alternate("glGetBooleanIndexedvEXT")
+ @GLreturn("data")
+ @StripPostfix(value = "data", extension = "EXT")
+ void glGetBooleanIndexedvEXT2(@GLenum int pname, @GLuint int index, @OutParameter @GLboolean ByteBuffer data);
+
+ @StripPostfix(value = "data", extension = "EXT")
+ void glGetIntegerIndexedvEXT(@GLenum int pname, @GLuint int index, @OutParameter @Check("16") IntBuffer data);
+
+ @Alternate("glGetIntegerIndexedvEXT")
+ @GLreturn("data")
+ @StripPostfix(value = "data", extension = "EXT")
+ void glGetIntegerIndexedvEXT2(@GLenum int pname, @GLuint int index, @OutParameter IntBuffer data);
+
+ @StripPostfix("val")
+ void glGetMultisamplefvNV(@GLenum int pname, @GLuint int index, @OutParameter @Check("2") FloatBuffer val);
+
+ void glSampleMaskIndexedNV(@GLuint int index, @GLbitfield int mask);
+
+ void glTexRenderbufferNV(@GLenum int target, @GLuint int renderbuffer);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/NV_fence.java b/src/templates/org/lwjgl/opengl/NV_fence.java
index 3d6abc9..6822f70 100644
--- a/src/templates/org/lwjgl/opengl/NV_fence.java
+++ b/src/templates/org/lwjgl/opengl/NV_fence.java
@@ -1,56 +1,56 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-public interface NV_fence {
- int GL_ALL_COMPLETED_NV = 0x84F2;
- int GL_FENCE_STATUS_NV = 0x84F3;
- int GL_FENCE_CONDITION_NV = 0x84F4;
-
- void glGenFencesNV(@AutoSize("piFences") @GLsizei int n, @OutParameter @GLuint IntBuffer piFences);
-
- void glDeleteFencesNV(@AutoSize("piFences") @GLsizei int n, @Const @GLuint IntBuffer piFences);
-
- void glSetFenceNV(@GLuint int fence, @GLenum int condition);
-
- boolean glTestFenceNV(@GLuint int fence);
-
- void glFinishFenceNV(@GLuint int fence);
-
- boolean glIsFenceNV(@GLuint int fence);
-
- void glGetFenceivNV(@GLuint int fence, @GLenum int pname, @OutParameter @Check("4") IntBuffer piParams);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+public interface NV_fence {
+ int GL_ALL_COMPLETED_NV = 0x84F2;
+ int GL_FENCE_STATUS_NV = 0x84F3;
+ int GL_FENCE_CONDITION_NV = 0x84F4;
+
+ void glGenFencesNV(@AutoSize("piFences") @GLsizei int n, @OutParameter @GLuint IntBuffer piFences);
+
+ void glDeleteFencesNV(@AutoSize("piFences") @GLsizei int n, @Const @GLuint IntBuffer piFences);
+
+ void glSetFenceNV(@GLuint int fence, @GLenum int condition);
+
+ boolean glTestFenceNV(@GLuint int fence);
+
+ void glFinishFenceNV(@GLuint int fence);
+
+ boolean glIsFenceNV(@GLuint int fence);
+
+ void glGetFenceivNV(@GLuint int fence, @GLenum int pname, @OutParameter @Check("4") IntBuffer piParams);
+}
diff --git a/src/templates/org/lwjgl/opengl/NV_float_buffer.java b/src/templates/org/lwjgl/opengl/NV_float_buffer.java
index 343aa95..9e00771 100644
--- a/src/templates/org/lwjgl/opengl/NV_float_buffer.java
+++ b/src/templates/org/lwjgl/opengl/NV_float_buffer.java
@@ -1,91 +1,91 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface NV_float_buffer {
-
- /**
- * Accepted by the <internalformat> parameter of TexImage2D and
- * CopyTexImage2D:
- */
- int GL_FLOAT_R_NV = 0x8880;
- int GL_FLOAT_RG_NV = 0x8881;
- int GL_FLOAT_RGB_NV = 0x8882;
- int GL_FLOAT_RGBA_NV = 0x8883;
- int GL_FLOAT_R16_NV = 0x8884;
- int GL_FLOAT_R32_NV = 0x8885;
- int GL_FLOAT_RG16_NV = 0x8886;
- int GL_FLOAT_RG32_NV = 0x8887;
- int GL_FLOAT_RGB16_NV = 0x8888;
- int GL_FLOAT_RGB32_NV = 0x8889;
- int GL_FLOAT_RGBA16_NV = 0x888A;
- int GL_FLOAT_RGBA32_NV = 0x888B;
-
- /**
- * Accepted by the <pname> parameter of GetTexLevelParameterfv and
- * GetTexLevelParameteriv:
- */
- int GL_TEXTURE_FLOAT_COMPONENTS_NV = 0x888C;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
- * and GetDoublev:
- */
- int GL_FLOAT_CLEAR_COLOR_VALUE_NV = 0x888D;
- int GL_FLOAT_RGBA_MODE_NV = 0x888E;
-
- /**
- * Accepted in the <piAttributes> array of wglGetPixelFormatAttribivARB and
- * wglGetPixelFormatAttribfvARB and in the <piAttribIList> and
- * <pfAttribFList> arrays of wglChoosePixelFormatARB:
- */
- /*
- int WGL_FLOAT_COMPONENTS_NV = 0x20B0;
- int WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV = 0x20B1;
- int WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV = 0x20B2;
- int WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV = 0x20B3;
- int WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV = 0x20B4;
- */
-
- /**
- * Accepted in the <piAttribIList> array of wglCreatePbufferARB and returned
- * in the <value> parameter of wglQueryPbufferARB when <iAttribute> is
- * WGL_TEXTURE_FORMAT_ARB:
- */
- /*
- int WGL_TEXTURE_FLOAT_R_NV = 0x20B5;
- int WGL_TEXTURE_FLOAT_RG_NV = 0x20B6;
- int WGL_TEXTURE_FLOAT_RGB_NV = 0x20B7;
- int WGL_TEXTURE_FLOAT_RGBA_NV = 0x20B8;
- */
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface NV_float_buffer {
+
+ /**
+ * Accepted by the <internalformat> parameter of TexImage2D and
+ * CopyTexImage2D:
+ */
+ int GL_FLOAT_R_NV = 0x8880;
+ int GL_FLOAT_RG_NV = 0x8881;
+ int GL_FLOAT_RGB_NV = 0x8882;
+ int GL_FLOAT_RGBA_NV = 0x8883;
+ int GL_FLOAT_R16_NV = 0x8884;
+ int GL_FLOAT_R32_NV = 0x8885;
+ int GL_FLOAT_RG16_NV = 0x8886;
+ int GL_FLOAT_RG32_NV = 0x8887;
+ int GL_FLOAT_RGB16_NV = 0x8888;
+ int GL_FLOAT_RGB32_NV = 0x8889;
+ int GL_FLOAT_RGBA16_NV = 0x888A;
+ int GL_FLOAT_RGBA32_NV = 0x888B;
+
+ /**
+ * Accepted by the <pname> parameter of GetTexLevelParameterfv and
+ * GetTexLevelParameteriv:
+ */
+ int GL_TEXTURE_FLOAT_COMPONENTS_NV = 0x888C;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
+ * and GetDoublev:
+ */
+ int GL_FLOAT_CLEAR_COLOR_VALUE_NV = 0x888D;
+ int GL_FLOAT_RGBA_MODE_NV = 0x888E;
+
+ /**
+ * Accepted in the <piAttributes> array of wglGetPixelFormatAttribivARB and
+ * wglGetPixelFormatAttribfvARB and in the <piAttribIList> and
+ * <pfAttribFList> arrays of wglChoosePixelFormatARB:
+ */
+ /*
+ int WGL_FLOAT_COMPONENTS_NV = 0x20B0;
+ int WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV = 0x20B1;
+ int WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV = 0x20B2;
+ int WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV = 0x20B3;
+ int WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV = 0x20B4;
+ */
+
+ /**
+ * Accepted in the <piAttribIList> array of wglCreatePbufferARB and returned
+ * in the <value> parameter of wglQueryPbufferARB when <iAttribute> is
+ * WGL_TEXTURE_FORMAT_ARB:
+ */
+ /*
+ int WGL_TEXTURE_FLOAT_R_NV = 0x20B5;
+ int WGL_TEXTURE_FLOAT_RG_NV = 0x20B6;
+ int WGL_TEXTURE_FLOAT_RGB_NV = 0x20B7;
+ int WGL_TEXTURE_FLOAT_RGBA_NV = 0x20B8;
+ */
+
+}
diff --git a/src/templates/org/lwjgl/opengl/NV_fog_distance.java b/src/templates/org/lwjgl/opengl/NV_fog_distance.java
index 201d738..766b354 100644
--- a/src/templates/org/lwjgl/opengl/NV_fog_distance.java
+++ b/src/templates/org/lwjgl/opengl/NV_fog_distance.java
@@ -1,38 +1,38 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface NV_fog_distance {
- int GL_FOG_DISTANCE_MODE_NV = 0x855A;
- int GL_EYE_RADIAL_NV = 0x855B;
- int GL_EYE_PLANE_ABSOLUTE_NV = 0x855C;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface NV_fog_distance {
+ int GL_FOG_DISTANCE_MODE_NV = 0x855A;
+ int GL_EYE_RADIAL_NV = 0x855B;
+ int GL_EYE_PLANE_ABSOLUTE_NV = 0x855C;
+}
diff --git a/src/templates/org/lwjgl/opengl/NV_fragment_program.java b/src/templates/org/lwjgl/opengl/NV_fragment_program.java
index 360f2ff..3af3504 100644
--- a/src/templates/org/lwjgl/opengl/NV_fragment_program.java
+++ b/src/templates/org/lwjgl/opengl/NV_fragment_program.java
@@ -1,69 +1,69 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-public interface NV_fragment_program extends NV_program {
-
- /**
- * Accepted by the <cap> parameter of Disable, Enable, and IsEnabled, by the
- * <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev,
- * and by the <target> parameter of BindProgramNV, LoadProgramNV,
- * ProgramLocalParameter4dARB, ProgramLocalParameter4dvARB,
- * ProgramLocalParameter4fARB, ProgramLocalParameter4fvARB,
- * GetProgramLocalParameterdvARB, and GetProgramLocalParameterfvARB:
- */
- int GL_FRAGMENT_PROGRAM_NV = 0x8870;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
- * and GetDoublev:
- */
- int GL_MAX_TEXTURE_COORDS_NV = 0x8871;
- int GL_MAX_TEXTURE_IMAGE_UNITS_NV = 0x8872;
- int GL_FRAGMENT_PROGRAM_BINDING_NV = 0x8873;
- int GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV = 0x8868;
-
- void glProgramNamedParameter4fNV(@GLuint int id, @AutoSize("name") @GLsizei int length, @Const @GLubyte ByteBuffer name, float x, float y, float z, float w);
-
- void glProgramNamedParameter4dNV(@GLuint int id, @AutoSize("name") @GLsizei int length, @Const @GLubyte ByteBuffer name, double x, double y, double z, double w);
-
- @StripPostfix("params")
- void glGetProgramNamedParameterfvNV(@GLuint int id, @AutoSize("name") @GLsizei int length, @Const @GLubyte ByteBuffer name, @OutParameter @Check("4") FloatBuffer params);
-
- @StripPostfix("params")
- void glGetProgramNamedParameterdvNV(@GLuint int id, @AutoSize("name") @GLsizei int length, @Const @GLubyte ByteBuffer name, @OutParameter @Check("4") DoubleBuffer params);
-}
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+public interface NV_fragment_program extends NV_program {
+
+ /**
+ * Accepted by the <cap> parameter of Disable, Enable, and IsEnabled, by the
+ * <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev,
+ * and by the <target> parameter of BindProgramNV, LoadProgramNV,
+ * ProgramLocalParameter4dARB, ProgramLocalParameter4dvARB,
+ * ProgramLocalParameter4fARB, ProgramLocalParameter4fvARB,
+ * GetProgramLocalParameterdvARB, and GetProgramLocalParameterfvARB:
+ */
+ int GL_FRAGMENT_PROGRAM_NV = 0x8870;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
+ * and GetDoublev:
+ */
+ int GL_MAX_TEXTURE_COORDS_NV = 0x8871;
+ int GL_MAX_TEXTURE_IMAGE_UNITS_NV = 0x8872;
+ int GL_FRAGMENT_PROGRAM_BINDING_NV = 0x8873;
+ int GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV = 0x8868;
+
+ void glProgramNamedParameter4fNV(@GLuint int id, @AutoSize("name") @GLsizei int length, @Const @GLubyte ByteBuffer name, float x, float y, float z, float w);
+
+ void glProgramNamedParameter4dNV(@GLuint int id, @AutoSize("name") @GLsizei int length, @Const @GLubyte ByteBuffer name, double x, double y, double z, double w);
+
+ @StripPostfix("params")
+ void glGetProgramNamedParameterfvNV(@GLuint int id, @AutoSize("name") @GLsizei int length, @Const @GLubyte ByteBuffer name, @OutParameter @Check("4") FloatBuffer params);
+
+ @StripPostfix("params")
+ void glGetProgramNamedParameterdvNV(@GLuint int id, @AutoSize("name") @GLsizei int length, @Const @GLubyte ByteBuffer name, @OutParameter @Check("4") DoubleBuffer params);
+}
+
diff --git a/src/templates/org/lwjgl/opengl/NV_fragment_program2.java b/src/templates/org/lwjgl/opengl/NV_fragment_program2.java
index edb8c38..2cc7d8b 100644
--- a/src/templates/org/lwjgl/opengl/NV_fragment_program2.java
+++ b/src/templates/org/lwjgl/opengl/NV_fragment_program2.java
@@ -1,44 +1,44 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface NV_fragment_program2 {
-
- /**
- * Accepted by the <pname> parameter of GetProgramivARB:
- */
- int GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV = 0x88F4;
- int GL_MAX_PROGRAM_CALL_DEPTH_NV = 0x88F5;
- int GL_MAX_PROGRAM_IF_DEPTH_NV = 0x88F6;
- int GL_MAX_PROGRAM_LOOP_DEPTH_NV = 0x88F7;
- int GL_MAX_PROGRAM_LOOP_COUNT_NV = 0x88F8;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface NV_fragment_program2 {
+
+ /**
+ * Accepted by the <pname> parameter of GetProgramivARB:
+ */
+ int GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV = 0x88F4;
+ int GL_MAX_PROGRAM_CALL_DEPTH_NV = 0x88F5;
+ int GL_MAX_PROGRAM_IF_DEPTH_NV = 0x88F6;
+ int GL_MAX_PROGRAM_LOOP_DEPTH_NV = 0x88F7;
+ int GL_MAX_PROGRAM_LOOP_COUNT_NV = 0x88F8;
+}
diff --git a/src/templates/org/lwjgl/opengl/NV_fragment_program_option.java b/src/templates/org/lwjgl/opengl/NV_fragment_program_option.java
index 56e04b1..ba736cd 100644
--- a/src/templates/org/lwjgl/opengl/NV_fragment_program_option.java
+++ b/src/templates/org/lwjgl/opengl/NV_fragment_program_option.java
@@ -1,35 +1,35 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface NV_fragment_program_option {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface NV_fragment_program_option {
+}
diff --git a/src/templates/org/lwjgl/opengl/NV_geometry_shader4.java b/src/templates/org/lwjgl/opengl/NV_geometry_shader4.java
index b1e173c..c064804 100644
--- a/src/templates/org/lwjgl/opengl/NV_geometry_shader4.java
+++ b/src/templates/org/lwjgl/opengl/NV_geometry_shader4.java
@@ -1,36 +1,36 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface NV_geometry_shader4 {
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface NV_geometry_shader4 {
+
+}
diff --git a/src/templates/org/lwjgl/opengl/NV_gpu_shader5.java b/src/templates/org/lwjgl/opengl/NV_gpu_shader5.java
index f81c43c..ea1a866 100644
--- a/src/templates/org/lwjgl/opengl/NV_gpu_shader5.java
+++ b/src/templates/org/lwjgl/opengl/NV_gpu_shader5.java
@@ -1,182 +1,182 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.LongBuffer;
-
- at Dependent
-public interface NV_gpu_shader5 {
-
- /**
- * Returned by the <type> parameter of GetActiveAttrib, GetActiveUniform, and
- * GetTransformFeedbackVarying:
- */
- int GL_INT64_NV = 0x140E;
- int GL_UNSIGNED_INT64_NV = 0x140F;
-
- int GL_INT8_NV = 0x8FE0;
- int GL_INT8_VEC2_NV = 0x8FE1;
- int GL_INT8_VEC3_NV = 0x8FE2;
- int GL_INT8_VEC4_NV = 0x8FE3;
- int GL_INT16_NV = 0x8FE4;
- int GL_INT16_VEC2_NV = 0x8FE5;
- int GL_INT16_VEC3_NV = 0x8FE6;
- int GL_INT16_VEC4_NV = 0x8FE7;
- int GL_INT64_VEC2_NV = 0x8FE9;
- int GL_INT64_VEC3_NV = 0x8FEA;
- int GL_INT64_VEC4_NV = 0x8FEB;
- int GL_UNSIGNED_INT8_NV = 0x8FEC;
- int GL_UNSIGNED_INT8_VEC2_NV = 0x8FED;
- int GL_UNSIGNED_INT8_VEC3_NV = 0x8FEE;
- int GL_UNSIGNED_INT8_VEC4_NV = 0x8FEF;
- int GL_UNSIGNED_INT16_NV = 0x8FF0;
- int GL_UNSIGNED_INT16_VEC2_NV = 0x8FF1;
- int GL_UNSIGNED_INT16_VEC3_NV = 0x8FF2;
- int GL_UNSIGNED_INT16_VEC4_NV = 0x8FF3;
- int GL_UNSIGNED_INT64_VEC2_NV = 0x8FF5;
- int GL_UNSIGNED_INT64_VEC3_NV = 0x8FF6;
- int GL_UNSIGNED_INT64_VEC4_NV = 0x8FF7;
- int GL_FLOAT16_NV = 0x8FF8;
- int GL_FLOAT16_VEC2_NV = 0x8FF9;
- int GL_FLOAT16_VEC3_NV = 0x8FFA;
- int GL_FLOAT16_VEC4_NV = 0x8FFB;
-
- /** Accepted by the <primitiveMode> parameter of BeginTransformFeedback: */
- int GL_PATCHES = ARB_tessellation_shader.GL_PATCHES;
-
- void glUniform1i64NV(int location, @GLint64EXT long x);
-
- void glUniform2i64NV(int location, @GLint64EXT long x, @GLint64EXT long y);
-
- void glUniform3i64NV(int location, @GLint64EXT long x, @GLint64EXT long y, @GLint64EXT long z);
-
- void glUniform4i64NV(int location, @GLint64EXT long x, @GLint64EXT long y, @GLint64EXT long z, @GLint64EXT long w);
-
- @StripPostfix("value")
- void glUniform1i64vNV(int location, @GLsizei int count, @Const @GLint64EXT @Check("1") LongBuffer value);
-
- @StripPostfix("value")
- void glUniform2i64vNV(int location, @GLsizei int count, @Const @GLint64EXT @Check("2") LongBuffer value);
-
- @StripPostfix("value")
- void glUniform3i64vNV(int location, @GLsizei int count, @Const @GLint64EXT @Check("3") LongBuffer value);
-
- @StripPostfix("value")
- void glUniform4i64vNV(int location, @GLsizei int count, @Const @GLint64EXT @Check("4") LongBuffer value);
-
- void glUniform1ui64NV(int location, @GLuint64EXT long x);
-
- void glUniform2ui64NV(int location, @GLuint64EXT long x, @GLuint64EXT long y);
-
- void glUniform3ui64NV(int location, @GLuint64EXT long x, @GLuint64EXT long y, @GLuint64EXT long z);
-
- void glUniform4ui64NV(int location, @GLuint64EXT long x, @GLuint64EXT long y, @GLuint64EXT long z, @GLuint64EXT long w);
-
- @StripPostfix("value")
- void glUniform1ui64vNV(int location, @GLsizei int count, @Const @GLuint64EXT @Check("1") LongBuffer value);
-
- @StripPostfix("value")
- void glUniform2ui64vNV(int location, @GLsizei int count, @Const @GLuint64EXT @Check("2") LongBuffer value);
-
- @StripPostfix("value")
- void glUniform3ui64vNV(int location, @GLsizei int count, @Const @GLuint64EXT @Check("3") LongBuffer value);
-
- @StripPostfix("value")
- void glUniform4ui64vNV(int location, @GLsizei int count, @Const @GLuint64EXT @Check("4") LongBuffer value);
-
- @StripPostfix("params")
- void glGetUniformi64vNV(@GLuint int program, int location, @GLint64EXT @Check LongBuffer params);
-
- @StripPostfix("params")
- void glGetUniformui64vNV(@GLuint int program, int location, @GLuint64EXT @Check LongBuffer params);
-
- // -------------
-
- @Dependent("EXT_direct_state_access")
- void glProgramUniform1i64NV(@GLuint int program, int location, @GLint64EXT long x);
-
- @Dependent("EXT_direct_state_access")
- void glProgramUniform2i64NV(@GLuint int program, int location, @GLint64EXT long x, @GLint64EXT long y);
-
- @Dependent("EXT_direct_state_access")
- void glProgramUniform3i64NV(@GLuint int program, int location, @GLint64EXT long x, @GLint64EXT long y, @GLint64EXT long z);
-
- @Dependent("EXT_direct_state_access")
- void glProgramUniform4i64NV(@GLuint int program, int location, @GLint64EXT long x, @GLint64EXT long y, @GLint64EXT long z, @GLint64EXT long w);
-
- @Dependent("EXT_direct_state_access")
- @StripPostfix("value")
- void glProgramUniform1i64vNV(@GLuint int program, int location, @GLsizei int count, @Const @GLint64EXT @Check("1") LongBuffer value);
-
- @Dependent("EXT_direct_state_access")
- @StripPostfix("value")
- void glProgramUniform2i64vNV(@GLuint int program, int location, @GLsizei int count, @Const @GLint64EXT @Check("2") LongBuffer value);
-
- @Dependent("EXT_direct_state_access")
- @StripPostfix("value")
- void glProgramUniform3i64vNV(@GLuint int program, int location, @GLsizei int count, @Const @GLint64EXT @Check("3") LongBuffer value);
-
- @Dependent("EXT_direct_state_access")
- @StripPostfix("value")
- void glProgramUniform4i64vNV(@GLuint int program, int location, @GLsizei int count, @Const @GLint64EXT @Check("4") LongBuffer value);
-
- @Dependent("EXT_direct_state_access")
- void glProgramUniform1ui64NV(@GLuint int program, int location, @GLuint64EXT long x);
-
- @Dependent("EXT_direct_state_access")
- void glProgramUniform2ui64NV(@GLuint int program, int location, @GLuint64EXT long x, @GLuint64EXT long y);
-
- @Dependent("EXT_direct_state_access")
- void glProgramUniform3ui64NV(@GLuint int program, int location, @GLuint64EXT long x, @GLuint64EXT long y, @GLuint64EXT long z);
-
- @Dependent("EXT_direct_state_access")
- void glProgramUniform4ui64NV(@GLuint int program, int location, @GLuint64EXT long x, @GLuint64EXT long y, @GLuint64EXT long z, @GLuint64EXT long w);
-
- @Dependent("EXT_direct_state_access")
- @StripPostfix("value")
- void glProgramUniform1ui64vNV(@GLuint int program, int location, @GLsizei int count, @Const @GLuint64EXT @Check("1") LongBuffer value);
-
- @Dependent("EXT_direct_state_access")
- @StripPostfix("value")
- void glProgramUniform2ui64vNV(@GLuint int program, int location, @GLsizei int count, @Const @GLuint64EXT @Check("2") LongBuffer value);
-
- @Dependent("EXT_direct_state_access")
- @StripPostfix("value")
- void glProgramUniform3ui64vNV(@GLuint int program, int location, @GLsizei int count, @Const @GLuint64EXT @Check("3") LongBuffer value);
-
- @Dependent("EXT_direct_state_access")
- @StripPostfix("value")
- void glProgramUniform4ui64vNV(@GLuint int program, int location, @GLsizei int count, @Const @GLuint64EXT @Check("4") LongBuffer value);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.LongBuffer;
+
+ at Dependent
+public interface NV_gpu_shader5 {
+
+ /**
+ * Returned by the <type> parameter of GetActiveAttrib, GetActiveUniform, and
+ * GetTransformFeedbackVarying:
+ */
+ int GL_INT64_NV = 0x140E;
+ int GL_UNSIGNED_INT64_NV = 0x140F;
+
+ int GL_INT8_NV = 0x8FE0;
+ int GL_INT8_VEC2_NV = 0x8FE1;
+ int GL_INT8_VEC3_NV = 0x8FE2;
+ int GL_INT8_VEC4_NV = 0x8FE3;
+ int GL_INT16_NV = 0x8FE4;
+ int GL_INT16_VEC2_NV = 0x8FE5;
+ int GL_INT16_VEC3_NV = 0x8FE6;
+ int GL_INT16_VEC4_NV = 0x8FE7;
+ int GL_INT64_VEC2_NV = 0x8FE9;
+ int GL_INT64_VEC3_NV = 0x8FEA;
+ int GL_INT64_VEC4_NV = 0x8FEB;
+ int GL_UNSIGNED_INT8_NV = 0x8FEC;
+ int GL_UNSIGNED_INT8_VEC2_NV = 0x8FED;
+ int GL_UNSIGNED_INT8_VEC3_NV = 0x8FEE;
+ int GL_UNSIGNED_INT8_VEC4_NV = 0x8FEF;
+ int GL_UNSIGNED_INT16_NV = 0x8FF0;
+ int GL_UNSIGNED_INT16_VEC2_NV = 0x8FF1;
+ int GL_UNSIGNED_INT16_VEC3_NV = 0x8FF2;
+ int GL_UNSIGNED_INT16_VEC4_NV = 0x8FF3;
+ int GL_UNSIGNED_INT64_VEC2_NV = 0x8FF5;
+ int GL_UNSIGNED_INT64_VEC3_NV = 0x8FF6;
+ int GL_UNSIGNED_INT64_VEC4_NV = 0x8FF7;
+ int GL_FLOAT16_NV = 0x8FF8;
+ int GL_FLOAT16_VEC2_NV = 0x8FF9;
+ int GL_FLOAT16_VEC3_NV = 0x8FFA;
+ int GL_FLOAT16_VEC4_NV = 0x8FFB;
+
+ /** Accepted by the <primitiveMode> parameter of BeginTransformFeedback: */
+ int GL_PATCHES = ARB_tessellation_shader.GL_PATCHES;
+
+ void glUniform1i64NV(int location, @GLint64EXT long x);
+
+ void glUniform2i64NV(int location, @GLint64EXT long x, @GLint64EXT long y);
+
+ void glUniform3i64NV(int location, @GLint64EXT long x, @GLint64EXT long y, @GLint64EXT long z);
+
+ void glUniform4i64NV(int location, @GLint64EXT long x, @GLint64EXT long y, @GLint64EXT long z, @GLint64EXT long w);
+
+ @StripPostfix("value")
+ void glUniform1i64vNV(int location, @GLsizei int count, @Const @GLint64EXT @Check("1") LongBuffer value);
+
+ @StripPostfix("value")
+ void glUniform2i64vNV(int location, @GLsizei int count, @Const @GLint64EXT @Check("2") LongBuffer value);
+
+ @StripPostfix("value")
+ void glUniform3i64vNV(int location, @GLsizei int count, @Const @GLint64EXT @Check("3") LongBuffer value);
+
+ @StripPostfix("value")
+ void glUniform4i64vNV(int location, @GLsizei int count, @Const @GLint64EXT @Check("4") LongBuffer value);
+
+ void glUniform1ui64NV(int location, @GLuint64EXT long x);
+
+ void glUniform2ui64NV(int location, @GLuint64EXT long x, @GLuint64EXT long y);
+
+ void glUniform3ui64NV(int location, @GLuint64EXT long x, @GLuint64EXT long y, @GLuint64EXT long z);
+
+ void glUniform4ui64NV(int location, @GLuint64EXT long x, @GLuint64EXT long y, @GLuint64EXT long z, @GLuint64EXT long w);
+
+ @StripPostfix("value")
+ void glUniform1ui64vNV(int location, @GLsizei int count, @Const @GLuint64EXT @Check("1") LongBuffer value);
+
+ @StripPostfix("value")
+ void glUniform2ui64vNV(int location, @GLsizei int count, @Const @GLuint64EXT @Check("2") LongBuffer value);
+
+ @StripPostfix("value")
+ void glUniform3ui64vNV(int location, @GLsizei int count, @Const @GLuint64EXT @Check("3") LongBuffer value);
+
+ @StripPostfix("value")
+ void glUniform4ui64vNV(int location, @GLsizei int count, @Const @GLuint64EXT @Check("4") LongBuffer value);
+
+ @StripPostfix("params")
+ void glGetUniformi64vNV(@GLuint int program, int location, @GLint64EXT @Check LongBuffer params);
+
+ @StripPostfix("params")
+ void glGetUniformui64vNV(@GLuint int program, int location, @GLuint64EXT @Check LongBuffer params);
+
+ // -------------
+
+ @Dependent("EXT_direct_state_access")
+ void glProgramUniform1i64NV(@GLuint int program, int location, @GLint64EXT long x);
+
+ @Dependent("EXT_direct_state_access")
+ void glProgramUniform2i64NV(@GLuint int program, int location, @GLint64EXT long x, @GLint64EXT long y);
+
+ @Dependent("EXT_direct_state_access")
+ void glProgramUniform3i64NV(@GLuint int program, int location, @GLint64EXT long x, @GLint64EXT long y, @GLint64EXT long z);
+
+ @Dependent("EXT_direct_state_access")
+ void glProgramUniform4i64NV(@GLuint int program, int location, @GLint64EXT long x, @GLint64EXT long y, @GLint64EXT long z, @GLint64EXT long w);
+
+ @Dependent("EXT_direct_state_access")
+ @StripPostfix("value")
+ void glProgramUniform1i64vNV(@GLuint int program, int location, @GLsizei int count, @Const @GLint64EXT @Check("1") LongBuffer value);
+
+ @Dependent("EXT_direct_state_access")
+ @StripPostfix("value")
+ void glProgramUniform2i64vNV(@GLuint int program, int location, @GLsizei int count, @Const @GLint64EXT @Check("2") LongBuffer value);
+
+ @Dependent("EXT_direct_state_access")
+ @StripPostfix("value")
+ void glProgramUniform3i64vNV(@GLuint int program, int location, @GLsizei int count, @Const @GLint64EXT @Check("3") LongBuffer value);
+
+ @Dependent("EXT_direct_state_access")
+ @StripPostfix("value")
+ void glProgramUniform4i64vNV(@GLuint int program, int location, @GLsizei int count, @Const @GLint64EXT @Check("4") LongBuffer value);
+
+ @Dependent("EXT_direct_state_access")
+ void glProgramUniform1ui64NV(@GLuint int program, int location, @GLuint64EXT long x);
+
+ @Dependent("EXT_direct_state_access")
+ void glProgramUniform2ui64NV(@GLuint int program, int location, @GLuint64EXT long x, @GLuint64EXT long y);
+
+ @Dependent("EXT_direct_state_access")
+ void glProgramUniform3ui64NV(@GLuint int program, int location, @GLuint64EXT long x, @GLuint64EXT long y, @GLuint64EXT long z);
+
+ @Dependent("EXT_direct_state_access")
+ void glProgramUniform4ui64NV(@GLuint int program, int location, @GLuint64EXT long x, @GLuint64EXT long y, @GLuint64EXT long z, @GLuint64EXT long w);
+
+ @Dependent("EXT_direct_state_access")
+ @StripPostfix("value")
+ void glProgramUniform1ui64vNV(@GLuint int program, int location, @GLsizei int count, @Const @GLuint64EXT @Check("1") LongBuffer value);
+
+ @Dependent("EXT_direct_state_access")
+ @StripPostfix("value")
+ void glProgramUniform2ui64vNV(@GLuint int program, int location, @GLsizei int count, @Const @GLuint64EXT @Check("2") LongBuffer value);
+
+ @Dependent("EXT_direct_state_access")
+ @StripPostfix("value")
+ void glProgramUniform3ui64vNV(@GLuint int program, int location, @GLsizei int count, @Const @GLuint64EXT @Check("3") LongBuffer value);
+
+ @Dependent("EXT_direct_state_access")
+ @StripPostfix("value")
+ void glProgramUniform4ui64vNV(@GLuint int program, int location, @GLsizei int count, @Const @GLuint64EXT @Check("4") LongBuffer value);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/NV_half_float.java b/src/templates/org/lwjgl/opengl/NV_half_float.java
index af90b89..134c61b 100644
--- a/src/templates/org/lwjgl/opengl/NV_half_float.java
+++ b/src/templates/org/lwjgl/opengl/NV_half_float.java
@@ -1,136 +1,136 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-public interface NV_half_float {
-
- /**
- * Accepted by the <type> argument of VertexPointer, NormalPointer,
- * ColorPointer, TexCoordPointer, FogCoordPointerEXT,
- * SecondaryColorPointerEXT, VertexWeightPointerEXT, VertexAttribPointerNV,
- * DrawPixels, ReadPixels, TexImage1D, TexImage2D, TexImage3D, TexSubImage1D,
- * TexSubImage2D, TexSubImage3D, and GetTexImage:
- */
- int GL_HALF_FLOAT_NV = 0x140B;
-
- @NoErrorCheck
- void glVertex2hNV(@GLhalf short x, @GLhalf short y);
-
- @NoErrorCheck
- void glVertex3hNV(@GLhalf short x, @GLhalf short y, @GLhalf short z);
-
- @NoErrorCheck
- void glVertex4hNV(@GLhalf short x, @GLhalf short y, @GLhalf short z, @GLhalf short w);
-
- @NoErrorCheck
- void glNormal3hNV(@GLhalf short nx, @GLhalf short ny, @GLhalf short nz);
-
- @NoErrorCheck
- void glColor3hNV(@GLhalf short red, @GLhalf short green, @GLhalf short blue);
-
- @NoErrorCheck
- void glColor4hNV(@GLhalf short red, @GLhalf short green, @GLhalf short blue, @GLhalf short alpha);
-
- @NoErrorCheck
- void glTexCoord1hNV(@GLhalf short s);
-
- @NoErrorCheck
- void glTexCoord2hNV(@GLhalf short s, @GLhalf short t);
-
- @NoErrorCheck
- void glTexCoord3hNV(@GLhalf short s, @GLhalf short t, @GLhalf short r);
-
- @NoErrorCheck
- void glTexCoord4hNV(@GLhalf short s, @GLhalf short t, @GLhalf short r, @GLhalf short q);
-
- @NoErrorCheck
- void glMultiTexCoord1hNV(@GLenum int target, @GLhalf short s);
-
- @NoErrorCheck
- void glMultiTexCoord2hNV(@GLenum int target, @GLhalf short s, @GLhalf short t);
-
- @NoErrorCheck
- void glMultiTexCoord3hNV(@GLenum int target, @GLhalf short s, @GLhalf short t, @GLhalf short r);
-
- @NoErrorCheck
- void glMultiTexCoord4hNV(@GLenum int target, @GLhalf short s, @GLhalf short t, @GLhalf short r, @GLhalf short q);
-
- @NoErrorCheck
- void glFogCoordhNV(@GLhalf short fog);
-
- @NoErrorCheck
- void glSecondaryColor3hNV(@GLhalf short red, @GLhalf short green, @GLhalf short blue);
-
- @Optional(reason = "AMD does not expose this (last driver checked: 10.3)")
- @NoErrorCheck
- void glVertexWeighthNV(@GLhalf short weight);
-
- @Optional(reason = "AMD does not expose this (last driver checked: 10.3)")
- @NoErrorCheck
- void glVertexAttrib1hNV(@GLuint int index, @GLhalf short x);
-
- @Optional(reason = "AMD does not expose this (last driver checked: 10.3)")
- @NoErrorCheck
- void glVertexAttrib2hNV(@GLuint int index, @GLhalf short x, @GLhalf short y);
-
- @Optional(reason = "AMD does not expose this (last driver checked: 10.3)")
- @NoErrorCheck
- void glVertexAttrib3hNV(@GLuint int index, @GLhalf short x, @GLhalf short y, @GLhalf short z);
-
- @Optional(reason = "AMD does not expose this (last driver checked: 10.3)")
- @NoErrorCheck
- void glVertexAttrib4hNV(@GLuint int index, @GLhalf short x, @GLhalf short y, @GLhalf short z, @GLhalf short w);
-
- @Optional(reason = "AMD does not expose this (last driver checked: 10.3)")
- @NoErrorCheck
- @StripPostfix("attribs")
- void glVertexAttribs1hvNV(@GLuint int index, @AutoSize("attribs") @GLsizei int n, @Const @GLhalf ShortBuffer attribs);
-
- @Optional(reason = "AMD does not expose this (last driver checked: 10.3)")
- @NoErrorCheck
- @StripPostfix("attribs")
- void glVertexAttribs2hvNV(@GLuint int index, @AutoSize(value = "attribs", expression = " >> 1") @GLsizei int n, @Const @GLhalf ShortBuffer attribs);
-
- @Optional(reason = "AMD does not expose this (last driver checked: 10.3)")
- @NoErrorCheck
- @StripPostfix("attribs")
- void glVertexAttribs3hvNV(@GLuint int index, @AutoSize(value = "attribs", expression = " / 3") @GLsizei int n, @Const @GLhalf ShortBuffer attribs);
-
- @Optional(reason = "AMD does not expose this (last driver checked: 10.3)")
- @NoErrorCheck
- @StripPostfix("attribs")
- void glVertexAttribs4hvNV(@GLuint int index, @AutoSize(value = "attribs", expression = " >> 2") @GLsizei int n, @Const @GLhalf ShortBuffer attribs);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+public interface NV_half_float {
+
+ /**
+ * Accepted by the <type> argument of VertexPointer, NormalPointer,
+ * ColorPointer, TexCoordPointer, FogCoordPointerEXT,
+ * SecondaryColorPointerEXT, VertexWeightPointerEXT, VertexAttribPointerNV,
+ * DrawPixels, ReadPixels, TexImage1D, TexImage2D, TexImage3D, TexSubImage1D,
+ * TexSubImage2D, TexSubImage3D, and GetTexImage:
+ */
+ int GL_HALF_FLOAT_NV = 0x140B;
+
+ @NoErrorCheck
+ void glVertex2hNV(@GLhalf short x, @GLhalf short y);
+
+ @NoErrorCheck
+ void glVertex3hNV(@GLhalf short x, @GLhalf short y, @GLhalf short z);
+
+ @NoErrorCheck
+ void glVertex4hNV(@GLhalf short x, @GLhalf short y, @GLhalf short z, @GLhalf short w);
+
+ @NoErrorCheck
+ void glNormal3hNV(@GLhalf short nx, @GLhalf short ny, @GLhalf short nz);
+
+ @NoErrorCheck
+ void glColor3hNV(@GLhalf short red, @GLhalf short green, @GLhalf short blue);
+
+ @NoErrorCheck
+ void glColor4hNV(@GLhalf short red, @GLhalf short green, @GLhalf short blue, @GLhalf short alpha);
+
+ @NoErrorCheck
+ void glTexCoord1hNV(@GLhalf short s);
+
+ @NoErrorCheck
+ void glTexCoord2hNV(@GLhalf short s, @GLhalf short t);
+
+ @NoErrorCheck
+ void glTexCoord3hNV(@GLhalf short s, @GLhalf short t, @GLhalf short r);
+
+ @NoErrorCheck
+ void glTexCoord4hNV(@GLhalf short s, @GLhalf short t, @GLhalf short r, @GLhalf short q);
+
+ @NoErrorCheck
+ void glMultiTexCoord1hNV(@GLenum int target, @GLhalf short s);
+
+ @NoErrorCheck
+ void glMultiTexCoord2hNV(@GLenum int target, @GLhalf short s, @GLhalf short t);
+
+ @NoErrorCheck
+ void glMultiTexCoord3hNV(@GLenum int target, @GLhalf short s, @GLhalf short t, @GLhalf short r);
+
+ @NoErrorCheck
+ void glMultiTexCoord4hNV(@GLenum int target, @GLhalf short s, @GLhalf short t, @GLhalf short r, @GLhalf short q);
+
+ @NoErrorCheck
+ void glFogCoordhNV(@GLhalf short fog);
+
+ @NoErrorCheck
+ void glSecondaryColor3hNV(@GLhalf short red, @GLhalf short green, @GLhalf short blue);
+
+ @Optional(reason = "AMD does not expose this (last driver checked: 10.3)")
+ @NoErrorCheck
+ void glVertexWeighthNV(@GLhalf short weight);
+
+ @Optional(reason = "AMD does not expose this (last driver checked: 10.3)")
+ @NoErrorCheck
+ void glVertexAttrib1hNV(@GLuint int index, @GLhalf short x);
+
+ @Optional(reason = "AMD does not expose this (last driver checked: 10.3)")
+ @NoErrorCheck
+ void glVertexAttrib2hNV(@GLuint int index, @GLhalf short x, @GLhalf short y);
+
+ @Optional(reason = "AMD does not expose this (last driver checked: 10.3)")
+ @NoErrorCheck
+ void glVertexAttrib3hNV(@GLuint int index, @GLhalf short x, @GLhalf short y, @GLhalf short z);
+
+ @Optional(reason = "AMD does not expose this (last driver checked: 10.3)")
+ @NoErrorCheck
+ void glVertexAttrib4hNV(@GLuint int index, @GLhalf short x, @GLhalf short y, @GLhalf short z, @GLhalf short w);
+
+ @Optional(reason = "AMD does not expose this (last driver checked: 10.3)")
+ @NoErrorCheck
+ @StripPostfix("attribs")
+ void glVertexAttribs1hvNV(@GLuint int index, @AutoSize("attribs") @GLsizei int n, @Const @GLhalf ShortBuffer attribs);
+
+ @Optional(reason = "AMD does not expose this (last driver checked: 10.3)")
+ @NoErrorCheck
+ @StripPostfix("attribs")
+ void glVertexAttribs2hvNV(@GLuint int index, @AutoSize(value = "attribs", expression = " >> 1") @GLsizei int n, @Const @GLhalf ShortBuffer attribs);
+
+ @Optional(reason = "AMD does not expose this (last driver checked: 10.3)")
+ @NoErrorCheck
+ @StripPostfix("attribs")
+ void glVertexAttribs3hvNV(@GLuint int index, @AutoSize(value = "attribs", expression = " / 3") @GLsizei int n, @Const @GLhalf ShortBuffer attribs);
+
+ @Optional(reason = "AMD does not expose this (last driver checked: 10.3)")
+ @NoErrorCheck
+ @StripPostfix("attribs")
+ void glVertexAttribs4hvNV(@GLuint int index, @AutoSize(value = "attribs", expression = " >> 2") @GLsizei int n, @Const @GLhalf ShortBuffer attribs);
+}
diff --git a/src/templates/org/lwjgl/opengl/NV_light_max_exponent.java b/src/templates/org/lwjgl/opengl/NV_light_max_exponent.java
index 3dde7e6..95ebbdb 100644
--- a/src/templates/org/lwjgl/opengl/NV_light_max_exponent.java
+++ b/src/templates/org/lwjgl/opengl/NV_light_max_exponent.java
@@ -1,37 +1,37 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface NV_light_max_exponent {
- int GL_MAX_SHININESS_NV = 0x8504;
- int GL_MAX_SPOT_EXPONENT_NV = 0x8505;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface NV_light_max_exponent {
+ int GL_MAX_SHININESS_NV = 0x8504;
+ int GL_MAX_SPOT_EXPONENT_NV = 0x8505;
+}
diff --git a/src/templates/org/lwjgl/opengl/NV_multisample_filter_hint.java b/src/templates/org/lwjgl/opengl/NV_multisample_filter_hint.java
index 96f8e4e..ed7eeb9 100644
--- a/src/templates/org/lwjgl/opengl/NV_multisample_filter_hint.java
+++ b/src/templates/org/lwjgl/opengl/NV_multisample_filter_hint.java
@@ -1,41 +1,41 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface NV_multisample_filter_hint {
-
- /**
- * Accepted by the <target> parameter of Hint and by the <pname>
- * parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev:
- */
- int GL_MULTISAMPLE_FILTER_HINT_NV = 0x8534;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface NV_multisample_filter_hint {
+
+ /**
+ * Accepted by the <target> parameter of Hint and by the <pname>
+ * parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev:
+ */
+ int GL_MULTISAMPLE_FILTER_HINT_NV = 0x8534;
+}
diff --git a/src/templates/org/lwjgl/opengl/NV_occlusion_query.java b/src/templates/org/lwjgl/opengl/NV_occlusion_query.java
index d0c0863..bfafdb6 100644
--- a/src/templates/org/lwjgl/opengl/NV_occlusion_query.java
+++ b/src/templates/org/lwjgl/opengl/NV_occlusion_query.java
@@ -1,80 +1,80 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.IntBuffer;
-
-public interface NV_occlusion_query {
-
- int GL_OCCLUSION_TEST_HP = 0x8165;
- int GL_OCCLUSION_TEST_RESULT_HP = 0x8166;
- /* HP_occlusion_test */
- int GL_PIXEL_COUNTER_BITS_NV = 0x8864;
- int GL_CURRENT_OCCLUSION_QUERY_ID_NV = 0x8865;
- int GL_PIXEL_COUNT_NV = 0x8866;
- int GL_PIXEL_COUNT_AVAILABLE_NV = 0x8867;
-
- void glGenOcclusionQueriesNV(@AutoSize("piIDs") @GLsizei int n, @OutParameter @GLuint IntBuffer piIDs);
-
- @Alternate("glGenOcclusionQueriesNV")
- @GLreturn("piIDs")
- void glGenOcclusionQueriesNV2(@Constant("1") @GLsizei int n, @OutParameter @GLuint IntBuffer piIDs);
-
- void glDeleteOcclusionQueriesNV(@AutoSize("piIDs") @GLsizei int n, @Const @GLuint IntBuffer piIDs);
-
- @Alternate("glDeleteOcclusionQueriesNV")
- void glDeleteOcclusionQueriesNV(@Constant("1") @GLsizei int n, @Constant(value = "APIUtils.getBufferInt().put(0, piID), 0", keepParam = true) int piID);
-
- boolean glIsOcclusionQueryNV(@GLuint int id);
-
- void glBeginOcclusionQueryNV(@GLuint int id);
-
- void glEndOcclusionQueryNV();
-
- @StripPostfix("params")
- void glGetOcclusionQueryuivNV(@GLuint int id, @GLenum int pname, @OutParameter @Check("1") @GLuint IntBuffer params);
-
- @Alternate("glGetOcclusionQueryuivNV")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- void glGetOcclusionQueryuivNV2(@GLuint int id, @GLenum int pname, @OutParameter @GLuint IntBuffer params);
-
- @StripPostfix("params")
- void glGetOcclusionQueryivNV(@GLuint int id, @GLenum int pname, @OutParameter @Check("1") IntBuffer params);
-
- @Alternate("glGetOcclusionQueryivNV")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- void glGetOcclusionQueryivNV2(@GLuint int id, @GLenum int pname, @OutParameter IntBuffer params);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.IntBuffer;
+
+public interface NV_occlusion_query {
+
+ int GL_OCCLUSION_TEST_HP = 0x8165;
+ int GL_OCCLUSION_TEST_RESULT_HP = 0x8166;
+ /* HP_occlusion_test */
+ int GL_PIXEL_COUNTER_BITS_NV = 0x8864;
+ int GL_CURRENT_OCCLUSION_QUERY_ID_NV = 0x8865;
+ int GL_PIXEL_COUNT_NV = 0x8866;
+ int GL_PIXEL_COUNT_AVAILABLE_NV = 0x8867;
+
+ void glGenOcclusionQueriesNV(@AutoSize("piIDs") @GLsizei int n, @OutParameter @GLuint IntBuffer piIDs);
+
+ @Alternate("glGenOcclusionQueriesNV")
+ @GLreturn("piIDs")
+ void glGenOcclusionQueriesNV2(@Constant("1") @GLsizei int n, @OutParameter @GLuint IntBuffer piIDs);
+
+ void glDeleteOcclusionQueriesNV(@AutoSize("piIDs") @GLsizei int n, @Const @GLuint IntBuffer piIDs);
+
+ @Alternate("glDeleteOcclusionQueriesNV")
+ void glDeleteOcclusionQueriesNV(@Constant("1") @GLsizei int n, @Constant(value = "APIUtils.getBufferInt().put(0, piID), 0", keepParam = true) int piID);
+
+ boolean glIsOcclusionQueryNV(@GLuint int id);
+
+ void glBeginOcclusionQueryNV(@GLuint int id);
+
+ void glEndOcclusionQueryNV();
+
+ @StripPostfix("params")
+ void glGetOcclusionQueryuivNV(@GLuint int id, @GLenum int pname, @OutParameter @Check("1") @GLuint IntBuffer params);
+
+ @Alternate("glGetOcclusionQueryuivNV")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetOcclusionQueryuivNV2(@GLuint int id, @GLenum int pname, @OutParameter @GLuint IntBuffer params);
+
+ @StripPostfix("params")
+ void glGetOcclusionQueryivNV(@GLuint int id, @GLenum int pname, @OutParameter @Check("1") IntBuffer params);
+
+ @Alternate("glGetOcclusionQueryivNV")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetOcclusionQueryivNV2(@GLuint int id, @GLenum int pname, @OutParameter IntBuffer params);
+}
diff --git a/src/templates/org/lwjgl/opengl/NV_packed_depth_stencil.java b/src/templates/org/lwjgl/opengl/NV_packed_depth_stencil.java
index 552447f..3e68888 100644
--- a/src/templates/org/lwjgl/opengl/NV_packed_depth_stencil.java
+++ b/src/templates/org/lwjgl/opengl/NV_packed_depth_stencil.java
@@ -1,37 +1,37 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface NV_packed_depth_stencil {
- int GL_DEPTH_STENCIL_NV = 0x84F9;
- int GL_UNSIGNED_INT_24_8_NV = 0x84FA;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface NV_packed_depth_stencil {
+ int GL_DEPTH_STENCIL_NV = 0x84F9;
+ int GL_UNSIGNED_INT_24_8_NV = 0x84FA;
+}
diff --git a/src/templates/org/lwjgl/opengl/NV_pixel_data_range.java b/src/templates/org/lwjgl/opengl/NV_pixel_data_range.java
index 1deb726..4cadda3 100644
--- a/src/templates/org/lwjgl/opengl/NV_pixel_data_range.java
+++ b/src/templates/org/lwjgl/opengl/NV_pixel_data_range.java
@@ -1,69 +1,69 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-public interface NV_pixel_data_range {
-
- /**
- * Accepted by the <target> parameter of PixelDataRangeNV and
- * FlushPixelDataRangeNV, and by the <cap> parameter of
- * EnableClientState, DisableClientState, and IsEnabled:
- */
- int GL_WRITE_PIXEL_DATA_RANGE_NV = 0x8878;
- int GL_READ_PIXEL_DATA_RANGE_NV = 0x8879;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv, and GetDoublev:
- */
- int GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV = 0x887A;
- int GL_READ_PIXEL_DATA_RANGE_LENGTH_NV = 0x887B;
-
- /**
- * Accepted by the <pname> parameter of GetPointerv:
- */
- int GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV = 0x887C;
- int GL_READ_PIXEL_DATA_RANGE_POINTER_NV = 0x887D;
-
- void glPixelDataRangeNV(@GLenum int target, @AutoSize("data") @GLsizei int length,
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer data);
-
- void glFlushPixelDataRangeNV(@GLenum int target);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+public interface NV_pixel_data_range {
+
+ /**
+ * Accepted by the <target> parameter of PixelDataRangeNV and
+ * FlushPixelDataRangeNV, and by the <cap> parameter of
+ * EnableClientState, DisableClientState, and IsEnabled:
+ */
+ int GL_WRITE_PIXEL_DATA_RANGE_NV = 0x8878;
+ int GL_READ_PIXEL_DATA_RANGE_NV = 0x8879;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, and GetDoublev:
+ */
+ int GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV = 0x887A;
+ int GL_READ_PIXEL_DATA_RANGE_LENGTH_NV = 0x887B;
+
+ /**
+ * Accepted by the <pname> parameter of GetPointerv:
+ */
+ int GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV = 0x887C;
+ int GL_READ_PIXEL_DATA_RANGE_POINTER_NV = 0x887D;
+
+ void glPixelDataRangeNV(@GLenum int target, @AutoSize("data") @GLsizei int length,
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer data);
+
+ void glFlushPixelDataRangeNV(@GLenum int target);
+}
diff --git a/src/templates/org/lwjgl/opengl/NV_point_sprite.java b/src/templates/org/lwjgl/opengl/NV_point_sprite.java
index fb8f627..17958db 100644
--- a/src/templates/org/lwjgl/opengl/NV_point_sprite.java
+++ b/src/templates/org/lwjgl/opengl/NV_point_sprite.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-public interface NV_point_sprite {
- int GL_POINT_SPRITE_NV = 0x8861;
- int GL_COORD_REPLACE_NV = 0x8862;
- int GL_POINT_SPRITE_R_MODE_NV = 0x8863;
-
- void glPointParameteriNV(@GLenum int pname, int param);
-
- @StripPostfix("params")
- void glPointParameterivNV(@GLenum int pname, @Check("4") @Const IntBuffer params);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+public interface NV_point_sprite {
+ int GL_POINT_SPRITE_NV = 0x8861;
+ int GL_COORD_REPLACE_NV = 0x8862;
+ int GL_POINT_SPRITE_R_MODE_NV = 0x8863;
+
+ void glPointParameteriNV(@GLenum int pname, int param);
+
+ @StripPostfix("params")
+ void glPointParameterivNV(@GLenum int pname, @Check("4") @Const IntBuffer params);
+}
diff --git a/src/templates/org/lwjgl/opengl/NV_primitive_restart.java b/src/templates/org/lwjgl/opengl/NV_primitive_restart.java
index de0ca10..d521de6 100644
--- a/src/templates/org/lwjgl/opengl/NV_primitive_restart.java
+++ b/src/templates/org/lwjgl/opengl/NV_primitive_restart.java
@@ -1,56 +1,56 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
- at ForceInit
-public interface NV_primitive_restart {
-
- /**
- * Accepted by the <array> parameter of EnableClientState and
- * DisableClientState, by the <cap> parameter of IsEnabled, and by
- * the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
- * GetDoublev:
- */
- int GL_PRIMITIVE_RESTART_NV = 0x8558;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv, and GetDoublev:
- */
- int GL_PRIMITIVE_RESTART_INDEX_NV = 0x8559;
-
- void glPrimitiveRestartNV();
-
- void glPrimitiveRestartIndexNV(@GLuint int index);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+ at ForceInit
+public interface NV_primitive_restart {
+
+ /**
+ * Accepted by the <array> parameter of EnableClientState and
+ * DisableClientState, by the <cap> parameter of IsEnabled, and by
+ * the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
+ * GetDoublev:
+ */
+ int GL_PRIMITIVE_RESTART_NV = 0x8558;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, and GetDoublev:
+ */
+ int GL_PRIMITIVE_RESTART_INDEX_NV = 0x8559;
+
+ void glPrimitiveRestartNV();
+
+ void glPrimitiveRestartIndexNV(@GLuint int index);
+}
diff --git a/src/templates/org/lwjgl/opengl/NV_program.java b/src/templates/org/lwjgl/opengl/NV_program.java
index 2c4c1f8..9cb9f87 100644
--- a/src/templates/org/lwjgl/opengl/NV_program.java
+++ b/src/templates/org/lwjgl/opengl/NV_program.java
@@ -1,104 +1,104 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.Buffer;
-import java.nio.ByteBuffer;
-import java.nio.IntBuffer;
-
- at Extension(postfix = "NV", isFinal = false)
-public interface NV_program {
-
- /** Accepted by the <pname> parameter of GetProgramivNV: */
- int GL_PROGRAM_TARGET_NV = 0x8646;
- int GL_PROGRAM_LENGTH_NV = 0x8627;
- int GL_PROGRAM_RESIDENT_NV = 0x8647;
-
- /** Accepted by the <pname> parameter of GetProgramStringNV: */
- int GL_PROGRAM_STRING_NV = 0x8628;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv, and GetDoublev:
- */
- int GL_PROGRAM_ERROR_POSITION_NV = 0x864B;
-
- /** Accepted by the <name> parameter of GetString: */
- int GL_PROGRAM_ERROR_STRING_NV = 0x8874;
-
- void glLoadProgramNV(@GLenum int target, @GLuint int programID, @AutoSize("string") @GLsizei int length, @Const @GLubyte Buffer string);
-
- @Alternate("glLoadProgramNV")
- void glLoadProgramNV(@GLenum int target, @GLuint int programID, @Constant("string.length()") @GLsizei int length, CharSequence string);
-
- void glBindProgramNV(@GLenum int target, @GLuint int programID);
-
- void glDeleteProgramsNV(@AutoSize("programs") @GLsizei int n, @Const @GLuint IntBuffer programs);
-
- @Alternate("glDeleteProgramsNV")
- void glDeleteProgramsNV(@Constant("1") @GLsizei int n, @Constant(value = "APIUtils.getBufferInt().put(0, program), 0", keepParam = true) int program);
-
- void glGenProgramsNV(@AutoSize("programs") @GLsizei int n, @OutParameter @GLuint IntBuffer programs);
-
- @Alternate("glGenProgramsNV")
- @GLreturn("programs")
- void glGenProgramsNV2(@Constant("1") @GLsizei int n, @OutParameter @GLuint IntBuffer programs);
-
- @StripPostfix("params")
- void glGetProgramivNV(@GLuint int programID, @GLenum int parameterName, @OutParameter @Check @GLint IntBuffer params);
-
- @Alternate("glGetProgramivNV")
- @GLreturn("params")
- @StripPostfix("params")
- void glGetProgramivNV2(@GLuint int programID, @GLenum int parameterName, @OutParameter @GLint IntBuffer params);
-
- void glGetProgramStringNV(@GLuint int programID, @GLenum int parameterName, @OutParameter @Check @GLubyte Buffer paramString);
-
- @Alternate("glGetProgramStringNV")
- @Code("\t\tint programLength = glGetProgramNV(programID, GL_PROGRAM_LENGTH_NV);")
- @GLreturn(value="paramString", maxLength = "programLength", forceMaxLength = true)
- void glGetProgramStringNV2(@GLuint int programID, @GLenum int parameterName, @OutParameter @GLchar ByteBuffer paramString);
-
- boolean glIsProgramNV(@GLuint int programID);
-
- boolean glAreProgramsResidentNV(@AutoSize("programIDs") @GLsizei int n,
- @Const @GLuint IntBuffer programIDs,
- @OutParameter @GLboolean @Check("programIDs.remaining()") ByteBuffer programResidences);
-
- void glRequestResidentProgramsNV(@AutoSize("programIDs") @GLsizei int n, @GLuint IntBuffer programIDs);
-
- @Alternate("glRequestResidentProgramsNV")
- void glRequestResidentProgramsNV(@Constant("1") @GLsizei int n, @Constant(value = "APIUtils.getBufferInt().put(0, programID), 0", keepParam = true) int programID);
-}
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.Buffer;
+import java.nio.ByteBuffer;
+import java.nio.IntBuffer;
+
+ at Extension(postfix = "NV", isFinal = false)
+public interface NV_program {
+
+ /** Accepted by the <pname> parameter of GetProgramivNV: */
+ int GL_PROGRAM_TARGET_NV = 0x8646;
+ int GL_PROGRAM_LENGTH_NV = 0x8627;
+ int GL_PROGRAM_RESIDENT_NV = 0x8647;
+
+ /** Accepted by the <pname> parameter of GetProgramStringNV: */
+ int GL_PROGRAM_STRING_NV = 0x8628;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, and GetDoublev:
+ */
+ int GL_PROGRAM_ERROR_POSITION_NV = 0x864B;
+
+ /** Accepted by the <name> parameter of GetString: */
+ int GL_PROGRAM_ERROR_STRING_NV = 0x8874;
+
+ void glLoadProgramNV(@GLenum int target, @GLuint int programID, @AutoSize("string") @GLsizei int length, @Const @GLubyte Buffer string);
+
+ @Alternate("glLoadProgramNV")
+ void glLoadProgramNV(@GLenum int target, @GLuint int programID, @Constant("string.length()") @GLsizei int length, CharSequence string);
+
+ void glBindProgramNV(@GLenum int target, @GLuint int programID);
+
+ void glDeleteProgramsNV(@AutoSize("programs") @GLsizei int n, @Const @GLuint IntBuffer programs);
+
+ @Alternate("glDeleteProgramsNV")
+ void glDeleteProgramsNV(@Constant("1") @GLsizei int n, @Constant(value = "APIUtils.getBufferInt().put(0, program), 0", keepParam = true) int program);
+
+ void glGenProgramsNV(@AutoSize("programs") @GLsizei int n, @OutParameter @GLuint IntBuffer programs);
+
+ @Alternate("glGenProgramsNV")
+ @GLreturn("programs")
+ void glGenProgramsNV2(@Constant("1") @GLsizei int n, @OutParameter @GLuint IntBuffer programs);
+
+ @StripPostfix("params")
+ void glGetProgramivNV(@GLuint int programID, @GLenum int parameterName, @OutParameter @Check @GLint IntBuffer params);
+
+ @Alternate("glGetProgramivNV")
+ @GLreturn("params")
+ @StripPostfix("params")
+ void glGetProgramivNV2(@GLuint int programID, @GLenum int parameterName, @OutParameter @GLint IntBuffer params);
+
+ void glGetProgramStringNV(@GLuint int programID, @GLenum int parameterName, @OutParameter @Check @GLubyte Buffer paramString);
+
+ @Alternate("glGetProgramStringNV")
+ @Code("\t\tint programLength = glGetProgramNV(programID, GL_PROGRAM_LENGTH_NV);")
+ @GLreturn(value="paramString", maxLength = "programLength", forceMaxLength = true)
+ void glGetProgramStringNV2(@GLuint int programID, @GLenum int parameterName, @OutParameter @GLchar ByteBuffer paramString);
+
+ boolean glIsProgramNV(@GLuint int programID);
+
+ boolean glAreProgramsResidentNV(@AutoSize("programIDs") @GLsizei int n,
+ @Const @GLuint IntBuffer programIDs,
+ @OutParameter @GLboolean @Check("programIDs.remaining()") ByteBuffer programResidences);
+
+ void glRequestResidentProgramsNV(@AutoSize("programIDs") @GLsizei int n, @GLuint IntBuffer programIDs);
+
+ @Alternate("glRequestResidentProgramsNV")
+ void glRequestResidentProgramsNV(@Constant("1") @GLsizei int n, @Constant(value = "APIUtils.getBufferInt().put(0, programID), 0", keepParam = true) int programID);
+}
+
diff --git a/src/templates/org/lwjgl/opengl/NV_register_combiners.java b/src/templates/org/lwjgl/opengl/NV_register_combiners.java
index 26b0f2f..19e389a 100644
--- a/src/templates/org/lwjgl/opengl/NV_register_combiners.java
+++ b/src/templates/org/lwjgl/opengl/NV_register_combiners.java
@@ -1,154 +1,154 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-public interface NV_register_combiners {
- int GL_REGISTER_COMBINERS_NV = 0x8522;
- int GL_COMBINER0_NV = 0x8550;
- int GL_COMBINER1_NV = 0x8551;
- int GL_COMBINER2_NV = 0x8552;
- int GL_COMBINER3_NV = 0x8553;
- int GL_COMBINER4_NV = 0x8554;
- int GL_COMBINER5_NV = 0x8555;
- int GL_COMBINER6_NV = 0x8556;
- int GL_COMBINER7_NV = 0x8557;
- int GL_VARIABLE_A_NV = 0x8523;
- int GL_VARIABLE_B_NV = 0x8524;
- int GL_VARIABLE_C_NV = 0x8525;
- int GL_VARIABLE_D_NV = 0x8526;
- int GL_VARIABLE_E_NV = 0x8527;
- int GL_VARIABLE_F_NV = 0x8528;
- int GL_VARIABLE_G_NV = 0x8529;
- int GL_CONSTANT_COLOR0_NV = 0x852A;
- int GL_CONSTANT_COLOR1_NV = 0x852B;
- int GL_PRIMARY_COLOR_NV = 0x852C;
- int GL_SECONDARY_COLOR_NV = 0x852D;
- int GL_SPARE0_NV = 0x852E;
- int GL_SPARE1_NV = 0x852F;
- int GL_UNSIGNED_IDENTITY_NV = 0x8536;
- int GL_UNSIGNED_INVERT_NV = 0x8537;
- int GL_EXPAND_NORMAL_NV = 0x8538;
- int GL_EXPAND_NEGATE_NV = 0x8539;
- int GL_HALF_BIAS_NORMAL_NV = 0x853A;
- int GL_HALF_BIAS_NEGATE_NV = 0x853B;
- int GL_SIGNED_IDENTITY_NV = 0x853C;
- int GL_SIGNED_NEGATE_NV = 0x853D;
- int GL_E_TIMES_F_NV = 0x8531;
- int GL_SPARE0_PLUS_SECONDARY_COLOR_NV = 0x8532;
- int GL_SCALE_BY_TWO_NV = 0x853E;
- int GL_SCALE_BY_FOUR_NV = 0x853F;
- int GL_SCALE_BY_ONE_HALF_NV = 0x8540;
- int GL_BIAS_BY_NEGATIVE_ONE_HALF_NV = 0x8541;
- int GL_DISCARD_NV = 0x8530;
- int GL_COMBINER_INPUT_NV = 0x8542;
- int GL_COMBINER_MAPPING_NV = 0x8543;
- int GL_COMBINER_COMPONENT_USAGE_NV = 0x8544;
- int GL_COMBINER_AB_DOT_PRODUCT_NV = 0x8545;
- int GL_COMBINER_CD_DOT_PRODUCT_NV = 0x8546;
- int GL_COMBINER_MUX_SUM_NV = 0x8547;
- int GL_COMBINER_SCALE_NV = 0x8548;
- int GL_COMBINER_BIAS_NV = 0x8549;
- int GL_COMBINER_AB_OUTPUT_NV = 0x854A;
- int GL_COMBINER_CD_OUTPUT_NV = 0x854B;
- int GL_COMBINER_SUM_OUTPUT_NV = 0x854C;
- int GL_NUM_GENERAL_COMBINERS_NV = 0x854E;
- int GL_COLOR_SUM_CLAMP_NV = 0x854F;
- int GL_MAX_GENERAL_COMBINERS_NV = 0x854D;
-
- void glCombinerParameterfNV(@GLenum int pname, float param);
-
- @StripPostfix("params")
- void glCombinerParameterfvNV(@GLenum int pname, @Check("4") @Const FloatBuffer params);
-
- void glCombinerParameteriNV(@GLenum int pname, int param);
-
- @StripPostfix("params")
- void glCombinerParameterivNV(@GLenum int pname, @Check("4") @Const IntBuffer params);
-
- void glCombinerInputNV(@GLenum int stage, @GLenum int portion, @GLenum int variable, @GLenum int input, @GLenum int mapping, @GLenum int componentUsage);
-
- void glCombinerOutputNV(@GLenum int stage, @GLenum int portion, @GLenum int abOutput, @GLenum int cdOutput, @GLenum int sumOutput, @GLenum int scale, @GLenum int bias, boolean abDotProduct, boolean cdDotProduct, boolean muxSum);
-
- void glFinalCombinerInputNV(@GLenum int variable, @GLenum int input, @GLenum int mapping, @GLenum int componentUsage);
-
- @StripPostfix("params")
- void glGetCombinerInputParameterfvNV(@GLenum int stage, @GLenum int portion, @GLenum int variable, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
-
- @Alternate("glGetCombinerInputParameterfvNV")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- void glGetCombinerInputParameterfvNV2(@GLenum int stage, @GLenum int portion, @GLenum int variable, @GLenum int pname, @OutParameter FloatBuffer params);
-
- @StripPostfix("params")
- void glGetCombinerInputParameterivNV(@GLenum int stage, @GLenum int portion, @GLenum int variable, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
-
- @Alternate("glGetCombinerInputParameterivNV")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- void glGetCombinerInputParameterivNV2(@GLenum int stage, @GLenum int portion, @GLenum int variable, @GLenum int pname, @OutParameter IntBuffer params);
-
- @StripPostfix("params")
- void glGetCombinerOutputParameterfvNV(@GLenum int stage, @GLenum int portion, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
-
- @Alternate("glGetCombinerOutputParameterfvNV")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- void glGetCombinerOutputParameterfvNV2(@GLenum int stage, @GLenum int portion, @GLenum int pname, @OutParameter FloatBuffer params);
-
- @StripPostfix("params")
- void glGetCombinerOutputParameterivNV(@GLenum int stage, @GLenum int portion, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
-
- @Alternate("glGetCombinerOutputParameterivNV")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- void glGetCombinerOutputParameterivNV2(@GLenum int stage, @GLenum int portion, @GLenum int pname, @OutParameter IntBuffer params);
-
- @StripPostfix("params")
- void glGetFinalCombinerInputParameterfvNV(@GLenum int variable, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
-
- @Alternate("glGetFinalCombinerInputParameterfvNV")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- void glGetFinalCombinerInputParameterfvNV2(@GLenum int variable, @GLenum int pname, @OutParameter FloatBuffer params);
-
- @StripPostfix("params")
- void glGetFinalCombinerInputParameterivNV(@GLenum int variable, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
-
- @Alternate("glGetFinalCombinerInputParameterivNV")
- @GLreturn("params")
- @StripPostfix(value = "params", postfix = "v")
- void glGetFinalCombinerInputParameterivNV2(@GLenum int variable, @GLenum int pname, @OutParameter IntBuffer params);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+public interface NV_register_combiners {
+ int GL_REGISTER_COMBINERS_NV = 0x8522;
+ int GL_COMBINER0_NV = 0x8550;
+ int GL_COMBINER1_NV = 0x8551;
+ int GL_COMBINER2_NV = 0x8552;
+ int GL_COMBINER3_NV = 0x8553;
+ int GL_COMBINER4_NV = 0x8554;
+ int GL_COMBINER5_NV = 0x8555;
+ int GL_COMBINER6_NV = 0x8556;
+ int GL_COMBINER7_NV = 0x8557;
+ int GL_VARIABLE_A_NV = 0x8523;
+ int GL_VARIABLE_B_NV = 0x8524;
+ int GL_VARIABLE_C_NV = 0x8525;
+ int GL_VARIABLE_D_NV = 0x8526;
+ int GL_VARIABLE_E_NV = 0x8527;
+ int GL_VARIABLE_F_NV = 0x8528;
+ int GL_VARIABLE_G_NV = 0x8529;
+ int GL_CONSTANT_COLOR0_NV = 0x852A;
+ int GL_CONSTANT_COLOR1_NV = 0x852B;
+ int GL_PRIMARY_COLOR_NV = 0x852C;
+ int GL_SECONDARY_COLOR_NV = 0x852D;
+ int GL_SPARE0_NV = 0x852E;
+ int GL_SPARE1_NV = 0x852F;
+ int GL_UNSIGNED_IDENTITY_NV = 0x8536;
+ int GL_UNSIGNED_INVERT_NV = 0x8537;
+ int GL_EXPAND_NORMAL_NV = 0x8538;
+ int GL_EXPAND_NEGATE_NV = 0x8539;
+ int GL_HALF_BIAS_NORMAL_NV = 0x853A;
+ int GL_HALF_BIAS_NEGATE_NV = 0x853B;
+ int GL_SIGNED_IDENTITY_NV = 0x853C;
+ int GL_SIGNED_NEGATE_NV = 0x853D;
+ int GL_E_TIMES_F_NV = 0x8531;
+ int GL_SPARE0_PLUS_SECONDARY_COLOR_NV = 0x8532;
+ int GL_SCALE_BY_TWO_NV = 0x853E;
+ int GL_SCALE_BY_FOUR_NV = 0x853F;
+ int GL_SCALE_BY_ONE_HALF_NV = 0x8540;
+ int GL_BIAS_BY_NEGATIVE_ONE_HALF_NV = 0x8541;
+ int GL_DISCARD_NV = 0x8530;
+ int GL_COMBINER_INPUT_NV = 0x8542;
+ int GL_COMBINER_MAPPING_NV = 0x8543;
+ int GL_COMBINER_COMPONENT_USAGE_NV = 0x8544;
+ int GL_COMBINER_AB_DOT_PRODUCT_NV = 0x8545;
+ int GL_COMBINER_CD_DOT_PRODUCT_NV = 0x8546;
+ int GL_COMBINER_MUX_SUM_NV = 0x8547;
+ int GL_COMBINER_SCALE_NV = 0x8548;
+ int GL_COMBINER_BIAS_NV = 0x8549;
+ int GL_COMBINER_AB_OUTPUT_NV = 0x854A;
+ int GL_COMBINER_CD_OUTPUT_NV = 0x854B;
+ int GL_COMBINER_SUM_OUTPUT_NV = 0x854C;
+ int GL_NUM_GENERAL_COMBINERS_NV = 0x854E;
+ int GL_COLOR_SUM_CLAMP_NV = 0x854F;
+ int GL_MAX_GENERAL_COMBINERS_NV = 0x854D;
+
+ void glCombinerParameterfNV(@GLenum int pname, float param);
+
+ @StripPostfix("params")
+ void glCombinerParameterfvNV(@GLenum int pname, @Check("4") @Const FloatBuffer params);
+
+ void glCombinerParameteriNV(@GLenum int pname, int param);
+
+ @StripPostfix("params")
+ void glCombinerParameterivNV(@GLenum int pname, @Check("4") @Const IntBuffer params);
+
+ void glCombinerInputNV(@GLenum int stage, @GLenum int portion, @GLenum int variable, @GLenum int input, @GLenum int mapping, @GLenum int componentUsage);
+
+ void glCombinerOutputNV(@GLenum int stage, @GLenum int portion, @GLenum int abOutput, @GLenum int cdOutput, @GLenum int sumOutput, @GLenum int scale, @GLenum int bias, boolean abDotProduct, boolean cdDotProduct, boolean muxSum);
+
+ void glFinalCombinerInputNV(@GLenum int variable, @GLenum int input, @GLenum int mapping, @GLenum int componentUsage);
+
+ @StripPostfix("params")
+ void glGetCombinerInputParameterfvNV(@GLenum int stage, @GLenum int portion, @GLenum int variable, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
+
+ @Alternate("glGetCombinerInputParameterfvNV")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetCombinerInputParameterfvNV2(@GLenum int stage, @GLenum int portion, @GLenum int variable, @GLenum int pname, @OutParameter FloatBuffer params);
+
+ @StripPostfix("params")
+ void glGetCombinerInputParameterivNV(@GLenum int stage, @GLenum int portion, @GLenum int variable, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
+
+ @Alternate("glGetCombinerInputParameterivNV")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetCombinerInputParameterivNV2(@GLenum int stage, @GLenum int portion, @GLenum int variable, @GLenum int pname, @OutParameter IntBuffer params);
+
+ @StripPostfix("params")
+ void glGetCombinerOutputParameterfvNV(@GLenum int stage, @GLenum int portion, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
+
+ @Alternate("glGetCombinerOutputParameterfvNV")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetCombinerOutputParameterfvNV2(@GLenum int stage, @GLenum int portion, @GLenum int pname, @OutParameter FloatBuffer params);
+
+ @StripPostfix("params")
+ void glGetCombinerOutputParameterivNV(@GLenum int stage, @GLenum int portion, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
+
+ @Alternate("glGetCombinerOutputParameterivNV")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetCombinerOutputParameterivNV2(@GLenum int stage, @GLenum int portion, @GLenum int pname, @OutParameter IntBuffer params);
+
+ @StripPostfix("params")
+ void glGetFinalCombinerInputParameterfvNV(@GLenum int variable, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
+
+ @Alternate("glGetFinalCombinerInputParameterfvNV")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetFinalCombinerInputParameterfvNV2(@GLenum int variable, @GLenum int pname, @OutParameter FloatBuffer params);
+
+ @StripPostfix("params")
+ void glGetFinalCombinerInputParameterivNV(@GLenum int variable, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
+
+ @Alternate("glGetFinalCombinerInputParameterivNV")
+ @GLreturn("params")
+ @StripPostfix(value = "params", postfix = "v")
+ void glGetFinalCombinerInputParameterivNV2(@GLenum int variable, @GLenum int pname, @OutParameter IntBuffer params);
+}
diff --git a/src/templates/org/lwjgl/opengl/NV_register_combiners2.java b/src/templates/org/lwjgl/opengl/NV_register_combiners2.java
index 4c7cd01..fd39f73 100644
--- a/src/templates/org/lwjgl/opengl/NV_register_combiners2.java
+++ b/src/templates/org/lwjgl/opengl/NV_register_combiners2.java
@@ -1,46 +1,46 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-public interface NV_register_combiners2 {
- int GL_PER_STAGE_CONSTANTS_NV = 0x8535;
-
- @StripPostfix("params")
- void glCombinerStageParameterfvNV(@GLenum int stage, @GLenum int pname, @Const @Check("4") FloatBuffer params);
-
- @StripPostfix("params")
- void glGetCombinerStageParameterfvNV(@GLenum int stage, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+public interface NV_register_combiners2 {
+ int GL_PER_STAGE_CONSTANTS_NV = 0x8535;
+
+ @StripPostfix("params")
+ void glCombinerStageParameterfvNV(@GLenum int stage, @GLenum int pname, @Const @Check("4") FloatBuffer params);
+
+ @StripPostfix("params")
+ void glGetCombinerStageParameterfvNV(@GLenum int stage, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
+}
diff --git a/src/templates/org/lwjgl/opengl/NV_shader_buffer_load.java b/src/templates/org/lwjgl/opengl/NV_shader_buffer_load.java
index 6c1e5c8..d2b6175 100644
--- a/src/templates/org/lwjgl/opengl/NV_shader_buffer_load.java
+++ b/src/templates/org/lwjgl/opengl/NV_shader_buffer_load.java
@@ -1,101 +1,101 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.LongBuffer;
-
-public interface NV_shader_buffer_load {
-
- /**
- * Accepted by the <pname> parameter of GetBufferParameterui64vNV,
- * GetNamedBufferParameterui64vNV:
- */
- int GL_BUFFER_GPU_ADDRESS_NV = 0x8F1D;
-
- /** Returned by the <type> parameter of GetActiveUniform: */
- int GL_GPU_ADDRESS_NV = 0x8F34;
-
- /** Accepted by the <value> parameter of GetIntegerui64vNV: */
- int GL_MAX_SHADER_BUFFER_ADDRESS_NV = 0x8F35;
-
- void glMakeBufferResidentNV(@GLenum int target, @GLenum int access);
-
- void glMakeBufferNonResidentNV(@GLenum int target);
-
- boolean glIsBufferResidentNV(@GLenum int target);
-
- void glMakeNamedBufferResidentNV(@GLuint int buffer, @GLenum int access);
-
- void glMakeNamedBufferNonResidentNV(@GLuint int buffer);
-
- boolean glIsNamedBufferResidentNV(@GLuint int buffer);
-
- @StripPostfix("params")
- void glGetBufferParameterui64vNV(@GLenum int target, @GLenum int pname, @OutParameter @Check("1") @GLuint64EXT LongBuffer params);
-
- @Alternate("glGetBufferParameterui64vNV")
- @GLreturn("params")
- @StripPostfix("params")
- void glGetBufferParameterui64vNV2(@GLenum int target, @GLenum int pname, @OutParameter @GLuint64EXT LongBuffer params);
-
- @StripPostfix("params")
- void glGetNamedBufferParameterui64vNV(@GLuint int buffer, @GLenum int pname, @OutParameter @Check("1") @GLuint64EXT LongBuffer params);
-
- @Alternate("glGetNamedBufferParameterui64vNV")
- @GLreturn("params")
- @StripPostfix("params")
- void glGetNamedBufferParameterui64vNV2(@GLuint int buffer, @GLenum int pname, @OutParameter @GLuint64EXT LongBuffer params);
-
- @StripPostfix("result")
- void glGetIntegerui64vNV(@GLenum int value, @OutParameter @Check("1") @GLuint64EXT LongBuffer result);
-
- @Alternate("glGetIntegerui64vNV")
- @GLreturn("result")
- @StripPostfix("result")
- void glGetIntegerui64vNV2(@GLenum int value, @OutParameter @GLuint64EXT LongBuffer result);
-
- void glUniformui64NV(int location, @GLuint64EXT long value);
-
- @StripPostfix("value")
- void glUniformui64vNV(int location, @AutoSize("value") @GLsizei int count, @Const @GLuint64EXT LongBuffer value);
-
- @StripPostfix("params")
- void glGetUniformui64vNV(@GLuint int program, int location, @OutParameter @Check("1") @GLuint64EXT LongBuffer params);
-
- void glProgramUniformui64NV(@GLuint int program, int location, @GLuint64EXT long value);
-
- @StripPostfix("value")
- void glProgramUniformui64vNV(@GLuint int program, int location, @AutoSize("value") @GLsizei int count, @Const @GLuint64EXT LongBuffer value);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.LongBuffer;
+
+public interface NV_shader_buffer_load {
+
+ /**
+ * Accepted by the <pname> parameter of GetBufferParameterui64vNV,
+ * GetNamedBufferParameterui64vNV:
+ */
+ int GL_BUFFER_GPU_ADDRESS_NV = 0x8F1D;
+
+ /** Returned by the <type> parameter of GetActiveUniform: */
+ int GL_GPU_ADDRESS_NV = 0x8F34;
+
+ /** Accepted by the <value> parameter of GetIntegerui64vNV: */
+ int GL_MAX_SHADER_BUFFER_ADDRESS_NV = 0x8F35;
+
+ void glMakeBufferResidentNV(@GLenum int target, @GLenum int access);
+
+ void glMakeBufferNonResidentNV(@GLenum int target);
+
+ boolean glIsBufferResidentNV(@GLenum int target);
+
+ void glMakeNamedBufferResidentNV(@GLuint int buffer, @GLenum int access);
+
+ void glMakeNamedBufferNonResidentNV(@GLuint int buffer);
+
+ boolean glIsNamedBufferResidentNV(@GLuint int buffer);
+
+ @StripPostfix("params")
+ void glGetBufferParameterui64vNV(@GLenum int target, @GLenum int pname, @OutParameter @Check("1") @GLuint64EXT LongBuffer params);
+
+ @Alternate("glGetBufferParameterui64vNV")
+ @GLreturn("params")
+ @StripPostfix("params")
+ void glGetBufferParameterui64vNV2(@GLenum int target, @GLenum int pname, @OutParameter @GLuint64EXT LongBuffer params);
+
+ @StripPostfix("params")
+ void glGetNamedBufferParameterui64vNV(@GLuint int buffer, @GLenum int pname, @OutParameter @Check("1") @GLuint64EXT LongBuffer params);
+
+ @Alternate("glGetNamedBufferParameterui64vNV")
+ @GLreturn("params")
+ @StripPostfix("params")
+ void glGetNamedBufferParameterui64vNV2(@GLuint int buffer, @GLenum int pname, @OutParameter @GLuint64EXT LongBuffer params);
+
+ @StripPostfix("result")
+ void glGetIntegerui64vNV(@GLenum int value, @OutParameter @Check("1") @GLuint64EXT LongBuffer result);
+
+ @Alternate("glGetIntegerui64vNV")
+ @GLreturn("result")
+ @StripPostfix("result")
+ void glGetIntegerui64vNV2(@GLenum int value, @OutParameter @GLuint64EXT LongBuffer result);
+
+ void glUniformui64NV(int location, @GLuint64EXT long value);
+
+ @StripPostfix("value")
+ void glUniformui64vNV(int location, @AutoSize("value") @GLsizei int count, @Const @GLuint64EXT LongBuffer value);
+
+ @StripPostfix("params")
+ void glGetUniformui64vNV(@GLuint int program, int location, @OutParameter @Check("1") @GLuint64EXT LongBuffer params);
+
+ void glProgramUniformui64NV(@GLuint int program, int location, @GLuint64EXT long value);
+
+ @StripPostfix("value")
+ void glProgramUniformui64vNV(@GLuint int program, int location, @AutoSize("value") @GLsizei int count, @Const @GLuint64EXT LongBuffer value);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/NV_shader_buffer_store.java b/src/templates/org/lwjgl/opengl/NV_shader_buffer_store.java
index f20da04..bf43b73 100644
--- a/src/templates/org/lwjgl/opengl/NV_shader_buffer_store.java
+++ b/src/templates/org/lwjgl/opengl/NV_shader_buffer_store.java
@@ -1,43 +1,43 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface NV_shader_buffer_store {
-
- /** Accepted by the <barriers> parameter of MemoryBarrierNV: */
- int GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV = 0x00000010;
-
- /** Accepted by the <access> parameter of MakeBufferResidentNV: */
- int GL_READ_WRITE = GL15.GL_READ_WRITE;
- int GL_WRITE_ONLY = GL15.GL_WRITE_ONLY;
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface NV_shader_buffer_store {
+
+ /** Accepted by the <barriers> parameter of MemoryBarrierNV: */
+ int GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV = 0x00000010;
+
+ /** Accepted by the <access> parameter of MakeBufferResidentNV: */
+ int GL_READ_WRITE = GL15.GL_READ_WRITE;
+ int GL_WRITE_ONLY = GL15.GL_WRITE_ONLY;
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/NV_texgen_reflection.java b/src/templates/org/lwjgl/opengl/NV_texgen_reflection.java
index fe0582a..6e4f62a 100644
--- a/src/templates/org/lwjgl/opengl/NV_texgen_reflection.java
+++ b/src/templates/org/lwjgl/opengl/NV_texgen_reflection.java
@@ -1,37 +1,37 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface NV_texgen_reflection {
- int GL_NORMAL_MAP_NV = 0x8511;
- int GL_REFLECTION_MAP_NV = 0x8512;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface NV_texgen_reflection {
+ int GL_NORMAL_MAP_NV = 0x8511;
+ int GL_REFLECTION_MAP_NV = 0x8512;
+}
diff --git a/src/templates/org/lwjgl/opengl/NV_texture_barrier.java b/src/templates/org/lwjgl/opengl/NV_texture_barrier.java
index 71858b2..d5bca28 100644
--- a/src/templates/org/lwjgl/opengl/NV_texture_barrier.java
+++ b/src/templates/org/lwjgl/opengl/NV_texture_barrier.java
@@ -1,38 +1,38 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface NV_texture_barrier {
-
- void glTextureBarrierNV();
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface NV_texture_barrier {
+
+ void glTextureBarrierNV();
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/NV_texture_compression_vtc.java b/src/templates/org/lwjgl/opengl/NV_texture_compression_vtc.java
index f3414be..a7b5464 100644
--- a/src/templates/org/lwjgl/opengl/NV_texture_compression_vtc.java
+++ b/src/templates/org/lwjgl/opengl/NV_texture_compression_vtc.java
@@ -1,48 +1,48 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
- at Extension(postfix = "NV", className = "NVTextureCompressionVTC")
-public interface NV_texture_compression_vtc {
-
- /**
- * Accepted by the <internalformat> parameter of TexImage3D and
- * CompressedTexImage3DARB and the <format> parameter of
- * CompressedTexSubImage2DARB:
- */
- int GL_COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0;
- int GL_COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1;
- int GL_COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2;
- int GL_COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+ at Extension(postfix = "NV", className = "NVTextureCompressionVTC")
+public interface NV_texture_compression_vtc {
+
+ /**
+ * Accepted by the <internalformat> parameter of TexImage3D and
+ * CompressedTexImage3DARB and the <format> parameter of
+ * CompressedTexSubImage2DARB:
+ */
+ int GL_COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0;
+ int GL_COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1;
+ int GL_COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2;
+ int GL_COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3;
+}
diff --git a/src/templates/org/lwjgl/opengl/NV_texture_env_combine4.java b/src/templates/org/lwjgl/opengl/NV_texture_env_combine4.java
index 5e2ae59..b8ac4cc 100644
--- a/src/templates/org/lwjgl/opengl/NV_texture_env_combine4.java
+++ b/src/templates/org/lwjgl/opengl/NV_texture_env_combine4.java
@@ -1,40 +1,40 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface NV_texture_env_combine4 {
- int GL_COMBINE4_NV = 0x8503;
- int GL_SOURCE3_RGB_NV = 0x8583;
- int GL_SOURCE3_ALPHA_NV = 0x858B;
- int GL_OPERAND3_RGB_NV = 0x8593;
- int GL_OPERAND3_ALPHA_NV = 0x859B;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface NV_texture_env_combine4 {
+ int GL_COMBINE4_NV = 0x8503;
+ int GL_SOURCE3_RGB_NV = 0x8583;
+ int GL_SOURCE3_ALPHA_NV = 0x858B;
+ int GL_OPERAND3_RGB_NV = 0x8593;
+ int GL_OPERAND3_ALPHA_NV = 0x859B;
+}
diff --git a/src/templates/org/lwjgl/opengl/NV_texture_expand_normal.java b/src/templates/org/lwjgl/opengl/NV_texture_expand_normal.java
index 46a1aef..b59c703 100644
--- a/src/templates/org/lwjgl/opengl/NV_texture_expand_normal.java
+++ b/src/templates/org/lwjgl/opengl/NV_texture_expand_normal.java
@@ -1,42 +1,42 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface NV_texture_expand_normal {
-
- /**
- * Accepted by the <pname> parameters of TexParameteri,
- * TexParameteriv, TexParameterf, TexParameterfv, GetTexParameteri,
- * and GetTexParameteriv:
- */
- int GL_TEXTURE_UNSIGNED_REMAP_MODE_NV = 0x888F;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface NV_texture_expand_normal {
+
+ /**
+ * Accepted by the <pname> parameters of TexParameteri,
+ * TexParameteriv, TexParameterf, TexParameterfv, GetTexParameteri,
+ * and GetTexParameteriv:
+ */
+ int GL_TEXTURE_UNSIGNED_REMAP_MODE_NV = 0x888F;
+}
diff --git a/src/templates/org/lwjgl/opengl/NV_texture_rectangle.java b/src/templates/org/lwjgl/opengl/NV_texture_rectangle.java
index 5948814..7f2346e 100644
--- a/src/templates/org/lwjgl/opengl/NV_texture_rectangle.java
+++ b/src/templates/org/lwjgl/opengl/NV_texture_rectangle.java
@@ -1,39 +1,39 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface NV_texture_rectangle {
- int GL_TEXTURE_RECTANGLE_NV = 0x84F5;
- int GL_TEXTURE_BINDING_RECTANGLE_NV = 0x84F6;
- int GL_PROXY_TEXTURE_RECTANGLE_NV = 0x84F7;
- int GL_MAX_RECTANGLE_TEXTURE_SIZE_NV = 0x84F8;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface NV_texture_rectangle {
+ int GL_TEXTURE_RECTANGLE_NV = 0x84F5;
+ int GL_TEXTURE_BINDING_RECTANGLE_NV = 0x84F6;
+ int GL_PROXY_TEXTURE_RECTANGLE_NV = 0x84F7;
+ int GL_MAX_RECTANGLE_TEXTURE_SIZE_NV = 0x84F8;
+}
diff --git a/src/templates/org/lwjgl/opengl/NV_texture_shader.java b/src/templates/org/lwjgl/opengl/NV_texture_shader.java
index 4cf0d7c..36868ad 100644
--- a/src/templates/org/lwjgl/opengl/NV_texture_shader.java
+++ b/src/templates/org/lwjgl/opengl/NV_texture_shader.java
@@ -1,175 +1,175 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface NV_texture_shader {
-
- /**
- * Accepted by the <cap> parameter of Enable, Disable, and IsEnabled,
- * and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
- * and GetDoublev, and by the <target> parameter of TexEnvf, TexEnvfv,
- * TexEnvi, TexEnviv, GetTexEnvfv, and GetTexEnviv.
- */
- int GL_TEXTURE_SHADER_NV = 0x86DE;
-
- /**
- * When the <target> parameter of TexEnvf, TexEnvfv, TexEnvi, TexEnviv,
- * GetTexEnvfv, and GetTexEnviv is TEXTURE_SHADER_NV, then the value
- * of <pname> may be:
- */
- int GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV = 0x86D9;
- int GL_SHADER_OPERATION_NV = 0x86DF;
- int GL_OFFSET_TEXTURE_SCALE_NV = 0x86E2;
- int GL_OFFSET_TEXTURE_BIAS_NV = 0x86E3;
- int GL_OFFSET_TEXTURE_2D_SCALE_NV = GL_OFFSET_TEXTURE_SCALE_NV;
- int GL_OFFSET_TEXTURE_2D_BIAS_NV = GL_OFFSET_TEXTURE_BIAS_NV;
- int GL_PREVIOUS_TEXTURE_INPUT_NV = 0x86E4;
-
- /**
- * When the <target> parameter of TexEnvfv, TexEnviv, GetTexEnvfv, and
- * GetTexEnviv is TEXTURE_SHADER_NV, then the value of <pname> may be:
- */
- int GL_CULL_MODES_NV = 0x86E0;
- int GL_OFFSET_TEXTURE_MATRIX_NV = 0x86E1;
- int GL_OFFSET_TEXTURE_2D_MATRIX_NV = GL_OFFSET_TEXTURE_MATRIX_NV;
- int GL_CONST_EYE_NV = 0x86E5;
-
- /**
- * When the <target> parameter GetTexEnvfv and GetTexEnviv is
- * TEXTURE_SHADER_NV, then the value of <pname> may be:
- */
- int GL_SHADER_CONSISTENT_NV = 0x86DD;
-
- /**
- * When the <target> and <pname> parameters of TexEnvf, TexEnvfv,
- * TexEnvi, and TexEnviv are TEXTURE_SHADER_NV and SHADER_OPERATION_NV
- * respectively, then the value of <param> or the value pointed to by
- * <params> may be:
- */
- int GL_PASS_THROUGH_NV = 0x86E6;
- int GL_CULL_FRAGMENT_NV = 0x86E7;
-
- int GL_OFFSET_TEXTURE_2D_NV = 0x86E8;
- int GL_OFFSET_TEXTURE_RECTANGLE_NV = 0x864C;
- int GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV = 0x864D;
- int GL_DEPENDENT_AR_TEXTURE_2D_NV = 0x86E9;
- int GL_DEPENDENT_GB_TEXTURE_2D_NV = 0x86EA;
-
- int GL_DOT_PRODUCT_NV = 0x86EC;
- int GL_DOT_PRODUCT_DEPTH_REPLACE_NV = 0x86ED;
- int GL_DOT_PRODUCT_TEXTURE_2D_NV = 0x86EE;
- int GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV = 0x864E;
- int GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV = 0x86F0;
- int GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV = 0x86F1;
- int GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV = 0x86F2;
- int GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV = 0x86F3;
-
- /**
- * Accepted by the <format> parameter of GetTexImage, TexImage1D,
- * TexImage2D, TexSubImage1D, and TexSubImage2D.
- */
- int GL_HILO_NV = 0x86F4;
- int GL_DSDT_NV = 0x86F5;
- int GL_DSDT_MAG_NV = 0x86F6;
- int GL_DSDT_MAG_VIB_NV = 0x86F7;
-
- /**
- * Accepted by the <type> parameter of GetTexImage, TexImage1D,
- * TexImage2D, TexSubImage1D, and TexSubImage2D.
- */
- int GL_UNSIGNED_INT_S8_S8_8_8_NV = 0x86DA;
- int GL_UNSIGNED_INT_8_8_S8_S8_REV_NV = 0x86DB;
-
- /**
- * Accepted by the <internalformat> parameter of CopyTexImage1D,
- * CopyTexImage2D, TexImage1D, and TexImage2D.
- */
- int GL_SIGNED_RGBA_NV = 0x86FB;
- int GL_SIGNED_RGBA8_NV = 0x86FC;
- int GL_SIGNED_RGB_NV = 0x86FE;
- int GL_SIGNED_RGB8_NV = 0x86FF;
- int GL_SIGNED_LUMINANCE_NV = 0x8701;
- int GL_SIGNED_LUMINANCE8_NV = 0x8702;
- int GL_SIGNED_LUMINANCE_ALPHA_NV = 0x8703;
- int GL_SIGNED_LUMINANCE8_ALPHA8_NV = 0x8704;
- int GL_SIGNED_ALPHA_NV = 0x8705;
- int GL_SIGNED_ALPHA8_NV = 0x8706;
- int GL_SIGNED_INTENSITY_NV = 0x8707;
- int GL_SIGNED_INTENSITY8_NV = 0x8708;
- int GL_SIGNED_RGB_UNSIGNED_ALPHA_NV = 0x870C;
- int GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV = 0x870D;
-
- /**
- * Accepted by the <internalformat> parameter of TexImage1D and
- * TexImage2D.
- */
- int GL_HILO16_NV = 0x86F8;
- int GL_SIGNED_HILO_NV = 0x86F9;
- int GL_SIGNED_HILO16_NV = 0x86FA;
- int GL_DSDT8_NV = 0x8709;
- int GL_DSDT8_MAG8_NV = 0x870A;
- int GL_DSDT_MAG_INTENSITY_NV = 0x86DC;
- int GL_DSDT8_MAG8_INTENSITY8_NV = 0x870B;
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv, GetDoublev, PixelTransferf, and PixelTransferi.
- */
- int GL_HI_SCALE_NV = 0x870E;
- int GL_LO_SCALE_NV = 0x870F;
- int GL_DS_SCALE_NV = 0x8710;
- int GL_DT_SCALE_NV = 0x8711;
- int GL_MAGNITUDE_SCALE_NV = 0x8712;
- int GL_VIBRANCE_SCALE_NV = 0x8713;
- int GL_HI_BIAS_NV = 0x8714;
- int GL_LO_BIAS_NV = 0x8715;
- int GL_DS_BIAS_NV = 0x8716;
- int GL_DT_BIAS_NV = 0x8717;
- int GL_MAGNITUDE_BIAS_NV = 0x8718;
- int GL_VIBRANCE_BIAS_NV = 0x8719;
-
- /**
- * Accepted by the <pname> parameter of TexParameteriv, TexParameterfv,
- * GetTexParameterfv and GetTexParameteriv.
- */
- int GL_TEXTURE_BORDER_VALUES_NV = 0x871A;
-
- /**
- * Accepted by the <pname> parameter of GetTexLevelParameterfv and
- * GetTexLevelParameteriv.
- */
- int GL_TEXTURE_HI_SIZE_NV = 0x871B;
- int GL_TEXTURE_LO_SIZE_NV = 0x871C;
- int GL_TEXTURE_DS_SIZE_NV = 0x871D;
- int GL_TEXTURE_DT_SIZE_NV = 0x871E;
- int GL_TEXTURE_MAG_SIZE_NV = 0x871F;
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface NV_texture_shader {
+
+ /**
+ * Accepted by the <cap> parameter of Enable, Disable, and IsEnabled,
+ * and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
+ * and GetDoublev, and by the <target> parameter of TexEnvf, TexEnvfv,
+ * TexEnvi, TexEnviv, GetTexEnvfv, and GetTexEnviv.
+ */
+ int GL_TEXTURE_SHADER_NV = 0x86DE;
+
+ /**
+ * When the <target> parameter of TexEnvf, TexEnvfv, TexEnvi, TexEnviv,
+ * GetTexEnvfv, and GetTexEnviv is TEXTURE_SHADER_NV, then the value
+ * of <pname> may be:
+ */
+ int GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV = 0x86D9;
+ int GL_SHADER_OPERATION_NV = 0x86DF;
+ int GL_OFFSET_TEXTURE_SCALE_NV = 0x86E2;
+ int GL_OFFSET_TEXTURE_BIAS_NV = 0x86E3;
+ int GL_OFFSET_TEXTURE_2D_SCALE_NV = GL_OFFSET_TEXTURE_SCALE_NV;
+ int GL_OFFSET_TEXTURE_2D_BIAS_NV = GL_OFFSET_TEXTURE_BIAS_NV;
+ int GL_PREVIOUS_TEXTURE_INPUT_NV = 0x86E4;
+
+ /**
+ * When the <target> parameter of TexEnvfv, TexEnviv, GetTexEnvfv, and
+ * GetTexEnviv is TEXTURE_SHADER_NV, then the value of <pname> may be:
+ */
+ int GL_CULL_MODES_NV = 0x86E0;
+ int GL_OFFSET_TEXTURE_MATRIX_NV = 0x86E1;
+ int GL_OFFSET_TEXTURE_2D_MATRIX_NV = GL_OFFSET_TEXTURE_MATRIX_NV;
+ int GL_CONST_EYE_NV = 0x86E5;
+
+ /**
+ * When the <target> parameter GetTexEnvfv and GetTexEnviv is
+ * TEXTURE_SHADER_NV, then the value of <pname> may be:
+ */
+ int GL_SHADER_CONSISTENT_NV = 0x86DD;
+
+ /**
+ * When the <target> and <pname> parameters of TexEnvf, TexEnvfv,
+ * TexEnvi, and TexEnviv are TEXTURE_SHADER_NV and SHADER_OPERATION_NV
+ * respectively, then the value of <param> or the value pointed to by
+ * <params> may be:
+ */
+ int GL_PASS_THROUGH_NV = 0x86E6;
+ int GL_CULL_FRAGMENT_NV = 0x86E7;
+
+ int GL_OFFSET_TEXTURE_2D_NV = 0x86E8;
+ int GL_OFFSET_TEXTURE_RECTANGLE_NV = 0x864C;
+ int GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV = 0x864D;
+ int GL_DEPENDENT_AR_TEXTURE_2D_NV = 0x86E9;
+ int GL_DEPENDENT_GB_TEXTURE_2D_NV = 0x86EA;
+
+ int GL_DOT_PRODUCT_NV = 0x86EC;
+ int GL_DOT_PRODUCT_DEPTH_REPLACE_NV = 0x86ED;
+ int GL_DOT_PRODUCT_TEXTURE_2D_NV = 0x86EE;
+ int GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV = 0x864E;
+ int GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV = 0x86F0;
+ int GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV = 0x86F1;
+ int GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV = 0x86F2;
+ int GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV = 0x86F3;
+
+ /**
+ * Accepted by the <format> parameter of GetTexImage, TexImage1D,
+ * TexImage2D, TexSubImage1D, and TexSubImage2D.
+ */
+ int GL_HILO_NV = 0x86F4;
+ int GL_DSDT_NV = 0x86F5;
+ int GL_DSDT_MAG_NV = 0x86F6;
+ int GL_DSDT_MAG_VIB_NV = 0x86F7;
+
+ /**
+ * Accepted by the <type> parameter of GetTexImage, TexImage1D,
+ * TexImage2D, TexSubImage1D, and TexSubImage2D.
+ */
+ int GL_UNSIGNED_INT_S8_S8_8_8_NV = 0x86DA;
+ int GL_UNSIGNED_INT_8_8_S8_S8_REV_NV = 0x86DB;
+
+ /**
+ * Accepted by the <internalformat> parameter of CopyTexImage1D,
+ * CopyTexImage2D, TexImage1D, and TexImage2D.
+ */
+ int GL_SIGNED_RGBA_NV = 0x86FB;
+ int GL_SIGNED_RGBA8_NV = 0x86FC;
+ int GL_SIGNED_RGB_NV = 0x86FE;
+ int GL_SIGNED_RGB8_NV = 0x86FF;
+ int GL_SIGNED_LUMINANCE_NV = 0x8701;
+ int GL_SIGNED_LUMINANCE8_NV = 0x8702;
+ int GL_SIGNED_LUMINANCE_ALPHA_NV = 0x8703;
+ int GL_SIGNED_LUMINANCE8_ALPHA8_NV = 0x8704;
+ int GL_SIGNED_ALPHA_NV = 0x8705;
+ int GL_SIGNED_ALPHA8_NV = 0x8706;
+ int GL_SIGNED_INTENSITY_NV = 0x8707;
+ int GL_SIGNED_INTENSITY8_NV = 0x8708;
+ int GL_SIGNED_RGB_UNSIGNED_ALPHA_NV = 0x870C;
+ int GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV = 0x870D;
+
+ /**
+ * Accepted by the <internalformat> parameter of TexImage1D and
+ * TexImage2D.
+ */
+ int GL_HILO16_NV = 0x86F8;
+ int GL_SIGNED_HILO_NV = 0x86F9;
+ int GL_SIGNED_HILO16_NV = 0x86FA;
+ int GL_DSDT8_NV = 0x8709;
+ int GL_DSDT8_MAG8_NV = 0x870A;
+ int GL_DSDT_MAG_INTENSITY_NV = 0x86DC;
+ int GL_DSDT8_MAG8_INTENSITY8_NV = 0x870B;
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, GetDoublev, PixelTransferf, and PixelTransferi.
+ */
+ int GL_HI_SCALE_NV = 0x870E;
+ int GL_LO_SCALE_NV = 0x870F;
+ int GL_DS_SCALE_NV = 0x8710;
+ int GL_DT_SCALE_NV = 0x8711;
+ int GL_MAGNITUDE_SCALE_NV = 0x8712;
+ int GL_VIBRANCE_SCALE_NV = 0x8713;
+ int GL_HI_BIAS_NV = 0x8714;
+ int GL_LO_BIAS_NV = 0x8715;
+ int GL_DS_BIAS_NV = 0x8716;
+ int GL_DT_BIAS_NV = 0x8717;
+ int GL_MAGNITUDE_BIAS_NV = 0x8718;
+ int GL_VIBRANCE_BIAS_NV = 0x8719;
+
+ /**
+ * Accepted by the <pname> parameter of TexParameteriv, TexParameterfv,
+ * GetTexParameterfv and GetTexParameteriv.
+ */
+ int GL_TEXTURE_BORDER_VALUES_NV = 0x871A;
+
+ /**
+ * Accepted by the <pname> parameter of GetTexLevelParameterfv and
+ * GetTexLevelParameteriv.
+ */
+ int GL_TEXTURE_HI_SIZE_NV = 0x871B;
+ int GL_TEXTURE_LO_SIZE_NV = 0x871C;
+ int GL_TEXTURE_DS_SIZE_NV = 0x871D;
+ int GL_TEXTURE_DT_SIZE_NV = 0x871E;
+ int GL_TEXTURE_MAG_SIZE_NV = 0x871F;
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/NV_texture_shader2.java b/src/templates/org/lwjgl/opengl/NV_texture_shader2.java
index 3cc4ace..5a2b565 100644
--- a/src/templates/org/lwjgl/opengl/NV_texture_shader2.java
+++ b/src/templates/org/lwjgl/opengl/NV_texture_shader2.java
@@ -1,63 +1,63 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface NV_texture_shader2 {
- int GL_DOT_PRODUCT_TEXTURE_3D_NV = 0x86EF;
- int GL_HILO_NV = 0x86F4;
- int GL_DSDT_NV = 0x86F5;
- int GL_DSDT_MAG_NV = 0x86F6;
- int GL_DSDT_MAG_VIB_NV = 0x86F7;
- int GL_UNSIGNED_INT_S8_S8_8_8_NV = 0x86DA;
- int GL_UNSIGNED_INT_8_8_S8_S8_REV_NV = 0x86DB;
- int GL_SIGNED_RGBA_NV = 0x86FB;
- int GL_SIGNED_RGBA8_NV = 0x86FC;
- int GL_SIGNED_RGB_NV = 0x86FE;
- int GL_SIGNED_RGB8_NV = 0x86FF;
- int GL_SIGNED_LUMINANCE_NV = 0x8701;
- int GL_SIGNED_LUMINANCE8_NV = 0x8702;
- int GL_SIGNED_LUMINANCE_ALPHA_NV = 0x8703;
- int GL_SIGNED_LUMINANCE8_ALPHA8_NV = 0x8704;
- int GL_SIGNED_ALPHA_NV = 0x8705;
- int GL_SIGNED_ALPHA8_NV = 0x8706;
- int GL_SIGNED_INTENSITY_NV = 0x8707;
- int GL_SIGNED_INTENSITY8_NV = 0x8708;
- int GL_SIGNED_RGB_UNSIGNED_ALPHA_NV = 0x870C;
- int GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV = 0x870D;
- int GL_HILO16_NV = 0x86F8;
- int GL_SIGNED_HILO_NV = 0x86F9;
- int GL_SIGNED_HILO16_NV = 0x86FA;
- int GL_DSDT8_NV = 0x8709;
- int GL_DSDT8_MAG8_NV = 0x870A;
- int GL_DSDT_MAG_INTENSITY_NV = 0x86DC;
- int GL_DSDT8_MAG8_INTENSITY8_NV = 0x870B;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface NV_texture_shader2 {
+ int GL_DOT_PRODUCT_TEXTURE_3D_NV = 0x86EF;
+ int GL_HILO_NV = 0x86F4;
+ int GL_DSDT_NV = 0x86F5;
+ int GL_DSDT_MAG_NV = 0x86F6;
+ int GL_DSDT_MAG_VIB_NV = 0x86F7;
+ int GL_UNSIGNED_INT_S8_S8_8_8_NV = 0x86DA;
+ int GL_UNSIGNED_INT_8_8_S8_S8_REV_NV = 0x86DB;
+ int GL_SIGNED_RGBA_NV = 0x86FB;
+ int GL_SIGNED_RGBA8_NV = 0x86FC;
+ int GL_SIGNED_RGB_NV = 0x86FE;
+ int GL_SIGNED_RGB8_NV = 0x86FF;
+ int GL_SIGNED_LUMINANCE_NV = 0x8701;
+ int GL_SIGNED_LUMINANCE8_NV = 0x8702;
+ int GL_SIGNED_LUMINANCE_ALPHA_NV = 0x8703;
+ int GL_SIGNED_LUMINANCE8_ALPHA8_NV = 0x8704;
+ int GL_SIGNED_ALPHA_NV = 0x8705;
+ int GL_SIGNED_ALPHA8_NV = 0x8706;
+ int GL_SIGNED_INTENSITY_NV = 0x8707;
+ int GL_SIGNED_INTENSITY8_NV = 0x8708;
+ int GL_SIGNED_RGB_UNSIGNED_ALPHA_NV = 0x870C;
+ int GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV = 0x870D;
+ int GL_HILO16_NV = 0x86F8;
+ int GL_SIGNED_HILO_NV = 0x86F9;
+ int GL_SIGNED_HILO16_NV = 0x86FA;
+ int GL_DSDT8_NV = 0x8709;
+ int GL_DSDT8_MAG8_NV = 0x870A;
+ int GL_DSDT_MAG_INTENSITY_NV = 0x86DC;
+ int GL_DSDT8_MAG8_INTENSITY8_NV = 0x870B;
+}
diff --git a/src/templates/org/lwjgl/opengl/NV_texture_shader3.java b/src/templates/org/lwjgl/opengl/NV_texture_shader3.java
index f4fecfa..a307780 100644
--- a/src/templates/org/lwjgl/opengl/NV_texture_shader3.java
+++ b/src/templates/org/lwjgl/opengl/NV_texture_shader3.java
@@ -1,52 +1,52 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface NV_texture_shader3 {
- int GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV = 0x8850;
- int GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV = 0x8851;
- int GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV = 0x8852;
- int GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV = 0x8853;
- int GL_OFFSET_HILO_TEXTURE_2D_NV = 0x8854;
- int GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV = 0x8855;
- int GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV = 0x8856;
- int GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV = 0x8857;
- int GL_DEPENDENT_HILO_TEXTURE_2D_NV = 0x8858;
- int GL_DEPENDENT_RGB_TEXTURE_3D_NV = 0x8859;
- int GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV = 0x885A;
- int GL_DOT_PRODUCT_PASS_THROUGH_NV = 0x885B;
- int GL_DOT_PRODUCT_TEXTURE_1D_NV = 0x885C;
- int GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV = 0x885D;
- int GL_HILO8_NV = 0x885E;
- int GL_SIGNED_HILO8_NV = 0x885F;
- int GL_FORCE_BLUE_TO_ONE_NV = 0x8860;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface NV_texture_shader3 {
+ int GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV = 0x8850;
+ int GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV = 0x8851;
+ int GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV = 0x8852;
+ int GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV = 0x8853;
+ int GL_OFFSET_HILO_TEXTURE_2D_NV = 0x8854;
+ int GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV = 0x8855;
+ int GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV = 0x8856;
+ int GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV = 0x8857;
+ int GL_DEPENDENT_HILO_TEXTURE_2D_NV = 0x8858;
+ int GL_DEPENDENT_RGB_TEXTURE_3D_NV = 0x8859;
+ int GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV = 0x885A;
+ int GL_DOT_PRODUCT_PASS_THROUGH_NV = 0x885B;
+ int GL_DOT_PRODUCT_TEXTURE_1D_NV = 0x885C;
+ int GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV = 0x885D;
+ int GL_HILO8_NV = 0x885E;
+ int GL_SIGNED_HILO8_NV = 0x885F;
+ int GL_FORCE_BLUE_TO_ONE_NV = 0x8860;
+}
diff --git a/src/templates/org/lwjgl/opengl/NV_vertex_array_range.java b/src/templates/org/lwjgl/opengl/NV_vertex_array_range.java
index a266aed..f4b995b 100644
--- a/src/templates/org/lwjgl/opengl/NV_vertex_array_range.java
+++ b/src/templates/org/lwjgl/opengl/NV_vertex_array_range.java
@@ -1,62 +1,62 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-public interface NV_vertex_array_range {
- int GL_VERTEX_ARRAY_RANGE_NV = 0x851D;
- int GL_VERTEX_ARRAY_RANGE_LENGTH_NV = 0x851E;
- int GL_VERTEX_ARRAY_RANGE_VALID_NV = 0x851F;
- int GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV = 0x8520;
- int GL_VERTEX_ARRAY_RANGE_POINTER_NV = 0x8521;
-
- void glVertexArrayRangeNV(@AutoSize("pPointer") @GLsizei int size,
- @Const
- @GLbyte
- @GLshort
- @GLint
- @GLfloat
- @GLdouble Buffer pPointer);
-
- void glFlushVertexArrayRangeNV();
-
- @PlatformDependent({Platform.WGL, Platform.GLX})
- @GLvoid
- @AutoResultSize("size")
- ByteBuffer glAllocateMemoryNV(int size, float readFrequency, float writeFrequency, float priority);
-
- @PlatformDependent({Platform.WGL, Platform.GLX})
- void glFreeMemoryNV(@Check @GLbyte Buffer pointer);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+public interface NV_vertex_array_range {
+ int GL_VERTEX_ARRAY_RANGE_NV = 0x851D;
+ int GL_VERTEX_ARRAY_RANGE_LENGTH_NV = 0x851E;
+ int GL_VERTEX_ARRAY_RANGE_VALID_NV = 0x851F;
+ int GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV = 0x8520;
+ int GL_VERTEX_ARRAY_RANGE_POINTER_NV = 0x8521;
+
+ void glVertexArrayRangeNV(@AutoSize("pPointer") @GLsizei int size,
+ @Const
+ @GLbyte
+ @GLshort
+ @GLint
+ @GLfloat
+ @GLdouble Buffer pPointer);
+
+ void glFlushVertexArrayRangeNV();
+
+ @PlatformDependent({Platform.WGL, Platform.GLX})
+ @GLvoid
+ @AutoResultSize("size")
+ ByteBuffer glAllocateMemoryNV(int size, float readFrequency, float writeFrequency, float priority);
+
+ @PlatformDependent({Platform.WGL, Platform.GLX})
+ void glFreeMemoryNV(@Check @GLbyte Buffer pointer);
+}
diff --git a/src/templates/org/lwjgl/opengl/NV_vertex_array_range2.java b/src/templates/org/lwjgl/opengl/NV_vertex_array_range2.java
index 2972f1a..87f139c 100644
--- a/src/templates/org/lwjgl/opengl/NV_vertex_array_range2.java
+++ b/src/templates/org/lwjgl/opengl/NV_vertex_array_range2.java
@@ -1,36 +1,36 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface NV_vertex_array_range2 {
- int GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV = 0x8533;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface NV_vertex_array_range2 {
+ int GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV = 0x8533;
+}
diff --git a/src/templates/org/lwjgl/opengl/NV_vertex_buffer_unified_memory.java b/src/templates/org/lwjgl/opengl/NV_vertex_buffer_unified_memory.java
index 0b5f77e..b34d2e6 100644
--- a/src/templates/org/lwjgl/opengl/NV_vertex_buffer_unified_memory.java
+++ b/src/templates/org/lwjgl/opengl/NV_vertex_buffer_unified_memory.java
@@ -1,111 +1,111 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.LongBuffer;
-
-public interface NV_vertex_buffer_unified_memory {
-
- /**
- * Accepted by the <cap> parameter of DisableClientState,
- * EnableClientState, IsEnabled:
- */
- int GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV = 0x8F1E;
- int GL_ELEMENT_ARRAY_UNIFIED_NV = 0x8F1F;
-
- /**
- * Accepted by the <pname> parameter of BufferAddressRangeNV
- * and the <value> parameter of GetIntegerui64i_vNV:
- */
- int GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV = 0x8F20;
- int GL_TEXTURE_COORD_ARRAY_ADDRESS_NV = 0x8F25;
-
- /**
- * Accepted by the <pname> parameter of BufferAddressRangeNV
- * and the <value> parameter of GetIntegerui64vNV:
- */
- int GL_VERTEX_ARRAY_ADDRESS_NV = 0x8F21;
- int GL_NORMAL_ARRAY_ADDRESS_NV = 0x8F22;
- int GL_COLOR_ARRAY_ADDRESS_NV = 0x8F23;
- int GL_INDEX_ARRAY_ADDRESS_NV = 0x8F24;
- int GL_EDGE_FLAG_ARRAY_ADDRESS_NV = 0x8F26;
- int GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV = 0x8F27;
- int GL_FOG_COORD_ARRAY_ADDRESS_NV = 0x8F28;
- int GL_ELEMENT_ARRAY_ADDRESS_NV = 0x8F29;
-
- /** Accepted by the <target> parameter of GetIntegeri_vNV: */
- int GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV = 0x8F2A;
- int GL_TEXTURE_COORD_ARRAY_LENGTH_NV = 0x8F2F;
-
- /** Accepted by the <value> parameter of GetIntegerv: */
- int GL_VERTEX_ARRAY_LENGTH_NV = 0x8F2B;
- int GL_NORMAL_ARRAY_LENGTH_NV = 0x8F2C;
- int GL_COLOR_ARRAY_LENGTH_NV = 0x8F2D;
- int GL_INDEX_ARRAY_LENGTH_NV = 0x8F2E;
- int GL_EDGE_FLAG_ARRAY_LENGTH_NV = 0x8F30;
- int GL_SECONDARY_COLOR_ARRAY_LENGTH_NV = 0x8F31;
- int GL_FOG_COORD_ARRAY_LENGTH_NV = 0x8F32;
- int GL_ELEMENT_ARRAY_LENGTH_NV = 0x8F33;
-
- void glBufferAddressRangeNV(@GLenum int pname, @GLuint int index, @GLuint64EXT long address, @GLsizeiptr long length);
-
- void glVertexFormatNV(int size, @GLenum int type, @GLsizei int stride);
-
- void glNormalFormatNV(@GLenum int type, @GLsizei int stride);
-
- void glColorFormatNV(int size, @GLenum int type, @GLsizei int stride);
-
- void glIndexFormatNV(@GLenum int type, @GLsizei int stride);
-
- void glTexCoordFormatNV(int size, @GLenum int type, @GLsizei int stride);
-
- void glEdgeFlagFormatNV(@GLsizei int stride);
-
- void glSecondaryColorFormatNV(int size, @GLenum int type, @GLsizei int stride);
-
- void glFogCoordFormatNV(@GLenum int type, @GLsizei int stride);
-
- void glVertexAttribFormatNV(@GLuint int index, int size, @GLenum int type, boolean normalized, @GLsizei int stride);
-
- void glVertexAttribIFormatNV(@GLuint int index, int size, @GLenum int type, @GLsizei int stride);
-
- @StripPostfix("result")
- void glGetIntegerui64i_vNV(@GLenum int value, @GLuint int index, @OutParameter @Check("1") @GLuint64EXT LongBuffer result);
-
- @Alternate("glGetIntegerui64i_vNV")
- @GLreturn("result")
- @StripPostfix("result")
- void glGetIntegerui64i_vNV2(@GLenum int value, @GLuint int index, @OutParameter @GLuint64EXT LongBuffer result);
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.LongBuffer;
+
+public interface NV_vertex_buffer_unified_memory {
+
+ /**
+ * Accepted by the <cap> parameter of DisableClientState,
+ * EnableClientState, IsEnabled:
+ */
+ int GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV = 0x8F1E;
+ int GL_ELEMENT_ARRAY_UNIFIED_NV = 0x8F1F;
+
+ /**
+ * Accepted by the <pname> parameter of BufferAddressRangeNV
+ * and the <value> parameter of GetIntegerui64i_vNV:
+ */
+ int GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV = 0x8F20;
+ int GL_TEXTURE_COORD_ARRAY_ADDRESS_NV = 0x8F25;
+
+ /**
+ * Accepted by the <pname> parameter of BufferAddressRangeNV
+ * and the <value> parameter of GetIntegerui64vNV:
+ */
+ int GL_VERTEX_ARRAY_ADDRESS_NV = 0x8F21;
+ int GL_NORMAL_ARRAY_ADDRESS_NV = 0x8F22;
+ int GL_COLOR_ARRAY_ADDRESS_NV = 0x8F23;
+ int GL_INDEX_ARRAY_ADDRESS_NV = 0x8F24;
+ int GL_EDGE_FLAG_ARRAY_ADDRESS_NV = 0x8F26;
+ int GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV = 0x8F27;
+ int GL_FOG_COORD_ARRAY_ADDRESS_NV = 0x8F28;
+ int GL_ELEMENT_ARRAY_ADDRESS_NV = 0x8F29;
+
+ /** Accepted by the <target> parameter of GetIntegeri_vNV: */
+ int GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV = 0x8F2A;
+ int GL_TEXTURE_COORD_ARRAY_LENGTH_NV = 0x8F2F;
+
+ /** Accepted by the <value> parameter of GetIntegerv: */
+ int GL_VERTEX_ARRAY_LENGTH_NV = 0x8F2B;
+ int GL_NORMAL_ARRAY_LENGTH_NV = 0x8F2C;
+ int GL_COLOR_ARRAY_LENGTH_NV = 0x8F2D;
+ int GL_INDEX_ARRAY_LENGTH_NV = 0x8F2E;
+ int GL_EDGE_FLAG_ARRAY_LENGTH_NV = 0x8F30;
+ int GL_SECONDARY_COLOR_ARRAY_LENGTH_NV = 0x8F31;
+ int GL_FOG_COORD_ARRAY_LENGTH_NV = 0x8F32;
+ int GL_ELEMENT_ARRAY_LENGTH_NV = 0x8F33;
+
+ void glBufferAddressRangeNV(@GLenum int pname, @GLuint int index, @GLuint64EXT long address, @GLsizeiptr long length);
+
+ void glVertexFormatNV(int size, @GLenum int type, @GLsizei int stride);
+
+ void glNormalFormatNV(@GLenum int type, @GLsizei int stride);
+
+ void glColorFormatNV(int size, @GLenum int type, @GLsizei int stride);
+
+ void glIndexFormatNV(@GLenum int type, @GLsizei int stride);
+
+ void glTexCoordFormatNV(int size, @GLenum int type, @GLsizei int stride);
+
+ void glEdgeFlagFormatNV(@GLsizei int stride);
+
+ void glSecondaryColorFormatNV(int size, @GLenum int type, @GLsizei int stride);
+
+ void glFogCoordFormatNV(@GLenum int type, @GLsizei int stride);
+
+ void glVertexAttribFormatNV(@GLuint int index, int size, @GLenum int type, boolean normalized, @GLsizei int stride);
+
+ void glVertexAttribIFormatNV(@GLuint int index, int size, @GLenum int type, @GLsizei int stride);
+
+ @StripPostfix("result")
+ void glGetIntegerui64i_vNV(@GLenum int value, @GLuint int index, @OutParameter @Check("1") @GLuint64EXT LongBuffer result);
+
+ @Alternate("glGetIntegerui64i_vNV")
+ @GLreturn("result")
+ @StripPostfix("result")
+ void glGetIntegerui64i_vNV2(@GLenum int value, @GLuint int index, @OutParameter @GLuint64EXT LongBuffer result);
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/NV_vertex_program.java b/src/templates/org/lwjgl/opengl/NV_vertex_program.java
index 23d8f8f..e960685 100644
--- a/src/templates/org/lwjgl/opengl/NV_vertex_program.java
+++ b/src/templates/org/lwjgl/opengl/NV_vertex_program.java
@@ -1,330 +1,330 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-import java.nio.*;
-
-public interface NV_vertex_program extends NV_program {
-
- /**
- Accepted by the <cap> parameter of Disable, Enable, and IsEnabled,
- and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
- and GetDoublev, and by the <target> parameter of BindProgramNV,
- ExecuteProgramNV, GetProgramParameter[df]vNV, GetTrackMatrixivNV,
- LoadProgramNV, ProgramParameter[s]4[df][v]NV, and TrackMatrixNV:
- */
- int GL_VERTEX_PROGRAM_NV = 0x8620;
-
- /**
- Accepted by the <cap> parameter of Disable, Enable, and IsEnabled,
- and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
- and GetDoublev:
- */
- int GL_VERTEX_PROGRAM_POINT_SIZE_NV = 0x8642;
- int GL_VERTEX_PROGRAM_TWO_SIDE_NV = 0x8643;
-
- /**
- Accepted by the <target> parameter of ExecuteProgramNV and
- LoadProgramNV:
- */
- int GL_VERTEX_STATE_PROGRAM_NV = 0x8621;
-
- /**
- Accepted by the <pname> parameter of GetVertexAttrib[dfi]vNV:
- */
- int GL_ATTRIB_ARRAY_SIZE_NV = 0x8623;
- int GL_ATTRIB_ARRAY_STRIDE_NV = 0x8624;
- int GL_ATTRIB_ARRAY_TYPE_NV = 0x8625;
- int GL_CURRENT_ATTRIB_NV = 0x8626;
-
- /**
- Accepted by the <pname> parameter of GetProgramParameterfvNV
- and GetProgramParameterdvNV:
- */
- int GL_PROGRAM_PARAMETER_NV = 0x8644;
-
- /**
- Accepted by the <pname> parameter of GetVertexAttribPointervNV:
- */
- int GL_ATTRIB_ARRAY_POINTER_NV = 0x8645;
-
- /**
- Accepted by the <pname> parameter of GetTrackMatrixivNV:
- */
- int GL_TRACK_MATRIX_NV = 0x8648;
- int GL_TRACK_MATRIX_TRANSFORM_NV = 0x8649;
-
- /**
- Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- GetFloatv, and GetDoublev:
- */
- int GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV = 0x862E;
- int GL_MAX_TRACK_MATRICES_NV = 0x862F;
- int GL_CURRENT_MATRIX_STACK_DEPTH_NV = 0x8640;
- int GL_CURRENT_MATRIX_NV = 0x8641;
- int GL_VERTEX_PROGRAM_BINDING_NV = 0x864A;
-
- /**
- Accepted by the <matrix> parameter of TrackMatrixNV:
- */
- int GL_MODELVIEW_PROJECTION_NV = 0x8629;
-
- /**
- Accepted by the <matrix> parameter of TrackMatrixNV and by the
- <mode> parameter of MatrixMode:
- */
- int GL_MATRIX0_NV = 0x8630;
- int GL_MATRIX1_NV = 0x8631;
- int GL_MATRIX2_NV = 0x8632;
- int GL_MATRIX3_NV = 0x8633;
- int GL_MATRIX4_NV = 0x8634;
- int GL_MATRIX5_NV = 0x8635;
- int GL_MATRIX6_NV = 0x8636;
- int GL_MATRIX7_NV = 0x8637;
-
- /**
- Accepted by the <transform> parameter of TrackMatrixNV:
- */
- int GL_IDENTITY_NV = 0x862A;
- int GL_INVERSE_NV = 0x862B;
- int GL_TRANSPOSE_NV = 0x862C;
- int GL_INVERSE_TRANSPOSE_NV = 0x862D;
-
- /**
- Accepted by the <array> parameter of EnableClientState and
- DisableClientState, by the <cap> parameter of IsEnabled, and by
- the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
- GetDoublev:
- */
- int GL_VERTEX_ATTRIB_ARRAY0_NV = 0x8650;
- int GL_VERTEX_ATTRIB_ARRAY1_NV = 0x8651;
- int GL_VERTEX_ATTRIB_ARRAY2_NV = 0x8652;
- int GL_VERTEX_ATTRIB_ARRAY3_NV = 0x8653;
- int GL_VERTEX_ATTRIB_ARRAY4_NV = 0x8654;
- int GL_VERTEX_ATTRIB_ARRAY5_NV = 0x8655;
- int GL_VERTEX_ATTRIB_ARRAY6_NV = 0x8656;
- int GL_VERTEX_ATTRIB_ARRAY7_NV = 0x8657;
- int GL_VERTEX_ATTRIB_ARRAY8_NV = 0x8658;
- int GL_VERTEX_ATTRIB_ARRAY9_NV = 0x8659;
- int GL_VERTEX_ATTRIB_ARRAY10_NV = 0x865A;
- int GL_VERTEX_ATTRIB_ARRAY11_NV = 0x865B;
- int GL_VERTEX_ATTRIB_ARRAY12_NV = 0x865C;
- int GL_VERTEX_ATTRIB_ARRAY13_NV = 0x865D;
- int GL_VERTEX_ATTRIB_ARRAY14_NV = 0x865E;
- int GL_VERTEX_ATTRIB_ARRAY15_NV = 0x865F;
-
- /**
- Accepted by the <target> parameter of GetMapdv, GetMapfv, GetMapiv,
- Map1d and Map1f and by the <cap> parameter of Enable, Disable, and
- IsEnabled, and by the <pname> parameter of GetBooleanv, GetIntegerv,
- GetFloatv, and GetDoublev:
- */
- int GL_MAP1_VERTEX_ATTRIB0_4_NV = 0x8660;
- int GL_MAP1_VERTEX_ATTRIB1_4_NV = 0x8661;
- int GL_MAP1_VERTEX_ATTRIB2_4_NV = 0x8662;
- int GL_MAP1_VERTEX_ATTRIB3_4_NV = 0x8663;
- int GL_MAP1_VERTEX_ATTRIB4_4_NV = 0x8664;
- int GL_MAP1_VERTEX_ATTRIB5_4_NV = 0x8665;
- int GL_MAP1_VERTEX_ATTRIB6_4_NV = 0x8666;
- int GL_MAP1_VERTEX_ATTRIB7_4_NV = 0x8667;
- int GL_MAP1_VERTEX_ATTRIB8_4_NV = 0x8668;
- int GL_MAP1_VERTEX_ATTRIB9_4_NV = 0x8669;
- int GL_MAP1_VERTEX_ATTRIB10_4_NV = 0x866A;
- int GL_MAP1_VERTEX_ATTRIB11_4_NV = 0x866B;
- int GL_MAP1_VERTEX_ATTRIB12_4_NV = 0x866C;
- int GL_MAP1_VERTEX_ATTRIB13_4_NV = 0x866D;
- int GL_MAP1_VERTEX_ATTRIB14_4_NV = 0x866E;
- int GL_MAP1_VERTEX_ATTRIB15_4_NV = 0x866F;
-
- /**
- Accepted by the <target> parameter of GetMapdv, GetMapfv, GetMapiv,
- Map2d and Map2f and by the <cap> parameter of Enable, Disable, and
- IsEnabled, and by the <pname> parameter of GetBooleanv, GetIntegerv,
- GetFloatv, and GetDoublev:
- */
- int GL_MAP2_VERTEX_ATTRIB0_4_NV = 0x8670;
- int GL_MAP2_VERTEX_ATTRIB1_4_NV = 0x8671;
- int GL_MAP2_VERTEX_ATTRIB2_4_NV = 0x8672;
- int GL_MAP2_VERTEX_ATTRIB3_4_NV = 0x8673;
- int GL_MAP2_VERTEX_ATTRIB4_4_NV = 0x8674;
- int GL_MAP2_VERTEX_ATTRIB5_4_NV = 0x8675;
- int GL_MAP2_VERTEX_ATTRIB6_4_NV = 0x8676;
- int GL_MAP2_VERTEX_ATTRIB7_4_NV = 0x8677;
- int GL_MAP2_VERTEX_ATTRIB8_4_NV = 0x8678;
- int GL_MAP2_VERTEX_ATTRIB9_4_NV = 0x8679;
- int GL_MAP2_VERTEX_ATTRIB10_4_NV = 0x867A;
- int GL_MAP2_VERTEX_ATTRIB11_4_NV = 0x867B;
- int GL_MAP2_VERTEX_ATTRIB12_4_NV = 0x867C;
- int GL_MAP2_VERTEX_ATTRIB13_4_NV = 0x867D;
- int GL_MAP2_VERTEX_ATTRIB14_4_NV = 0x867E;
- int GL_MAP2_VERTEX_ATTRIB15_4_NV = 0x867F;
-
- void glExecuteProgramNV(@GLenum int target, @GLuint int id, @Check("4") @Const FloatBuffer params);
-
- @StripPostfix("params")
- void glGetProgramParameterfvNV(@GLenum int target, @GLuint int index, @GLenum int parameterName, @OutParameter @Check("4") FloatBuffer params);
-
- @StripPostfix("params")
- void glGetProgramParameterdvNV(@GLenum int target, @GLuint int index, @GLenum int parameterName, @OutParameter @Check("4") DoubleBuffer params);
-
- @StripPostfix("params")
- void glGetTrackMatrixivNV(@GLenum int target, @GLuint int address, @GLenum int parameterName, @OutParameter @Check("4") IntBuffer params);
-
- @StripPostfix("params")
- void glGetVertexAttribfvNV(@GLuint int index, @GLenum int parameterName, @OutParameter @Check("4") FloatBuffer params);
-
- @StripPostfix("params")
- void glGetVertexAttribdvNV(@GLuint int index, @GLenum int parameterName, @OutParameter @Check("4") DoubleBuffer params);
-
- @StripPostfix("params")
- void glGetVertexAttribivNV(@GLuint int index, @GLenum int parameterName, @OutParameter @Check("4") IntBuffer params);
-
- @StripPostfix("pointer")
- void glGetVertexAttribPointervNV(@GLuint int index, @GLenum int parameterName, @Result @GLvoid ByteBuffer pointer);
-
- void glProgramParameter4fNV(@GLenum int target, @GLuint int index, float x, float y, float z, float w);
-
- void glProgramParameter4dNV(@GLenum int target, @GLuint int index, double x, double y, double z, double w);
-
- @StripPostfix("params")
- void glProgramParameters4fvNV(@GLenum int target, @GLuint int index, @AutoSize(value = "params", expression = " >> 2") @GLuint int count,
- @Const FloatBuffer params);
-
- @StripPostfix("params")
- void glProgramParameters4dvNV(@GLenum int target, @GLuint int index, @AutoSize(value = "params", expression = " >> 2") @GLuint int count,
- @Const DoubleBuffer params);
-
- void glTrackMatrixNV(@GLenum int target, @GLuint int address, @GLenum int matrix, @GLenum int transform);
-
- void glVertexAttribPointerNV(@GLuint int index, int size, @GLenum int type, @GLsizei int stride,
- @CachedReference(index="index",name="glVertexAttribPointer_buffer")
- @BufferObject(BufferKind.ArrayVBO)
- @Check
- @Const
- @GLbyte
- @GLubyte
- @GLshort
- @GLushort
- @GLint
- @GLuint
- @GLfloat
- @GLdouble Buffer buffer);
-
- @NoErrorCheck
- void glVertexAttrib1sNV(@GLuint int index, short x);
-
- @NoErrorCheck
- void glVertexAttrib1fNV(@GLuint int index, float x);
-
- @NoErrorCheck
- void glVertexAttrib1dNV(@GLuint int index, double x);
-
- @NoErrorCheck
- void glVertexAttrib2sNV(@GLuint int index, short x, short y);
-
- @NoErrorCheck
- void glVertexAttrib2fNV(@GLuint int index, float x, float y);
-
- @NoErrorCheck
- void glVertexAttrib2dNV(@GLuint int index, double x, double y);
-
- @NoErrorCheck
- void glVertexAttrib3sNV(@GLuint int index, short x, short y, short z);
-
- @NoErrorCheck
- void glVertexAttrib3fNV(@GLuint int index, float x, float y, float z);
-
- @NoErrorCheck
- void glVertexAttrib3dNV(@GLuint int index, double x, double y, double z);
-
- @NoErrorCheck
- void glVertexAttrib4sNV(@GLuint int index, short x, short y, short z, short w);
-
- @NoErrorCheck
- void glVertexAttrib4fNV(@GLuint int index, float x, float y, float z, float w);
-
- @NoErrorCheck
- void glVertexAttrib4dNV(@GLuint int index, double x, double y, double z, double w);
-
- @NoErrorCheck
- void glVertexAttrib4ubNV(@GLuint int index, @GLubyte byte x, @GLubyte byte y, @GLubyte byte z, @GLubyte byte w);
-
- @NoErrorCheck
- @StripPostfix("v")
- void glVertexAttribs1svNV(@GLuint int index, @AutoSize("v") @GLsizei int n, @Const ShortBuffer v);
-
- @NoErrorCheck
- @StripPostfix("v")
- void glVertexAttribs1fvNV(@GLuint int index, @AutoSize("v") @GLsizei int n, @Const FloatBuffer v);
-
- @NoErrorCheck
- @StripPostfix("v")
- void glVertexAttribs1dvNV(@GLuint int index, @AutoSize("v") @GLsizei int n, @Const DoubleBuffer v);
-
- @NoErrorCheck
- @StripPostfix("v")
- void glVertexAttribs2svNV(@GLuint int index, @AutoSize(value = "v", expression = " >> 1") @GLsizei int n, @Const ShortBuffer v);
-
- @NoErrorCheck
- @StripPostfix("v")
- void glVertexAttribs2fvNV(@GLuint int index, @AutoSize(value = "v", expression = " >> 1") @GLsizei int n, @Const FloatBuffer v);
-
- @NoErrorCheck
- @StripPostfix("v")
- void glVertexAttribs2dvNV(@GLuint int index, @AutoSize(value = "v", expression = " >> 1") @GLsizei int n, @Const DoubleBuffer v);
-
- @NoErrorCheck
- @StripPostfix("v")
- void glVertexAttribs3svNV(@GLuint int index, @AutoSize(value = "v", expression = " / 3") @GLsizei int n, @Const ShortBuffer v);
-
- @NoErrorCheck
- @StripPostfix("v")
- void glVertexAttribs3fvNV(@GLuint int index, @AutoSize(value = "v", expression = " / 3") @GLsizei int n, @Const FloatBuffer v);
-
- @NoErrorCheck
- @StripPostfix("v")
- void glVertexAttribs3dvNV(@GLuint int index, @AutoSize(value = "v", expression = " / 3") @GLsizei int n, @Const DoubleBuffer v);
-
- @NoErrorCheck
- @StripPostfix("v")
- void glVertexAttribs4svNV(@GLuint int index, @AutoSize(value = "v", expression = " >> 2") @GLsizei int n, @Const ShortBuffer v);
-
- @NoErrorCheck
- @StripPostfix("v")
- void glVertexAttribs4fvNV(@GLuint int index, @AutoSize(value = "v", expression = " >> 2") @GLsizei int n, @Const FloatBuffer v);
-
- @NoErrorCheck
- @StripPostfix("v")
- void glVertexAttribs4dvNV(@GLuint int index, @AutoSize(value = "v", expression = " >> 2") @GLsizei int n, @Const DoubleBuffer v);
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+import java.nio.*;
+
+public interface NV_vertex_program extends NV_program {
+
+ /**
+ Accepted by the <cap> parameter of Disable, Enable, and IsEnabled,
+ and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
+ and GetDoublev, and by the <target> parameter of BindProgramNV,
+ ExecuteProgramNV, GetProgramParameter[df]vNV, GetTrackMatrixivNV,
+ LoadProgramNV, ProgramParameter[s]4[df][v]NV, and TrackMatrixNV:
+ */
+ int GL_VERTEX_PROGRAM_NV = 0x8620;
+
+ /**
+ Accepted by the <cap> parameter of Disable, Enable, and IsEnabled,
+ and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
+ and GetDoublev:
+ */
+ int GL_VERTEX_PROGRAM_POINT_SIZE_NV = 0x8642;
+ int GL_VERTEX_PROGRAM_TWO_SIDE_NV = 0x8643;
+
+ /**
+ Accepted by the <target> parameter of ExecuteProgramNV and
+ LoadProgramNV:
+ */
+ int GL_VERTEX_STATE_PROGRAM_NV = 0x8621;
+
+ /**
+ Accepted by the <pname> parameter of GetVertexAttrib[dfi]vNV:
+ */
+ int GL_ATTRIB_ARRAY_SIZE_NV = 0x8623;
+ int GL_ATTRIB_ARRAY_STRIDE_NV = 0x8624;
+ int GL_ATTRIB_ARRAY_TYPE_NV = 0x8625;
+ int GL_CURRENT_ATTRIB_NV = 0x8626;
+
+ /**
+ Accepted by the <pname> parameter of GetProgramParameterfvNV
+ and GetProgramParameterdvNV:
+ */
+ int GL_PROGRAM_PARAMETER_NV = 0x8644;
+
+ /**
+ Accepted by the <pname> parameter of GetVertexAttribPointervNV:
+ */
+ int GL_ATTRIB_ARRAY_POINTER_NV = 0x8645;
+
+ /**
+ Accepted by the <pname> parameter of GetTrackMatrixivNV:
+ */
+ int GL_TRACK_MATRIX_NV = 0x8648;
+ int GL_TRACK_MATRIX_TRANSFORM_NV = 0x8649;
+
+ /**
+ Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ GetFloatv, and GetDoublev:
+ */
+ int GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV = 0x862E;
+ int GL_MAX_TRACK_MATRICES_NV = 0x862F;
+ int GL_CURRENT_MATRIX_STACK_DEPTH_NV = 0x8640;
+ int GL_CURRENT_MATRIX_NV = 0x8641;
+ int GL_VERTEX_PROGRAM_BINDING_NV = 0x864A;
+
+ /**
+ Accepted by the <matrix> parameter of TrackMatrixNV:
+ */
+ int GL_MODELVIEW_PROJECTION_NV = 0x8629;
+
+ /**
+ Accepted by the <matrix> parameter of TrackMatrixNV and by the
+ <mode> parameter of MatrixMode:
+ */
+ int GL_MATRIX0_NV = 0x8630;
+ int GL_MATRIX1_NV = 0x8631;
+ int GL_MATRIX2_NV = 0x8632;
+ int GL_MATRIX3_NV = 0x8633;
+ int GL_MATRIX4_NV = 0x8634;
+ int GL_MATRIX5_NV = 0x8635;
+ int GL_MATRIX6_NV = 0x8636;
+ int GL_MATRIX7_NV = 0x8637;
+
+ /**
+ Accepted by the <transform> parameter of TrackMatrixNV:
+ */
+ int GL_IDENTITY_NV = 0x862A;
+ int GL_INVERSE_NV = 0x862B;
+ int GL_TRANSPOSE_NV = 0x862C;
+ int GL_INVERSE_TRANSPOSE_NV = 0x862D;
+
+ /**
+ Accepted by the <array> parameter of EnableClientState and
+ DisableClientState, by the <cap> parameter of IsEnabled, and by
+ the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
+ GetDoublev:
+ */
+ int GL_VERTEX_ATTRIB_ARRAY0_NV = 0x8650;
+ int GL_VERTEX_ATTRIB_ARRAY1_NV = 0x8651;
+ int GL_VERTEX_ATTRIB_ARRAY2_NV = 0x8652;
+ int GL_VERTEX_ATTRIB_ARRAY3_NV = 0x8653;
+ int GL_VERTEX_ATTRIB_ARRAY4_NV = 0x8654;
+ int GL_VERTEX_ATTRIB_ARRAY5_NV = 0x8655;
+ int GL_VERTEX_ATTRIB_ARRAY6_NV = 0x8656;
+ int GL_VERTEX_ATTRIB_ARRAY7_NV = 0x8657;
+ int GL_VERTEX_ATTRIB_ARRAY8_NV = 0x8658;
+ int GL_VERTEX_ATTRIB_ARRAY9_NV = 0x8659;
+ int GL_VERTEX_ATTRIB_ARRAY10_NV = 0x865A;
+ int GL_VERTEX_ATTRIB_ARRAY11_NV = 0x865B;
+ int GL_VERTEX_ATTRIB_ARRAY12_NV = 0x865C;
+ int GL_VERTEX_ATTRIB_ARRAY13_NV = 0x865D;
+ int GL_VERTEX_ATTRIB_ARRAY14_NV = 0x865E;
+ int GL_VERTEX_ATTRIB_ARRAY15_NV = 0x865F;
+
+ /**
+ Accepted by the <target> parameter of GetMapdv, GetMapfv, GetMapiv,
+ Map1d and Map1f and by the <cap> parameter of Enable, Disable, and
+ IsEnabled, and by the <pname> parameter of GetBooleanv, GetIntegerv,
+ GetFloatv, and GetDoublev:
+ */
+ int GL_MAP1_VERTEX_ATTRIB0_4_NV = 0x8660;
+ int GL_MAP1_VERTEX_ATTRIB1_4_NV = 0x8661;
+ int GL_MAP1_VERTEX_ATTRIB2_4_NV = 0x8662;
+ int GL_MAP1_VERTEX_ATTRIB3_4_NV = 0x8663;
+ int GL_MAP1_VERTEX_ATTRIB4_4_NV = 0x8664;
+ int GL_MAP1_VERTEX_ATTRIB5_4_NV = 0x8665;
+ int GL_MAP1_VERTEX_ATTRIB6_4_NV = 0x8666;
+ int GL_MAP1_VERTEX_ATTRIB7_4_NV = 0x8667;
+ int GL_MAP1_VERTEX_ATTRIB8_4_NV = 0x8668;
+ int GL_MAP1_VERTEX_ATTRIB9_4_NV = 0x8669;
+ int GL_MAP1_VERTEX_ATTRIB10_4_NV = 0x866A;
+ int GL_MAP1_VERTEX_ATTRIB11_4_NV = 0x866B;
+ int GL_MAP1_VERTEX_ATTRIB12_4_NV = 0x866C;
+ int GL_MAP1_VERTEX_ATTRIB13_4_NV = 0x866D;
+ int GL_MAP1_VERTEX_ATTRIB14_4_NV = 0x866E;
+ int GL_MAP1_VERTEX_ATTRIB15_4_NV = 0x866F;
+
+ /**
+ Accepted by the <target> parameter of GetMapdv, GetMapfv, GetMapiv,
+ Map2d and Map2f and by the <cap> parameter of Enable, Disable, and
+ IsEnabled, and by the <pname> parameter of GetBooleanv, GetIntegerv,
+ GetFloatv, and GetDoublev:
+ */
+ int GL_MAP2_VERTEX_ATTRIB0_4_NV = 0x8670;
+ int GL_MAP2_VERTEX_ATTRIB1_4_NV = 0x8671;
+ int GL_MAP2_VERTEX_ATTRIB2_4_NV = 0x8672;
+ int GL_MAP2_VERTEX_ATTRIB3_4_NV = 0x8673;
+ int GL_MAP2_VERTEX_ATTRIB4_4_NV = 0x8674;
+ int GL_MAP2_VERTEX_ATTRIB5_4_NV = 0x8675;
+ int GL_MAP2_VERTEX_ATTRIB6_4_NV = 0x8676;
+ int GL_MAP2_VERTEX_ATTRIB7_4_NV = 0x8677;
+ int GL_MAP2_VERTEX_ATTRIB8_4_NV = 0x8678;
+ int GL_MAP2_VERTEX_ATTRIB9_4_NV = 0x8679;
+ int GL_MAP2_VERTEX_ATTRIB10_4_NV = 0x867A;
+ int GL_MAP2_VERTEX_ATTRIB11_4_NV = 0x867B;
+ int GL_MAP2_VERTEX_ATTRIB12_4_NV = 0x867C;
+ int GL_MAP2_VERTEX_ATTRIB13_4_NV = 0x867D;
+ int GL_MAP2_VERTEX_ATTRIB14_4_NV = 0x867E;
+ int GL_MAP2_VERTEX_ATTRIB15_4_NV = 0x867F;
+
+ void glExecuteProgramNV(@GLenum int target, @GLuint int id, @Check("4") @Const FloatBuffer params);
+
+ @StripPostfix("params")
+ void glGetProgramParameterfvNV(@GLenum int target, @GLuint int index, @GLenum int parameterName, @OutParameter @Check("4") FloatBuffer params);
+
+ @StripPostfix("params")
+ void glGetProgramParameterdvNV(@GLenum int target, @GLuint int index, @GLenum int parameterName, @OutParameter @Check("4") DoubleBuffer params);
+
+ @StripPostfix("params")
+ void glGetTrackMatrixivNV(@GLenum int target, @GLuint int address, @GLenum int parameterName, @OutParameter @Check("4") IntBuffer params);
+
+ @StripPostfix("params")
+ void glGetVertexAttribfvNV(@GLuint int index, @GLenum int parameterName, @OutParameter @Check("4") FloatBuffer params);
+
+ @StripPostfix("params")
+ void glGetVertexAttribdvNV(@GLuint int index, @GLenum int parameterName, @OutParameter @Check("4") DoubleBuffer params);
+
+ @StripPostfix("params")
+ void glGetVertexAttribivNV(@GLuint int index, @GLenum int parameterName, @OutParameter @Check("4") IntBuffer params);
+
+ @StripPostfix("pointer")
+ void glGetVertexAttribPointervNV(@GLuint int index, @GLenum int parameterName, @Result @GLvoid ByteBuffer pointer);
+
+ void glProgramParameter4fNV(@GLenum int target, @GLuint int index, float x, float y, float z, float w);
+
+ void glProgramParameter4dNV(@GLenum int target, @GLuint int index, double x, double y, double z, double w);
+
+ @StripPostfix("params")
+ void glProgramParameters4fvNV(@GLenum int target, @GLuint int index, @AutoSize(value = "params", expression = " >> 2") @GLuint int count,
+ @Const FloatBuffer params);
+
+ @StripPostfix("params")
+ void glProgramParameters4dvNV(@GLenum int target, @GLuint int index, @AutoSize(value = "params", expression = " >> 2") @GLuint int count,
+ @Const DoubleBuffer params);
+
+ void glTrackMatrixNV(@GLenum int target, @GLuint int address, @GLenum int matrix, @GLenum int transform);
+
+ void glVertexAttribPointerNV(@GLuint int index, int size, @GLenum int type, @GLsizei int stride,
+ @CachedReference(index="index",name="glVertexAttribPointer_buffer")
+ @BufferObject(BufferKind.ArrayVBO)
+ @Check
+ @Const
+ @GLbyte
+ @GLubyte
+ @GLshort
+ @GLushort
+ @GLint
+ @GLuint
+ @GLfloat
+ @GLdouble Buffer buffer);
+
+ @NoErrorCheck
+ void glVertexAttrib1sNV(@GLuint int index, short x);
+
+ @NoErrorCheck
+ void glVertexAttrib1fNV(@GLuint int index, float x);
+
+ @NoErrorCheck
+ void glVertexAttrib1dNV(@GLuint int index, double x);
+
+ @NoErrorCheck
+ void glVertexAttrib2sNV(@GLuint int index, short x, short y);
+
+ @NoErrorCheck
+ void glVertexAttrib2fNV(@GLuint int index, float x, float y);
+
+ @NoErrorCheck
+ void glVertexAttrib2dNV(@GLuint int index, double x, double y);
+
+ @NoErrorCheck
+ void glVertexAttrib3sNV(@GLuint int index, short x, short y, short z);
+
+ @NoErrorCheck
+ void glVertexAttrib3fNV(@GLuint int index, float x, float y, float z);
+
+ @NoErrorCheck
+ void glVertexAttrib3dNV(@GLuint int index, double x, double y, double z);
+
+ @NoErrorCheck
+ void glVertexAttrib4sNV(@GLuint int index, short x, short y, short z, short w);
+
+ @NoErrorCheck
+ void glVertexAttrib4fNV(@GLuint int index, float x, float y, float z, float w);
+
+ @NoErrorCheck
+ void glVertexAttrib4dNV(@GLuint int index, double x, double y, double z, double w);
+
+ @NoErrorCheck
+ void glVertexAttrib4ubNV(@GLuint int index, @GLubyte byte x, @GLubyte byte y, @GLubyte byte z, @GLubyte byte w);
+
+ @NoErrorCheck
+ @StripPostfix("v")
+ void glVertexAttribs1svNV(@GLuint int index, @AutoSize("v") @GLsizei int n, @Const ShortBuffer v);
+
+ @NoErrorCheck
+ @StripPostfix("v")
+ void glVertexAttribs1fvNV(@GLuint int index, @AutoSize("v") @GLsizei int n, @Const FloatBuffer v);
+
+ @NoErrorCheck
+ @StripPostfix("v")
+ void glVertexAttribs1dvNV(@GLuint int index, @AutoSize("v") @GLsizei int n, @Const DoubleBuffer v);
+
+ @NoErrorCheck
+ @StripPostfix("v")
+ void glVertexAttribs2svNV(@GLuint int index, @AutoSize(value = "v", expression = " >> 1") @GLsizei int n, @Const ShortBuffer v);
+
+ @NoErrorCheck
+ @StripPostfix("v")
+ void glVertexAttribs2fvNV(@GLuint int index, @AutoSize(value = "v", expression = " >> 1") @GLsizei int n, @Const FloatBuffer v);
+
+ @NoErrorCheck
+ @StripPostfix("v")
+ void glVertexAttribs2dvNV(@GLuint int index, @AutoSize(value = "v", expression = " >> 1") @GLsizei int n, @Const DoubleBuffer v);
+
+ @NoErrorCheck
+ @StripPostfix("v")
+ void glVertexAttribs3svNV(@GLuint int index, @AutoSize(value = "v", expression = " / 3") @GLsizei int n, @Const ShortBuffer v);
+
+ @NoErrorCheck
+ @StripPostfix("v")
+ void glVertexAttribs3fvNV(@GLuint int index, @AutoSize(value = "v", expression = " / 3") @GLsizei int n, @Const FloatBuffer v);
+
+ @NoErrorCheck
+ @StripPostfix("v")
+ void glVertexAttribs3dvNV(@GLuint int index, @AutoSize(value = "v", expression = " / 3") @GLsizei int n, @Const DoubleBuffer v);
+
+ @NoErrorCheck
+ @StripPostfix("v")
+ void glVertexAttribs4svNV(@GLuint int index, @AutoSize(value = "v", expression = " >> 2") @GLsizei int n, @Const ShortBuffer v);
+
+ @NoErrorCheck
+ @StripPostfix("v")
+ void glVertexAttribs4fvNV(@GLuint int index, @AutoSize(value = "v", expression = " >> 2") @GLsizei int n, @Const FloatBuffer v);
+
+ @NoErrorCheck
+ @StripPostfix("v")
+ void glVertexAttribs4dvNV(@GLuint int index, @AutoSize(value = "v", expression = " >> 2") @GLsizei int n, @Const DoubleBuffer v);
+}
diff --git a/src/templates/org/lwjgl/opengl/NV_vertex_program1_1.java b/src/templates/org/lwjgl/opengl/NV_vertex_program1_1.java
index 1f1e89f..cc4fb76 100644
--- a/src/templates/org/lwjgl/opengl/NV_vertex_program1_1.java
+++ b/src/templates/org/lwjgl/opengl/NV_vertex_program1_1.java
@@ -1,35 +1,35 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface NV_vertex_program1_1 {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface NV_vertex_program1_1 {
+}
diff --git a/src/templates/org/lwjgl/opengl/NV_vertex_program2.java b/src/templates/org/lwjgl/opengl/NV_vertex_program2.java
index d6f3d74..ce32217 100644
--- a/src/templates/org/lwjgl/opengl/NV_vertex_program2.java
+++ b/src/templates/org/lwjgl/opengl/NV_vertex_program2.java
@@ -1,35 +1,35 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface NV_vertex_program2 {
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface NV_vertex_program2 {
+}
diff --git a/src/templates/org/lwjgl/opengl/NV_vertex_program2_option.java b/src/templates/org/lwjgl/opengl/NV_vertex_program2_option.java
index 0d87f4e..98675a1 100644
--- a/src/templates/org/lwjgl/opengl/NV_vertex_program2_option.java
+++ b/src/templates/org/lwjgl/opengl/NV_vertex_program2_option.java
@@ -1,41 +1,41 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface NV_vertex_program2_option {
-
- /**
- * Accepted by the <pname> parameter of GetProgramivARB:
- */
- int GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV = 0x88F4;
- int GL_MAX_PROGRAM_CALL_DEPTH_NV = 0x88F5;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface NV_vertex_program2_option {
+
+ /**
+ * Accepted by the <pname> parameter of GetProgramivARB:
+ */
+ int GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV = 0x88F4;
+ int GL_MAX_PROGRAM_CALL_DEPTH_NV = 0x88F5;
+}
diff --git a/src/templates/org/lwjgl/opengl/NV_vertex_program3.java b/src/templates/org/lwjgl/opengl/NV_vertex_program3.java
index 61342ea..4406499 100644
--- a/src/templates/org/lwjgl/opengl/NV_vertex_program3.java
+++ b/src/templates/org/lwjgl/opengl/NV_vertex_program3.java
@@ -1,41 +1,41 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface NV_vertex_program3 {
-
- /**
- * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
- * GetFloatv, and GetDoublev:
- */
- int GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB = 0x8B4C;
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface NV_vertex_program3 {
+
+ /**
+ * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, and GetDoublev:
+ */
+ int GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB = 0x8B4C;
+}
diff --git a/src/templates/org/lwjgl/opengl/SGIS_generate_mipmap.java b/src/templates/org/lwjgl/opengl/SGIS_generate_mipmap.java
index f68622b..8f5e822 100644
--- a/src/templates/org/lwjgl/opengl/SGIS_generate_mipmap.java
+++ b/src/templates/org/lwjgl/opengl/SGIS_generate_mipmap.java
@@ -1,50 +1,50 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
-public interface SGIS_generate_mipmap {
-
- /**
- * Accepted by the <pname> parameter of TexParameteri, TexParameterf,
- * TexParameteriv, TexParameterfv, GetTexParameteriv, and GetTexParameterfv.
- */
- int GL_GENERATE_MIPMAP_SGIS = 0x8191;
-
- /**
- * Accepted by the <target> parameter of Hint, and by the <pname>
- * parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.
- */
- int GL_GENERATE_MIPMAP_HINT_SGIS = 0x8192;
-
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+public interface SGIS_generate_mipmap {
+
+ /**
+ * Accepted by the <pname> parameter of TexParameteri, TexParameterf,
+ * TexParameteriv, TexParameterfv, GetTexParameteriv, and GetTexParameterfv.
+ */
+ int GL_GENERATE_MIPMAP_SGIS = 0x8191;
+
+ /**
+ * Accepted by the <target> parameter of Hint, and by the <pname>
+ * parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.
+ */
+ int GL_GENERATE_MIPMAP_HINT_SGIS = 0x8192;
+
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/SGIS_texture_lod.java b/src/templates/org/lwjgl/opengl/SGIS_texture_lod.java
index 9cd0cec..9fced68 100644
--- a/src/templates/org/lwjgl/opengl/SGIS_texture_lod.java
+++ b/src/templates/org/lwjgl/opengl/SGIS_texture_lod.java
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-import org.lwjgl.util.generator.*;
-
- at Extension(postfix = "SGIS", className = "SGISTextureLOD")
-public interface SGIS_texture_lod {
-
- /**
- * Accepted by the <pname> parameter of TexParameteri, TexParameterf,
- * TexParameteriv, TexParameterfv, GetTexParameteriv, and GetTexParameterfv.
- */
- int GL_TEXTURE_MIN_LOD_SGIS = 0x813A;
- int GL_TEXTURE_MAX_LOD_SGIS = 0x813B;
- int GL_TEXTURE_BASE_LEVEL_SGIS = 0x813C;
- int GL_TEXTURE_MAX_LEVEL_SGIS = 0x813D;
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.*;
+
+ at Extension(postfix = "SGIS", className = "SGISTextureLOD")
+public interface SGIS_texture_lod {
+
+ /**
+ * Accepted by the <pname> parameter of TexParameteri, TexParameterf,
+ * TexParameteriv, TexParameterfv, GetTexParameteriv, and GetTexParameterfv.
+ */
+ int GL_TEXTURE_MIN_LOD_SGIS = 0x813A;
+ int GL_TEXTURE_MAX_LOD_SGIS = 0x813B;
+ int GL_TEXTURE_BASE_LEVEL_SGIS = 0x813C;
+ int GL_TEXTURE_MAX_LEVEL_SGIS = 0x813D;
}
\ No newline at end of file
diff --git a/src/templates/org/lwjgl/opengl/SUN_slice_accum.java b/src/templates/org/lwjgl/opengl/SUN_slice_accum.java
index b4f9e27..5c3c003 100644
--- a/src/templates/org/lwjgl/opengl/SUN_slice_accum.java
+++ b/src/templates/org/lwjgl/opengl/SUN_slice_accum.java
@@ -1,41 +1,41 @@
-/*
- * Copyright (c) 2002-2008 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.
- */
-package org.lwjgl.opengl;
-
-public interface SUN_slice_accum {
-
- /**
- * Accepted by the <op> parameter of Accum,
- */
- int GL_SLICE_ACCUM_SUN = 0x85CC;
-
-}
+/*
+ * Copyright (c) 2002-2008 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.
+ */
+package org.lwjgl.opengl;
+
+public interface SUN_slice_accum {
+
+ /**
+ * Accepted by the <op> parameter of Accum,
+ */
+ int GL_SLICE_ACCUM_SUN = 0x85CC;
+
+}
hooks/post-receive
--
lwjgl - Lightweight Java Game Library
More information about the pkg-java-commits
mailing list