From 1e69c2ec924a2da6331bd74ddf0c66f987317028 Mon Sep 17 00:00:00 2001 From: Caspian Rychlik-Prince Date: Sun, 17 Aug 2003 16:38:57 +0000 Subject: [PATCH] Whooooops! --- src/java/org/lwjgl/Display.java | 257 +++ src/java/org/lwjgl/DisplayMode.java | 106 ++ src/java/org/lwjgl/input/Cursor.java | 132 ++ src/java/org/lwjgl/openal/AL.java | 132 ++ src/java/org/lwjgl/openal/ALC.java | 413 +++++ src/java/org/lwjgl/openal/ALCcontext.java | 73 + src/java/org/lwjgl/openal/ALCdevice.java | 55 + src/java/org/lwjgl/openal/ALConstants.java | 43 + src/java/org/lwjgl/openal/BaseAL.java | 190 ++ .../org/lwjgl/openal/BaseALConstants.java | 350 ++++ src/java/org/lwjgl/openal/CoreAL.java | 878 ++++++++++ .../org/lwjgl/openal/OpenALException.java | 76 + .../eax/BaseEAX.java} | 147 +- .../lwjgl/openal/eax/BaseEAXConstants.java | 110 ++ src/java/org/lwjgl/openal/eax/CoreEAX.java | 93 + .../EAXTest.java => openal/eax/EAX.java} | 69 +- .../lwjgl/openal/eax/EAXBufferProperties.java | 519 ++++++ .../openal/eax/EAXListenerProperties.java | 516 ++++++ src/java/org/lwjgl/opengl/CoreGL11.java | 590 +++++++ .../org/lwjgl/opengl/CoreGL11Constants.java | 1056 +++++++++++ src/java/org/lwjgl/opengl/CoreGL12.java | 233 +++ .../org/lwjgl/opengl/CoreGL12Constants.java | 156 ++ src/java/org/lwjgl/opengl/CoreGL13.java | 133 ++ .../org/lwjgl/opengl/CoreGL13Constants.java | 145 ++ src/java/org/lwjgl/opengl/CoreGL14.java | 94 + .../org/lwjgl/opengl/CoreGL14Constants.java | 83 + src/java/org/lwjgl/opengl/GL.java | 1556 +++++++++++++++++ src/java/org/lwjgl/opengl/GLCaps.java | 265 +++ src/java/org/lwjgl/opengl/GLConstants.java | 142 ++ src/java/org/lwjgl/opengl/GLU.java | 204 +++ src/java/org/lwjgl/opengl/GLUConstants.java | 59 + .../org/lwjgl/opengl/OpenGLException.java | 78 + src/java/org/lwjgl/opengl/Pbuffer.java | 168 ++ src/java/org/lwjgl/opengl/StateStack.java | 64 + src/java/org/lwjgl/opengl/Util.java | 64 + src/java/org/lwjgl/opengl/VBOTracker.java | 69 + src/java/org/lwjgl/opengl/Window.java | 2 +- src/java/org/lwjgl/opengl/arb/ARBCubeMap.java | 56 + .../org/lwjgl/opengl/arb/ARBDepthTexture.java | 49 + .../lwjgl/opengl/arb/ARBMatrixPalette.java | 54 + .../org/lwjgl/opengl/arb/ARBMultisample.java | 53 + .../org/lwjgl/opengl/arb/ARBMultitexture.java | 79 + .../lwjgl/opengl/arb/ARBPointParameters.java | 48 + src/java/org/lwjgl/opengl/arb/ARBShadow.java | 47 + .../lwjgl/opengl/arb/ARBShadowAmbient.java | 45 + .../opengl/arb/ARBTextureBorderClamp.java | 45 + .../opengl/arb/ARBTextureCompression.java | 55 + .../opengl/arb/ARBTextureEnvCombine.java | 65 + .../lwjgl/opengl/arb/ARBTextureEnvDot3.java | 47 + .../opengl/arb/ARBTextureMirroredRepeat.java | 45 + .../lwjgl/opengl/arb/ARBTransposeMatrix.java | 48 + .../org/lwjgl/opengl/arb/ARBVertexBlend.java | 86 + .../opengl/arb/ARBVertexBufferObject.java | 77 + .../lwjgl/opengl/arb/ARBVertexProgram.java | 123 ++ .../org/lwjgl/opengl/ati/ATIElementArray.java | 47 + .../lwjgl/opengl/ati/ATIEnvmapBumpmap.java | 52 + .../lwjgl/opengl/ati/ATIFragmentShader.java | 152 ++ .../org/lwjgl/opengl/ati/ATIPnTriangles.java | 53 + .../opengl/ati/ATITextureMirrorOnce.java | 46 + .../opengl/ati/ATIVertexArrayObject.java | 52 + .../lwjgl/opengl/ati/ATIVertexStreams.java | 54 + .../lwjgl/opengl/atix/ATIXPointSprites.java | 50 + .../opengl/atix/ATIXTextureEnvRoute.java | 47 + src/java/org/lwjgl/opengl/ext/EXTAbgr.java | 46 + src/java/org/lwjgl/opengl/ext/EXTBgra.java | 43 + .../org/lwjgl/opengl/ext/EXTBlendColor.java | 45 + .../org/lwjgl/opengl/ext/EXTBlendMinmax.java | 44 + .../lwjgl/opengl/ext/EXTBlendSubtract.java | 42 + .../opengl/ext/EXTCompiledVertexArray.java | 46 + .../opengl/ext/EXTDrawRangeElements.java | 46 + .../org/lwjgl/opengl/ext/EXTFogCoord.java | 53 + .../lwjgl/opengl/ext/EXTLightMaxExponent.java | 42 + .../org/lwjgl/opengl/ext/EXTPackedPixels.java | 45 + .../lwjgl/opengl/ext/EXTPalettedTexture.java | 56 + .../lwjgl/opengl/ext/EXTPointParameters.java | 48 + .../lwjgl/opengl/ext/EXTRescaleNormal.java | 42 + .../lwjgl/opengl/ext/EXTSecondaryColor.java | 51 + .../opengl/ext/EXTSeparateSpecularColor.java | 44 + .../opengl/ext/EXTSharedTexturePalette.java | 41 + .../lwjgl/opengl/ext/EXTStencilTwoSide.java | 46 + .../org/lwjgl/opengl/ext/EXTStencilWrap.java | 46 + .../opengl/ext/EXTTextureCompressionS3TC.java | 48 + .../opengl/ext/EXTTextureEnvCombine.java | 61 + .../lwjgl/opengl/ext/EXTTextureEnvDot3.java | 43 + .../ext/EXTTextureFilterAnisotropic.java | 46 + .../lwjgl/opengl/ext/EXTTextureLODBias.java | 47 + .../org/lwjgl/opengl/ext/EXTVertexArray.java | 71 + .../org/lwjgl/opengl/ext/EXTVertexShader.java | 154 ++ .../lwjgl/opengl/ext/EXTVertexWeighting.java | 57 + .../lwjgl/opengl/nv/NVCopyDepthToColor.java | 46 + .../org/lwjgl/opengl/nv/NVDepthClamp.java | 45 + .../org/lwjgl/opengl/nv/NVEvaluators.java | 68 + src/java/org/lwjgl/opengl/nv/NVFence.java | 47 + .../org/lwjgl/opengl/nv/NVFogDistance.java | 47 + .../lwjgl/opengl/nv/NVLightMaxExponent.java | 46 + .../org/lwjgl/opengl/nv/NVOcclusionQuery.java | 51 + .../lwjgl/opengl/nv/NVPackedDepthStencil.java | 46 + .../org/lwjgl/opengl/nv/NVPointSprite.java | 47 + .../lwjgl/opengl/nv/NVRegisterCombiners.java | 95 + .../lwjgl/opengl/nv/NVRegisterCombiners2.java | 45 + .../lwjgl/opengl/nv/NVTexgenReflection.java | 46 + .../lwjgl/opengl/nv/NVTextureEnvCombine4.java | 49 + .../lwjgl/opengl/nv/NVTextureRectangle.java | 48 + .../org/lwjgl/opengl/nv/NVTextureShader.java | 114 ++ .../org/lwjgl/opengl/nv/NVTextureShader2.java | 72 + .../org/lwjgl/opengl/nv/NVTextureShader3.java | 61 + .../lwjgl/opengl/nv/NVVertexArrayRange.java | 49 + .../lwjgl/opengl/nv/NVVertexArrayRange2.java | 45 + .../org/lwjgl/opengl/nv/NVVertexProgram.java | 127 ++ .../org/lwjgl/opengl/wgl/WGLBufferRegion.java | 48 + .../lwjgl/opengl/wgl/WGLMakeCurrentRead.java | 46 + .../org/lwjgl/opengl/wgl/WGLMultisample.java | 46 + src/java/org/lwjgl/opengl/wgl/WGLPBuffer.java | 52 + .../org/lwjgl/opengl/wgl/WGLPixelFormat.java | 93 + .../lwjgl/opengl/wgl/WGLRenderTexture.java | 78 + .../lwjgl/test/DisplayConfigurationTest.java | 43 - .../org/lwjgl/test/WindowCreationTest.java | 44 - .../test/input/ControllerCreationTest.java | 225 --- .../org/lwjgl/test/input/ControllerTest.java | 201 --- .../org/lwjgl/test/input/HWCursorTest.java | 357 ---- .../org/lwjgl/test/input/KeyboardTest.java | 217 --- .../lwjgl/test/input/MouseCreationTest.java | 234 --- src/java/org/lwjgl/test/input/MouseTest.java | 188 -- src/java/org/lwjgl/test/openal/ALCTest.java | 107 -- .../lwjgl/test/openal/MovingSoundTest.java | 238 --- .../lwjgl/test/openal/OpenALCreationTest.java | 223 --- src/java/org/lwjgl/test/openal/PlayTest.java | 154 -- .../org/lwjgl/test/openal/PlayTestMemory.java | 200 --- .../lwjgl/test/openal/SourceLimitTest.java | 162 -- .../org/lwjgl/test/openal/StressTest.java | 219 --- src/java/org/lwjgl/test/openal/WaveData.java | 183 -- .../test/opengl/FullScreenWindowedTest.java | 335 ---- src/java/org/lwjgl/test/opengl/Game.java | 202 --- src/java/org/lwjgl/test/opengl/Grass.java | 466 ----- .../org/lwjgl/test/opengl/PbufferTest.java | 417 ----- .../org/lwjgl/test/opengl/VBOIndexTest.java | 242 --- src/java/org/lwjgl/test/opengl/VBOTest.java | 218 --- src/java/org/lwjgl/test/opengl/cg_grass2.cg | 72 - src/java/org/lwjgl/test/opengl/cg_grass2.vp | 116 -- src/java/org/lwjgl/vector/Matrix.java | 134 ++ src/java/org/lwjgl/vector/Matrix2f.java | 393 +++++ src/java/org/lwjgl/vector/Matrix3f.java | 494 ++++++ src/java/org/lwjgl/vector/Matrix4f.java | 818 +++++++++ src/java/org/lwjgl/vector/Vector.java | 114 ++ src/java/org/lwjgl/vector/Vector2f.java | 244 +++ src/java/org/lwjgl/vector/Vector3f.java | 294 ++++ 146 files changed, 16168 insertions(+), 5191 deletions(-) create mode 100644 src/java/org/lwjgl/Display.java create mode 100644 src/java/org/lwjgl/DisplayMode.java create mode 100644 src/java/org/lwjgl/input/Cursor.java create mode 100644 src/java/org/lwjgl/openal/AL.java create mode 100644 src/java/org/lwjgl/openal/ALC.java create mode 100644 src/java/org/lwjgl/openal/ALCcontext.java create mode 100644 src/java/org/lwjgl/openal/ALCdevice.java create mode 100644 src/java/org/lwjgl/openal/ALConstants.java create mode 100644 src/java/org/lwjgl/openal/BaseAL.java create mode 100644 src/java/org/lwjgl/openal/BaseALConstants.java create mode 100644 src/java/org/lwjgl/openal/CoreAL.java create mode 100644 src/java/org/lwjgl/openal/OpenALException.java rename src/java/org/lwjgl/{test/openal/BasicTest.java => openal/eax/BaseEAX.java} (50%) create mode 100644 src/java/org/lwjgl/openal/eax/BaseEAXConstants.java create mode 100644 src/java/org/lwjgl/openal/eax/CoreEAX.java rename src/java/org/lwjgl/{test/openal/EAXTest.java => openal/eax/EAX.java} (61%) create mode 100644 src/java/org/lwjgl/openal/eax/EAXBufferProperties.java create mode 100644 src/java/org/lwjgl/openal/eax/EAXListenerProperties.java create mode 100644 src/java/org/lwjgl/opengl/CoreGL11.java create mode 100644 src/java/org/lwjgl/opengl/CoreGL11Constants.java create mode 100644 src/java/org/lwjgl/opengl/CoreGL12.java create mode 100644 src/java/org/lwjgl/opengl/CoreGL12Constants.java create mode 100644 src/java/org/lwjgl/opengl/CoreGL13.java create mode 100644 src/java/org/lwjgl/opengl/CoreGL13Constants.java create mode 100644 src/java/org/lwjgl/opengl/CoreGL14.java create mode 100644 src/java/org/lwjgl/opengl/CoreGL14Constants.java create mode 100644 src/java/org/lwjgl/opengl/GL.java create mode 100644 src/java/org/lwjgl/opengl/GLCaps.java create mode 100644 src/java/org/lwjgl/opengl/GLConstants.java create mode 100644 src/java/org/lwjgl/opengl/GLU.java create mode 100644 src/java/org/lwjgl/opengl/GLUConstants.java create mode 100644 src/java/org/lwjgl/opengl/OpenGLException.java create mode 100644 src/java/org/lwjgl/opengl/Pbuffer.java create mode 100644 src/java/org/lwjgl/opengl/StateStack.java create mode 100644 src/java/org/lwjgl/opengl/Util.java create mode 100644 src/java/org/lwjgl/opengl/VBOTracker.java create mode 100644 src/java/org/lwjgl/opengl/arb/ARBCubeMap.java create mode 100644 src/java/org/lwjgl/opengl/arb/ARBDepthTexture.java create mode 100644 src/java/org/lwjgl/opengl/arb/ARBMatrixPalette.java create mode 100644 src/java/org/lwjgl/opengl/arb/ARBMultisample.java create mode 100644 src/java/org/lwjgl/opengl/arb/ARBMultitexture.java create mode 100644 src/java/org/lwjgl/opengl/arb/ARBPointParameters.java create mode 100644 src/java/org/lwjgl/opengl/arb/ARBShadow.java create mode 100644 src/java/org/lwjgl/opengl/arb/ARBShadowAmbient.java create mode 100644 src/java/org/lwjgl/opengl/arb/ARBTextureBorderClamp.java create mode 100644 src/java/org/lwjgl/opengl/arb/ARBTextureCompression.java create mode 100644 src/java/org/lwjgl/opengl/arb/ARBTextureEnvCombine.java create mode 100644 src/java/org/lwjgl/opengl/arb/ARBTextureEnvDot3.java create mode 100644 src/java/org/lwjgl/opengl/arb/ARBTextureMirroredRepeat.java create mode 100644 src/java/org/lwjgl/opengl/arb/ARBTransposeMatrix.java create mode 100644 src/java/org/lwjgl/opengl/arb/ARBVertexBlend.java create mode 100755 src/java/org/lwjgl/opengl/arb/ARBVertexBufferObject.java create mode 100644 src/java/org/lwjgl/opengl/arb/ARBVertexProgram.java create mode 100644 src/java/org/lwjgl/opengl/ati/ATIElementArray.java create mode 100644 src/java/org/lwjgl/opengl/ati/ATIEnvmapBumpmap.java create mode 100644 src/java/org/lwjgl/opengl/ati/ATIFragmentShader.java create mode 100644 src/java/org/lwjgl/opengl/ati/ATIPnTriangles.java create mode 100644 src/java/org/lwjgl/opengl/ati/ATITextureMirrorOnce.java create mode 100644 src/java/org/lwjgl/opengl/ati/ATIVertexArrayObject.java create mode 100644 src/java/org/lwjgl/opengl/ati/ATIVertexStreams.java create mode 100644 src/java/org/lwjgl/opengl/atix/ATIXPointSprites.java create mode 100644 src/java/org/lwjgl/opengl/atix/ATIXTextureEnvRoute.java create mode 100644 src/java/org/lwjgl/opengl/ext/EXTAbgr.java create mode 100644 src/java/org/lwjgl/opengl/ext/EXTBgra.java create mode 100644 src/java/org/lwjgl/opengl/ext/EXTBlendColor.java create mode 100644 src/java/org/lwjgl/opengl/ext/EXTBlendMinmax.java create mode 100644 src/java/org/lwjgl/opengl/ext/EXTBlendSubtract.java create mode 100644 src/java/org/lwjgl/opengl/ext/EXTCompiledVertexArray.java create mode 100644 src/java/org/lwjgl/opengl/ext/EXTDrawRangeElements.java create mode 100644 src/java/org/lwjgl/opengl/ext/EXTFogCoord.java create mode 100644 src/java/org/lwjgl/opengl/ext/EXTLightMaxExponent.java create mode 100644 src/java/org/lwjgl/opengl/ext/EXTPackedPixels.java create mode 100644 src/java/org/lwjgl/opengl/ext/EXTPalettedTexture.java create mode 100644 src/java/org/lwjgl/opengl/ext/EXTPointParameters.java create mode 100644 src/java/org/lwjgl/opengl/ext/EXTRescaleNormal.java create mode 100644 src/java/org/lwjgl/opengl/ext/EXTSecondaryColor.java create mode 100644 src/java/org/lwjgl/opengl/ext/EXTSeparateSpecularColor.java create mode 100644 src/java/org/lwjgl/opengl/ext/EXTSharedTexturePalette.java create mode 100644 src/java/org/lwjgl/opengl/ext/EXTStencilTwoSide.java create mode 100644 src/java/org/lwjgl/opengl/ext/EXTStencilWrap.java create mode 100644 src/java/org/lwjgl/opengl/ext/EXTTextureCompressionS3TC.java create mode 100644 src/java/org/lwjgl/opengl/ext/EXTTextureEnvCombine.java create mode 100644 src/java/org/lwjgl/opengl/ext/EXTTextureEnvDot3.java create mode 100644 src/java/org/lwjgl/opengl/ext/EXTTextureFilterAnisotropic.java create mode 100644 src/java/org/lwjgl/opengl/ext/EXTTextureLODBias.java create mode 100644 src/java/org/lwjgl/opengl/ext/EXTVertexArray.java create mode 100644 src/java/org/lwjgl/opengl/ext/EXTVertexShader.java create mode 100644 src/java/org/lwjgl/opengl/ext/EXTVertexWeighting.java create mode 100644 src/java/org/lwjgl/opengl/nv/NVCopyDepthToColor.java create mode 100644 src/java/org/lwjgl/opengl/nv/NVDepthClamp.java create mode 100644 src/java/org/lwjgl/opengl/nv/NVEvaluators.java create mode 100644 src/java/org/lwjgl/opengl/nv/NVFence.java create mode 100644 src/java/org/lwjgl/opengl/nv/NVFogDistance.java create mode 100644 src/java/org/lwjgl/opengl/nv/NVLightMaxExponent.java create mode 100644 src/java/org/lwjgl/opengl/nv/NVOcclusionQuery.java create mode 100644 src/java/org/lwjgl/opengl/nv/NVPackedDepthStencil.java create mode 100644 src/java/org/lwjgl/opengl/nv/NVPointSprite.java create mode 100644 src/java/org/lwjgl/opengl/nv/NVRegisterCombiners.java create mode 100644 src/java/org/lwjgl/opengl/nv/NVRegisterCombiners2.java create mode 100644 src/java/org/lwjgl/opengl/nv/NVTexgenReflection.java create mode 100644 src/java/org/lwjgl/opengl/nv/NVTextureEnvCombine4.java create mode 100644 src/java/org/lwjgl/opengl/nv/NVTextureRectangle.java create mode 100644 src/java/org/lwjgl/opengl/nv/NVTextureShader.java create mode 100644 src/java/org/lwjgl/opengl/nv/NVTextureShader2.java create mode 100644 src/java/org/lwjgl/opengl/nv/NVTextureShader3.java create mode 100644 src/java/org/lwjgl/opengl/nv/NVVertexArrayRange.java create mode 100644 src/java/org/lwjgl/opengl/nv/NVVertexArrayRange2.java create mode 100644 src/java/org/lwjgl/opengl/nv/NVVertexProgram.java create mode 100644 src/java/org/lwjgl/opengl/wgl/WGLBufferRegion.java create mode 100644 src/java/org/lwjgl/opengl/wgl/WGLMakeCurrentRead.java create mode 100644 src/java/org/lwjgl/opengl/wgl/WGLMultisample.java create mode 100644 src/java/org/lwjgl/opengl/wgl/WGLPBuffer.java create mode 100644 src/java/org/lwjgl/opengl/wgl/WGLPixelFormat.java create mode 100644 src/java/org/lwjgl/opengl/wgl/WGLRenderTexture.java delete mode 100644 src/java/org/lwjgl/test/DisplayConfigurationTest.java delete mode 100644 src/java/org/lwjgl/test/WindowCreationTest.java delete mode 100644 src/java/org/lwjgl/test/input/ControllerCreationTest.java delete mode 100644 src/java/org/lwjgl/test/input/ControllerTest.java delete mode 100644 src/java/org/lwjgl/test/input/HWCursorTest.java delete mode 100644 src/java/org/lwjgl/test/input/KeyboardTest.java delete mode 100644 src/java/org/lwjgl/test/input/MouseCreationTest.java delete mode 100644 src/java/org/lwjgl/test/input/MouseTest.java delete mode 100644 src/java/org/lwjgl/test/openal/ALCTest.java delete mode 100644 src/java/org/lwjgl/test/openal/MovingSoundTest.java delete mode 100644 src/java/org/lwjgl/test/openal/OpenALCreationTest.java delete mode 100644 src/java/org/lwjgl/test/openal/PlayTest.java delete mode 100644 src/java/org/lwjgl/test/openal/PlayTestMemory.java delete mode 100644 src/java/org/lwjgl/test/openal/SourceLimitTest.java delete mode 100644 src/java/org/lwjgl/test/openal/StressTest.java delete mode 100644 src/java/org/lwjgl/test/openal/WaveData.java delete mode 100644 src/java/org/lwjgl/test/opengl/FullScreenWindowedTest.java delete mode 100644 src/java/org/lwjgl/test/opengl/Game.java delete mode 100644 src/java/org/lwjgl/test/opengl/Grass.java delete mode 100644 src/java/org/lwjgl/test/opengl/PbufferTest.java delete mode 100644 src/java/org/lwjgl/test/opengl/VBOIndexTest.java delete mode 100644 src/java/org/lwjgl/test/opengl/VBOTest.java delete mode 100644 src/java/org/lwjgl/test/opengl/cg_grass2.cg delete mode 100644 src/java/org/lwjgl/test/opengl/cg_grass2.vp create mode 100644 src/java/org/lwjgl/vector/Matrix.java create mode 100644 src/java/org/lwjgl/vector/Matrix2f.java create mode 100644 src/java/org/lwjgl/vector/Matrix3f.java create mode 100644 src/java/org/lwjgl/vector/Matrix4f.java create mode 100644 src/java/org/lwjgl/vector/Vector.java create mode 100644 src/java/org/lwjgl/vector/Vector2f.java create mode 100644 src/java/org/lwjgl/vector/Vector3f.java diff --git a/src/java/org/lwjgl/Display.java b/src/java/org/lwjgl/Display.java new file mode 100644 index 00000000..39ade6a5 --- /dev/null +++ b/src/java/org/lwjgl/Display.java @@ -0,0 +1,257 @@ +/* + * Copyright (c) 2002 Light Weight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ + +package org.lwjgl; + +import java.util.HashSet; +import java.util.Arrays; +import java.nio.ByteBuffer; +import java.nio.FloatBuffer; +import java.nio.ByteOrder; + +/** + * $Id$ + * + * Encapsulates everything you need for game display. + * It must be created before any input devices are created. + * The game display has NO mouse cursor or any other window decorations. + * + * @author cix_foo + * @version $Revision$ + */ + +public final class Display { + + /** Has the display been created? */ + private static boolean created; + + /** The current display mode, if created */ + private static DisplayMode mode; + + /** A pointer to the native display window. On Windows this will be an hWnd. */ + private static int handle; + + /** Whether or not the display has been requested to shutdown by the user */ + private static boolean closeRequested = false; + + /* + * Platforms. This will let you determine which platform you are running + * on, which is handy to know for some GL context calls. + */ + + /** Windows platform */ + public static final int PLATFORM_WGL = 0; + + /** GLX (Linux/Unix) platform */ + public static final int PLATFORM_GLX = 1; + + /** MacOSX platform */ + public static final int PLATFORM_AGL = 2; + + static { + System.loadLibrary(Sys.getLibraryName()); + init(); + } + + /** + * No construction allowed. + */ + private Display() { + super(); + } + + /** + * Initialize. This determines, natively, the current display mode and stashes + * it back in the mode static member. + */ + private static native void init(); + + /** + * Returns the entire list of display modes as an array, in no + * particular order. Any given mode is not guaranteed to be available and + * 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). + * + * @return an array of all display modes the system reckons it can handle. + */ + public static DisplayMode[] getAvailableDisplayModes() { + DisplayMode[] unfilteredModes = nGetAvailableDisplayModes(); + + 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); + + if (Sys.DEBUG) { + System.out.println("Removed " + (unfilteredModes.length - filteredModes.length) + " duplicate displaymodes"); + } + + return filteredModes; + } + + /** + * Native method for getting displaymodes + */ + private static native DisplayMode[] nGetAvailableDisplayModes(); + + /** + * Set the current display mode. The underlying OS may not use an exact match for + * the specified display mode. After successfully calling setDisplayMode() you will + * still need to query the display's characteristics using getDisplayMode(). + * + * @param mode The new display mode to set + * @throws Exception if the display mode could not be set + */ + public static native void setDisplayMode(DisplayMode mode) throws Exception; + + /** + * Reset the display mode to whatever it was when LWJGL was initialized. + * Fails silently. + */ + public static native void resetDisplayMode(); + + /** + * Retrieves the width of the created display + * + * @return the current display width. + */ + public static int getWidth() { + return mode.width; + } + + /** + * Retrieves the height of the created display + * + * @return the current display height. + */ + public static int getHeight() { + return mode.height; + } + + /** + * Retrieves the current display depth of the created display + * + * @return the current display depth. + */ + public static int getDepth() { + return mode.bpp; + } + + /** + * Retrieves the current display frequency of the created display + * + * @return the current display frequency. + */ + public static int getFrequency() { + return mode.freq; + } + + /** + * Retrieves the native handle to the created window. The meaning of this value + * is platform specific. Under Win32, it is an HWND. + * + * @return the native handle + * @throws AssertionError if the display has not been created yet. + */ + public static int getHandle() { + assert created : "The display has not been created yet."; + return handle; + } + + /** + * Returns the operating system windowing platform. This will be one of the + * constants defined above. There is no "unknown" platform; a native library port + * has to provide a unique platform number for this mechanism to work. If the LWJGL + * is ported to, say, QNX, we will have a PLATFORM_QNX at the ready. + * + * @return the windowing system + */ + public static native int getPlatform(); + + /** + * Set the display configuration to the specified gamma, brightness and contrast. + * The configuration changes will be reset when resetDisplayMode 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. + * @return true if the call succeeded, false otherwise + */ + public static boolean setDisplayConfiguration(float gamma, float brightness, float contrast) { + assert brightness >= -1.0f && brightness <= 1.0f; + assert contrast >= 0.0f; + int rampSize = getGammaRampLength(); + if (rampSize == 0) + return false; + FloatBuffer gammaRamp = ByteBuffer.allocateDirect(rampSize*4).order(ByteOrder.nativeOrder()).asFloatBuffer(); + 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); + } + if (!setGammaRamp(gammaRamp)) + return false; + if (Sys.DEBUG) { + System.out.println("Gamma set, gamma = " + gamma + ", brightness = " + brightness + ", contrast = " + contrast); + } + return true; + } + + /** + * 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. + */ + private static native int getGammaRampLength(); + + /** + * Native method to set the gamma ramp. + */ + private static native boolean setGammaRamp(FloatBuffer gammaRamp); +} diff --git a/src/java/org/lwjgl/DisplayMode.java b/src/java/org/lwjgl/DisplayMode.java new file mode 100644 index 00000000..4051c1a6 --- /dev/null +++ b/src/java/org/lwjgl/DisplayMode.java @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2002 Light Weight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ + +package org.lwjgl; + +/** + * $Id$ + * + * This class encapsulates the properties for a given display mode. + * This class is not instantiable, and is aquired from the Display. + * getAvailableDisplayModes() method. + * + * @author cix_foo + * @version $Revision$ + */ + +public final class DisplayMode { + + /** properties of the display mode */ + public final int width, height, bpp, freq; + + /** + * Construct a display mode. + * + * @see Display + */ + private DisplayMode(int width, int height, int bpp, int freq) { + this.width = width; + this.height = height; + this.bpp = bpp; + this.freq = freq; + } + + /** + * Tests for DisplayMode 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 == dm.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 DisplayMode + * + * @see java.lang.Object#toString() + */ + public String toString() { + StringBuffer sb = new StringBuffer(); + 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/input/Cursor.java b/src/java/org/lwjgl/input/Cursor.java new file mode 100644 index 00000000..cd9467ed --- /dev/null +++ b/src/java/org/lwjgl/input/Cursor.java @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ + +package org.lwjgl.input; + +import org.lwjgl.Sys; + +import java.nio.IntBuffer; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; + +/** + * $Id$ + * + * A class representing a native cursor. Instances of this + * class can be used with Mouse.setCursor(), if available. + * + * @author elias_naur + * @version $Revision$ + */ + +public class Cursor { + + static { + System.loadLibrary(Sys.getLibraryName()); + } + + /** + * The native handle to the cursor + */ + private final int nativeHandle; + + /** + * 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 Exception 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 Exception { + assert Mouse.isCreated(); + assert width*height*numImages <= images.remaining(): "width*height*numImages > images.remaining()"; + assert delays == null || numImages <= delays.remaining(): "delays != null && numImages > delays.remaining()"; + assert xHotspot <= width && xHotspot >= 0: "xHotspot > width || xHotspot < 0"; + assert yHotspot <= height && yHotspot >= 0: "yHotspot > height || yHotspot < 0"; + IntBuffer images_copy = ByteBuffer.allocateDirect(images.remaining()*4).order(ByteOrder.nativeOrder()).asIntBuffer(); + flipImages(width, height, numImages, images, images_copy); + nativeHandle = nCreateCursor(width, height, xHotspot, height - yHotspot, numImages, images_copy, 0, delays, delays != null ? delays.position() : 0); + } + + 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); + } + } + + 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); + } + } + } + + /** + * Destroy the native cursor. Cursor must not be current. + */ + public void destroy() { + nDestroyCursor(nativeHandle); + } + + /** + * Gets the native handle associated with the cursor object. + */ + public int getHandle() { + return nativeHandle; + } + + /** + * Native method to create a native cursor + */ + private static native int nCreateCursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, int images_offset, IntBuffer delays, int delays_offset); + + /** + * Native method to destroy a native cursor + */ + private static native void nDestroyCursor(int handle); +} diff --git a/src/java/org/lwjgl/openal/AL.java b/src/java/org/lwjgl/openal/AL.java new file mode 100644 index 00000000..1286105f --- /dev/null +++ b/src/java/org/lwjgl/openal/AL.java @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'Lightweight 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. + */ +package org.lwjgl.openal; + +/** + * $Id$ + *
+ * This is the OpenAL class. It extends the latest core. + * + * @author Brian Matzon + * @version $Revision$ + */ +public abstract class AL extends CoreAL { + + /** ALC instance. */ + protected static ALC alc; + + /** ALCdevice instance. */ + protected static ALCdevice device; + + /** Current ALCcontext. */ + protected static ALCcontext context; + + /** + * String that requests a certain device or device configuration. + * If null is specified, the implementation will provide an + * implementation specific default. */ + protected static String deviceArguments; + + /** Frequency for mixing output buffer, in units of Hz. */ + protected static int contextFrequency = -1; + + /** Refresh intervalls, in units of Hz. */ + protected static int contextRefresh = -1; + + /** Flag, indicating a synchronous context. */ + protected static int contextSynchronized = ALC.ALC_FALSE; + + /** + * 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 OpenALException { + AL.deviceArguments = deviceArguments; + AL.contextFrequency = contextFrequency; + AL.contextRefresh = contextRefresh; + AL.contextSynchronized = contextSynchronized ? ALC.ALC_TRUE : ALC.ALC_FALSE; + + create(); + } + + /** + * Creates an OpenAL instance. The empty create will cause OpenAL to + * open the default device, and create a context using default values. + */ + public static void create() throws OpenALException { + BaseAL.create(); + + ALC.create(); + + device = ALC.alcOpenDevice(deviceArguments); + + //check if doing default values or not + if (contextFrequency == -1) { + context = ALC.alcCreateContext(device.device, null); + } else { + context = + ALC.alcCreateContext( + device.device, + ALCcontext.createAttributeList(contextFrequency, contextRefresh, contextSynchronized)); + } + + ALC.alcMakeContextCurrent(context.context); + + } + + /** + * Exit cleanly by calling destroy. + */ + public static void destroy() { + ALC.alcDestroyContext(context.context); + ALC.alcCloseDevice(device.device); + ALC.destroy(); + + device = null; + context = null; + + deviceArguments = null; + + contextFrequency = -1; + contextRefresh = -1; + contextSynchronized = ALC.ALC_FALSE; + + BaseAL.destroy(); + } +} \ No newline at end of file diff --git a/src/java/org/lwjgl/openal/ALC.java b/src/java/org/lwjgl/openal/ALC.java new file mode 100644 index 00000000..d9e66e84 --- /dev/null +++ b/src/java/org/lwjgl/openal/ALC.java @@ -0,0 +1,413 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'Lightweight 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. + */ +package org.lwjgl.openal; + +import java.nio.Buffer; +import java.nio.IntBuffer; + +/** + * $Id$ + * + *

+ * This is the context class for OpenAL. This class implements functions + * in alc.h + *

+ * + *

+ * 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). + *

+ * + *

+ * NOTE:
+ * The LWJGL implementation of OpenAL does not expose the device, nor the context. + * Whenever AL is created using the create method, an underlying + * device and context is created. Thus more advanced usage of multiple contexts and/or devices + * are not possible. The above mentioned features are very rarely used in games. + *

+ * + * @author Brian Matzon + * @version $Revision$ + */ +public class ALC { + /** Has the ALC object been created? */ + protected static boolean created; + + /** Bad value */ + public static final int ALC_INVALID = -1; + + /** 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 { + initialize(); + } + + /** Creates a new instance of ALC */ + protected ALC() { + } + + /** + * Override to provide any initialization code after creation. + */ + protected static void init() { + } + + /** + * Static initialization + */ + private static void initialize() { + System.loadLibrary(org.lwjgl.Sys.getLibraryName()); + } + + /** + * Creates the ALC instance + * + * @throws Exception if a failiure occured in the ALC creation process + */ + protected static void create() throws OpenALException { + if (created) { + return; + } + + if (!nCreate()) { + throw new OpenALException("ALC instance could not be created."); + } + init(); + created = true; + } + + /** + * Native method to create ALC instance + * + * @return true if the ALC creation process succeeded + */ + protected static native boolean nCreate(); + + /** + * Calls whatever destruction rutines that are needed + */ + protected static void destroy() { + if (!created) { + return; + } + created = false; + nDestroy(); + } + + /** + * Native method the destroy the ALC + */ + protected static native void nDestroy(); + + /** + * The application can obtain certain strings from ALC. + * + * ALC_DEFAULT_DEVICE_SPECIFIER - The specifer string for the default device + * ALC_DEVICE_SPECIFIER - The specifer string for the device + * ALC_EXTENSIONS - The extensions string for diagnostics and printing. + * + * In addition, printable error message strings are provided for all valid error tokens, + * including ALC_NO_ERROR,ALC_INVALID_DEVICE, ALC_INVALID_CONTEXT, + * ALC_INVALID_ENUM, ALC_INVALID_VALUE. + * + * @param pname Property to get + * @return String property from device + */ + public static String alcGetString(int pname) { + return nalcGetString(AL.device.device, pname); + } + + native static String nalcGetString(int device, int pname); + + /** + * The application can query ALC for information using an integer query function. + * For some tokens, null is a legal deviceHandle. In other cases, specifying a null + * device will generate an ALC_INVALID_DEVICE error. The application has to + * specify the size of the destination buffer provided. A null destination or a zero + * size parameter will cause ALC to ignore the query. + * + * ALC_MAJOR_VERSION - Major version query. + * ALC_MINOR_VERSION - Minor version query. + * ALC_ATTRIBUTES_SIZE - The size required for the zero-terminated attributes list, + * for the current context. null is an invalid device. null (no current context + * for the specified device) is legal. + * ALC_ALL_ATTRIBUTES - Expects a destination of ALC_CURRENT_ATTRIBUTES_SIZE, + * and provides the attribute list for the current context of the specified device. + * null is an invalid device. null (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(int pname, IntBuffer integerdata) { + nalcGetIntegerv(AL.device.device, pname, integerdata.remaining(), integerdata, integerdata.position()); + } + + native static void nalcGetIntegerv(int device, int pname, int size, Buffer integerdata, int offset); + + /** + * The alcOpenDevice function allows the application (i.e. the client program) to + * connect to a device (i.e. the server). + * + * If the function returns null, then no sound driver/device has been found. The + * argument is a null terminated string that requests a certain device or device + * configuration. If null is specified, the implementation will provide an + * implementation specific default. + * + * @param devicename name of device to open + * @return opened device, or null + */ + native static ALCdevice alcOpenDevice(String devicename); + + /** + * The alcCloseDevice function allows the application (i.e. the client program) to + * disconnect from a device (i.e. the server). + * + * If deviceHandle is null or invalid, an ALC_INVALID_DEVICE error will be + * generated. Once closed, a deviceHandle is invalid. + * + * @param device address of native device to close + */ + native static void alcCloseDevice(int device); + + /** + * A context is created using alcCreateContext. The device parameter has to be a valid + * device. The attribute list can be null, 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 + */ + native static ALCcontext alcCreateContext(int device, IntBuffer attrList); + + /** + * To make a Context current with respect to AL Operation (state changes by issueing + * commands), alcMakeContextCurrent is used. The context parameter can be null + * 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 + */ + native static boolean alcMakeContextCurrent(int 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 alcProcessContext. + * + * Repeated calls to alcProcessContext 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() { + nalcProcessContext(AL.context.context); + } + + native static void nalcProcessContext(int context); + + /** + * The application can query for, and obtain an handle to, the current context for the + * application. If there is no current context, null is returned. + * + * @return Current ALCcontext + */ + native static ALCcontext alcGetCurrentContext(); + + /** + * 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 + * @param ALCdevice associated with context + */ + native static ALCdevice alcGetContextsDevice(int 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 alcSuspendContext. + * + * Repeated calls to alcSuspendContext are legal, and do not affect a context that is + * already marked as suspended. The default state of a context created by + * alcCreateContext is that it is marked as suspended. + * + * @param context address of context to suspend + */ + native static void alcSuspendContext(int context); + + /** + * The correct way to destroy a context is to first release it using alcMakeCurrent and + * null. Applications should not attempt to destroy a current context. + * + * @param context address of context to Destroy + */ + native static void alcDestroyContext(int 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 alcGetError 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. + * ALC_INVALID_DEVICE - The Context argument does not name a valid context. + * ALC_INVALID_CONTEXT - The Context argument does not name a valid context. + * ALC_INVALID_ENUM - A token used is not valid, or not applicable. + * ALC_INVALID_VALUE - An value (e.g. attribute) is not valid, or not applicable. + * + * @return Errorcode from ALC statemachine + */ + public static int alcGetError() { + return nalcGetError(AL.device.device); + } + + native static int nalcGetError(int device); + + /** + * Verify that a given extension is available for the current context and the device it + * is associated with. + * A null name argument returns ALC_FALSE, 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(String extName) { + return nalcIsExtensionPresent(AL.device.device, extName); + } + + native static boolean nalcIsExtensionPresent(int 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 null name parameter will cause an ALC_INVALID_VALUE error. + * + * @param enumName name of enum to find + * @return value of enumeration + */ + public static int alcGetEnumValue(String enumName) { + return nalcGetEnumValue(AL.device.device, enumName); + } + + native static int nalcGetEnumValue(int device, String enumName); +} \ No newline at end of file diff --git a/src/java/org/lwjgl/openal/ALCcontext.java b/src/java/org/lwjgl/openal/ALCcontext.java new file mode 100644 index 00000000..d7782539 --- /dev/null +++ b/src/java/org/lwjgl/openal/ALCcontext.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'Lightweight 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. + */ +package org.lwjgl.openal; + +import java.nio.*; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; + +/** + * $Id$ + *
+ * Wrapper class, to make ALC contexts behave like the orginal api. + * + * @author Brian Matzon + * @version $Revision$ + */ +final class ALCcontext { + + /** address of actual context */ + final int context; + + /** + * Creates a new instance of ALCcontext + * + * @param context address of actual context + */ + ALCcontext(int context) { + this.context = context; + } + + static IntBuffer createAttributeList(int contextFrequency, int contextRefresh, int contextSynchronized) { + IntBuffer attribList = ByteBuffer.allocateDirect(7*4).order(ByteOrder.nativeOrder()).asIntBuffer(); + + attribList.put(ALC.ALC_FREQUENCY); + attribList.put(contextFrequency); + attribList.put(ALC.ALC_REFRESH); + attribList.put(contextRefresh); + attribList.put(ALC.ALC_SYNC); + attribList.put(contextSynchronized); + attribList.put(0); //terminating int + + return attribList; + } +} \ No newline at end of file diff --git a/src/java/org/lwjgl/openal/ALCdevice.java b/src/java/org/lwjgl/openal/ALCdevice.java new file mode 100644 index 00000000..a74e3338 --- /dev/null +++ b/src/java/org/lwjgl/openal/ALCdevice.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'Lightweight 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. + */ +package org.lwjgl.openal; + +/** + * $Id$ + *
+ * Wrapper class, to make ALC devices behave like the orginal api. + * + * @author Brian Matzon + * @version $Revision$ + */ +final class ALCdevice { + + /** address of actual device */ + final int device; + + /** + * Creates a new instance of ALCdevice + * + * @param device address of actual device + */ + ALCdevice(int device) { + this.device = device; + } +} \ No newline at end of file diff --git a/src/java/org/lwjgl/openal/ALConstants.java b/src/java/org/lwjgl/openal/ALConstants.java new file mode 100644 index 00000000..75ca670c --- /dev/null +++ b/src/java/org/lwjgl/openal/ALConstants.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +package org.lwjgl.openal; + +/** + * $Id$ + *
+ * This class contains all OpenAL constants, including extensions. + * + * @author Brian Matzon + * @version $Revision$ + */ +public interface ALConstants extends BaseALConstants { +} \ No newline at end of file diff --git a/src/java/org/lwjgl/openal/BaseAL.java b/src/java/org/lwjgl/openal/BaseAL.java new file mode 100644 index 00000000..641c3c46 --- /dev/null +++ b/src/java/org/lwjgl/openal/BaseAL.java @@ -0,0 +1,190 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +package org.lwjgl.openal; + +import java.io.File; +import java.util.StringTokenizer; +import java.lang.reflect.Method; + +import org.lwjgl.Sys; + +/** + * $Id$ + *
+ * The base AL functionality (no actual AL methods). + * + * This has been provided as a base class that we can use for either the + * full AL 1.0 specification or as a cut-down OpenAL embedded spec. (aka + * a mini-driver). + * + * @author Brian Matzon + * @version $Revision$ + */ +public abstract class BaseAL { + /** Have we been created? */ + protected static boolean created; + + static { + initialize(); + } + + /** + * Override to provide any initialization code after creation. + */ + protected static void init() throws OpenALException { + } + + /** + * Static initialization + */ + private static void initialize() { + System.loadLibrary(org.lwjgl.Sys.getLibraryName()); + } + + /** + * Creates the AL instance + * + * @throws Exception if a failiure occured in the AL creation process + */ + public static void create() throws OpenALException { + if (created) { + return; + } + + // need to pass path of possible locations of OAL to native side + String libpath = System.getProperty("java.library.path"); + String seperator = System.getProperty("path.separator"); + String libname; + + // libname is hardcoded atm - this will change in a near future... + libname = + (System.getProperty("os.name").toLowerCase().indexOf("windows") == -1) + ? "libopenal.so" + : "lwjglaudio.dll"; + + // try to get path from JWS (if possible) + String jwsLibname = + (System.getProperty("os.name").toLowerCase().indexOf("windows") == -1) + ? "openal" + : "lwjglaudio"; + + String jwsPath = getPathFromJWS(jwsLibname); + if (jwsPath != null) { + libpath += seperator + + jwsPath.substring(0, jwsPath.lastIndexOf(File.separator)); + } + + StringTokenizer st = new StringTokenizer(libpath, seperator); + + //create needed string array + String[] oalPaths = new String[st.countTokens() + 1]; + + //build paths + for (int i = 0; i < oalPaths.length - 1; i++) { + oalPaths[i] = st.nextToken() + File.separator + libname; + } + + //add cwd path + oalPaths[oalPaths.length - 1] = libname; + if (!nCreate(oalPaths)) { + throw new OpenALException("AL instance could not be created."); + } + + init(); + created = true; + } + + /** + * Tries to locate OpenAL from the JWS Library path + * This method exists because OpenAL is loaded from native code, and as such + * is exempt from JWS library loading rutines. OpenAL therefore always fails. + * We therefore invoke the protected method of the JWS classloader to see if it can + * locate it. + * + * @param libname Name of library to search for + * @return Absolute path to library if found, otherwise null + */ + private static String getPathFromJWS(String libname) { + try { + + if(Sys.DEBUG) { + System.out.println("JWS Classloader looking for: " + libname); + } + + Object o = BaseAL.class.getClassLoader(); + Class c = o.getClass(); + Method findLibrary = + c.getMethod("findLibrary", new Class[] { String.class }); + Object[] arguments = new Object[] { libname }; + return (String) findLibrary.invoke(o, arguments); + + } catch (Exception e) { + if(Sys.DEBUG) { + System.out.println("Failure locating OpenAL using classloader:"); + e.printStackTrace(); + } + } + return null; + } + + /** + * Native method to create AL instance + * + * @param oalPaths Array of strings containing paths to search for OpenAL library + * @return true if the AL creation process succeeded + */ + protected static native boolean nCreate(String[] oalPaths); + + /** + * Calls whatever destruction rutines that are needed + */ + public static void destroy() { + if (!created) { + return; + } + created = false; + nDestroy(); + } + + /** + * Native method the destroy the AL + */ + protected static native void nDestroy(); + + + /** + * @return true if AL has been created + */ + public static boolean isCreated() { + return created; + } +} diff --git a/src/java/org/lwjgl/openal/BaseALConstants.java b/src/java/org/lwjgl/openal/BaseALConstants.java new file mode 100644 index 00000000..5175ffaf --- /dev/null +++ b/src/java/org/lwjgl/openal/BaseALConstants.java @@ -0,0 +1,350 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +package org.lwjgl.openal; + +/** + * $Id$ + *
+ * This class implements all basic OpenAL constants. + * + * @author Brian Matzon + * @version $Revision$ + */ +public interface BaseALConstants { + + /** Bad value */ + public static final int AL_INVALID = -1; + + /** Disable value */ + public static final int AL_NONE = 0; + + /** Boolean False */ + public static final int AL_FALSE = 0; + + /** Boolean True */ + public static final int AL_TRUE = 1; + + /** + * Indicate the type of SOURCE. + * Sources can be spatialized + */ + public static final int AL_SOURCE_TYPE = 0x200; + + /** Indicate source has absolute coordinates */ + public static final int AL_SOURCE_ABSOLUTE = 0x201; + + /** Indicate Source has listener relative coordinates */ + public static final int AL_SOURCE_RELATIVE = 0x202; + + /** + * Directional source, inner cone angle, in degrees + * Range: [0-360] + * Default: 360 + */ + public static final int AL_CONE_INNER_ANGLE = 0x1001; + + /** + * Directional source, outer cone angle, in degrees. + * Range: [0-360] + * Default: 360 + */ + public static final 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 + */ + public static final 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. + */ + public static final int AL_POSITION = 0x1004; + + /** Specify the current direction as forward vector. */ + public static final int AL_DIRECTION = 0x1005; + + /** Specify the current velocity in three dimensional space. */ + public static final int AL_VELOCITY = 0x1006; + + /** + * Indicate whether source has to loop infinite. + * Type: ALboolean + * Range: [TRUE, FALSE] + * Default: FALSE + */ + public static final int AL_LOOPING = 0x1007; + + /** + * Indicate the buffer to provide sound samples. + * Type: ALuint. + * Range: any valid Buffer id. + */ + public static final 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. + */ + public static final int AL_GAIN = 0x100A; + + /** + * Indicate minimum source attenuation. + * Type: ALfloat + * Range: [0.0 - 1.0] + */ + public static final int AL_MIN_GAIN = 0x100D; + + /** + * Indicate maximum source attenuation. + * Type: ALfloat + * Range: [0.0 - 1.0] + */ + public static final int AL_MAX_GAIN = 0x100E; + + /** + * Specify the current orientation. + * Type: ALfv6 (at/up) + * Range: N/A + */ + public static final 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 + */ + public static final int AL_REFERENCE_DISTANCE = 0x1020; + + /** + * Indicate the rolloff factor for the source. + * Type: ALfloat + * Range: [0.0 - ] + * Default: 1.0 + */ + public static final 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. + */ + public static final int AL_CONE_OUTER_GAIN = 0x1022; + + /** + * Specify the maximum distance. + * Type: ALfloat + * Range: [0.0 - ] + */ + public static final int AL_MAX_DISTANCE = 0x1023; + + /** + * Specify the channel mask. (Creative) + * Type: ALuint + * Range: [0 - 255] + */ + public static final int AL_CHANNEL_MASK = 0x3000; + + /** Source state information */ + public static final int AL_SOURCE_STATE = 0x1010; + + /** Source state information */ + public static final int AL_INITIAL = 0x1011; + + /** Source state information */ + public static final int AL_PLAYING = 0x1012; + + /** Source state information */ + public static final int AL_PAUSED = 0x1013; + + /** Source state information */ + public static final int AL_STOPPED = 0x1014; + + /** Buffer Queue params */ + public static final int AL_BUFFERS_QUEUED = 0x1015; + + /** Buffer Queue params */ + public static final int AL_BUFFERS_PROCESSED = 0x1016; + + /** Sound buffers: format specifier. */ + public static final int AL_FORMAT_MONO8 = 0x1100; + + /** Sound buffers: format specifier. */ + public static final int AL_FORMAT_MONO16 = 0x1101; + + /** Sound buffers: format specifier. */ + public static final int AL_FORMAT_STEREO8 = 0x1102; + + /** Sound buffers: format specifier. */ + public static final int AL_FORMAT_STEREO16 = 0x1103; + + /** + * 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. + */ + public static final 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. + */ + public static final 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. + */ + public static final 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. + */ + public static final 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. + */ + public static final int AL_DATA = 0x2005; + + /** + * Buffer state. + * + * Not supported for public use (yet). + */ + public static final int AL_UNUSED = 0x2010; + + /** + * Buffer state. + * + * Not supported for public use (yet). + */ + public static final int AL_PENDING = 0x2011; + + /** + * Buffer state. + * + * Not supported for public use (yet). + */ + public static final int AL_PROCESSED = 0x2012; + + /** Errors: No Error. */ + public static final int AL_NO_ERROR = AL_FALSE; + + /** Illegal name passed as an argument to an AL call. */ + public static final int AL_INVALID_NAME = 0xA001; + + /** Illegal enum passed as an argument to an AL call. */ + public static final int AL_INVALID_ENUM = 0xA002; + + /** + * Illegal value passed as an argument to an AL call. + * Applies to parameter values, but not to enumerations. + */ + public static final 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. + */ + public static final int AL_INVALID_OPERATION = 0xA004; + + /** + * A function could not be completed, + * because there is not enough memory available. + */ + public static final int AL_OUT_OF_MEMORY = 0xA005; + + /** Context strings: Vendor */ + public static final int AL_VENDOR = 0xB001; + + /** Context strings: Version */ + public static final int AL_VERSION = 0xB002; + + /** Context strings: Renderer */ + public static final int AL_RENDERER = 0xB003; + + /** Context strings: Extensions */ + public static final int AL_EXTENSIONS = 0xB004; + + /** Doppler scale. Default 1.0 */ + public static final int AL_DOPPLER_FACTOR = 0xC000; + + /** Doppler velocity. Default 1.0 */ + public static final int AL_DOPPLER_VELOCITY = 0xC001; + + /** Distance model. Default INVERSE_DISTANCE_CLAMPED */ + public static final int AL_DISTANCE_MODEL = 0xD000; + + /** Distance model */ + public static final int AL_INVERSE_DISTANCE = 0xD001; + + /** Distance model */ + public static final int AL_INVERSE_DISTANCE_CLAMPED = 0xD002; +} \ No newline at end of file diff --git a/src/java/org/lwjgl/openal/CoreAL.java b/src/java/org/lwjgl/openal/CoreAL.java new file mode 100644 index 00000000..38817da3 --- /dev/null +++ b/src/java/org/lwjgl/openal/CoreAL.java @@ -0,0 +1,878 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +package org.lwjgl.openal; + +import java.nio.ByteBuffer; +import java.nio.IntBuffer; +import java.nio.FloatBuffer; +/** + * $Id$ + *
+ * This is the core OpenAL class. This class implements + * AL.h version 1.0 + * + * @author Brian Matzon + * @version $Revision$ + */ +public abstract class CoreAL extends BaseAL implements BaseALConstants { + + /** + * 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 + */ + public static native 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 + */ + public static native void alDisable(int capability); + + /** + * The application can also query whether a given capability is currently enabled or + * not. + *

+ * If the token used to specify target is not legal, an AL_INVALID_ENUM error will be + * generated. + *

+ *

+ * At this time, this mechanism is not used. There are no valid targets. + *

+ * + * @param capability name of a capability to check + * @return true if named feature is enabled + */ + public static native boolean alIsEnabled(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 + */ + public static native void alHint(int target, 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. + *

+ * null 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. + *

+ * + * @return boolean state described by pname will be returned. + */ + public static native boolean alGetBoolean(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. + *

+ * null 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. + *

+ * + * @return int state described by pname will be returned. + */ + public static native int alGetInteger(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. + *

+ * null 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. + *

+ * + * @return float state described by pname will be returned. + */ + public static native float alGetFloat(int pname); + + private static native void nalGetBooleanv(int pname, ByteBuffer data, int offset); + + /** + * 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. + *

+ * null 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. + *

+ * + * @param pname state to be queried + * @param data Buffer to place the integers in + */ + public static void alGetInteger(int pname, IntBuffer data) { + assert data.remaining() > 0; + nalGetIntegerv(pname, data, data.position()); + } + private static native void nalGetIntegerv(int pname, IntBuffer data, int offset); + + /** + * 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. + *

+ * null 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. + *

+ * + * @param pname state to be queried + * @param data Buffer to place the floats in + */ + public static void alGetFloat(int pname, FloatBuffer data) { + assert data.remaining() > 0; + nalGetFloatv(pname, data, data.position()); + } + private static native void nalGetFloatv(int pname, FloatBuffer data, int position); + + /** + * 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 + */ + public static native String alGetString(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. + *

+ * 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). + *

+ *

+ * 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. + *

+ *

+ * AL_NO_ERROR - "No Error" token.
+ * AL_INVALID_NAME - Invalid Name parameter.
+ * AL_INVALID_ENUM - Invalid parameter.
+ * AL_INVALID_VALUE - Invalid enum parameter value.
+ * AL_INVALID_OPERATION - Illegal call.
+ * AL_OUT_OF_MEMORY - Unable to allocate memory.
+ *

+ *

+ * 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. + *

+ *

+ * 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. + *

+ *

+ * 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. + *

+ *

+ * 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). + *

+ *

+ * 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. + *

+ *

+ * 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. + *

+ *

+ * Otherwise errors are generated only for conditions that are explicitely described in + * this specification. + *

+ * + * @return current error state + */ + public static native int alGetError(); + + /** + * To verify that a given extension is available for the current context and the device it + * is associated with, use this method. + *

+ * A null name argument returns AL_FALSE, as do invalid and unsupported string + * tokens. A null deviceHandle will result in an INVALID_DEVICE error. + *

+ * + * @param fname String describing the desired extension + * @return true if extension is available, false if not + */ + public static native boolean alIsExtensionPresent(String fname); + + /** + *

+ * 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. + *

+ *

+ * 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. + *

+ * + * @param ename String describing an OpenAL enum + * @return Actual int for the described enumeration name + */ + public static native 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 + */ + public static native void alListeneri(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 + */ + public static native void alListenerf(int pname, float 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 + */ + public static native void alListener3f(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 + */ + public static native int alGetListeneri(int pname); + + /** + * 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 + */ + public static native float alGetListenerf(int pname); + + /** + * 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 + */ + public static void alGetListener(int pname, FloatBuffer floatdata) { + nalGetListenerfv(pname, floatdata, floatdata.position()); + } + private static native void nalGetListenerfv(int pname, FloatBuffer floatdata, int offset); + + /** + * The application requests a number of Sources using GenSources. + * + * @param sources array holding sources + */ + public static void alGenSources(IntBuffer sources) { + nalGenSources(sources.remaining(), sources, sources.position()); + } + private static native void nalGenSources(int n, IntBuffer sources, int offset); + + /** + * The application requests deletion of a number of Sources by DeleteSources. + * + * @param source Source array to delete from + */ + public static void alDeleteSources(IntBuffer source) { + nalDeleteSources(source.remaining(), source, source.position()); + } + private static native void nalDeleteSources(int n, IntBuffer source, int offset); + + /** + * 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 + */ + public static native boolean alIsSource(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 + */ + public static native void alSourcei(int source, 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 + */ + public static native void alSourcef(int source, 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 v1 value 1 of property + * @param v2 value 2 of property + * @param v3 value 3 of property + */ + public static native void alSource3f( + int source, + 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 + */ + public static native int alGetSourcei(int source, int pname); + + /** + * 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 + */ + public static native float alGetSourcef(int source, int pname); + + /** + * 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 + */ + public static void alGetSource(int source, int pname, FloatBuffer floatdata) { + assert floatdata.remaining() > 0; + nalGetSourcefv(source, pname, floatdata, floatdata.position()); + } + private static native void nalGetSourcefv(int source, int pname, FloatBuffer floatdata, int position); + + /** + * 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 + */ + public static void alSourcePlay(int n, IntBuffer sources) { + nalSourcePlayv(sources.remaining(), sources, sources.position()); + } + private static native void nalSourcePlayv(int n, IntBuffer sources, int offset); + + /** + * 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 + */ + public static void alSourcePause(IntBuffer sources) { + nalSourcePausev(sources.remaining(), sources, sources.position()); + } + private static native void nalSourcePausev(int n, IntBuffer sources, int offset); + + /** + * 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 + */ + public static void alSourceStop(IntBuffer sources) { + nalSourceStopv(sources.remaining(), sources, sources.position()); + } + private static native void nalSourceStopv(int n, IntBuffer sources, int offset); + + /** + * 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 n number of sources to rewind + * @param sources array of sources to rewind + */ + public static void alSourceRewind(IntBuffer sources) { + nalSourceRewindv(sources.remaining(), sources, sources.position()); + } + private static native void nalSourceRewindv(int n, IntBuffer sources, int offset); + + /** + * 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 + */ + public static native void alSourcePlay(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 + */ + public static native void alSourcePause(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 + */ + public static native void alSourceStop(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 + */ + public static native void alSourceRewind(int source); + + /** + * The application requests a number of Buffers using GenBuffers. + * + * @param buffers holding buffers + */ + public static void alGenBuffers(IntBuffer buffers) { + nalGenBuffers(buffers.remaining(), buffers, buffers.position()); + } + private static native void nalGenBuffers(int n, IntBuffer buffers, int offset); + + /** + *

+ * The application requests deletion of a number of Buffers by calling DeleteBuffers. + *

+ *

+ * 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. + *

+ *

+ * 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 + */ + public static void alDeleteBuffers(IntBuffer buffers) { + nalDeleteBuffers(buffers.remaining(), buffers, buffers.position()); + } + private static native void nalDeleteBuffers(int n, IntBuffer buffers, int offset); + + /** + * 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 + */ + public static native boolean alIsBuffer(int buffer); + + /** + *

+ * 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. + *

+ *

+ * 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. + *

+ *

+ * 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. + *

+ * + * @param buffer Buffer to fill + * @param format format sound data is in + * @param data location of data + * @param freq frequency of data + */ + public static void alBufferData( + int buffer, + int format, + ByteBuffer data, + int size, + int freq) { + // TODO: add an assertion here? + nalBufferData(buffer, format, data, data.position(), data.remaining(), freq); + } + private static native void nalBufferData( + int buffer, + int format, + ByteBuffer data, + int offset, + int size, + int freq); + + /** + * Buffer state is maintained inside the AL implementation and can be queried in full.
+ * ALC_FREQUENCY - specified in samples per second, i.e. units of Hertz [Hz].
+ * ALC_SIZE - Size in bytes of the buffer data.
+ * + * @param buffer buffer to get property from + * @param pname name of property to retrieve + * @param int + */ + public static native int alGetBufferi(int buffer, int pname); + + /** + * Buffer state is maintained inside the AL implementation and can be queried in full.
+ * ALC_FREQUENCY - specified in samples per second, i.e. units of Hertz [Hz].
+ * ALC_SIZE - Size in bytes of the buffer data.
+ * + * @param buffer buffer to get property from + * @param pname name of property to retrieve + * @return float + */ + public static native float alGetBufferf(int buffer, int pname); + + /** + *

+ * 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. + *

+ *

+ * 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. + *

+ * + * @param source source to queue buffers onto + * @param buffers buffers to be queued + */ + public static void alSourceQueueBuffers(int source, IntBuffer buffers) { + nalSourceQueueBuffers(source, buffers.remaining(), buffers, buffers.position()); + } + private static native void nalSourceQueueBuffers(int source, int n, IntBuffer buffers, int offset); + + /** + *

+ * 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). + *

+ *

+ * The Unqueue command removes a number of buffers entries that have nished + * 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. + *

+ * + * @param source source to unqueue buffers from + * @param buffers buffers to be unqueued + */ + public static void alSourceUnqueueBuffers(int source, IntBuffer buffers) { + nalSourceUnqueueBuffers(source, buffers.remaining(), buffers, buffers.position()); + } + private static native void nalSourceUnqueueBuffers(int source, int n, IntBuffer buffers, int offset); + + /** + *

+ * 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. + *

+ *

+ * 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. + *

+ *

+ * 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. + *

+ *

+ * Legal arguments are AL_NONE, AL_INVERSE_DISTANCE, and + * AL_INVERSE_DISTANCE_CLAMPED. + *
+ *
+ * AL_NONE bypasses all distance attenuation + * calculation for all Sources. The implementation is expected to optimize this + * situation. + *
+ *
+ * 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. + *
+ *
+ * AL_INVERSE_DISTANCE is equivalent to the DS3D + * model with the exception that AL_REFERENCE_DISTANCE does not imply any + * clamping. + *
+ *
+ * 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. + *

+ * + * @param value distance model to be set + */ + public static native void alDistanceModel(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. + *
+ *
+ * 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. + * + *

+ *

+   *   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
+   * 
+ *

+ *

+ * 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. + *

+ *

+ * There are two API calls global to the current context that provide control of the two + * related parameters. + *

+ *

+ * AL_DOPPLER_FACTOR is a simple scaling to exaggerate or + * deemphasize the Doppler (pitch) shift resulting from the calculation. + *

+ *

+ * 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. + *

+ * + * @param value Doppler scale value to set + */ + public static native 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. + *
+ *
+ * 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. + * + *

+ *

+   *   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
+   * 
+ *

+ *

+ * 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. + *

+ *

+ * There are two API calls global to the current context that provide control of the two + * related parameters. + *

+ *

+ * 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. + *

+ *

+ * 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. + *

+ * + * @param value Doppler velocity value to set + */ + public static native void alDopplerVelocity(float value); +} diff --git a/src/java/org/lwjgl/openal/OpenALException.java b/src/java/org/lwjgl/openal/OpenALException.java new file mode 100644 index 00000000..11534b1d --- /dev/null +++ b/src/java/org/lwjgl/openal/OpenALException.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +package org.lwjgl.openal; + +/** + * $Id$ + *
+ * Thrown by the debug build library of the LWJGL if any OpenAL operation + * causes an error. + * + * @author Brian Matzon + * @version $Revision$ + */ +public class OpenALException extends RuntimeException { + + /** + * Constructor for OpenALException. + */ + public OpenALException() { + super(); + } + + /** + * 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/test/openal/BasicTest.java b/src/java/org/lwjgl/openal/eax/BaseEAX.java similarity index 50% rename from src/java/org/lwjgl/test/openal/BasicTest.java rename to src/java/org/lwjgl/openal/eax/BaseEAX.java index 99a55f98..88f18b7e 100644 --- a/src/java/org/lwjgl/test/openal/BasicTest.java +++ b/src/java/org/lwjgl/openal/eax/BaseEAX.java @@ -1,108 +1,107 @@ -/* +/* * Copyright (c) 2002 Lightweight Java Game Library Project * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are + * modification, are permitted provided that the following conditions are * met: - * - * * Redistributions of source code must retain the above copyright + * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * 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 + * * 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 + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR 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 org.lwjgl.openal.AL; - -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.nio.IntBuffer; -import java.nio.FloatBuffer; +package org.lwjgl.openal.eax; /** * $Id$ * - * This is a basic test, which contains the most used stuff + * The base OpenAL EAX functionality. + * + * This has been provided as a base class that we can use for either the + * full EAX specification or as a cut-down OpenAL EAX embedded spec. (aka + * a mini-driver). * * @author Brian Matzon * @version $Revision$ */ -public abstract class BasicTest { +public abstract class BaseEAX { - /** - * Creates an instance of PlayTest - */ - public BasicTest() { - try { - AL.create(); - } catch (Exception e) { - e.printStackTrace(); - return; - } - } + /** Has the EAX object been created? */ + protected static boolean created; - /** - * Shutdowns OpenAL - */ - protected void alExit() { - AL.destroy(); - } + static { + initialize(); + } - /** - * 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()); + /** + * Override to provide any initialization code after creation. + */ + protected static void init() { + } - return temp.asIntBuffer(); - } + /** + * Static initialization + */ + private static void initialize() { + System.loadLibrary(org.lwjgl.Sys.getLibraryName()); + } - /** - * Creates a float buffer to hold specified floats - * - strictly a utility method - * - * @param size how many floats to contain - * @return created FloatBuffer - */ - protected FloatBuffer createFloatBuffer(int size) { - ByteBuffer temp = ByteBuffer.allocateDirect(4 * size); - temp.order(ByteOrder.nativeOrder()); + /** + * Loads the EAX functions + * + * @throws Exception if the EAX extensions couldn't be loaded + */ + public static void create() throws Exception { + if (created) { + return; + } - return temp.asFloatBuffer(); - } + if (!nCreate()) { + throw new Exception("EAX instance could not be created."); + } + created = true; + init(); + } - /** - * Exits the test NOW, printing errorcode to stdout - * - * @param error Error code causing exit - */ - protected void exit(int error) { - System.out.println("OpenAL Error: " + AL.alGetString(error)); - alExit(); - System.exit(-1); - } + /** + * Native method to create EAX instance + * + * @return true if the EAX extensions could be found + */ + protected static native boolean nCreate(); + + /** + * "Destroy" the EAX object + */ + public static void destroy() { + if (!created) { + return; + } + created = false; + nDestroy(); + } + + /** + * Native method the destroy the EAX + */ + protected static native void nDestroy(); } \ No newline at end of file diff --git a/src/java/org/lwjgl/openal/eax/BaseEAXConstants.java b/src/java/org/lwjgl/openal/eax/BaseEAXConstants.java new file mode 100644 index 00000000..ffa58a4a --- /dev/null +++ b/src/java/org/lwjgl/openal/eax/BaseEAXConstants.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +package org.lwjgl.openal.eax; + +/** + * $Id$ + * + * This class implements the basic EAX extension constants. + * + * @author Brian Matzon + * @version $Revision$ + */ +public interface BaseEAXConstants { + public static final int EAX_ENVIRONMENT_GENERIC = 0; + public static final int EAX_ENVIRONMENT_PADDEDCELL = 1; + public static final int EAX_ENVIRONMENT_ROOM = 2; + public static final int EAX_ENVIRONMENT_BATHROOM = 3; + public static final int EAX_ENVIRONMENT_LIVINGROOM = 4; + public static final int EAX_ENVIRONMENT_STONEROOM = 5; + public static final int EAX_ENVIRONMENT_AUDITORIUM = 6; + public static final int EAX_ENVIRONMENT_CONCERTHALL = 7; + public static final int EAX_ENVIRONMENT_CAVE = 8; + public static final int EAX_ENVIRONMENT_ARENA = 9; + public static final int EAX_ENVIRONMENT_HANGAR = 10; + public static final int EAX_ENVIRONMENT_CARPETEDHALLWAY = 11; + public static final int EAX_ENVIRONMENT_HALLWAY = 12; + public static final int EAX_ENVIRONMENT_STONECORRIDOR = 13; + public static final int EAX_ENVIRONMENT_ALLEY = 14; + public static final int EAX_ENVIRONMENT_FOREST = 15; + public static final int EAX_ENVIRONMENT_CITY = 16; + public static final int EAX_ENVIRONMENT_MOUNTAINS = 17; + public static final int EAX_ENVIRONMENT_QUARRY = 18; + public static final int EAX_ENVIRONMENT_PLAIN = 19; + public static final int EAX_ENVIRONMENT_PARKINGLOT = 20; + public static final int EAX_ENVIRONMENT_SEWERPIPE = 21; + public static final int EAX_ENVIRONMENT_UNDERWATER = 22; + public static final int EAX_ENVIRONMENT_DRUGGED = 23; + public static final int EAX_ENVIRONMENT_DIZZY = 24; + public static final int EAX_ENVIRONMENT_PSYCHOTIC = 25; + public static final int EAX_ENVIRONMENT_COUNT = 26; + + // Single window material preset + public static final int EAX_MATERIAL_SINGLEWINDOW = -2800; + public static final float EAX_MATERIAL_SINGLEWINDOWLF = 0.71f; + public static final float EAX_MATERIAL_SINGLEWINDOWROOMRATIO = 0.43f; + + // Double window material preset + public static final int EAX_MATERIAL_DOUBLEWINDOW = -5000; + public static final float EAX_MATERIAL_DOUBLEWINDOWHF = 0.40f; + public static final float EAX_MATERIAL_DOUBLEWINDOWROOMRATIO = 0.24f; + + // Thin door material preset + public static final int EAX_MATERIAL_THINDOOR = -1800; + public static final float EAX_MATERIAL_THINDOORLF = 0.66f; + public static final float EAX_MATERIAL_THINDOORROOMRATIO = 0.66f; + + // Thick door material preset + public static final int EAX_MATERIAL_THICKDOOR = -4400; + public static final float EAX_MATERIAL_THICKDOORLF = 0.64f; + public static final float EAX_MATERIAL_THICKDOORROOMRTATION = 0.27f; + + // Wood wall material preset + public static final int EAX_MATERIAL_WOODWALL = -4000; + public static final float EAX_MATERIAL_WOODWALLLF = 0.50f; + public static final float EAX_MATERIAL_WOODWALLROOMRATIO = 0.30f; + + // Brick wall material preset + public static final int EAX_MATERIAL_BRICKWALL = -5000; + public static final float EAX_MATERIAL_BRICKWALLLF = 0.60f; + public static final float EAX_MATERIAL_BRICKWALLROOMRATIO = 0.24f; + + // Stone wall material preset + public static final int EAX_MATERIAL_STONEWALL = -6000; + public static final float EAX_MATERIAL_STONEWALLLF = 0.68f; + public static final float EAX_MATERIAL_STONEWALLROOMRATIO = 0.20f; + + // Curtain material preset + public static final int EAX_MATERIAL_CURTAIN = -1200; + public static final float EAX_MATERIAL_CURTAINLF = 0.15f; + public static final float EAX_MATERIAL_CURTAINROOMRATIO = 1.00f; +} \ No newline at end of file diff --git a/src/java/org/lwjgl/openal/eax/CoreEAX.java b/src/java/org/lwjgl/openal/eax/CoreEAX.java new file mode 100644 index 00000000..c671a3db --- /dev/null +++ b/src/java/org/lwjgl/openal/eax/CoreEAX.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +package org.lwjgl.openal.eax; + +import java.nio.Buffer; + +/** + * $Id$ + * + * This is the OpenAL EAX class. It extends the latest core. + * + * @author Brian Matzon + * @version $Revision$ + */ +public class CoreEAX extends BaseEAX implements BaseEAXConstants { + + /** GUID for buffer */ + public static int BUFFER_GUID; + + /** GUID for listener */ + public static int LISTENER_GUID; + + /** + * Load extensions + */ + protected static void init() { + determineAvailableExtensions(); + setGUID(); + } + + /** + * Determines available EAX extensions + */ + protected static native void determineAvailableExtensions(); + + /** + * Sets the GUID's for the buffer and listener objects + */ + protected static native void setGUID(); + + /** + * Retrieves an EAX Value + * + * @param propertySetID adress to the property set GUID of the object being queried (a listener or a source) + * @param property property being queried + * @param source the source to be queried + * @param data Buffer to write value to + * @param size size of area being written to + * @return OpenAL Error code + */ + public static native int eaxGet(int propertySetID, int property, int source, Buffer data, int size); + + /** + * Sets an EAX Value + * + * @param propertySetID adress to the property set GUID of the object being queried (a listener or a source) + * @param property property being queried + * @param source the source to be queried + * @param data Buffer to write value to + * @param size size of area being written to + * @return OpenAL Error code + */ + public static native int eaxSet(int propertySetID, int property, int source, Buffer data, int size); +} \ No newline at end of file diff --git a/src/java/org/lwjgl/test/openal/EAXTest.java b/src/java/org/lwjgl/openal/eax/EAX.java similarity index 61% rename from src/java/org/lwjgl/test/openal/EAXTest.java rename to src/java/org/lwjgl/openal/eax/EAX.java index 2f0ecfd8..7a588f0b 100644 --- a/src/java/org/lwjgl/test/openal/EAXTest.java +++ b/src/java/org/lwjgl/openal/eax/EAX.java @@ -1,80 +1,43 @@ -/* +/* * Copyright (c) 2002 Lightweight Java Game Library Project * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are + * modification, are permitted provided that the following conditions are * met: - * - * * Redistributions of source code must retain the above copyright + * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * 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 + * * 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 + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR 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 org.lwjgl.openal.eax.EAX; + package org.lwjgl.openal.eax; /** * $Id$ * - * This test initializes EAX and tries to get and set some EAX values + * This is the OpenAL EAX class. It extends the latest core. * * @author Brian Matzon * @version $Revision$ */ -public class EAXTest extends BasicTest { - - /** - * Creates an instance of EAXTest - */ - public EAXTest() { - super(); - } - - /** - * Runs the actual test, using supplied arguments - */ - protected void execute(String[] args) { - try { - System.out.print("Testing EAX support..."); - EAX.create(); - System.out.println("supported!"); - } catch (Exception e) { - System.out.println("no supported!"); - } - - //shutdown - alExit(); - - System.out.println("test done."); - } - - /** - * main entry point - * - * @param args String array containing arguments - */ - public static void main(String[] args) { - EAXTest eaxTest = new EAXTest(); - eaxTest.execute(args); - } +public class EAX extends CoreEAX { } \ No newline at end of file diff --git a/src/java/org/lwjgl/openal/eax/EAXBufferProperties.java b/src/java/org/lwjgl/openal/eax/EAXBufferProperties.java new file mode 100644 index 00000000..b1e685be --- /dev/null +++ b/src/java/org/lwjgl/openal/eax/EAXBufferProperties.java @@ -0,0 +1,519 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +package org.lwjgl.openal.eax; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; + +/** + * $Id$ + * + * This class encapsultaes the EAXBUFFERPROPERTIES struct. Since longs + * are 64 bit in Java and "typically" 32 on other platforms, we cheat by reading an + * int when reading a long field. + * + * @author Brian Matzon + * @version $Revision$ + */ +public class EAXBufferProperties { + + /** ByteBuffer representing EAXBUFFERPROPERTIES */ + protected ByteBuffer eaxBufferProperties; + + /** size needed by ByteBuffer to contain EAXBUFFERPROPERTIES */ + protected static int EAXBUFFERPROPERTIES_SIZE; + + /** direct path level offset */ + protected static int direct_offset; + + /** direct path level at high frequencies offset */ + protected static int directHF_offset; + + /** room effect level offset */ + protected static int room_offset; + + /** room effect level at high frequencies offset */ + protected static int roomHF_offset; + + /** like DS3D flRolloffFactor but for room effect offset */ + protected static int roomRolloffFactor_offset; + + /** main obstruction control (attenuation at high frequencies) offset */ + protected static int obstruction_offset; + + /** obstruction low-frequency level re. main control offset */ + protected static int obstructionLFRatio_offset; + + /** main occlusion control (attenuation at high frequencies) offset */ + protected static int occlusion_offset; + + /** occlusion low-frequency level re. main control offset */ + protected static int occlusionLFRatio_offset; + + /** occlusion room effect level re. main control offset */ + protected static int occlusionRoomRatio_offset; + + /** outside sound cone level at high frequencies offset */ + protected static int outsideVolumeHF_offset; + + /** multiplies DSPROPERTY_EAXLISTENER_AIRABSORPTIONHF offset */ + protected static int airAbsorptionFactor_offset; + + /** modifies the behavior of properties offset */ + protected static int flags_offset; + + public static final int EAXBUFFER_NONE = 0; + public static final int EAXBUFFER_ALLPARAMETERS = 1; + public static final int EAXBUFFER_DIRECT = 2; + public static final int EAXBUFFER_DIRECTHF = 3; + public static final int EAXBUFFER_ROOM = 4; + public static final int EAXBUFFER_ROOMHF = 5; + public static final int EAXBUFFER_ROOMROLLOFFFACTOR = 6; + public static final int EAXBUFFER_OBSTRUCTION = 7; + public static final int EAXBUFFER_OBSTRUCTIONLFRATIO = 8; + public static final int EAXBUFFER_OCCLUSION = 9; + public static final int EAXBUFFER_OCCLUSIONLFRATIO = 10; + public static final int EAXBUFFER_OCCLUSIONROOMRATIO = 11; + public static final int EAXBUFFER_OUTSIDEVOLUMEHF = 12; + public static final int EAXBUFFER_AIRABSORPTIONFACTOR = 13; + public static final int EAXBUFFER_FLAGS = 14; + + /** changes take effect immediately */ + public static final int EAXBUFFER_IMMEDIATE = 0x00000000; + + /** changes take effect later */ + public static final int EAXBUFFER_DEFERRED = 0x80000000; + public static final int EAXBUFFER_COMMITDEFERREDSETTINGS = + (EAXBUFFER_NONE | EAXBUFFER_IMMEDIATE); + + /** affects DSPROPERTY_EAXBUFFER_DIRECTHF */ + public static final int EAXBUFFER_FLAGS_DIRECTHFAUTO = 0x00000001; + + /** affects DSPROPERTY_EAXBUFFER_ROOM */ + public static final int EAXBUFFER_FLAGS_ROOMAUTO = 0x00000002; + + /** affects DSPROPERTY_EAXBUFFER_ROOMHF */ + public static final int EAXBUFFER_FLAGS_ROOMHFAUTO = 0x00000004; + + /** reserved future use */ + public static final int EAXBUFFER_FLAGS_RESERVED = 0xFFFFFFF8; + + // property ranges and defaults: + + public static final int EAXBUFFER_MINDIRECT = -10000; + public static final int EAXBUFFER_MAXDIRECT = 1000; + public static final int EAXBUFFER_DEFAULTDIRECT = 0; + + public static final int EAXBUFFER_MINDIRECTHF = -10000; + public static final int EAXBUFFER_MAXDIRECTHF = 0; + public static final int EAXBUFFER_DEFAULTDIRECTHF = 0; + + public static final int EAXBUFFER_MINROOM = -10000; + public static final int EAXBUFFER_MAXROOM = 1000; + public static final int EAXBUFFER_DEFAULTROOM = 0; + + public static final int EAXBUFFER_MINROOMHF = -10000; + public static final int EAXBUFFER_MAXROOMHF = 0; + public static final int EAXBUFFER_DEFAULTROOMHF = 0; + + public static final float EAXBUFFER_MINROOMROLLOFFFACTOR = 0.0f; + public static final float EAXBUFFER_MAXROOMROLLOFFFACTOR = 10.f; + public static final float EAXBUFFER_DEFAULTROOMROLLOFFFACTOR = 0.0f; + + public static final int EAXBUFFER_MINOBSTRUCTION = -10000; + public static final int EAXBUFFER_MAXOBSTRUCTION = 0; + public static final int EAXBUFFER_DEFAULTOBSTRUCTION = 0; + + public static final float EAXBUFFER_MINOBSTRUCTIONLFRATIO = 0.0f; + public static final float EAXBUFFER_MAXOBSTRUCTIONLFRATIO = 1.0f; + public static final float EAXBUFFER_DEFAULTOBSTRUCTIONLFRATIO = 0.0f; + + public static final int EAXBUFFER_MINOCCLUSION = -10000; + public static final int EAXBUFFER_MAXOCCLUSION = 0; + public static final int EAXBUFFER_DEFAULTOCCLUSION = 0; + + public static final float EAXBUFFER_MINOCCLUSIONLFRATIO = 0.0f; + public static final float EAXBUFFER_MAXOCCLUSIONLFRATIO = 1.0f; + public static final float EAXBUFFER_DEFAULTOCCLUSIONLFRATIO = 0.25f; + + public static final float EAXBUFFER_MINOCCLUSIONROOMRATIO = 0.0f; + public static final float EAXBUFFER_MAXOCCLUSIONROOMRATIO = 10.0f; + public static final float EAXBUFFER_DEFAULTOCCLUSIONROOMRATIO = 0.5f; + + public static final int EAXBUFFER_MINOUTSIDEVOLUMEHF = -10000; + public static final int EAXBUFFER_MAXOUTSIDEVOLUMEHF = 0; + public static final int EAXBUFFER_DEFAULTOUTSIDEVOLUMEHF = 0; + + public static final float EAXBUFFER_MINAIRABSORPTIONFACTOR = 0.0f; + public static final float EAXBUFFER_MAXAIRABSORPTIONFACTOR = 10.0f; + public static final float EAXBUFFER_DEFAULTAIRABSORPTIONFACTOR = 1.0f; + + public static final int EAXBUFFER_DEFAULTFLAGS = + (EAXBUFFER_FLAGS_DIRECTHFAUTO + | EAXBUFFER_FLAGS_ROOMAUTO + | EAXBUFFER_FLAGS_ROOMHFAUTO); + + static { + System.loadLibrary(org.lwjgl.Sys.getLibraryName()); + EAXBUFFERPROPERTIES_SIZE = sizeOfEaxBufferProperties(); + assignOffsets(); + } + + public EAXBufferProperties() { + eaxBufferProperties = ByteBuffer.allocateDirect(EAXBUFFERPROPERTIES_SIZE); + eaxBufferProperties.order(ByteOrder.nativeOrder()); + } + + /** + * Sets an EAX Value + * + * @param property property being queried + * @param source the source to be queried + */ + public void eaxSet(int property, int source) { + EAX.eaxSet( + CoreEAX.BUFFER_GUID, + property, + source, + eaxBufferProperties, + EAXBUFFERPROPERTIES_SIZE); + } + + /** + * Sets an EAX Value + * + * @param property property being queried + * @param source the source to be queried + */ + public void eaxGet(int property, int source) { + EAX.eaxGet( + CoreEAX.BUFFER_GUID, + property, + source, + eaxBufferProperties, + EAXBUFFERPROPERTIES_SIZE); + } + + /** + * Retireves the direct path level + * + * @return direct path level + */ + public int getDirect() { + return eaxBufferProperties.getInt(direct_offset); + } + + /** + * Sets the direct path level + * + * @param direct direct path level to set to + */ + public void setDirect(int direct) { + eaxBufferProperties.putInt(direct_offset, direct); + } + + /** + * Retireves the direct path level at high frequencies + * + * @return direct path level at high frequencies + */ + public int getDirectHF() { + return eaxBufferProperties.getInt(directHF_offset); + } + + /** + * Sets the direct path level at high frequencies + * + * @param directHF direct path level at high frequencies to set to + */ + public void setDirectHF(int directHF) { + eaxBufferProperties.putInt(directHF_offset, directHF); + } + + /** + * Retireves the room effect level + * + * @return room effect level + */ + public int getRoom() { + return eaxBufferProperties.getInt(room_offset); + } + + /** + * Sets the room effect level + * + * @param room room effect level to set to + */ + public void setRoom(int room) { + eaxBufferProperties.putInt(room_offset, room); + } + + /** + * Retireves the room effect level at high frequencies + * + * @return room effect level at high frequencies + */ + public int getRoomHF() { + return eaxBufferProperties.getInt(roomHF_offset); + } + + /** + * Sets the room effect level at high frequencies + * + * @param roomHF room effect level at high frequencies to set to + */ + public void setRoomHF(int roomHF) { + eaxBufferProperties.putInt(roomHF_offset, roomHF); + } + + /** + * Retireves the DS3D flRolloffFactor for room effect + * + * @return DS3D flRolloffFactor for room effect + */ + public float getRoomRolloffFactor() { + return eaxBufferProperties.getFloat(roomRolloffFactor_offset); + } + + /** + * Sets the DS3D flRolloffFactor for room effect + * + * @param roomRolloffFactor DS3D flRolloffFactor for room effect to set to + */ + public void setRoomRolloffFactor(float roomRolloffFactor) { + eaxBufferProperties.putFloat(roomRolloffFactor_offset, roomRolloffFactor); + } + + /** + * Retireves the main obstruction control (attenuation at high frequencies) + * + * @return main obstruction control (attenuation at high frequencies) + */ + public int getObstruction() { + return eaxBufferProperties.getInt(obstruction_offset); + } + + /** + * Sets the main obstruction control (attenuation at high frequencies) + * + * @param obstruction main obstruction control (attenuation at high frequencies) to set to + */ + public void setObstruction(int obstruction) { + eaxBufferProperties.putInt(obstruction_offset, obstruction); + } + + /** + * Retireves the obstruction low-frequency level re. main control + * + * @return obstruction low-frequency level re. main control + */ + public float getObstructionLFRatio() { + return eaxBufferProperties.getFloat(obstructionLFRatio_offset); + } + + /** + * Sets the obstruction low-frequency level re. main control + * + * @param obstructionLFRatio obstruction low-frequency level re. main control to set to + */ + public void setObstructionLFRatio(float obstructionLFRatio) { + eaxBufferProperties.putFloat(obstructionLFRatio_offset, obstructionLFRatio); + } + + /** + * Retireves the main occlusion control (attenuation at high frequencies) + * + * @return main occlusion control (attenuation at high frequencies) + */ + public int getOcclusion() { + return eaxBufferProperties.getInt(occlusion_offset); + } + + /** + * Sets the main occlusion control (attenuation at high frequencies) + * + * @param occlusion main occlusion control (attenuation at high frequencies) to set to + */ + public void setOcclusion(int occlusion) { + eaxBufferProperties.putInt(occlusion_offset, occlusion); + } + + /** + * Retireves the occlusion low-frequency level re. main control + * + * @return occlusion low-frequency level re. main control + */ + public float getOcclusionLFRatio() { + return eaxBufferProperties.getFloat(occlusionLFRatio_offset); + } + + /** + * Sets the occlusion low-frequency level re. main control + * + * @param occlusionLFRatio occlusion low-frequency level re. main control to set to + */ + public void setOcclusionLFRatio(float occlusionLFRatio) { + eaxBufferProperties.putFloat(occlusionLFRatio_offset, occlusionLFRatio); + } + + /** + * Retireves the occlusion room effect level re. main control + * + * @return occlusion room effect level re. main control + */ + public float getOcclusionRoomRatio() { + return eaxBufferProperties.getFloat(occlusionRoomRatio_offset); + } + + /** + * Sets the OcclusionRoomRatio + * + * @param occlusionRoomRatio OcclusionRoomRatio to set to + */ + public void setOcclusionRoomRatio(float occlusionRoomRatio) { + eaxBufferProperties.putFloat(occlusionRoomRatio_offset, occlusionRoomRatio); + } + + /** + * Retireves the OutsideVolumeHF + * + * @return OutsideVolumeHF + */ + public int getOutsideVolumeHF() { + return eaxBufferProperties.getInt(outsideVolumeHF_offset); + } + + /** + * Sets the OutsideVolumeHF + * + * @param outsideVolumeHF OutsideVolumeHF to set to + */ + public void setOutsideVolumeHF(int outsideVolumeHF) { + eaxBufferProperties.putInt(outsideVolumeHF_offset, outsideVolumeHF); + } + + /** + * Retireves the multiplier for DSPROPERTY_EAXLISTENER_AIRABSORPTIONHF + * + * @return multiplier for DSPROPERTY_EAXLISTENER_AIRABSORPTIONHF + */ + public float getAirAbsorptionFactor() { + return eaxBufferProperties.getFloat(airAbsorptionFactor_offset); + } + + /** + * Sets the multiplier for DSPROPERTY_EAXLISTENER_AIRABSORPTIONHF + * + * @param airAbsorptionFactor multiplier for DSPROPERTY_EAXLISTENER_AIRABSORPTIONHF to set to + */ + public void setAirAbsorptionFactor(float airAbsorptionFactor) { + eaxBufferProperties.putFloat( + airAbsorptionFactor_offset, + airAbsorptionFactor); + } + + /** + * Retireves the modifier for behavior of properties + * + * @return modifier for behavior of properties + */ + public int getFlags() { + return eaxBufferProperties.getInt(flags_offset); + } + + /** + * Sets the modifier for behavior of properties + * + * @param flags modifier for behavior of properties to set to + */ + public void setFlags(int flags) { + eaxBufferProperties.putInt(flags_offset, flags); + } + + /** + * Retrieves the size of the containing ByteBuffer + */ + public static int getSize() { + return EAXBUFFERPROPERTIES_SIZE; + } + + /** + * Retrieves the size of the EAXBUFFERPROPERTIES + */ + protected static native int sizeOfEaxBufferProperties(); + + /** + * Sets the offsets to the fields + */ + protected static native void assignOffsets(); + + /** + * Retrieves the size of the property + * + * @param property Property to determine size of + * @return size of property + */ + private static int getSizeOfProperty(int property) { + switch (property) { + case EAXBufferProperties.EAXBUFFER_NONE : + return 0; + + /* long */ + case EAXBufferProperties.EAXBUFFER_DIRECT : + case EAXBufferProperties.EAXBUFFER_DIRECTHF : + case EAXBufferProperties.EAXBUFFER_ROOM : + case EAXBufferProperties.EAXBUFFER_ROOMHF : + case EAXBufferProperties.EAXBUFFER_OBSTRUCTION : + case EAXBufferProperties.EAXBUFFER_OCCLUSION : + case EAXBufferProperties.EAXBUFFER_OUTSIDEVOLUMEHF : + + /* float */ + case EAXBufferProperties.EAXBUFFER_ROOMROLLOFFFACTOR : + case EAXBufferProperties.EAXBUFFER_OBSTRUCTIONLFRATIO : + case EAXBufferProperties.EAXBUFFER_OCCLUSIONLFRATIO : + case EAXBufferProperties.EAXBUFFER_OCCLUSIONROOMRATIO : + case EAXBufferProperties.EAXBUFFER_AIRABSORPTIONFACTOR : + + /* unsigned long */ + case EAXBufferProperties.EAXBUFFER_FLAGS : + return 4; + + case EAXBufferProperties.EAXBUFFER_ALLPARAMETERS : + return EAXBufferProperties.EAXBUFFERPROPERTIES_SIZE; + + default : + throw new IllegalArgumentException( + "No such property '" + property + "'"); + + } + } +} \ No newline at end of file diff --git a/src/java/org/lwjgl/openal/eax/EAXListenerProperties.java b/src/java/org/lwjgl/openal/eax/EAXListenerProperties.java new file mode 100644 index 00000000..140669bf --- /dev/null +++ b/src/java/org/lwjgl/openal/eax/EAXListenerProperties.java @@ -0,0 +1,516 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +package org.lwjgl.openal.eax; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; + +/** + * $Id$ + * + * This class encapsultaes the EAXLISTENERPROPERTIES struct + * + * @author Brian Matzon + * @version $Revision$ + */ +public class EAXListenerProperties { + + /** ByteBuffer representing EAXLISTENERPROPERTIES */ + protected ByteBuffer eaxListenerProperties; + + /** size needed by ByteBuffer to contain EAXLISTENERPROPERTIES */ + protected static int EAXLISTENERPROPERTIES_SIZE; + + /** room effect level offset */ + protected static int room_offset; + + /** room effect level at high frequencies offset */ + protected static int roomHF_offset; + + /**like DS3D flRolloffFactor but for room effect offset */ + protected static int roomRolloffFactor_offset; + + /** reverberation decay time at low frequencies offset */ + protected static int decayTime_offset; + + /** high-frequency to low-frequency decay time ratio offset */ + protected static int decayHFRatio_offset; + + /** early reflections level relative to room effect offset */ + protected static int reflections_offset; + + /** initial reflection delay time offset */ + protected static int reflectionsDelay_offset; + + /** late reverberation level relative to room effect offset */ + protected static int reverb_offset; + + /** late reverberation delay time relative to initial reflection offset */ + protected static int reverbDelay_offset; + + /** sets all listener properties offset */ + protected static int environment_offset; + + /** environment size in meters offset */ + protected static int environmentSize_offset; + + /** environment diffusion offset */ + protected static int environmentDiffusion_offset; + + /** change in level per meter at 5 kHz offset */ + protected static int airAbsorptionHF_offset; + + /** modifies the behavior of properties offset */ + protected static int flags_offset; + + public static final int EAXLISTENER_NONE = 0; + public static final int EAXLISTENER_ALLPARAMETERS = 1; + public static final int EAXLISTENER_ROOM = 2; + public static final int EAXLISTENER_ROOMHF = 3; + public static final int EAXLISTENER_ROOMROLLOFFFACTOR = 4; + public static final int EAXLISTENER_DECAYTIME = 5; + public static final int EAXLISTENER_DECAYHFRATIO = 6; + public static final int EAXLISTENER_REFLECTIONS = 7; + public static final int EAXLISTENER_REFLECTIONSDELAY = 8; + public static final int EAXLISTENER_REVERB = 9; + public static final int EAXLISTENER_REVERBDELAY = 10; + public static final int EAXLISTENER_ENVIRONMENT = 11; + public static final int EAXLISTENER_ENVIRONMENTSIZE = 12; + public static final int EAXLISTENER_ENVIRONMENTDIFFUSION = 13; + public static final int EAXLISTENER_AIRABSORPTIONHF = 14; + public static final int EAXLISTENER_FLAGS = 15; + + /** changes take effect immediately */ + public static final int EAXLISTENER_IMMEDIATE = 0x00000000; + + /** changes take effect later */ + public static final int EAXLISTENER_DEFERRED = 0x80000000; + + public static final int EAXLISTENER_COMMITDEFERREDSETTINGS = + (EAXLISTENER_NONE | EAXLISTENER_IMMEDIATE); + + /** reverberation decay time */ + public static final int EAXLISTENERFLAGS_DECAYTIMESCALE = 0x00000001; + + /** reflection level */ + public static final int EAXLISTENERFLAGS_REFLECTIONSSCALE = 0x00000002; + + /** initial reflection delay time */ + public static final int EAXLISTENERFLAGS_REFLECTIONSDELAYSCALE = 0x00000004; + + /** reflections level */ + public static final int EAXLISTENERFLAGS_REVERBSCALE = 0x00000008; + + /** late reverberation delay time */ + public static final int EAXLISTENERFLAGS_REVERBDELAYSCALE = 0x00000010; + + /** This flag limits high-frequency decay time according to air absorption. */ + public static final int EAXLISTENERFLAGS_DECAYHFLIMIT = 0x00000020; + + /** reserved future use */ + public static final int EAXLISTENERFLAGS_RESERVED = 0xFFFFFFC0; + + // property ranges and defaults: + public static final int EAXLISTENER_MINROOM = -10000; + public static final int EAXLISTENER_MAXROOM = 0; + public static final int EAXLISTENER_DEFAULTROOM = -1000; + + public static final int EAXLISTENER_MINROOMHF = -10000; + public static final int EAXLISTENER_MAXROOMHF = 0; + public static final int EAXLISTENER_DEFAULTROOMHF = -100; + + public static final float EAXLISTENER_MINROOMROLLOFFFACTOR = 0.0f; + public static final float EAXLISTENER_MAXROOMROLLOFFFACTOR = 10.0f; + public static final float EAXLISTENER_DEFAULTROOMROLLOFFFACTOR = 0.0f; + + public static final float EAXLISTENER_MINDECAYTIME = 0.1f; + public static final float EAXLISTENER_MAXDECAYTIME = 20.0f; + public static final float EAXLISTENER_DEFAULTDECAYTIME = 1.49f; + + public static final float EAXLISTENER_MINDECAYHFRATIO = 0.1f; + public static final float EAXLISTENER_MAXDECAYHFRATIO = 2.0f; + public static final float EAXLISTENER_DEFAULTDECAYHFRATIO = 0.83f; + + public static final int EAXLISTENER_MINREFLECTIONS = -10000; + public static final int EAXLISTENER_MAXREFLECTIONS = 1000; + public static final int EAXLISTENER_DEFAULTREFLECTIONS = -2602; + + public static final float EAXLISTENER_MINREFLECTIONSDELAY = 0.0f; + public static final float EAXLISTENER_MAXREFLECTIONSDELAY = 0.3f; + public static final float EAXLISTENER_DEFAULTREFLECTIONSDELAY = 0.007f; + + public static final int EAXLISTENER_MINREVERB = -10000; + public static final int EAXLISTENER_MAXREVERB = 2000; + public static final int EAXLISTENER_DEFAULTREVERB = 200; + + public static final float EAXLISTENER_MINREVERBDELAY = 0.0f; + public static final float EAXLISTENER_MAXREVERBDELAY = 0.1f; + public static final float EAXLISTENER_DEFAULTREVERBDELAY = 0.011f; + + public static final int EAXLISTENER_MINENVIRONMENT = 0; + public static final int EAXLISTENER_MAXENVIRONMENT = + (EAX.EAX_ENVIRONMENT_COUNT - 1); + public static final int EAXLISTENER_DEFAULTENVIRONMENT = + EAX.EAX_ENVIRONMENT_GENERIC; + + public static final float EAXLISTENER_MINENVIRONMENTSIZE = 1.0f; + public static final float EAXLISTENER_MAXENVIRONMENTSIZE = 100.0f; + public static final float EAXLISTENER_DEFAULTENVIRONMENTSIZE = 7.5f; + + public static final float EAXLISTENER_MINENVIRONMENTDIFFUSION = 0.0f; + public static final float EAXLISTENER_MAXENVIRONMENTDIFFUSION = 1.0f; + public static final float EAXLISTENER_DEFAULTENVIRONMENTDIFFUSION = 1.0f; + + public static final float EAXLISTENER_MINAIRABSORPTIONHF = -100.0f; + public static final float EAXLISTENER_MAXAIRABSORPTIONHF = 0.0f; + public static final float EAXLISTENER_DEFAULTAIRABSORPTIONHF = -5.0f; + + public static final int EAXLISTENER_DEFAULTFLAGS = + (EAXLISTENERFLAGS_DECAYTIMESCALE + | EAXLISTENERFLAGS_REFLECTIONSSCALE + | EAXLISTENERFLAGS_REFLECTIONSDELAYSCALE + | EAXLISTENERFLAGS_REVERBSCALE + | EAXLISTENERFLAGS_REVERBDELAYSCALE + | EAXLISTENERFLAGS_DECAYHFLIMIT); + static { + System.loadLibrary(org.lwjgl.Sys.getLibraryName()); + EAXLISTENERPROPERTIES_SIZE = sizeOfEaxListenerProperties(); + assignOffsets(); + } + + public EAXListenerProperties() { + eaxListenerProperties = + ByteBuffer.allocateDirect(EAXLISTENERPROPERTIES_SIZE); + eaxListenerProperties.order(ByteOrder.nativeOrder()); + } + + /** + * Sets an EAX Value + * + * @param property property being queried + * @param source the source to be queried + */ + public void eaxSet(int property, int source) { + EAX.eaxSet( + CoreEAX.LISTENER_GUID, + property, + source, + eaxListenerProperties, + EAXLISTENERPROPERTIES_SIZE); + } + + /** + * Gets an EAX Value + * + * @param property property being queried + * @param source the source to be queried + */ + public void eaxGet(int property, int source) { + EAX.eaxGet( + CoreEAX.LISTENER_GUID, + property, + source, + eaxListenerProperties, + EAXLISTENERPROPERTIES_SIZE); + } + + /** + * Retireves the room effect level + * + * @return room effect level + */ + public int getRoom() { + return eaxListenerProperties.getInt(room_offset); + } + + /** + * Sets the room effect level + * + * @param room room effect level to set to + */ + public void setRoom(int room) { + eaxListenerProperties.putInt(room_offset, room); + } + + /** + * Retireves the room effect level at high frequencies + * + * @return room effect level at high frequencies + */ + public int getRoomHF() { + return eaxListenerProperties.getInt(roomHF_offset); + } + + /** + * Sets the room effect level at high frequencies + * + * @param roomHF room effect level at high frequencies to set to + */ + public void setRoomHF(int roomHF) { + eaxListenerProperties.putInt(roomHF_offset, roomHF); + } + + /** + * Retireves the DS3D flRolloffFactor for room effect + * + * @return DS3D flRolloffFactor for room effect + */ + public float getRoomRolloffFactor() { + return eaxListenerProperties.getFloat(roomRolloffFactor_offset); + } + + /** + * Sets the DS3D flRolloffFactor for room effect + * + * @param roomRolloffFactor DS3D flRolloffFactor for room effect to set to + */ + public void setRoomRolloffFactor(float roomRolloffFactor) { + eaxListenerProperties.putFloat(roomRolloffFactor_offset, roomRolloffFactor); + } + + /** + * Retireves the reverberation decay time at low frequencies + * + * @return reverberation decay time at low frequencies + */ + public float getDecayTime() { + return eaxListenerProperties.getFloat(decayTime_offset); + } + + /** + * Sets the reverberation decay time at low frequencies + * + * @param decayTime reverberation decay time at low frequencies to set to + */ + public void setDecayTime(float decayTime) { + eaxListenerProperties.putFloat(decayTime_offset, decayTime); + } + + /** + * Retireves the high-frequency to low-frequency decay time ratio + * + * @return high-frequency to low-frequency decay time ratio + */ + public float getDecayTimeHFRatio() { + return eaxListenerProperties.getFloat(decayHFRatio_offset); + } + + /** + * Sets the high-frequency to low-frequency decay time ratio + * + * @param decayTimeHFRatio high-frequency to low-frequency decay time ratio to set to + */ + public void setDecayTimeHFRatio(float decayTimeHFRatio) { + eaxListenerProperties.putFloat(decayHFRatio_offset, decayTimeHFRatio); + } + + /** + * Retireves the early reflections level relative to room effect + * + * @return early reflections level relative to room effect + */ + public int getReflections() { + return eaxListenerProperties.getInt(reflections_offset); + } + + /** + * Sets the early reflections level relative to room effect + * + * @param reflections early reflections level relative to room effect to set to + */ + public void setReflections(int reflections) { + eaxListenerProperties.putInt(reflections_offset, reflections); + } + + /** + * Retireves the initial reflection delay time + * + * @return initial reflection delay time + */ + public float getReflectionsDelay() { + return eaxListenerProperties.getFloat(reflectionsDelay_offset); + } + + /** + * Sets the initial reflection delay time + * + * @param reflectionsDelay initial reflection delay time to set to + */ + public void setReflectionsDelay(float reflectionsDelay) { + eaxListenerProperties.putFloat(reflectionsDelay_offset, reflectionsDelay); + } + + /** + * Retireves the late reverberation level relative to room effect + * + * @return late reverberation level relative to room effect + */ + public int getReverb() { + return eaxListenerProperties.getInt(reverb_offset); + } + + /** + * Sets the late reverberation level relative to room effect + * + * @param reverb late reverberation level relative to room effect to set to + */ + public void setReverb(int reverb) { + eaxListenerProperties.putInt(reverb_offset, reverb); + } + + /** + * Retireves the late reverberation delay time relative to initial reflection + * + * @return late reverberation delay time relative to initial reflection + */ + public float getReverbDelay() { + return eaxListenerProperties.getFloat(reverbDelay_offset); + } + + /** + * Sets the late reverberation delay time relative to initial reflection + * + * @param reverbDelay late reverberation delay time relative to initial reflection + */ + public void setReverbDelay(float reverbDelay) { + eaxListenerProperties.putFloat(reverbDelay_offset, reverbDelay); + } + + /** + * Retireves the listener properties + * + * @return listener properties + */ + public int getEnvironment() { + return eaxListenerProperties.getInt(environment_offset); + } + + /** + * Sets the listener properties + * + * @param environment listener properties to set to + */ + public void setEnvironment(int environment) { + eaxListenerProperties.putInt(environment_offset, environment); + } + + /** + * Retireves the environment size in meters + * + * @return environment size in meters + */ + public float getEnvironmentSize() { + return eaxListenerProperties.getFloat(environmentSize_offset); + } + + /** + * Sets the environment size in meters + * + * @param environmentSize environment size in meters to set to + */ + public void setEnvironmentSize(float environmentSize) { + eaxListenerProperties.putFloat(environmentSize_offset, environmentSize); + } + + /** + * Retireves the environment diffusion + * + * @return environment diffusion + */ + public float getEnvironmentDiffusion() { + return eaxListenerProperties.getFloat(environmentDiffusion_offset); + } + + /** + * Sets the environment diffusion + * + * @param environmentDiffusion environment diffusion to set to + */ + public void setEnvironmentDiffusion(float environmentDiffusion) { + eaxListenerProperties.putFloat( + environmentDiffusion_offset, + environmentDiffusion); + } + + /** + * Retireves the change in level per meter at 5 kHz + * + * @return change in level per meter at 5 kHz + */ + public float getAirAbsorptionHF() { + return eaxListenerProperties.getFloat(airAbsorptionHF_offset); + } + + /** + * Sets the change in level per meter at 5 kHz + * + * @param airAbsorptionHF change in level per meter at 5 kHz to set to + */ + public void setAirAbsorptionFactor(float airAbsorptionHF) { + eaxListenerProperties.putFloat(airAbsorptionHF_offset, airAbsorptionHF); + } + + /** + * Retireves the modifier for behavior of properties + * + * @return modifier for behavior of properties + */ + public int getFlags() { + return eaxListenerProperties.getInt(flags_offset); + } + + /** + * Sets the modifier for behavior of properties + * + * @param flags modifier for behavior of properties to set to + */ + public void setFlags(int flags) { + eaxListenerProperties.putInt(flags_offset, flags); + } + + /** + * Retrieves the size of the containing ByteBuffer + */ + public int getSize() { + return EAXLISTENERPROPERTIES_SIZE; + } + + /** + * Retrieves the size of the EAXLISTENERPROPERTIES + */ + protected static native int sizeOfEaxListenerProperties(); + + /** + * Sets the offsets to the fields + */ + protected static native void assignOffsets(); +} \ No newline at end of file diff --git a/src/java/org/lwjgl/opengl/CoreGL11.java b/src/java/org/lwjgl/opengl/CoreGL11.java new file mode 100644 index 00000000..41fb3ca8 --- /dev/null +++ b/src/java/org/lwjgl/opengl/CoreGL11.java @@ -0,0 +1,590 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ + +package org.lwjgl.opengl; + +import java.nio.*; +import java.nio.ByteBuffer; +import java.nio.IntBuffer; +import java.nio.FloatBuffer; +import java.nio.DoubleBuffer; +import java.nio.Buffer; + +/** + * $Id: CoreGL.java,v 1.23 2003/07/23 14:51:19 elias_naur Exp $ + * + * The core OpenGL1.1 API. + * + * @author cix_foo + * @version $Revision: 1.23 $ + */ +public abstract class CoreGL11 implements CoreGL11Constants { + + public static native void glAccum(int op, float value); + public static native void glAlphaFunc(int func, float ref); + public static native void glClearColor(float red, float green, float blue, float alpha); + public static native void glClearAccum(float red, float green, float blue, float alpha); + public static native void glClear(int mask); + public static void glCallLists(ByteBuffer lists) { + nglCallLists(lists.remaining(), GL_UNSIGNED_BYTE, lists, lists.position()); + } + public static void glCallLists(ShortBuffer lists) { + nglCallLists(lists.remaining(), GL_UNSIGNED_SHORT, lists, lists.position() << 1); + } + public static void glCallLists(int n, IntBuffer lists) { + nglCallLists(lists.remaining(), GL_UNSIGNED_INT, lists, lists.position() << 2); + } + private static native void nglCallLists(int n, int type, Buffer lists, int lists_offset); + public static native void glCallList(int list); + public static native void glBlendFunc(int sfactor, int dfactor); + public static void glBitmap(int width, int height, float xorig, float yorig, float xmove, float ymove, ByteBuffer bitmap) { + nglBitmap(width, height, xorig, yorig, xmove, ymove, bitmap, bitmap.position()); + } + private static native void nglBitmap(int width, int height, float xorig, float yorig, float xmove, float ymove, ByteBuffer bitmap, int bitmap_offset); + public static native void glBindTexture(int target, int texture); + public static native void glBegin(int mode); + public static native void glEnd(); + public static native void glArrayElement(int i); + public static native void glClearDepth(double depth); + public static native void glDeleteLists(int list, int range); + public static void glDeleteTextures(IntBuffer textures) { + nglDeleteTextures(textures.remaining(), textures, textures.position()); + } + private static native void nglDeleteTextures(int n, IntBuffer textures, int textures_offset); + public static native void glCullFace(int mode); + public static native void glCopyTexSubImage2D(int target, int level, int xoffset, int yoffset, int x, int y, int width, int height); + public static native void glCopyTexSubImage1D(int target, int level, int xoffset, int x, int y, int width); + public static native void glCopyTexImage2D(int target, int level, int internalFormat, int x, int y, int width, int height, int border); + public static native void glCopyTexImage1D(int target, int level, int internalFormat, int x, int y, int width, int border); + public static native void glCopyPixels(int x, int y, int width, int height, int type); + public static void glColorPointer(int size, boolean unsigned, int stride, ByteBuffer pointer) { + assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + nglColorPointer(size, unsigned ? GL_UNSIGNED_BYTE : GL_BYTE, stride, pointer, pointer.position()); + } + public static void glColorPointer(int size, int stride, FloatBuffer pointer) { + assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + nglColorPointer(size, GL_FLOAT, stride, pointer, pointer.position() << 2); + } + private static native void nglColorPointer(int size, int type, int stride, Buffer pointer, int pointer_offset); + public static void glColorPointer(int size, int type, int stride, int buffer_offset) { + assert VBOTracker.getVBOArrayStack().getState() != 0: "Cannot use int offsets when VBO is disabled"; + nglColorPointerVBO(size, type, stride, buffer_offset); + } + private static native void nglColorPointerVBO(int size, int type, int stride, int buffer_offset); + public static native void glColorMaterial(int face, int mode); + public static native void glColorMask(boolean red, boolean green, boolean blue, boolean alpha); + public static native void glColor3b(byte red, byte green, byte blue); + public static native void glColor3f(float red, float green, float blue); + public static native void glColor3ub(byte red, byte green, byte blue); + public static native void glColor4b(byte red, byte green, byte blue, byte alpha); + public static native void glColor4f(float red, float green, float blue, float alpha); + public static native void glColor4ub(byte red, byte green, byte blue, byte alpha); + public static void glClipPlane(int plane, DoubleBuffer equation) { + nglClipPlane(plane, equation, equation.position() << 3); + } + private static native void nglClipPlane(int plane, DoubleBuffer equation, int equation_offset); + public static native void glClearStencil(int s); + public static native void glClearIndex(float c); + public static native void glEvalPoint1(int i); + public static native void glEvalPoint2(int i, int j); + public static native void glEvalMesh1(int mode, int i1, int i2); + public static native void glEvalMesh2(int mode, int i1, int i2, int j1, int j2); + public static native void glEvalCoord1f(float u); + public static native void glEvalCoord2f(float u, float v); + public static native void glEnableClientState(int cap); + public static native void glDisableClientState(int cap); + public static native void glEnable(int cap); + public static native void glDisable(int cap); + public static void glEdgeFlagPointer(int stride, ByteBuffer pointer) { + assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + nglEdgeFlagPointer(stride, pointer, pointer.position()); + } + private static native void nglEdgeFlagPointer(int stride, Buffer pointer, int pointer_offset); + public static void glEdgeFlagPointer(int stride, int buffer_offset) { + assert VBOTracker.getVBOArrayStack().getState() != 0: "Cannot use int offsets when VBO is disabled"; + nglEdgeFlagPointerVBO(stride, buffer_offset); + } + private static native void nglEdgeFlagPointerVBO(int stride, int buffer_offset); + public static native void glEdgeFlag(boolean flag); + public static void glDrawPixels(int width, int height, int format, int type, ByteBuffer pixels) { + nglDrawPixels(width, height, format, type, pixels, pixels.position()); + } + public static void glDrawPixels(int width, int height, int format, int type, ShortBuffer pixels) { + nglDrawPixels(width, height, format, type, pixels, pixels.position() << 1); + } + public static void glDrawPixels(int width, int height, int format, int type, IntBuffer pixels) { + nglDrawPixels(width, height, format, type, pixels, pixels.position() << 2); + } + private static native void nglDrawPixels(int width, int height, int format, int type, Buffer pixels, int pixels_offset); + public static void glDrawElements(int mode, ByteBuffer indices) { + assert VBOTracker.getVBOElementStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + nglDrawElements(mode, indices.remaining(), GL_UNSIGNED_BYTE, indices, indices.position()); + } + public static void glDrawElements(int mode, ShortBuffer indices) { + assert VBOTracker.getVBOElementStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + nglDrawElements(mode, indices.remaining(), GL_UNSIGNED_SHORT, indices, indices.position() << 1); + } + public static void glDrawElements(int mode, IntBuffer indices) { + assert VBOTracker.getVBOElementStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + nglDrawElements(mode, indices.remaining(), GL_UNSIGNED_INT, indices, indices.position() << 2); + } + private static native void nglDrawElements(int mode, int count, int type, Buffer indices, int indices_offset); + public static void glDrawElements(int mode, int count, int type, int buffer_offset) { + assert VBOTracker.getVBOElementStack().getState() != 0: "Cannot use int offsets when VBO is disabled"; + nglDrawElementsVBO(mode, count, type, buffer_offset); + } + private static native void nglDrawElementsVBO(int mode, int count, int type, int buffer_offset); + public static native void glDrawBuffer(int mode); + public static native void glDrawArrays(int mode, int first, int count); + public static native void glDepthRange(double zNear, double zFar); + public static native void glDepthMask(boolean flag); + public static native void glDepthFunc(int func); + public static void glFeedbackBuffer(int type, FloatBuffer buffer) { + nglFeedbackBuffer(buffer.remaining(), type, buffer, buffer.position()); + } + private static native void nglFeedbackBuffer(int size, int type, FloatBuffer buffer, int buffer_offset); + public static void glGetPixelMap(int map, FloatBuffer values) { + nglGetPixelMapfv(map, values, values.position()); + } + private static native void nglGetPixelMapfv(int map, FloatBuffer values, int values_offset); + public static void glGetPixelMap(int map, IntBuffer values) { + nglGetPixelMapuiv(map, values, values.position()); + } + private static native void nglGetPixelMapuiv(int map, IntBuffer values, int values_offset); + public static void glGetPixelMap(int map, ShortBuffer values) { + nglGetPixelMapusv(map, values, values.position()); + } + private static native void nglGetPixelMapusv(int map, ShortBuffer values, int values_offset); + public static void glGetMaterial(int face, int pname, FloatBuffer params) { + nglGetMaterialfv(face, pname, params, params.position()); + } + private static native void nglGetMaterialfv(int face, int pname, FloatBuffer params, int params_offset); + public static void glGetMaterial(int face, int pname, IntBuffer params) { + nglGetMaterialiv(face, pname, params, params.position()); + } + private static native void nglGetMaterialiv(int face, int pname, IntBuffer params, int params_offset); + public static void glGetMap(int target, int query, FloatBuffer v) { + nglGetMapfv(target, query, v, v.position()); + } + public static void glGetMap(int target, int query, IntBuffer v) { + nglGetMapiv(target, query, v, v.position()); + } + private static native void nglGetMapfv(int target, int query, FloatBuffer v, int v_offset); + private static native void nglGetMapiv(int target, int query, IntBuffer v, int v_offset); + public static void glGetLight(int light, int pname, FloatBuffer params) { + nglGetLightfv(light, pname, params, params.position()); + } + private static native void nglGetLightfv(int light, int pname, FloatBuffer params, int params_offset); + public static void glGetLight(int light, int pname, IntBuffer params) { + nglGetLightiv(light, pname, params, params.position()); + } + private static native void nglGetLightiv(int light, int pname, IntBuffer params, int params_offset); + public static native int glGetError(); + public static void glGetClipPlane(int plane, DoubleBuffer equation) { + nglGetClipPlane(plane, equation, equation.position()); + } + private static native void nglGetClipPlane(int plane, DoubleBuffer equation, int equation_offset); + public static void glGetBoolean(int pname, ByteBuffer params) { + nglGetBooleanv(pname, params, params.position()); + } + private static native void nglGetBooleanv(int pname, ByteBuffer params, int params_offset); + public static void glGetDouble(int pname, DoubleBuffer params) { + nglGetDoublev(pname, params, params.position()); + } + private static native void nglGetDoublev(int pname, DoubleBuffer params, int params_offset); + public static void glGetFloat(int pname, FloatBuffer params) { + nglGetFloatv(pname, params, params.position()); + } + private static native void nglGetFloatv(int pname, FloatBuffer params, int params_offset); + public static void glGetInteger(int pname, IntBuffer params) { + nglGetIntegerv(pname, params, params.position()); + } + private static native void nglGetIntegerv(int pname, IntBuffer params, int params_offset); + public static void glGenTextures(IntBuffer textures) { + nglGenTextures(textures.remaining(), textures, textures.position()); + } + private static native void nglGenTextures(int n, IntBuffer textures, int textures_offset); + public static native int glGenLists(int range); + public static native void glFrustum(double left, double right, double bottom, double top, double zNear, double zFar); + public static native void glFrontFace(int mode); + public static native void glFogf(int pname, float param); + public static native void glFogi(int pname, int param); + public static void glFog(int pname, FloatBuffer params) { + nglFogfv(pname, params, params.position()); + } + private static native void nglFogfv(int pname, FloatBuffer params, int params_offset); + public static void glFog(int pname, IntBuffer params) { + nglFogiv(pname, params, params.position()); + } + private static native void nglFogiv(int pname, IntBuffer params, int params_offset); + public static native void glFlush(); + public static native void glFinish(); + /** + * Fetch a pointer from OpenGL. Will return a ByteBuffer representing the pointer, where + * the size argument specifies the buffer size in bytes. + * + * @param size The size of the memory area pointed to. This is the size of the returned ByteBuffer. + * @return The ByteBuffer of the specified size pointing to the returned address. + */ + public static native ByteBuffer glGetPointerv(int pname, int size); + public static native boolean glIsEnabled(int cap); + public static void glInterleavedArrays(int format, int stride, ByteBuffer pointer) { + assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + nglInterleavedArrays(format, stride, pointer, pointer.position()); + } + public static void glInterleavedArrays(int format, int stride, ShortBuffer pointer) { + assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + nglInterleavedArrays(format, stride, pointer, pointer.position() << 1); + } + public static void glInterleavedArrays(int format, int stride, IntBuffer pointer) { + assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + nglInterleavedArrays(format, stride, pointer, pointer.position() << 2); + } + public static void glInterleavedArrays(int format, int stride, FloatBuffer pointer) { + assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + nglInterleavedArrays(format, stride, pointer, pointer.position() << 2); + } + private static native void nglInterleavedArrays(int format, int stride, Buffer pointer, int pointer_offset); + public static void glInterleavedArrays(int format, int stride, int buffer_offset) { + assert VBOTracker.getVBOArrayStack().getState() != 0: "Cannot use int offsets when VBO is disabled"; + nglInterleavedArraysVBO(format, stride, buffer_offset); + } + private static native void nglInterleavedArraysVBO(int format, int stride, int buffer_offset); + public static native void glInitNames(); + public static native void glHint(int target, int mode); + public static void glGetTexParameter(int target, int pname, FloatBuffer params) { + nglGetTexParameterfv(target, pname, params, params.position()); + } + private static native void nglGetTexParameterfv(int target, int pname, FloatBuffer params, int params_offset); + public static void glGetTexParameter(int target, int pname, IntBuffer params) { + nglGetTexParameteriv(target, pname, params, params.position()); + } + private static native void nglGetTexParameteriv(int target, int pname, IntBuffer params, int params_offset); + public static void glGetTexLevelParameter(int target, int level, int pname, FloatBuffer params) { + nglGetTexLevelParameterfv(target, level, pname, params, params.position()); + } + private static native void nglGetTexLevelParameterfv(int target, int level, int pname, FloatBuffer params, int params_offset); + public static void glGetTexLevelParameter(int target, int level, int pname, IntBuffer params) { + nglGetTexLevelParameteriv(target, level, pname, params, params.position()); + } + private static native void nglGetTexLevelParameteriv(int target, int level, int pname, IntBuffer params, int params_offset); + public static void glGetTexImage(int target, int level, int format, int type, ByteBuffer pixels) { + nglGetTexImage(target, level, format, type, pixels, pixels.position()); + } + public static void glGetTexImage(int target, int level, int format, int type, ShortBuffer pixels) { + nglGetTexImage(target, level, format, type, pixels, pixels.position() << 1); + } + public static void glGetTexImage(int target, int level, int format, int type, IntBuffer pixels) { + nglGetTexImage(target, level, format, type, pixels, pixels.position() << 2); + } + private static native void nglGetTexImage(int target, int level, int format, int type, Buffer pixels, int pixels_offset); + + public static void glGetTexGen(int coord, int pname, FloatBuffer params) { + nglGetTexGenfv(coord, pname, params, params.position()); + } + private static native void nglGetTexGenfv(int coord, int pname, FloatBuffer params, int params_offset); + + public static void glGetTexEnv(int coord, int pname, IntBuffer params) { + nglGetTexEnviv(coord, pname, params, params.position()); + } + private static native void nglGetTexEnviv(int coord, int pname, IntBuffer params, int params_offset); + public static void glGetTexEnv(int coord, int pname, FloatBuffer params) { + nglGetTexEnvfv(coord, pname, params, params.position()); + } + private static native void nglGetTexEnvfv(int coord, int pname, FloatBuffer params, int params_offset); + + public static native String glGetString(int name); + public static void glGetPolygonStipple(ByteBuffer mask) { + nglGetPolygonStipple(mask, mask.position()); + } + private static native void nglGetPolygonStipple(ByteBuffer mask, int mask_offset); + public static native boolean glIsList(int list); + public static native void glMaterialf(int face, int pname, float param); + public static native void glMateriali(int face, int pname, int param); + public static void glMaterial(int face, int pname, FloatBuffer params) { + nglMaterialfv(face, pname, params, params.position()); + } + private static native void nglMaterialfv(int face, int pname, FloatBuffer params, int params_offset); + public static void glMaterial(int face, int pname, IntBuffer params) { + nglMaterialiv(face, pname, params, params.position()); + } + private static native void nglMaterialiv(int face, int pname, IntBuffer params, int params_offset); + public static native void glMapGrid1f(int un, float u1, float u2); + public static native void glMapGrid2f(int un, float u1, float u2, int vn, float v1, float v2); + public static void glMap2f(int target, float u1, float u2, int ustride, int uorder, float v1, float v2, int vstride, int vorder, FloatBuffer points) { + nglMap2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points, points.position()); + } + private static native void nglMap2f(int target, float u1, float u2, int ustride, int uorder, float v1, float v2, int vstride, int vorder, FloatBuffer points, int points_offset); + public static void glMap1f(int target, float u1, float u2, int stride, int order, FloatBuffer points) { + nglMap1f(target, u1, u2, stride, order, points, points.position()); + } + private static native void nglMap1f(int target, float u1, float u2, int stride, int order, FloatBuffer points, int points_offset); + public static native void glLogicOp(int opcode); + public static native void glLoadName(int name); + public static void glLoadMatrixf(FloatBuffer m) { + nglLoadMatrixf(m, m.position()); + } + private static native void nglLoadMatrixf(FloatBuffer m, int m_offset); + public static native void glLoadIdentity(); + public static native void glListBase(int base); + public static native void glLineWidth(float width); + public static native void glLineStipple(int factor, short pattern); + public static native void glLightModelf(int pname, float param); + public static native void glLightModeli(int pname, int param); + public static void glLightModel(int pname, FloatBuffer params) { + nglLightModelfv( pname, params, params.position()); + } + private static native void nglLightModelfv(int pname, FloatBuffer params, int params_offset); + public static void glLightModel(int pname, IntBuffer params) { + nglLightModeliv(pname, params, params.position()); + } + private static native void nglLightModeliv(int pname, IntBuffer params, int params_offset); + public static native void glLightf(int light, int pname, float param); + public static native void glLighti(int light, int pname, int param); + public static void glLightfv(int light, int pname, FloatBuffer params) { + nglLightfv(light, pname, params, params.position()); + } + private static native void nglLightfv(int light, int pname, FloatBuffer params, int params_offset); + public static void glLightiv(int light, int pname, IntBuffer params) { + nglLightiv(light, pname, params, params.position()); + } + private static native void nglLightiv(int light, int pname, IntBuffer params, int params_offset); + public static native boolean glIsTexture(int texture); + public static native void glMatrixMode(int mode); + public static void glPolygonStipple(ByteBuffer mask) { + nglPolygonStipple(mask, mask.position()); + } + private static native void nglPolygonStipple(ByteBuffer mask, int mask_offset); + public static native void glPolygonOffset(float factor, float units); + public static native void glPolygonMode(int face, int mode); + public static native void glPointSize(float size); + public static native void glPixelZoom(float xfactor, float yfactor); + public static native void glPixelTransferf(int pname, float param); + public static native void glPixelTransferi(int pname, int param); + public static native void glPixelStoref(int pname, float param); + public static native void glPixelStorei(int pname, int param); + public static void glPixelMap(int map, FloatBuffer values) { + nglPixelMapfv(map, values.remaining(), values, values.position()); + } + private static native void nglPixelMapfv(int map, int mapsize, FloatBuffer values, int values_offset); + public static void glPixelMap(int map, IntBuffer values) { + nglPixelMapuiv(map, values.remaining(), values, values.position()); + } + private static native void nglPixelMapuiv(int map, int mapsize, IntBuffer values, int values_offset); + public static void glPixelMap(int map, ShortBuffer values) { + nglPixelMapusv(map, values.remaining(), values, values.position()); + } + private static native void nglPixelMapusv(int map, int mapsize, ShortBuffer values, int values_offset); + public static native void glPassThrough(float token); + public static native void glOrtho(double left, double right, double bottom, double top, double zNear, double zFar); + public static void glNormalPointer(int stride, ByteBuffer pointer) { + assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + nglNormalPointer(GL_BYTE, stride, pointer, pointer.position()); + } + public static void glNormalPointer(int stride, IntBuffer pointer) { + assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + nglNormalPointer(GL_INT, stride, pointer, pointer.position() << 2); + } + public static void glNormalPointer(int stride, FloatBuffer pointer) { + assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + nglNormalPointer(GL_FLOAT, stride, pointer, pointer.position() << 2); + } + private static native void nglNormalPointer(int type, int stride, Buffer pointer, int pointer_offset); + public static void glNormalPointer(int type, int stride, int buffer_offset) { + assert VBOTracker.getVBOArrayStack().getState() != 0: "Cannot use int offsets when VBO is disabled"; + nglNormalPointerVBO(type, stride, buffer_offset); + } + private static native void nglNormalPointerVBO(int type, int stride, int buffer_offset); + public static native void glNormal3b(byte nx, byte ny, byte nz); + public static native void glNormal3f(float nx, float ny, float nz); + public static native void glNormal3i(int nx, int ny, int nz); + public static native void glNewList(int list, int mode); + public static native void glEndList(); + public static void glMultMatrixf(FloatBuffer m) { + nglMultMatrixf(m, m.position()); + } + private static native void nglMultMatrixf(FloatBuffer m, int m_offset); + public static native void glShadeModel(int mode); + public static void glSelectBuffer(IntBuffer buffer) { + nglSelectBuffer(buffer.remaining(), buffer, buffer.position()); + } + private static native void nglSelectBuffer(int size, IntBuffer buffer, int buffer_offset); + public static native void glScissor(int x, int y, int width, int height); + public static native void glScalef(float x, float y, float z); + public static native void glRotatef(float angle, float x, float y, float z); + public static native int glRenderMode(int mode); + public static native void glRectf(float x1, float y1, float x2, float y2); + public static native void glRecti(int x1, int y1, int x2, int y2); + public static void glReadPixels(int x, int y, int width, int height, int format, int type, ByteBuffer pixels) { + nglReadPixels(x, y, width, height, format, type, pixels, pixels.position()); + } + public static void glReadPixels(int x, int y, int width, int height, int format, int type, ShortBuffer pixels) { + nglReadPixels(x, y, width, height, format, type, pixels, pixels.position() << 1); + } + public static void glReadPixels(int x, int y, int width, int height, int format, int type, IntBuffer pixels) { + nglReadPixels(x, y, width, height, format, type, pixels, pixels.position() << 2); + } + private static native void nglReadPixels(int x, int y, int width, int height, int format, int type, Buffer pixels, int pixels_offset); + public static native void glReadBuffer(int mode); + public static native void glRasterPos2f(float x, float y); + public static native void glRasterPos2i(int x, int y); + public static native void glRasterPos3f(float x, float y, float z); + public static native void glRasterPos3i(int x, int y, int z); + public static native void glRasterPos4f(float x, float y, float z, float w); + public static native void glRasterPos4i(int x, int y, int z, int w); + public static native void glPushName(int name); + public static native void glPopName(); + public static native void glPushMatrix(); + public static native void glPopMatrix(); + public static void glPushClientAttrib(int mask) { + VBOTracker.getClientAttribStack().pushState(); + VBOTracker.getClientAttribStack().setState(mask); + if ((mask & GL_CLIENT_VERTEX_ARRAY_BIT) != 0) { + VBOTracker.getVBOArrayStack().pushState(); + VBOTracker.getVBOElementStack().pushState(); + } + nglPushClientAttrib(mask); + } + private static native void nglPushClientAttrib(int mask); + public static void glPopClientAttrib() { + if ((VBOTracker.getClientAttribStack().popState() & GL_CLIENT_VERTEX_ARRAY_BIT) != 0) { + VBOTracker.getVBOArrayStack().popState(); + VBOTracker.getVBOElementStack().popState(); + } + nglPopClientAttrib(); + } + private static native void nglPopClientAttrib(); + public static native void glPushAttrib(int mask); + public static native void glPopAttrib(); + public static native void glStencilFunc(int func, int ref, int mask); + public static void glVertexPointer(int size, int stride, FloatBuffer pointer) { + assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + nglVertexPointer(size, GL_FLOAT, stride, pointer, pointer.position() << 2); + } + public static void glVertexPointer(int size, int stride, IntBuffer pointer) { + assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + nglVertexPointer(size, GL_INT, stride, pointer, pointer.position() << 2); + } + private static native void nglVertexPointer(int size, int type, int stride, Buffer pointer, int pointer_offset); + public static void glVertexPointer(int size, int type, int stride, int buffer_offset) { + assert VBOTracker.getVBOArrayStack().getState() != 0: "Cannot use int offsets when VBO is disabled"; + nglVertexPointerVBO(size, type, stride, buffer_offset); + } + private static native void nglVertexPointerVBO(int size, int type, int stride, int buffer_offset); + public static native void glVertex2f(float x, float y); + public static native void glVertex2i(int x, int y); + public static native void glVertex3f(float x, float y, float z); + public static native void glVertex3i(int x, int y, int z); + public static native void glVertex4f(float x, float y, float z, float w); + public static native void glVertex4i(int x, int y, int z, int w); + public static native void glTranslatef(float x, float y, float z); + public static void glTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, ByteBuffer pixels) { + nglTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels, pixels.position()); + } + public static void glTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, ShortBuffer pixels) { + nglTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels, pixels.position() << 1); + } + public static void glTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, IntBuffer pixels) { + nglTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels, pixels.position() << 2); + } + private static native void nglTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, Buffer pixels, int pixels_offset); + public static void glTexSubImage1D(int target, int level, int xoffset, int width, int format, int type, ByteBuffer pixels) { + nglTexSubImage1D(target, level, xoffset, width, format, type, pixels, pixels.position()); + } + public static void glTexSubImage1D(int target, int level, int xoffset, int width, int format, int type, ShortBuffer pixels) { + nglTexSubImage1D(target, level, xoffset, width, format, type, pixels, pixels.position() << 1); + } + public static void glTexSubImage1D(int target, int level, int xoffset, int width, int format, int type, IntBuffer pixels) { + nglTexSubImage1D(target, level, xoffset, width, format, type, pixels, pixels.position() << 2); + } + private static native void nglTexSubImage1D(int target, int level, int xoffset, int width, int format, int type, Buffer pixels, int pixels_offset); + public static native void glTexParameterf(int target, int pname, float param); + public static native void glTexParameteri(int target, int pname, int param); + public static void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, ByteBuffer pixels) { + nglTexImage2D(target, level, internalformat, width, height, border, format, type, pixels, pixels.position()); + } + public static void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, ShortBuffer pixels) { + nglTexImage2D(target, level, internalformat, width, height, border, format, type, pixels, pixels.position() << 1); + } + public static void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, IntBuffer pixels) { + nglTexImage2D(target, level, internalformat, width, height, border, format, type, pixels, pixels.position() << 2); + } + private static native void nglTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, Buffer pixels, int pixels_offset); + public static void glTexImage1D(int target, int level, int internalformat, int width, int border, int format, int type, ByteBuffer pixels) { + nglTexImage1D(target, level, internalformat, width, border, format, type, pixels, pixels.position()); + } + public static void glTexImage1D(int target, int level, int internalformat, int width, int border, int format, int type, ShortBuffer pixels) { + nglTexImage1D(target, level, internalformat, width, border, format, type, pixels, pixels.position() << 1); + } + public static void glTexImage1D(int target, int level, int internalformat, int width, int border, int format, int type, IntBuffer pixels) { + nglTexImage1D(target, level, internalformat, width, border, format, type, pixels, pixels.position() << 2); + } + private static native void nglTexImage1D(int target, int level, int internalformat, int width, int border, int format, int type, Buffer pixels, int pixels_offset); + public static native void glTexGenf(int coord, int pname, float param); + public static void glTexGen(int coord, int pname, FloatBuffer params) { + nglTexGenfv(coord, pname, params, params.position()); + } + private static native void nglTexGenfv(int coord, int pname, FloatBuffer params, int params_offset); + public static native void glTexGeni(int coord, int pname, int param); + public static void glTexGen(int coord, int pname, IntBuffer params) { + nglTexGeniv(coord, pname, params, params.position()); + } + private static native void nglTexGeniv(int coord, int pname, IntBuffer params, int params_offset); + public static native void glTexEnvf(int target, int pname, float param); + public static native void glTexEnvi(int target, int pname, int param); + public static void glTexEnv(int target, int pname, FloatBuffer params) { + nglTexEnvfv(target, pname, params, params.position()); + } + private static native void nglTexEnvfv(int target, int pname, FloatBuffer params, int params_offset); + public static void glTexEnv(int target, int pname, IntBuffer params) { + nglTexEnviv(target, pname, params, params.position()); + } + private static native void nglTexEnviv(int target, int pname, IntBuffer params, int params_offset); + public static void glTexCoordPointer(int size, int stride, FloatBuffer pointer) { + assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + nglTexCoordPointer(size, GL_FLOAT, stride, pointer, pointer.position() << 2); + } + private static native void nglTexCoordPointer(int size, int type, int stride, Buffer pointer, int pointer_offset); + public static void glTexCoordPointer(int size, int type, int stride, int buffer_offset) { + assert VBOTracker.getVBOArrayStack().getState() != 0: "Cannot use int offsets when VBO is disabled"; + nglTexCoordPointerVBO(size, type, stride, buffer_offset); + } + private static native void nglTexCoordPointerVBO(int size, int type, int stride, int buffer_offset); + public static native void glTexCoord1f(float s); + public static native void glTexCoord2f(float s, float t); + public static native void glTexCoord3f(float s, float t, float r); + public static native void glTexCoord4f(float s, float t, float r, float q); + public static native void glStencilOp(int fail, int zfail, int zpass); + public static native void glStencilMask(int mask); + public static native void glViewport(int x, int y, int width, int height); +} + diff --git a/src/java/org/lwjgl/opengl/CoreGL11Constants.java b/src/java/org/lwjgl/opengl/CoreGL11Constants.java new file mode 100644 index 00000000..13ade8e3 --- /dev/null +++ b/src/java/org/lwjgl/opengl/CoreGL11Constants.java @@ -0,0 +1,1056 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ + +package org.lwjgl.opengl; + +/** + * $Id$ + * + * Core OpenGL 1.1 constants. + * + * @author cix_foo + * @version $Revision$ + */ +public interface CoreGL11Constants { + /* AccumOp */ + public static final int GL_ACCUM = 0x0100; + public static final int GL_LOAD = 0x0101; + public static final int GL_RETURN = 0x0102; + public static final int GL_MULT = 0x0103; + public static final int GL_ADD = 0x0104; + + /* AlphaFunction */ + public static final int GL_NEVER = 0x0200; + public static final int GL_LESS = 0x0201; + public static final int GL_EQUAL = 0x0202; + public static final int GL_LEQUAL = 0x0203; + public static final int GL_GREATER = 0x0204; + public static final int GL_NOTEQUAL = 0x0205; + public static final int GL_GEQUAL = 0x0206; + public static final int GL_ALWAYS = 0x0207; + + /* AttribMask */ + public static final int GL_CURRENT_BIT = 0x00000001; + public static final int GL_POINT_BIT = 0x00000002; + public static final int GL_LINE_BIT = 0x00000004; + public static final int GL_POLYGON_BIT = 0x00000008; + public static final int GL_POLYGON_STIPPLE_BIT = 0x00000010; + public static final int GL_PIXEL_MODE_BIT = 0x00000020; + public static final int GL_LIGHTING_BIT = 0x00000040; + public static final int GL_FOG_BIT = 0x00000080; + public static final int GL_DEPTH_BUFFER_BIT = 0x00000100; + public static final int GL_ACCUM_BUFFER_BIT = 0x00000200; + public static final int GL_STENCIL_BUFFER_BIT = 0x00000400; + public static final int GL_VIEWPORT_BIT = 0x00000800; + public static final int GL_TRANSFORM_BIT = 0x00001000; + public static final int GL_ENABLE_BIT = 0x00002000; + public static final int GL_COLOR_BUFFER_BIT = 0x00004000; + public static final int GL_HINT_BIT = 0x00008000; + public static final int GL_EVAL_BIT = 0x00010000; + public static final int GL_LIST_BIT = 0x00020000; + public static final int GL_TEXTURE_BIT = 0x00040000; + public static final int GL_SCISSOR_BIT = 0x00080000; + public static final int GL_ALL_ATTRIB_BITS = 0x000fffff; + + /* BeginMode */ + public static final int GL_POINTS = 0x0000; + public static final int GL_LINES = 0x0001; + public static final int GL_LINE_LOOP = 0x0002; + public static final int GL_LINE_STRIP = 0x0003; + public static final int GL_TRIANGLES = 0x0004; + public static final int GL_TRIANGLE_STRIP = 0x0005; + public static final int GL_TRIANGLE_FAN = 0x0006; + public static final int GL_QUADS = 0x0007; + public static final int GL_QUAD_STRIP = 0x0008; + public static final int GL_POLYGON = 0x0009; + + /* BlendingFactorDest */ + public static final int GL_ZERO = 0; + public static final int GL_ONE = 1; + public static final int GL_SRC_COLOR = 0x0300; + public static final int GL_ONE_MINUS_SRC_COLOR = 0x0301; + public static final int GL_SRC_ALPHA = 0x0302; + public static final int GL_ONE_MINUS_SRC_ALPHA = 0x0303; + public static final int GL_DST_ALPHA = 0x0304; + public static final int GL_ONE_MINUS_DST_ALPHA = 0x0305; + + /* BlendingFactorSrc */ + /* GL_ZERO */ + /* GL_ONE */ + public static final int GL_DST_COLOR = 0x0306; + public static final int GL_ONE_MINUS_DST_COLOR = 0x0307; + public static final int GL_SRC_ALPHA_SATURATE = 0x0308; + public static final int GL_CONSTANT_COLOR = 0x8001; + public static final int GL_ONE_MINUS_CONSTANT_COLOR = 0x8002; + public static final int GL_CONSTANT_ALPHA = 0x8003; + public static final int GL_ONE_MINUS_CONSTANT_ALPHA = 0x8004; + + /* GL_SRC_ALPHA */ + /* GL_ONE_MINUS_SRC_ALPHA */ + /* GL_DST_ALPHA */ + /* GL_ONE_MINUS_DST_ALPHA */ + + /* Boolean */ + public static final int GL_TRUE = 1; + public static final int GL_FALSE = 0; + + /* ClearBufferMask */ + /* GL_COLOR_BUFFER_BIT */ + /* GL_ACCUM_BUFFER_BIT */ + /* GL_STENCIL_BUFFER_BIT */ + /* GL_DEPTH_BUFFER_BIT */ + + /* ClientArrayType */ + /* GL_VERTEX_ARRAY */ + /* GL_NORMAL_ARRAY */ + /* GL_COLOR_ARRAY */ + /* GL_INDEX_ARRAY */ + /* GL_TEXTURE_COORD_ARRAY */ + /* GL_EDGE_FLAG_ARRAY */ + + /* ClipPlaneName */ + public static final int GL_CLIP_PLANE0 = 0x3000; + public static final int GL_CLIP_PLANE1 = 0x3001; + public static final int GL_CLIP_PLANE2 = 0x3002; + public static final int GL_CLIP_PLANE3 = 0x3003; + public static final int GL_CLIP_PLANE4 = 0x3004; + public static final int GL_CLIP_PLANE5 = 0x3005; + + /* ColorMaterialFace */ + /* GL_FRONT */ + /* GL_BACK */ + /* GL_FRONT_AND_BACK */ + + /* ColorMaterialParameter */ + /* GL_AMBIENT */ + /* GL_DIFFUSE */ + /* GL_SPECULAR */ + /* GL_EMISSION */ + /* GL_AMBIENT_AND_DIFFUSE */ + + /* ColorPointerType */ + /* GL_BYTE */ + /* GL_UNSIGNED_BYTE */ + /* GL_SHORT */ + /* GL_UNSIGNED_SHORT */ + /* GL_INT */ + /* GL_UNSIGNED_INT */ + /* GL_FLOAT */ + /* GL_DOUBLE */ + + /* CullFaceMode */ + /* GL_FRONT */ + /* GL_BACK */ + /* GL_FRONT_AND_BACK */ + + /* DataType */ + public static final int GL_BYTE = 0x1400; + public static final int GL_UNSIGNED_BYTE = 0x1401; + public static final int GL_SHORT = 0x1402; + public static final int GL_UNSIGNED_SHORT = 0x1403; + public static final int GL_INT = 0x1404; + public static final int GL_UNSIGNED_INT = 0x1405; + public static final int GL_FLOAT = 0x1406; + public static final int GL_2_BYTES = 0x1407; + public static final int GL_3_BYTES = 0x1408; + public static final int GL_4_BYTES = 0x1409; + public static final int GL_DOUBLE = 0x140A; + + /* DepthFunction */ + /* GL_NEVER */ + /* GL_LESS */ + /* GL_EQUAL */ + /* GL_LEQUAL */ + /* GL_GREATER */ + /* GL_NOTEQUAL */ + /* GL_GEQUAL */ + /* GL_ALWAYS */ + + /* DrawBufferMode */ + public static final int GL_NONE = 0; + public static final int GL_FRONT_LEFT = 0x0400; + public static final int GL_FRONT_RIGHT = 0x0401; + public static final int GL_BACK_LEFT = 0x0402; + public static final int GL_BACK_RIGHT = 0x0403; + public static final int GL_FRONT = 0x0404; + public static final int GL_BACK = 0x0405; + public static final int GL_LEFT = 0x0406; + public static final int GL_RIGHT = 0x0407; + public static final int GL_FRONT_AND_BACK = 0x0408; + public static final int GL_AUX0 = 0x0409; + public static final int GL_AUX1 = 0x040A; + public static final int GL_AUX2 = 0x040B; + public static final int GL_AUX3 = 0x040C; + + /* Enable */ + /* GL_FOG */ + /* GL_LIGHTING */ + /* GL_TEXTURE_1D */ + /* GL_TEXTURE_2D */ + /* GL_LINE_STIPPLE */ + /* GL_POLYGON_STIPPLE */ + /* GL_CULL_FACE */ + /* GL_ALPHA_TEST */ + /* GL_BLEND */ + /* GL_INDEX_LOGIC_OP */ + /* GL_COLOR_LOGIC_OP */ + /* GL_DITHER */ + /* GL_STENCIL_TEST */ + /* GL_DEPTH_TEST */ + /* GL_CLIP_PLANE0 */ + /* GL_CLIP_PLANE1 */ + /* GL_CLIP_PLANE2 */ + /* GL_CLIP_PLANE3 */ + /* GL_CLIP_PLANE4 */ + /* GL_CLIP_PLANE5 */ + /* GL_LIGHT0 */ + /* GL_LIGHT1 */ + /* GL_LIGHT2 */ + /* GL_LIGHT3 */ + /* GL_LIGHT4 */ + /* GL_LIGHT5 */ + /* GL_LIGHT6 */ + /* GL_LIGHT7 */ + /* GL_TEXTURE_GEN_S */ + /* GL_TEXTURE_GEN_T */ + /* GL_TEXTURE_GEN_R */ + /* GL_TEXTURE_GEN_Q */ + /* GL_MAP1_VERTEX_3 */ + /* GL_MAP1_VERTEX_4 */ + /* GL_MAP1_COLOR_4 */ + /* GL_MAP1_INDEX */ + /* GL_MAP1_NORMAL */ + /* GL_MAP1_TEXTURE_COORD_1 */ + /* GL_MAP1_TEXTURE_COORD_2 */ + /* GL_MAP1_TEXTURE_COORD_3 */ + /* GL_MAP1_TEXTURE_COORD_4 */ + /* GL_MAP2_VERTEX_3 */ + /* GL_MAP2_VERTEX_4 */ + /* GL_MAP2_COLOR_4 */ + /* GL_MAP2_INDEX */ + /* GL_MAP2_NORMAL */ + /* GL_MAP2_TEXTURE_COORD_1 */ + /* GL_MAP2_TEXTURE_COORD_2 */ + /* GL_MAP2_TEXTURE_COORD_3 */ + /* GL_MAP2_TEXTURE_COORD_4 */ + /* GL_POINT_SMOOTH */ + /* GL_LINE_SMOOTH */ + /* GL_POLYGON_SMOOTH */ + /* GL_SCISSOR_TEST */ + /* GL_COLOR_MATERIAL */ + /* GL_NORMALIZE */ + /* GL_AUTO_NORMAL */ + /* GL_VERTEX_ARRAY */ + /* GL_NORMAL_ARRAY */ + /* GL_COLOR_ARRAY */ + /* GL_INDEX_ARRAY */ + /* GL_TEXTURE_COORD_ARRAY */ + /* GL_EDGE_FLAG_ARRAY */ + /* GL_POLYGON_OFFSET_POINT */ + /* GL_POLYGON_OFFSET_LINE */ + /* GL_POLYGON_OFFSET_FILL */ + + /* ErrorCode */ + public static final int GL_NO_ERROR = 0; + public static final int GL_INVALID_ENUM = 0x0500; + public static final int GL_INVALID_VALUE = 0x0501; + public static final int GL_INVALID_OPERATION = 0x0502; + public static final int GL_STACK_OVERFLOW = 0x0503; + public static final int GL_STACK_UNDERFLOW = 0x0504; + public static final int GL_OUT_OF_MEMORY = 0x0505; + + /* FeedBackMode */ + public static final int GL_2D = 0x0600; + public static final int GL_3D = 0x0601; + public static final int GL_3D_COLOR = 0x0602; + public static final int GL_3D_COLOR_TEXTURE = 0x0603; + public static final int GL_4D_COLOR_TEXTURE = 0x0604; + + /* FeedBackToken */ + public static final int GL_PASS_THROUGH_TOKEN = 0x0700; + public static final int GL_POINT_TOKEN = 0x0701; + public static final int GL_LINE_TOKEN = 0x0702; + public static final int GL_POLYGON_TOKEN = 0x0703; + public static final int GL_BITMAP_TOKEN = 0x0704; + public static final int GL_DRAW_PIXEL_TOKEN = 0x0705; + public static final int GL_COPY_PIXEL_TOKEN = 0x0706; + public static final int GL_LINE_RESET_TOKEN = 0x0707; + + /* FogMode */ + /* GL_LINEAR */ + public static final int GL_EXP = 0x0800; + public static final int GL_EXP2 = 0x0801; + + + /* FogParameter */ + /* GL_FOG_COLOR */ + /* GL_FOG_DENSITY */ + /* GL_FOG_END */ + /* GL_FOG_INDEX */ + /* GL_FOG_MODE */ + /* GL_FOG_START */ + + /* FrontFaceDirection */ + public static final int GL_CW = 0x0900; + public static final int GL_CCW = 0x0901; + + /* GetMapTarget */ + public static final int GL_COEFF = 0x0A00; + public static final int GL_ORDER = 0x0A01; + public static final int GL_DOMAIN = 0x0A02; + + /* GetPixelMap */ + /* GL_PIXEL_MAP_I_TO_I */ + /* GL_PIXEL_MAP_S_TO_S */ + /* GL_PIXEL_MAP_I_TO_R */ + /* GL_PIXEL_MAP_I_TO_G */ + /* GL_PIXEL_MAP_I_TO_B */ + /* GL_PIXEL_MAP_I_TO_A */ + /* GL_PIXEL_MAP_R_TO_R */ + /* GL_PIXEL_MAP_G_TO_G */ + /* GL_PIXEL_MAP_B_TO_B */ + /* GL_PIXEL_MAP_A_TO_A */ + + /* GetPointerTarget */ + /* GL_VERTEX_ARRAY_POINTER */ + /* GL_NORMAL_ARRAY_POINTER */ + /* GL_COLOR_ARRAY_POINTER */ + /* GL_INDEX_ARRAY_POINTER */ + /* GL_TEXTURE_COORD_ARRAY_POINTER */ + /* GL_EDGE_FLAG_ARRAY_POINTER */ + + /* GetTarget */ + public static final int GL_CURRENT_COLOR = 0x0B00; + public static final int GL_CURRENT_INDEX = 0x0B01; + public static final int GL_CURRENT_NORMAL = 0x0B02; + public static final int GL_CURRENT_TEXTURE_COORDS = 0x0B03; + public static final int GL_CURRENT_RASTER_COLOR = 0x0B04; + public static final int GL_CURRENT_RASTER_INDEX = 0x0B05; + public static final int GL_CURRENT_RASTER_TEXTURE_COORDS = 0x0B06; + public static final int GL_CURRENT_RASTER_POSITION = 0x0B07; + public static final int GL_CURRENT_RASTER_POSITION_VALID = 0x0B08; + public static final int GL_CURRENT_RASTER_DISTANCE = 0x0B09; + public static final int GL_POINT_SMOOTH = 0x0B10; + public static final int GL_POINT_SIZE = 0x0B11; + public static final int GL_POINT_SIZE_RANGE = 0x0B12; + public static final int GL_POINT_SIZE_GRANULARITY = 0x0B13; + public static final int GL_LINE_SMOOTH = 0x0B20; + public static final int GL_LINE_WIDTH = 0x0B21; + public static final int GL_LINE_WIDTH_RANGE = 0x0B22; + public static final int GL_LINE_WIDTH_GRANULARITY = 0x0B23; + public static final int GL_LINE_STIPPLE = 0x0B24; + public static final int GL_LINE_STIPPLE_PATTERN = 0x0B25; + public static final int GL_LINE_STIPPLE_REPEAT = 0x0B26; + public static final int GL_LIST_MODE = 0x0B30; + public static final int GL_MAX_LIST_NESTING = 0x0B31; + public static final int GL_LIST_BASE = 0x0B32; + public static final int GL_LIST_INDEX = 0x0B33; + public static final int GL_POLYGON_MODE = 0x0B40; + public static final int GL_POLYGON_SMOOTH = 0x0B41; + public static final int GL_POLYGON_STIPPLE = 0x0B42; + public static final int GL_EDGE_FLAG = 0x0B43; + public static final int GL_CULL_FACE = 0x0B44; + public static final int GL_CULL_FACE_MODE = 0x0B45; + public static final int GL_FRONT_FACE = 0x0B46; + public static final int GL_LIGHTING = 0x0B50; + public static final int GL_LIGHT_MODEL_LOCAL_VIEWER = 0x0B51; + public static final int GL_LIGHT_MODEL_TWO_SIDE = 0x0B52; + public static final int GL_LIGHT_MODEL_AMBIENT = 0x0B53; + public static final int GL_SHADE_MODEL = 0x0B54; + public static final int GL_COLOR_MATERIAL_FACE = 0x0B55; + public static final int GL_COLOR_MATERIAL_PARAMETER = 0x0B56; + public static final int GL_COLOR_MATERIAL = 0x0B57; + public static final int GL_FOG = 0x0B60; + public static final int GL_FOG_INDEX = 0x0B61; + public static final int GL_FOG_DENSITY = 0x0B62; + public static final int GL_FOG_START = 0x0B63; + public static final int GL_FOG_END = 0x0B64; + public static final int GL_FOG_MODE = 0x0B65; + public static final int GL_FOG_COLOR = 0x0B66; + public static final int GL_DEPTH_RANGE = 0x0B70; + public static final int GL_DEPTH_TEST = 0x0B71; + public static final int GL_DEPTH_WRITEMASK = 0x0B72; + public static final int GL_DEPTH_CLEAR_VALUE = 0x0B73; + public static final int GL_DEPTH_FUNC = 0x0B74; + public static final int GL_ACCUM_CLEAR_VALUE = 0x0B80; + public static final int GL_STENCIL_TEST = 0x0B90; + public static final int GL_STENCIL_CLEAR_VALUE = 0x0B91; + public static final int GL_STENCIL_FUNC = 0x0B92; + public static final int GL_STENCIL_VALUE_MASK = 0x0B93; + public static final int GL_STENCIL_FAIL = 0x0B94; + public static final int GL_STENCIL_PASS_DEPTH_FAIL = 0x0B95; + public static final int GL_STENCIL_PASS_DEPTH_PASS = 0x0B96; + public static final int GL_STENCIL_REF = 0x0B97; + public static final int GL_STENCIL_WRITEMASK = 0x0B98; + public static final int GL_MATRIX_MODE = 0x0BA0; + public static final int GL_NORMALIZE = 0x0BA1; + public static final int GL_VIEWPORT = 0x0BA2; + public static final int GL_MODELVIEW_STACK_DEPTH = 0x0BA3; + public static final int GL_PROJECTION_STACK_DEPTH = 0x0BA4; + public static final int GL_TEXTURE_STACK_DEPTH = 0x0BA5; + public static final int GL_MODELVIEW_MATRIX = 0x0BA6; + public static final int GL_PROJECTION_MATRIX = 0x0BA7; + public static final int GL_TEXTURE_MATRIX = 0x0BA8; + public static final int GL_ATTRIB_STACK_DEPTH = 0x0BB0; + public static final int GL_CLIENT_ATTRIB_STACK_DEPTH = 0x0BB1; + public static final int GL_ALPHA_TEST = 0x0BC0; + public static final int GL_ALPHA_TEST_FUNC = 0x0BC1; + public static final int GL_ALPHA_TEST_REF = 0x0BC2; + public static final int GL_DITHER = 0x0BD0; + public static final int GL_BLEND_DST = 0x0BE0; + public static final int GL_BLEND_SRC = 0x0BE1; + public static final int GL_BLEND = 0x0BE2; + public static final int GL_LOGIC_OP_MODE = 0x0BF0; + public static final int GL_INDEX_LOGIC_OP = 0x0BF1; + public static final int GL_COLOR_LOGIC_OP = 0x0BF2; + public static final int GL_AUX_BUFFERS = 0x0C00; + public static final int GL_DRAW_BUFFER = 0x0C01; + public static final int GL_READ_BUFFER = 0x0C02; + public static final int GL_SCISSOR_BOX = 0x0C10; + public static final int GL_SCISSOR_TEST = 0x0C11; + public static final int GL_INDEX_CLEAR_VALUE = 0x0C20; + public static final int GL_INDEX_WRITEMASK = 0x0C21; + public static final int GL_COLOR_CLEAR_VALUE = 0x0C22; + public static final int GL_COLOR_WRITEMASK = 0x0C23; + public static final int GL_INDEX_MODE = 0x0C30; + public static final int GL_RGBA_MODE = 0x0C31; + public static final int GL_DOUBLEBUFFER = 0x0C32; + public static final int GL_STEREO = 0x0C33; + public static final int GL_RENDER_MODE = 0x0C40; + public static final int GL_PERSPECTIVE_CORRECTION_HINT = 0x0C50; + public static final int GL_POINT_SMOOTH_HINT = 0x0C51; + public static final int GL_LINE_SMOOTH_HINT = 0x0C52; + public static final int GL_POLYGON_SMOOTH_HINT = 0x0C53; + public static final int GL_FOG_HINT = 0x0C54; + public static final int GL_TEXTURE_GEN_S = 0x0C60; + public static final int GL_TEXTURE_GEN_T = 0x0C61; + public static final int GL_TEXTURE_GEN_R = 0x0C62; + public static final int GL_TEXTURE_GEN_Q = 0x0C63; + public static final int GL_PIXEL_MAP_I_TO_I = 0x0C70; + public static final int GL_PIXEL_MAP_S_TO_S = 0x0C71; + public static final int GL_PIXEL_MAP_I_TO_R = 0x0C72; + public static final int GL_PIXEL_MAP_I_TO_G = 0x0C73; + public static final int GL_PIXEL_MAP_I_TO_B = 0x0C74; + public static final int GL_PIXEL_MAP_I_TO_A = 0x0C75; + public static final int GL_PIXEL_MAP_R_TO_R = 0x0C76; + public static final int GL_PIXEL_MAP_G_TO_G = 0x0C77; + public static final int GL_PIXEL_MAP_B_TO_B = 0x0C78; + public static final int GL_PIXEL_MAP_A_TO_A = 0x0C79; + public static final int GL_PIXEL_MAP_I_TO_I_SIZE = 0x0CB0; + public static final int GL_PIXEL_MAP_S_TO_S_SIZE = 0x0CB1; + public static final int GL_PIXEL_MAP_I_TO_R_SIZE = 0x0CB2; + public static final int GL_PIXEL_MAP_I_TO_G_SIZE = 0x0CB3; + public static final int GL_PIXEL_MAP_I_TO_B_SIZE = 0x0CB4; + public static final int GL_PIXEL_MAP_I_TO_A_SIZE = 0x0CB5; + public static final int GL_PIXEL_MAP_R_TO_R_SIZE = 0x0CB6; + public static final int GL_PIXEL_MAP_G_TO_G_SIZE = 0x0CB7; + public static final int GL_PIXEL_MAP_B_TO_B_SIZE = 0x0CB8; + public static final int GL_PIXEL_MAP_A_TO_A_SIZE = 0x0CB9; + public static final int GL_UNPACK_SWAP_BYTES = 0x0CF0; + public static final int GL_UNPACK_LSB_FIRST = 0x0CF1; + public static final int GL_UNPACK_ROW_LENGTH = 0x0CF2; + public static final int GL_UNPACK_SKIP_ROWS = 0x0CF3; + public static final int GL_UNPACK_SKIP_PIXELS = 0x0CF4; + public static final int GL_UNPACK_ALIGNMENT = 0x0CF5; + public static final int GL_PACK_SWAP_BYTES = 0x0D00; + public static final int GL_PACK_LSB_FIRST = 0x0D01; + public static final int GL_PACK_ROW_LENGTH = 0x0D02; + public static final int GL_PACK_SKIP_ROWS = 0x0D03; + public static final int GL_PACK_SKIP_PIXELS = 0x0D04; + public static final int GL_PACK_ALIGNMENT = 0x0D05; + public static final int GL_MAP_COLOR = 0x0D10; + public static final int GL_MAP_STENCIL = 0x0D11; + public static final int GL_INDEX_SHIFT = 0x0D12; + public static final int GL_INDEX_OFFSET = 0x0D13; + public static final int GL_RED_SCALE = 0x0D14; + public static final int GL_RED_BIAS = 0x0D15; + public static final int GL_ZOOM_X = 0x0D16; + public static final int GL_ZOOM_Y = 0x0D17; + public static final int GL_GREEN_SCALE = 0x0D18; + public static final int GL_GREEN_BIAS = 0x0D19; + public static final int GL_BLUE_SCALE = 0x0D1A; + public static final int GL_BLUE_BIAS = 0x0D1B; + public static final int GL_ALPHA_SCALE = 0x0D1C; + public static final int GL_ALPHA_BIAS = 0x0D1D; + public static final int GL_DEPTH_SCALE = 0x0D1E; + public static final int GL_DEPTH_BIAS = 0x0D1F; + public static final int GL_MAX_EVAL_ORDER = 0x0D30; + public static final int GL_MAX_LIGHTS = 0x0D31; + public static final int GL_MAX_CLIP_PLANES = 0x0D32; + public static final int GL_MAX_TEXTURE_SIZE = 0x0D33; + public static final int GL_MAX_PIXEL_MAP_TABLE = 0x0D34; + public static final int GL_MAX_ATTRIB_STACK_DEPTH = 0x0D35; + public static final int GL_MAX_MODELVIEW_STACK_DEPTH = 0x0D36; + public static final int GL_MAX_NAME_STACK_DEPTH = 0x0D37; + public static final int GL_MAX_PROJECTION_STACK_DEPTH = 0x0D38; + public static final int GL_MAX_TEXTURE_STACK_DEPTH = 0x0D39; + public static final int GL_MAX_VIEWPORT_DIMS = 0x0D3A; + public static final int GL_MAX_CLIENT_ATTRIB_STACK_DEPTH = 0x0D3B; + public static final int GL_SUBPIXEL_BITS = 0x0D50; + public static final int GL_INDEX_BITS = 0x0D51; + public static final int GL_RED_BITS = 0x0D52; + public static final int GL_GREEN_BITS = 0x0D53; + public static final int GL_BLUE_BITS = 0x0D54; + public static final int GL_ALPHA_BITS = 0x0D55; + public static final int GL_DEPTH_BITS = 0x0D56; + public static final int GL_STENCIL_BITS = 0x0D57; + public static final int GL_ACCUM_RED_BITS = 0x0D58; + public static final int GL_ACCUM_GREEN_BITS = 0x0D59; + public static final int GL_ACCUM_BLUE_BITS = 0x0D5A; + public static final int GL_ACCUM_ALPHA_BITS = 0x0D5B; + public static final int GL_NAME_STACK_DEPTH = 0x0D70; + public static final int GL_AUTO_NORMAL = 0x0D80; + public static final int GL_MAP1_COLOR_4 = 0x0D90; + public static final int GL_MAP1_INDEX = 0x0D91; + public static final int GL_MAP1_NORMAL = 0x0D92; + public static final int GL_MAP1_TEXTURE_COORD_1 = 0x0D93; + public static final int GL_MAP1_TEXTURE_COORD_2 = 0x0D94; + public static final int GL_MAP1_TEXTURE_COORD_3 = 0x0D95; + public static final int GL_MAP1_TEXTURE_COORD_4 = 0x0D96; + public static final int GL_MAP1_VERTEX_3 = 0x0D97; + public static final int GL_MAP1_VERTEX_4 = 0x0D98; + public static final int GL_MAP2_COLOR_4 = 0x0DB0; + public static final int GL_MAP2_INDEX = 0x0DB1; + public static final int GL_MAP2_NORMAL = 0x0DB2; + public static final int GL_MAP2_TEXTURE_COORD_1 = 0x0DB3; + public static final int GL_MAP2_TEXTURE_COORD_2 = 0x0DB4; + public static final int GL_MAP2_TEXTURE_COORD_3 = 0x0DB5; + public static final int GL_MAP2_TEXTURE_COORD_4 = 0x0DB6; + public static final int GL_MAP2_VERTEX_3 = 0x0DB7; + public static final int GL_MAP2_VERTEX_4 = 0x0DB8; + public static final int GL_MAP1_GRID_DOMAIN = 0x0DD0; + public static final int GL_MAP1_GRID_SEGMENTS = 0x0DD1; + public static final int GL_MAP2_GRID_DOMAIN = 0x0DD2; + public static final int GL_MAP2_GRID_SEGMENTS = 0x0DD3; + public static final int GL_TEXTURE_1D = 0x0DE0; + public static final int GL_TEXTURE_2D = 0x0DE1; + public static final int GL_FEEDBACK_BUFFER_POINTER = 0x0DF0; + public static final int GL_FEEDBACK_BUFFER_SIZE = 0x0DF1; + public static final int GL_FEEDBACK_BUFFER_TYPE = 0x0DF2; + public static final int GL_SELECTION_BUFFER_POINTER = 0x0DF3; + public static final int GL_SELECTION_BUFFER_SIZE = 0x0DF4; + /* GL_TEXTURE_BINDING_1D */ + /* GL_TEXTURE_BINDING_2D */ + /* GL_VERTEX_ARRAY */ + /* GL_NORMAL_ARRAY */ + /* GL_COLOR_ARRAY */ + /* GL_INDEX_ARRAY */ + /* GL_TEXTURE_COORD_ARRAY */ + /* GL_EDGE_FLAG_ARRAY */ + /* GL_VERTEX_ARRAY_SIZE */ + /* GL_VERTEX_ARRAY_TYPE */ + /* GL_VERTEX_ARRAY_STRIDE */ + /* GL_NORMAL_ARRAY_TYPE */ + /* GL_NORMAL_ARRAY_STRIDE */ + /* GL_COLOR_ARRAY_SIZE */ + /* GL_COLOR_ARRAY_TYPE */ + /* GL_COLOR_ARRAY_STRIDE */ + /* GL_INDEX_ARRAY_TYPE */ + /* GL_INDEX_ARRAY_STRIDE */ + /* GL_TEXTURE_COORD_ARRAY_SIZE */ + /* GL_TEXTURE_COORD_ARRAY_TYPE */ + /* GL_TEXTURE_COORD_ARRAY_STRIDE */ + /* GL_EDGE_FLAG_ARRAY_STRIDE */ + /* GL_POLYGON_OFFSET_FACTOR */ + /* GL_POLYGON_OFFSET_UNITS */ + + /* GetTextureParameter */ + /* GL_TEXTURE_MAG_FILTER */ + /* GL_TEXTURE_MIN_FILTER */ + /* GL_TEXTURE_WRAP_S */ + /* GL_TEXTURE_WRAP_T */ + public static final int GL_TEXTURE_WIDTH = 0x1000; + public static final int GL_TEXTURE_HEIGHT = 0x1001; + public static final int GL_TEXTURE_INTERNAL_FORMAT = 0x1003; + public static final int GL_TEXTURE_BORDER_COLOR = 0x1004; + public static final 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 */ + public static final int GL_DONT_CARE = 0x1100; + public static final int GL_FASTEST = 0x1101; + public static final int GL_NICEST = 0x1102; + + /* HintTarget */ + /* GL_PERSPECTIVE_CORRECTION_HINT */ + /* GL_POINT_SMOOTH_HINT */ + /* GL_LINE_SMOOTH_HINT */ + /* GL_POLYGON_SMOOTH_HINT */ + /* GL_FOG_HINT */ + /* GL_PHONG_HINT */ + + /* IndexPointerType */ + /* GL_SHORT */ + /* GL_INT */ + /* GL_FLOAT */ + /* GL_DOUBLE */ + + /* LightModelParameter */ + /* GL_LIGHT_MODEL_AMBIENT */ + /* GL_LIGHT_MODEL_LOCAL_VIEWER */ + /* GL_LIGHT_MODEL_TWO_SIDE */ + + /* LightName */ + public static final int GL_LIGHT0 = 0x4000; + public static final int GL_LIGHT1 = 0x4001; + public static final int GL_LIGHT2 = 0x4002; + public static final int GL_LIGHT3 = 0x4003; + public static final int GL_LIGHT4 = 0x4004; + public static final int GL_LIGHT5 = 0x4005; + public static final int GL_LIGHT6 = 0x4006; + public static final int GL_LIGHT7 = 0x4007; + + /* LightParameter */ + public static final int GL_AMBIENT = 0x1200; + public static final int GL_DIFFUSE = 0x1201; + public static final int GL_SPECULAR = 0x1202; + public static final int GL_POSITION = 0x1203; + public static final int GL_SPOT_DIRECTION = 0x1204; + public static final int GL_SPOT_EXPONENT = 0x1205; + public static final int GL_SPOT_CUTOFF = 0x1206; + public static final int GL_CONSTANT_ATTENUATION = 0x1207; + public static final int GL_LINEAR_ATTENUATION = 0x1208; + public static final int GL_QUADRATIC_ATTENUATION = 0x1209; + + /* InterleavedArrays */ + /* GL_V2F */ + /* GL_V3F */ + /* GL_C4UB_V2F */ + /* GL_C4UB_V3F */ + /* GL_C3F_V3F */ + /* GL_N3F_V3F */ + /* GL_C4F_N3F_V3F */ + /* GL_T2F_V3F */ + /* GL_T4F_V4F */ + /* GL_T2F_C4UB_V3F */ + /* GL_T2F_C3F_V3F */ + /* GL_T2F_N3F_V3F */ + /* GL_T2F_C4F_N3F_V3F */ + /* GL_T4F_C4F_N3F_V4F */ + + /* ListMode */ + public static final int GL_COMPILE = 0x1300; + public static final int GL_COMPILE_AND_EXECUTE = 0x1301; + + /* ListNameType */ + /* GL_BYTE */ + /* GL_UNSIGNED_BYTE */ + /* GL_SHORT */ + /* GL_UNSIGNED_SHORT */ + /* GL_INT */ + /* GL_UNSIGNED_INT */ + /* GL_FLOAT */ + /* GL_2_BYTES */ + /* GL_3_BYTES */ + /* GL_4_BYTES */ + + /* LogicOp */ + public static final int GL_CLEAR = 0x1500; + public static final int GL_AND = 0x1501; + public static final int GL_AND_REVERSE = 0x1502; + public static final int GL_COPY = 0x1503; + public static final int GL_AND_INVERTED = 0x1504; + public static final int GL_NOOP = 0x1505; + public static final int GL_XOR = 0x1506; + public static final int GL_OR = 0x1507; + public static final int GL_NOR = 0x1508; + public static final int GL_EQUIV = 0x1509; + public static final int GL_INVERT = 0x150A; + public static final int GL_OR_REVERSE = 0x150B; + public static final int GL_COPY_INVERTED = 0x150C; + public static final int GL_OR_INVERTED = 0x150D; + public static final int GL_NAND = 0x150E; + public static final int GL_SET = 0x150F; + + /* MapTarget */ + /* GL_MAP1_COLOR_4 */ + /* GL_MAP1_INDEX */ + /* GL_MAP1_NORMAL */ + /* GL_MAP1_TEXTURE_COORD_1 */ + /* GL_MAP1_TEXTURE_COORD_2 */ + /* GL_MAP1_TEXTURE_COORD_3 */ + /* GL_MAP1_TEXTURE_COORD_4 */ + /* GL_MAP1_VERTEX_3 */ + /* GL_MAP1_VERTEX_4 */ + /* GL_MAP2_COLOR_4 */ + /* GL_MAP2_INDEX */ + /* GL_MAP2_NORMAL */ + /* GL_MAP2_TEXTURE_COORD_1 */ + /* GL_MAP2_TEXTURE_COORD_2 */ + /* GL_MAP2_TEXTURE_COORD_3 */ + /* GL_MAP2_TEXTURE_COORD_4 */ + /* GL_MAP2_VERTEX_3 */ + /* GL_MAP2_VERTEX_4 */ + + /* MaterialFace */ + /* GL_FRONT */ + /* GL_BACK */ + /* GL_FRONT_AND_BACK */ + + /* MaterialParameter */ + public static final int GL_EMISSION = 0x1600; + public static final int GL_SHININESS = 0x1601; + public static final int GL_AMBIENT_AND_DIFFUSE = 0x1602; + public static final int GL_COLOR_INDEXES = 0x1603; + /* GL_AMBIENT */ + /* GL_DIFFUSE */ + /* GL_SPECULAR */ + + /* MatrixMode */ + public static final int GL_MODELVIEW = 0x1700; + public static final int GL_PROJECTION = 0x1701; + public static final int GL_TEXTURE = 0x1702; + + /* MeshMode1 */ + /* GL_POINT */ + /* GL_LINE */ + + /* MeshMode2 */ + /* GL_POINT */ + /* GL_LINE */ + /* GL_FILL */ + + /* NormalPointerType */ + /* GL_BYTE */ + /* GL_SHORT */ + /* GL_INT */ + /* GL_FLOAT */ + /* GL_DOUBLE */ + + /* PixelCopyType */ + public static final int GL_COLOR = 0x1800; + public static final int GL_DEPTH = 0x1801; + public static final int GL_STENCIL = 0x1802; + + /* PixelFormat */ + public static final int GL_COLOR_INDEX = 0x1900; + public static final int GL_STENCIL_INDEX = 0x1901; + public static final int GL_DEPTH_COMPONENT = 0x1902; + public static final int GL_RED = 0x1903; + public static final int GL_GREEN = 0x1904; + public static final int GL_BLUE = 0x1905; + public static final int GL_ALPHA = 0x1906; + public static final int GL_RGB = 0x1907; + public static final int GL_RGBA = 0x1908; + public static final int GL_LUMINANCE = 0x1909; + public static final int GL_LUMINANCE_ALPHA = 0x190A; + + /* PixelMap */ + /* GL_PIXEL_MAP_I_TO_I */ + /* GL_PIXEL_MAP_S_TO_S */ + /* GL_PIXEL_MAP_I_TO_R */ + /* GL_PIXEL_MAP_I_TO_G */ + /* GL_PIXEL_MAP_I_TO_B */ + /* GL_PIXEL_MAP_I_TO_A */ + /* GL_PIXEL_MAP_R_TO_R */ + /* GL_PIXEL_MAP_G_TO_G */ + /* GL_PIXEL_MAP_B_TO_B */ + /* GL_PIXEL_MAP_A_TO_A */ + + /* PixelStore */ + /* GL_UNPACK_SWAP_BYTES */ + /* GL_UNPACK_LSB_FIRST */ + /* GL_UNPACK_ROW_LENGTH */ + /* GL_UNPACK_SKIP_ROWS */ + /* GL_UNPACK_SKIP_PIXELS */ + /* GL_UNPACK_ALIGNMENT */ + /* GL_PACK_SWAP_BYTES */ + /* GL_PACK_LSB_FIRST */ + /* GL_PACK_ROW_LENGTH */ + /* GL_PACK_SKIP_ROWS */ + /* GL_PACK_SKIP_PIXELS */ + /* GL_PACK_ALIGNMENT */ + + /* PixelTransfer */ + /* GL_MAP_COLOR */ + /* GL_MAP_STENCIL */ + /* GL_INDEX_SHIFT */ + /* GL_INDEX_OFFSET */ + /* GL_RED_SCALE */ + /* GL_RED_BIAS */ + /* GL_GREEN_SCALE */ + /* GL_GREEN_BIAS */ + /* GL_BLUE_SCALE */ + /* GL_BLUE_BIAS */ + /* GL_ALPHA_SCALE */ + /* GL_ALPHA_BIAS */ + /* GL_DEPTH_SCALE */ + /* GL_DEPTH_BIAS */ + + /* PixelType */ + public static final int GL_BITMAP = 0x1A00; + /* GL_BYTE */ + /* GL_UNSIGNED_BYTE */ + /* GL_SHORT */ + /* GL_UNSIGNED_SHORT */ + /* GL_INT */ + /* GL_UNSIGNED_INT */ + /* GL_FLOAT */ + + /* PolygonMode */ + public static final int GL_POINT = 0x1B00; + public static final int GL_LINE = 0x1B01; + public static final int GL_FILL = 0x1B02; + + /* ReadBufferMode */ + /* GL_FRONT_LEFT */ + /* GL_FRONT_RIGHT */ + /* GL_BACK_LEFT */ + /* GL_BACK_RIGHT */ + /* GL_FRONT */ + /* GL_BACK */ + /* GL_LEFT */ + /* GL_RIGHT */ + /* GL_AUX0 */ + /* GL_AUX1 */ + /* GL_AUX2 */ + /* GL_AUX3 */ + + /* RenderingMode */ + public static final int GL_RENDER = 0x1C00; + public static final int GL_FEEDBACK = 0x1C01; + public static final int GL_SELECT = 0x1C02; + + /* ShadingModel */ + public static final int GL_FLAT = 0x1D00; + public static final int GL_SMOOTH = 0x1D01; + + + /* StencilFunction */ + /* GL_NEVER */ + /* GL_LESS */ + /* GL_EQUAL */ + /* GL_LEQUAL */ + /* GL_GREATER */ + /* GL_NOTEQUAL */ + /* GL_GEQUAL */ + /* GL_ALWAYS */ + + /* StencilOp */ + /* GL_ZERO */ + public static final int GL_KEEP = 0x1E00; + public static final int GL_REPLACE = 0x1E01; + public static final int GL_INCR = 0x1E02; + public static final int GL_DECR = 0x1E03; + /* GL_INVERT */ + + /* StringName */ + public static final int GL_VENDOR = 0x1F00; + public static final int GL_RENDERER = 0x1F01; + public static final int GL_VERSION = 0x1F02; + public static final int GL_EXTENSIONS = 0x1F03; + + /* TextureCoordName */ + public static final int GL_S = 0x2000; + public static final int GL_T = 0x2001; + public static final int GL_R = 0x2002; + public static final int GL_Q = 0x2003; + + /* TexCoordPointerType */ + /* GL_SHORT */ + /* GL_INT */ + /* GL_FLOAT */ + /* GL_DOUBLE */ + + /* TextureEnvMode */ + public static final int GL_MODULATE = 0x2100; + public static final int GL_DECAL = 0x2101; + /* GL_BLEND */ + /* GL_REPLACE */ + + /* TextureEnvParameter */ + public static final int GL_TEXTURE_ENV_MODE = 0x2200; + public static final int GL_TEXTURE_ENV_COLOR = 0x2201; + + /* TextureEnvTarget */ + public static final int GL_TEXTURE_ENV = 0x2300; + + /* TextureGenMode */ + public static final int GL_EYE_LINEAR = 0x2400; + public static final int GL_OBJECT_LINEAR = 0x2401; + public static final int GL_SPHERE_MAP = 0x2402; + + /* TextureGenParameter */ + public static final int GL_TEXTURE_GEN_MODE = 0x2500; + public static final int GL_OBJECT_PLANE = 0x2501; + public static final int GL_EYE_PLANE = 0x2502; + + /* TextureMagFilter */ + public static final int GL_NEAREST = 0x2600; + public static final int GL_LINEAR = 0x2601; + + /* TextureMinFilter */ + /* GL_NEAREST */ + /* GL_LINEAR */ + public static final int GL_NEAREST_MIPMAP_NEAREST = 0x2700; + public static final int GL_LINEAR_MIPMAP_NEAREST = 0x2701; + public static final int GL_NEAREST_MIPMAP_LINEAR = 0x2702; + public static final int GL_LINEAR_MIPMAP_LINEAR = 0x2703; + + /* TextureParameterName */ + public static final int GL_TEXTURE_MAG_FILTER = 0x2800; + public static final int GL_TEXTURE_MIN_FILTER = 0x2801; + public static final int GL_TEXTURE_WRAP_S = 0x2802; + public static final int GL_TEXTURE_WRAP_T = 0x2803; + /* GL_TEXTURE_BORDER_COLOR */ + /* GL_TEXTURE_PRIORITY */ + + /* TextureTarget */ + /* GL_TEXTURE_1D */ + /* GL_TEXTURE_2D */ + /* GL_PROXY_TEXTURE_1D */ + /* GL_PROXY_TEXTURE_2D */ + + /* TextureWrapMode */ + public static final int GL_CLAMP = 0x2900; + public static final int GL_REPEAT = 0x2901; + + /* VertexPointerType */ + /* GL_SHORT */ + /* GL_INT */ + /* GL_FLOAT */ + /* GL_DOUBLE */ + + /* ClientAttribMask */ + public static final int GL_CLIENT_PIXEL_STORE_BIT = 0x00000001; + public static final int GL_CLIENT_VERTEX_ARRAY_BIT = 0x00000002; + public static final int GL_ALL_CLIENT_ATTRIB_BITS = 0xffffffff; + + /* polygon_offset */ + public static final int GL_POLYGON_OFFSET_FACTOR = 0x8038; + public static final int GL_POLYGON_OFFSET_UNITS = 0x2A00; + public static final int GL_POLYGON_OFFSET_POINT = 0x2A01; + public static final int GL_POLYGON_OFFSET_LINE = 0x2A02; + public static final int GL_POLYGON_OFFSET_FILL = 0x8037; + + /* texture */ + public static final int GL_ALPHA4 = 0x803B; + public static final int GL_ALPHA8 = 0x803C; + public static final int GL_ALPHA12 = 0x803D; + public static final int GL_ALPHA16 = 0x803E; + public static final int GL_LUMINANCE4 = 0x803F; + public static final int GL_LUMINANCE8 = 0x8040; + public static final int GL_LUMINANCE12 = 0x8041; + public static final int GL_LUMINANCE16 = 0x8042; + public static final int GL_LUMINANCE4_ALPHA4 = 0x8043; + public static final int GL_LUMINANCE6_ALPHA2 = 0x8044; + public static final int GL_LUMINANCE8_ALPHA8 = 0x8045; + public static final int GL_LUMINANCE12_ALPHA4 = 0x8046; + public static final int GL_LUMINANCE12_ALPHA12 = 0x8047; + public static final int GL_LUMINANCE16_ALPHA16 = 0x8048; + public static final int GL_INTENSITY = 0x8049; + public static final int GL_INTENSITY4 = 0x804A; + public static final int GL_INTENSITY8 = 0x804B; + public static final int GL_INTENSITY12 = 0x804C; + public static final int GL_INTENSITY16 = 0x804D; + public static final int GL_R3_G3_B2 = 0x2A10; + public static final int GL_RGB4 = 0x804F; + public static final int GL_RGB5 = 0x8050; + public static final int GL_RGB8 = 0x8051; + public static final int GL_RGB10 = 0x8052; + public static final int GL_RGB12 = 0x8053; + public static final int GL_RGB16 = 0x8054; + public static final int GL_RGBA2 = 0x8055; + public static final int GL_RGBA4 = 0x8056; + public static final int GL_RGB5_A1 = 0x8057; + public static final int GL_RGBA8 = 0x8058; + public static final int GL_RGB10_A2 = 0x8059; + public static final int GL_RGBA12 = 0x805A; + public static final int GL_RGBA16 = 0x805B; + public static final int GL_TEXTURE_RED_SIZE = 0x805C; + public static final int GL_TEXTURE_GREEN_SIZE = 0x805D; + public static final int GL_TEXTURE_BLUE_SIZE = 0x805E; + public static final int GL_TEXTURE_ALPHA_SIZE = 0x805F; + public static final int GL_TEXTURE_LUMINANCE_SIZE = 0x8060; + public static final int GL_TEXTURE_INTENSITY_SIZE = 0x8061; + public static final int GL_PROXY_TEXTURE_1D = 0x8063; + public static final int GL_PROXY_TEXTURE_2D = 0x8064; + + /* texture_object */ + public static final int GL_TEXTURE_PRIORITY = 0x8066; + public static final int GL_TEXTURE_RESIDENT = 0x8067; + public static final int GL_TEXTURE_BINDING_1D = 0x8068; + public static final int GL_TEXTURE_BINDING_2D = 0x8069; + + /* vertex_array */ + public static final int GL_VERTEX_ARRAY = 0x8074; + public static final int GL_NORMAL_ARRAY = 0x8075; + public static final int GL_COLOR_ARRAY = 0x8076; + public static final int GL_INDEX_ARRAY = 0x8077; + public static final int GL_TEXTURE_COORD_ARRAY = 0x8078; + public static final int GL_EDGE_FLAG_ARRAY = 0x8079; + public static final int GL_VERTEX_ARRAY_SIZE = 0x807A; + public static final int GL_VERTEX_ARRAY_TYPE = 0x807B; + public static final int GL_VERTEX_ARRAY_STRIDE = 0x807C; + public static final int GL_NORMAL_ARRAY_TYPE = 0x807E; + public static final int GL_NORMAL_ARRAY_STRIDE = 0x807F; + public static final int GL_COLOR_ARRAY_SIZE = 0x8081; + public static final int GL_COLOR_ARRAY_TYPE = 0x8082; + public static final int GL_COLOR_ARRAY_STRIDE = 0x8083; + public static final int GL_INDEX_ARRAY_TYPE = 0x8085; + public static final int GL_INDEX_ARRAY_STRIDE = 0x8086; + public static final int GL_TEXTURE_COORD_ARRAY_SIZE = 0x8088; + public static final int GL_TEXTURE_COORD_ARRAY_TYPE = 0x8089; + public static final int GL_TEXTURE_COORD_ARRAY_STRIDE = 0x808A; + public static final int GL_EDGE_FLAG_ARRAY_STRIDE = 0x808C; + public static final int GL_VERTEX_ARRAY_POINTER = 0x808E; + public static final int GL_NORMAL_ARRAY_POINTER = 0x808F; + public static final int GL_COLOR_ARRAY_POINTER = 0x8090; + public static final int GL_INDEX_ARRAY_POINTER = 0x8091; + public static final int GL_TEXTURE_COORD_ARRAY_POINTER = 0x8092; + public static final int GL_EDGE_FLAG_ARRAY_POINTER = 0x8093; + public static final int GL_V2F = 0x2A20; + public static final int GL_V3F = 0x2A21; + public static final int GL_C4UB_V2F = 0x2A22; + public static final int GL_C4UB_V3F = 0x2A23; + public static final int GL_C3F_V3F = 0x2A24; + public static final int GL_N3F_V3F = 0x2A25; + public static final int GL_C4F_N3F_V3F = 0x2A26; + public static final int GL_T2F_V3F = 0x2A27; + public static final int GL_T4F_V4F = 0x2A28; + public static final int GL_T2F_C4UB_V3F = 0x2A29; + public static final int GL_T2F_C3F_V3F = 0x2A2A; + public static final int GL_T2F_N3F_V3F = 0x2A2B; + public static final int GL_T2F_C4F_N3F_V3F = 0x2A2C; + public static final int GL_T4F_C4F_N3F_V4F = 0x2A2D; + + /* For compatibility with OpenGL v1.0 */ + public static final int GL_LOGIC_OP = GL_INDEX_LOGIC_OP; + public static final int GL_TEXTURE_COMPONENTS = GL_TEXTURE_INTERNAL_FORMAT; +} diff --git a/src/java/org/lwjgl/opengl/CoreGL12.java b/src/java/org/lwjgl/opengl/CoreGL12.java new file mode 100644 index 00000000..cc5185d4 --- /dev/null +++ b/src/java/org/lwjgl/opengl/CoreGL12.java @@ -0,0 +1,233 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ + +package org.lwjgl.opengl; + +import java.nio.*; +import java.nio.IntBuffer; +import java.nio.FloatBuffer; +import java.nio.Buffer; + +/** + * $Id: CoreGL.java,v 1.23 2003/07/23 14:51:19 elias_naur Exp $ + * + * The core OpenGL1.2.1 API, with the imaging subset. + * + * @author cix_foo + * @version $Revision: 1.23 $ + */ +public abstract class CoreGL12 extends CoreGL11 implements CoreGL12Constants { + + public static void glColorTable(int target, int internalFormat, int width, int format, int type, ByteBuffer data) { + nglColorTable(target, internalFormat, width, format, type, data, data.position()); + } + public static void glColorTable(int target, int internalFormat, int width, int format, int type, FloatBuffer data) { + nglColorTable(target, internalFormat, width, format, type, data, data.position() << 2); + } + private static native void nglColorTable(int target, int internalFormat, int width, int format, int type, Buffer data, int data_offset); + public static void glColorSubTable(int target, int start, int count, int format, int type, ByteBuffer data) { + nglColorSubTable(target, start, count, format, type, data, data.position()); + } + public static void glColorSubTable(int target, int start, int count, int format, int type, FloatBuffer data) { + nglColorSubTable(target, start, count, format, type, data, data.position() << 2); + } + private static native void nglColorSubTable(int target, int start, int count, int format, int type, Buffer data, int data_offset); + public static void glColorTableParameter(int target, int pname, IntBuffer params) { + nglColorTableParameteriv(target, pname, params, params.position()); + } + private static native void nglColorTableParameteriv(int target, int pname, IntBuffer params, int data_offset); + public static void glColorTableParameter(int target, int pname, FloatBuffer params) { + nglColorTableParameterfv(target, pname, params, params.position()); + } + private static native void nglColorTableParameterfv(int target, int pname, FloatBuffer params, int data_offset); + public static native void glCopyColorSubTable(int target, int start, int x, int y, int width); + public static native void glCopyColorTable(int target, int internalformat, int x, int y, int width); + public static void glGetColorTable(int target, int format, int type, ByteBuffer data) { + nglGetColorTable(target, format, type, data, data.position()); + } + public static void glGetColorTable(int target, int format, int type, FloatBuffer data) { + nglGetColorTable(target, format, type, data, data.position()); + } + private static native void nglGetColorTable(int target, int format, int type, Buffer data, int data_offset); + public static void glGetColorTableParameter(int target, int pname, IntBuffer params) { + nglGetColorTableParameteriv(target, pname, params, params.position()); + } + private static native void nglGetColorTableParameteriv(int target, int pname, IntBuffer params, int params_offset); + public static void glGetColorTableParameter(int target, int pname, FloatBuffer params) { + nglGetColorTableParameterfv(target, pname, params, params.position()); + } + private static native void nglGetColorTableParameterfv(int target, int pname, FloatBuffer params, int params_offset); + public static native void glBlendEquation(int mode); + public static native void glBlendColor(float red, float green, float blue, float alpha); + public static native void glHistogram(int target, int width, int internalformat, boolean sink); + public static native void glResetHistogram(int target); + public static void glGetHistogram(int target, boolean reset, int format, int type, ByteBuffer values) { + nglGetHistogram(target, reset, format, type, values, values.position()); + } + public static void glGetHistogram(int target, boolean reset, int format, int type, ShortBuffer values) { + nglGetHistogram(target, reset, format, type, values, values.position() << 1); + } + public static void glGetHistogram(int target, boolean reset, int format, int type, IntBuffer values) { + nglGetHistogram(target, reset, format, type, values, values.position() << 2); + } + public static void glGetHistogram(int target, boolean reset, int format, int type, FloatBuffer values) { + nglGetHistogram(target, reset, format, type, values, values.position() << 2); + } + private static native void nglGetHistogram(int target, boolean reset, int format, int type, Buffer values, int values_offset); + public static void glGetHistogramParameter(int target, int pname, FloatBuffer params) { + nglGetHistogramParameterfv(target, pname, params, params.position()); + } + private static native void nglGetHistogramParameterfv(int target, int pname, FloatBuffer params, int params_offset); + public static void glGetHistogramParameter(int target, int pname, IntBuffer params) { + nglGetHistogramParameteriv(target, pname, params, params.position()); + } + private static native void nglGetHistogramParameteriv(int target, int pname, IntBuffer params, int params_offset); + public static native void glMinmax(int target, int internalformat, boolean sink); + public static native void glResetMinmax(int target); + public static void glGetMinmax(int target, boolean reset, int format, int types, ByteBuffer values) { + nglGetMinmax(target, reset, format, types, values, values.position()); + } + public static void glGetMinmax(int target, boolean reset, int format, int types, ShortBuffer values) { + nglGetMinmax(target, reset, format, types, values, values.position() << 1); + } + public static void glGetMinmax(int target, boolean reset, int format, int types, IntBuffer values) { + nglGetMinmax(target, reset, format, types, values, values.position() << 2); + } + public static void glGetMinmax(int target, boolean reset, int format, int types, FloatBuffer values) { + nglGetMinmax(target, reset, format, types, values, values.position() << 2); + } + private static native void nglGetMinmax(int target, boolean reset, int format, int types, Buffer values, int values_offset); + public static void glGetMinmaxParameter(int target, int pname, FloatBuffer params) { + nglGetMinmaxParameterfv(target, pname, params, params.position()); + } + private static native void nglGetMinmaxParameterfv(int target, int pname, FloatBuffer params, int params_offset); + public static void glGetMinmaxParameter(int target, int pname, IntBuffer params) { + nglGetMinmaxParameteriv(target, pname, params, params.position()); + } + private static native void nglGetMinmaxParameteriv(int target, int pname, IntBuffer params, int params_offset); + public static void glConvolutionFilter1D(int target, int internalformat, int width, int format, int type, ByteBuffer image) { + nglConvolutionFilter1D(target, internalformat, width, format, type, image, image.position()); + } + public static void glConvolutionFilter1D(int target, int internalformat, int width, int format, int type, ShortBuffer image) { + nglConvolutionFilter1D(target, internalformat, width, format, type, image, image.position()); + } + public static void glConvolutionFilter1D(int target, int internalformat, int width, int format, int type, IntBuffer image) { + nglConvolutionFilter1D(target, internalformat, width, format, type, image, image.position()); + } + public static void glConvolutionFilter1D(int target, int internalformat, int width, int format, int type, FloatBuffer image) { + nglConvolutionFilter1D(target, internalformat, width, format, type, image, image.position()); + } + private static native void nglConvolutionFilter1D(int target, int internalformat, int width, int format, int type, Buffer image, int image_offset); + public static void glConvolutionFilter2D(int target, int internalformat, int width, int height, int format, int type, Buffer image) { + } + private static native void nglConvolutionFilter2D(int target, int internalformat, int width, int height, int format, int type, Buffer image, int image_offset); + public static native void glConvolutionParameterf(int target, int pname, float params); + public static void glConvolutionParameter(int target, int pname, FloatBuffer params) { + } + private static native void nglConvolutionParameterfv(int target, int pname, FloatBuffer params, int params_offset); + public static native void glConvolutionParameteri(int target, int pname, int params); + public static void glConvolutionParameteriv(int target, int pname, IntBuffer params) { + nglConvolutionParameteriv(target, pname, params, params.position()); + } + private static native void nglConvolutionParameteriv(int target, int pname, IntBuffer params, int params_offset); + public static native void glCopyConvolutionFilter1D(int target, int internalformat, int x, int y, int width); + public static native void glCopyConvolutionFilter2D(int target, int internalformat, int x, int y, int width, int height); + public static void glGetConvolutionFilter(int target, int format, int type, ByteBuffer image) { + nglGetConvolutionFilter(target, format, type, image, image.position()); + } + public static void glGetConvolutionFilter(int target, int format, int type, ShortBuffer image) { + nglGetConvolutionFilter(target, format, type, image, image.position() << 1); + } + public static void glGetConvolutionFilter(int target, int format, int type, IntBuffer image) { + nglGetConvolutionFilter(target, format, type, image, image.position() << 2); + } + public static void glGetConvolutionFilter(int target, int format, int type, FloatBuffer image) { + nglGetConvolutionFilter(target, format, type, image, image.position() << 2); + } + private static native void nglGetConvolutionFilter(int target, int format, int type, Buffer image, int image_offset); + public static void glGetConvolutionParameter(int target, int pname, FloatBuffer params) { + nglGetConvolutionParameterfv(target, pname, params, params.position()); + } + private static native void nglGetConvolutionParameterfv(int target, int pname, FloatBuffer params, int params_offset); + public static void glGetConvolutionParameter(int target, int pname, IntBuffer params) { + nglGetConvolutionParameteriv(target, pname, params, params.position()); + } + private static native void nglGetConvolutionParameteriv(int target, int pname, IntBuffer params, int params_offset); + public static void glSeparableFilter2D(int target, int internalformat, int width, int height, int format, int type, Buffer row, Buffer column) { + nglSeparableFilter2D(target, internalformat, width, height, format, type, row, Util.getOffset(row), column, Util.getOffset(column)); + } + private static native void nglSeparableFilter2D(int target, int internalformat, int width, int height, int format, int type, Buffer row, int row_offset, Buffer column, int column_offset); + public static void glGetSeparableFilter(int target, int format, int type, Buffer row, Buffer column, Buffer span) { + nglGetSeparableFilter(target, format, type, row, Util.getOffset(row), column, Util.getOffset(column), span, Util.getOffset(span)); + } + private static native void nglGetSeparableFilter(int target, int format, int type, Buffer row, int row_offset, Buffer column, int column_offset, Buffer span, int span_offset); + public static void glDrawRangeElements(int mode, int start, int end, ByteBuffer indices) { + assert VBOTracker.getVBOElementStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + nglDrawRangeElements(mode, start, end, indices.remaining(), GL_UNSIGNED_BYTE, indices, indices.position()); + } + public static void glDrawRangeElements(int mode, int start, int end, ShortBuffer indices) { + assert VBOTracker.getVBOElementStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + nglDrawRangeElements(mode, start, end, indices.remaining(), GL_UNSIGNED_SHORT, indices, indices.position() << 1); + } + public static void glDrawRangeElements(int mode, int start, int end, IntBuffer indices) { + assert VBOTracker.getVBOElementStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + nglDrawRangeElements(mode, start, end, indices.remaining(), GL_UNSIGNED_INT, indices, indices.position() << 2); + } + private static native void nglDrawRangeElements(int mode, int start, int end, int count, int type, Buffer indices, int indices_offset); + public static void glDrawRangeElements(int mode, int start, int end, int count, int type, int buffer_offset) { + assert VBOTracker.getVBOElementStack().getState() != 0: "Cannot use int offsets when VBO is disabled"; + nglDrawRangeElementsVBO(mode, start, end, count, type, buffer_offset); + } + private static native void nglDrawRangeElementsVBO(int mode, int start, int end, int count, int type, int buffer_offset); + public static void glTexImage3D(int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, ByteBuffer pixels) { + nglTexImage3D(target, level, internalFormat, width, height, depth, border, format, type, pixels, pixels.position()); + } + public static void glTexImage3D(int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, ShortBuffer pixels) { + nglTexImage3D(target, level, internalFormat, width, height, depth, border, format, type, pixels, pixels.position() << 1); + } + public static void glTexImage3D(int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, IntBuffer pixels) { + nglTexImage3D(target, level, internalFormat, width, height, depth, border, format, type, pixels, pixels.position() << 2); + } + private static native void nglTexImage3D(int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, Buffer pixels, int pixels_offset); + public static void glTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, ByteBuffer pixels) { + nglTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels, pixels.position()); + } + public static void glTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, ShortBuffer pixels) { + nglTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels, pixels.position() << 1); + } + public static void glTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, IntBuffer pixels) { + nglTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels, pixels.position() << 2); + } + private static native void nglTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, Buffer pixels, int pixels_offset); + public static native void glCopyTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int x, int y, int width, int height); +} + diff --git a/src/java/org/lwjgl/opengl/CoreGL12Constants.java b/src/java/org/lwjgl/opengl/CoreGL12Constants.java new file mode 100644 index 00000000..b1988109 --- /dev/null +++ b/src/java/org/lwjgl/opengl/CoreGL12Constants.java @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ + +package org.lwjgl.opengl; + +/** + * $Id$ + * + * Core OpenGL 1.1 constants. + * + * @author cix_foo + * @version $Revision$ + */ +public interface CoreGL12Constants extends CoreGL11Constants { + public static final int GL_RESCALE_NORMAL = 0x803A; + public static final int GL_CLAMP_TO_EDGE = 0x812F; + public static final int GL_MAX_ELEMENTS_VERTICES = 0x80E8; + public static final int GL_MAX_ELEMENTS_INDICES = 0x80E9; + public static final int GL_BGR = 0x80E0; + public static final int GL_BGRA = 0x80E1; + public static final int GL_UNSIGNED_BYTE_3_3_2 = 0x8032; + public static final int GL_UNSIGNED_BYTE_2_3_3_REV = 0x8362; + public static final int GL_UNSIGNED_SHORT_5_6_5 = 0x8363; + public static final int GL_UNSIGNED_SHORT_5_6_5_REV = 0x8364; + public static final int GL_UNSIGNED_SHORT_4_4_4_4 = 0x8033; + public static final int GL_UNSIGNED_SHORT_4_4_4_4_REV = 0x8365; + public static final int GL_UNSIGNED_SHORT_5_5_5_1 = 0x8034; + public static final int GL_UNSIGNED_SHORT_1_5_5_5_REV = 0x8366; + public static final int GL_UNSIGNED_INT_8_8_8_8 = 0x8035; + public static final int GL_UNSIGNED_INT_8_8_8_8_REV = 0x8367; + public static final int GL_UNSIGNED_INT_10_10_10_2 = 0x8036; + public static final int GL_UNSIGNED_INT_2_10_10_10_REV = 0x8368; + public static final int GL_LIGHT_MODEL_COLOR_CONTROL = 0x81F8; + public static final int GL_SINGLE_COLOR = 0x81F9; + public static final int GL_SEPARATE_SPECULAR_COLOR = 0x81FA; + public static final int GL_TEXTURE_MIN_LOD = 0x813A; + public static final int GL_TEXTURE_MAX_LOD = 0x813B; + public static final int GL_TEXTURE_BASE_LEVEL = 0x813C; + public static final int GL_TEXTURE_MAX_LEVEL = 0x813D; + public static final int GL_SMOOTH_POINT_SIZE_RANGE = 0x0B12; + public static final int GL_SMOOTH_POINT_SIZE_GRANULARITY = 0x0B13; + public static final int GL_SMOOTH_LINE_WIDTH_RANGE = 0x0B22; + public static final int GL_SMOOTH_LINE_WIDTH_GRANULARITY = 0x0B23; + public static final int GL_ALIASED_POINT_SIZE_RANGE = 0x846D; + public static final int GL_ALIASED_LINE_WIDTH_RANGE = 0x846E; + public static final int GL_PACK_SKIP_IMAGES = 0x806B; + public static final int GL_PACK_IMAGE_HEIGHT = 0x806C; + public static final int GL_UNPACK_SKIP_IMAGES = 0x806D; + public static final int GL_UNPACK_IMAGE_HEIGHT = 0x806E; + public static final int GL_TEXTURE_3D = 0x806F; + public static final int GL_PROXY_TEXTURE_3D = 0x8070; + public static final int GL_TEXTURE_DEPTH = 0x8071; + public static final int GL_TEXTURE_WRAP_R = 0x8072; + public static final int GL_MAX_3D_TEXTURE_SIZE = 0x8073; + public static final int GL_TEXTURE_BINDING_3D = 0x806A; + public static final int GL_COLOR_TABLE = 0x80D0; + public static final int GL_POST_CONVOLUTION_COLOR_TABLE = 0x80D1; + public static final int GL_POST_COLOR_MATRIX_COLOR_TABLE = 0x80D2; + public static final int GL_PROXY_COLOR_TABLE = 0x80D3; + public static final int GL_PROXY_POST_CONVOLUTION_COLOR_TABLE = 0x80D4; + public static final int GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE = 0x80D5; + public static final int GL_COLOR_TABLE_SCALE = 0x80D6; + public static final int GL_COLOR_TABLE_BIAS = 0x80D7; + public static final int GL_COLOR_TABLE_FORMAT = 0x80D8; + public static final int GL_COLOR_TABLE_WIDTH = 0x80D9; + public static final int GL_COLOR_TABLE_RED_SIZE = 0x80DA; + public static final int GL_COLOR_TABLE_GREEN_SIZE = 0x80DB; + public static final int GL_COLOR_TABLE_BLUE_SIZE = 0x80DC; + public static final int GL_COLOR_TABLE_ALPHA_SIZE = 0x80DD; + public static final int GL_COLOR_TABLE_LUMINANCE_SIZE = 0x80DE; + public static final int GL_COLOR_TABLE_INTENSITY_SIZE = 0x80DF; + public static final int GL_CONVOLUTION_1D = 0x8010; + public static final int GL_CONVOLUTION_2D = 0x8011; + public static final int GL_SEPARABLE_2D = 0x8012; + public static final int GL_CONVOLUTION_BORDER_MODE = 0x8013; + public static final int GL_CONVOLUTION_FILTER_SCALE = 0x8014; + public static final int GL_CONVOLUTION_FILTER_BIAS = 0x8015; + public static final int GL_REDUCE = 0x8016; + public static final int GL_CONVOLUTION_FORMAT = 0x8017; + public static final int GL_CONVOLUTION_WIDTH = 0x8018; + public static final int GL_CONVOLUTION_HEIGHT = 0x8019; + public static final int GL_MAX_CONVOLUTION_WIDTH = 0x801A; + public static final int GL_MAX_CONVOLUTION_HEIGHT = 0x801B; + public static final int GL_POST_CONVOLUTION_RED_SCALE = 0x801C; + public static final int GL_POST_CONVOLUTION_GREEN_SCALE = 0x801D; + public static final int GL_POST_CONVOLUTION_BLUE_SCALE = 0x801E; + public static final int GL_POST_CONVOLUTION_ALPHA_SCALE = 0x801F; + public static final int GL_POST_CONVOLUTION_RED_BIAS = 0x8020; + public static final int GL_POST_CONVOLUTION_GREEN_BIAS = 0x8021; + public static final int GL_POST_CONVOLUTION_BLUE_BIAS = 0x8022; + public static final int GL_POST_CONVOLUTION_ALPHA_BIAS = 0x8023; + public static final int GL_CONSTANT_BORDER = 0x8151; + public static final int GL_REPLICATE_BORDER = 0x8153; + public static final int GL_CONVOLUTION_BORDER_COLOR = 0x8154; + public static final int GL_COLOR_MATRIX = 0x80B1; + public static final int GL_COLOR_MATRIX_STACK_DEPTH = 0x80B2; + public static final int GL_MAX_COLOR_MATRIX_STACK_DEPTH = 0x80B3; + public static final int GL_POST_COLOR_MATRIX_RED_SCALE = 0x80B4; + public static final int GL_POST_COLOR_MATRIX_GREEN_SCALE = 0x80B5; + public static final int GL_POST_COLOR_MATRIX_BLUE_SCALE = 0x80B6; + public static final int GL_POST_COLOR_MATRIX_ALPHA_SCALE = 0x80B7; + public static final int GL_POST_COLOR_MATRIX_RED_BIAS = 0x80B8; + public static final int GL_POST_COLOR_MATRIX_GREEN_BIAS = 0x80B9; + public static final int GL_POST_COLOR_MATRIX_BLUE_BIAS = 0x80BA; + public static final int GL_POST_COLOR_MATRIX_ALPHA_BIAS = 0x80BB; + public static final int GL_HISTOGRAM = 0x8024; + public static final int GL_PROXY_HISTOGRAM = 0x8025; + public static final int GL_HISTOGRAM_WIDTH = 0x8026; + public static final int GL_HISTOGRAM_FORMAT = 0x8027; + public static final int GL_HISTOGRAM_RED_SIZE = 0x8028; + public static final int GL_HISTOGRAM_GREEN_SIZE = 0x8029; + public static final int GL_HISTOGRAM_BLUE_SIZE = 0x802A; + public static final int GL_HISTOGRAM_ALPHA_SIZE = 0x802B; + public static final int GL_HISTOGRAM_LUMINANCE_SIZE = 0x802C; + public static final int GL_HISTOGRAM_SINK = 0x802D; + public static final int GL_MINMAX = 0x802E; + public static final int GL_MINMAX_FORMAT = 0x802F; + public static final int GL_MINMAX_SINK = 0x8030; + public static final int GL_TABLE_TOO_LARGE = 0x8031; + public static final int GL_BLEND_EQUATION = 0x8009; + public static final int GL_MIN = 0x8007; + public static final int GL_MAX = 0x8008; + public static final int GL_FUNC_ADD = 0x8006; + public static final int GL_FUNC_SUBTRACT = 0x800A; + public static final int GL_FUNC_REVERSE_SUBTRACT = 0x800B; + public static final int GL_BLEND_COLOR = 0x8005; +} diff --git a/src/java/org/lwjgl/opengl/CoreGL13.java b/src/java/org/lwjgl/opengl/CoreGL13.java new file mode 100644 index 00000000..abb26beb --- /dev/null +++ b/src/java/org/lwjgl/opengl/CoreGL13.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ + +package org.lwjgl.opengl; + +import java.nio.*; + +/** + * $Id: CoreGL.java,v 1.23 2003/07/23 14:51:19 elias_naur Exp $ + * + * The core OpenGL1.3 API. + * + * @author cix_foo + * @version $Revision: 1.23 $ + */ +public abstract class CoreGL13 extends CoreGL12 implements CoreGL13Constants { + public static native void glActiveTexture(int texture); + public static native void glClientActiveTexture(int texture); + public static void glCompressedTexImage1D(int target, int level, int internalformat, int width, int border, int imageSize, ByteBuffer data) { + nglCompressedTexImage1D(target, level, internalformat, width, border, imageSize, data, data.position()); + } + public static void glCompressedTexImage1D(int target, int level, int internalformat, int width, int border, int imageSize, ShortBuffer data) { + nglCompressedTexImage1D(target, level, internalformat, width, border, imageSize, data, data.position() << 1); + } + public static void glCompressedTexImage1D(int target, int level, int internalformat, int width, int border, int imageSize, FloatBuffer data) { + nglCompressedTexImage1D(target, level, internalformat, width, border, imageSize, data, data.position() << 2); + } + private static native void nglCompressedTexImage1D(int target, int level, int internalformat, int width, int border, int imageSize, Buffer data, int data_offset); + public static void glCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, ByteBuffer data) { + nglCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data, data.position()); + } + public static void glCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, ShortBuffer data) { + nglCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data, data.position() << 1); + } + public static void glCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, IntBuffer data) { + nglCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data, data.position() << 2); + } + private static native void nglCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, Buffer data, int data_offset); + public static void glCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, ByteBuffer data) { + nglCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data, data.position()); + } + public static void glCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, ShortBuffer data) { + nglCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data, data.position() << 1); + } + public static void glCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, IntBuffer data) { + nglCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data, data.position() << 2); + } + private static native void nglCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, Buffer data, int data_offset); + public static void glCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, ByteBuffer data) { + nglCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data, data.position()); + } + public static void glCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, ShortBuffer data) { + nglCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data, data.position() << 1); + } + public static void glCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, IntBuffer data) { + nglCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data, data.position() << 2); + } + private static native void nglCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, Buffer data, int data_offset); + public static void glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, ByteBuffer data) { + nglCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data, data.position()); + } + public static void glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, ShortBuffer data) { + nglCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data, data.position() << 1); + } + public static void glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, IntBuffer data) { + nglCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data, data.position() << 2); + } + private static native void nglCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, Buffer data, int data_offset); + public static void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, ByteBuffer data) { + nglCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data, data.position()); + } + public static void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, ShortBuffer data) { + nglCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data, data.position() << 1); + } + public static void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, IntBuffer data) { + nglCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data, data.position() << 2); + } + private static native void nglCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, Buffer data, int data_offset); + public static void glGetCompressedTexImage(int target, int lod, ByteBuffer img) { + nglGetCompressedTexImage(target, lod, img, img.position()); + } + public static void glGetCompressedTexImage(int target, int lod, ShortBuffer img) { + nglGetCompressedTexImage(target, lod, img, img.position() << 1); + } + public static void glGetCompressedTexImage(int target, int lod, IntBuffer img) { + nglGetCompressedTexImage(target, lod, img, img.position() << 2); + } + private static native void nglGetCompressedTexImage(int target, int lod, Buffer img, int img_offset); + public static native void glMultiTexCoord1f(int target, float s); + public static native void glMultiTexCoord2f(int target, float s, float t); + public static native void glMultiTexCoord3f(int target, float s, float t, float r); + public static native void glMultiTexCoord4f(int target, float s, float t, float r, float q); + public static void glLoadTransposeMatrix(FloatBuffer m) { + nglLoadTransposeMatrixf(m, m.position()); + } + private static native void nglLoadTransposeMatrixf(FloatBuffer m, int m_offset); + public static void glMultTransposeMatrix(FloatBuffer m) { + nglMultTransposeMatrixf(m, m.position()); + } + private static native void nglMultTransposeMatrixf(FloatBuffer m, int m_offset); + public static native void glSampleCoverage(float value, boolean invert); +} + + diff --git a/src/java/org/lwjgl/opengl/CoreGL13Constants.java b/src/java/org/lwjgl/opengl/CoreGL13Constants.java new file mode 100644 index 00000000..c93b8cec --- /dev/null +++ b/src/java/org/lwjgl/opengl/CoreGL13Constants.java @@ -0,0 +1,145 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ + +package org.lwjgl.opengl; + +/** + * $Id$ + * + * Core OpenGL 1.1 constants. + * + * @author cix_foo + * @version $Revision$ + */ +public interface CoreGL13Constants extends CoreGL12Constants { + public static final int GL_TEXTURE0 = 0x84C0; + public static final int GL_TEXTURE1 = 0x84C1; + public static final int GL_TEXTURE2 = 0x84C2; + public static final int GL_TEXTURE3 = 0x84C3; + public static final int GL_TEXTURE4 = 0x84C4; + public static final int GL_TEXTURE5 = 0x84C5; + public static final int GL_TEXTURE6 = 0x84C6; + public static final int GL_TEXTURE7 = 0x84C7; + public static final int GL_TEXTURE8 = 0x84C8; + public static final int GL_TEXTURE9 = 0x84C9; + public static final int GL_TEXTURE10 = 0x84CA; + public static final int GL_TEXTURE11 = 0x84CB; + public static final int GL_TEXTURE12 = 0x84CC; + public static final int GL_TEXTURE13 = 0x84CD; + public static final int GL_TEXTURE14 = 0x84CE; + public static final int GL_TEXTURE15 = 0x84CF; + public static final int GL_TEXTURE16 = 0x84D0; + public static final int GL_TEXTURE17 = 0x84D1; + public static final int GL_TEXTURE18 = 0x84D2; + public static final int GL_TEXTURE19 = 0x84D3; + public static final int GL_TEXTURE20 = 0x84D4; + public static final int GL_TEXTURE21 = 0x84D5; + public static final int GL_TEXTURE22 = 0x84D6; + public static final int GL_TEXTURE23 = 0x84D7; + public static final int GL_TEXTURE24 = 0x84D8; + public static final int GL_TEXTURE25 = 0x84D9; + public static final int GL_TEXTURE26 = 0x84DA; + public static final int GL_TEXTURE27 = 0x84DB; + public static final int GL_TEXTURE28 = 0x84DC; + public static final int GL_TEXTURE29 = 0x84DD; + public static final int GL_TEXTURE30 = 0x84DE; + public static final int GL_TEXTURE31 = 0x84DF; + public static final int GL_ACTIVE_TEXTURE = 0x84E0; + public static final int GL_CLIENT_ACTIVE_TEXTURE = 0x84E1; + public static final int GL_MAX_TEXTURE_UNITS = 0x84E2; + + public static final int GL_NORMAL_MAP = 0x8511; + public static final int GL_REFLECTION_MAP = 0x8512; + public static final int GL_TEXTURE_CUBE_MAP = 0x8513; + public static final int GL_TEXTURE_BINDING_CUBE_MAP = 0x8514; + public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515; + public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516; + public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517; + public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518; + public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519; + public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A; + public static final int GL_PROXY_TEXTURE_CUBE_MAP = 0x851B; + public static final int GL_MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C; + + public static final int GL_COMPRESSED_ALPHA = 0x84E9; + public static final int GL_COMPRESSED_LUMINANCE = 0x84EA; + public static final int GL_COMPRESSED_LUMINANCE_ALPHA = 0x84EB; + public static final int GL_COMPRESSED_INTENSITY = 0x84EC; + public static final int GL_COMPRESSED_RGB = 0x84ED; + public static final int GL_COMPRESSED_RGBA = 0x84EE; + public static final int GL_TEXTURE_COMPRESSION_HINT = 0x84EF; + public static final int GL_TEXTURE_COMPRESSED_IMAGE_SIZE = 0x86A0; + public static final int GL_TEXTURE_COMPRESSED = 0x86A1; + public static final int GL_NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2; + public static final int GL_COMPRESSED_TEXTURE_FORMATS = 0x86A3; + + public static final int GL_MULTISAMPLE = 0x809D; + public static final int GL_SAMPLE_ALPHA_TO_COVERAGE = 0x809E; + public static final int GL_SAMPLE_ALPHA_TO_ONE = 0x809F; + public static final int GL_SAMPLE_COVERAGE = 0x80A0; + public static final int GL_SAMPLE_BUFFERS = 0x80A8; + public static final int GL_SAMPLES = 0x80A9; + public static final int GL_SAMPLE_COVERAGE_VALUE = 0x80AA; + public static final int GL_SAMPLE_COVERAGE_INVERT = 0x80AB; + public static final int GL_MULTISAMPLE_BIT = 0x20000000; + + public static final int GL_TRANSPOSE_MODELVIEW_MATRIX = 0x84E3; + public static final int GL_TRANSPOSE_PROJECTION_MATRIX = 0x84E4; + public static final int GL_TRANSPOSE_TEXTURE_MATRIX = 0x84E5; + public static final int GL_TRANSPOSE_COLOR_MATRIX = 0x84E6; + + public static final int GL_COMBINE = 0x8570; + public static final int GL_COMBINE_RGB = 0x8571; + public static final int GL_COMBINE_ALPHA = 0x8572; + public static final int GL_SOURCE0_RGB = 0x8580; + public static final int GL_SOURCE1_RGB = 0x8581; + public static final int GL_SOURCE2_RGB = 0x8582; + public static final int GL_SOURCE0_ALPHA = 0x8588; + public static final int GL_SOURCE1_ALPHA = 0x8589; + public static final int GL_SOURCE2_ALPHA = 0x858A; + public static final int GL_OPERAND0_RGB = 0x8590; + public static final int GL_OPERAND1_RGB = 0x8591; + public static final int GL_OPERAND2_RGB = 0x8592; + public static final int GL_OPERAND0_ALPHA = 0x8598; + public static final int GL_OPERAND1_ALPHA = 0x8599; + public static final int GL_OPERAND2_ALPHA = 0x859A; + public static final int GL_RGB_SCALE = 0x8573; + public static final int GL_ADD_SIGNED = 0x8574; + public static final int GL_INTERPOLATE = 0x8575; + public static final int GL_SUBTRACT = 0x84E7; + public static final int GL_CONSTANT = 0x8576; + public static final int GL_PRIMARY_COLOR = 0x8577; + public static final int GL_PREVIOUS = 0x8578; + public static final int GL_DOT3_RGB = 0x86AE; + public static final int GL_DOT3_RGBA = 0x86AF; + public static final int GL_CLAMP_TO_BORDER = 0x812D; +} diff --git a/src/java/org/lwjgl/opengl/CoreGL14.java b/src/java/org/lwjgl/opengl/CoreGL14.java new file mode 100644 index 00000000..e319e8c7 --- /dev/null +++ b/src/java/org/lwjgl/opengl/CoreGL14.java @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ + +package org.lwjgl.opengl; + +import java.nio.*; +import java.nio.IntBuffer; +import java.nio.FloatBuffer; +import java.nio.Buffer; + +/** + * $Id: CoreGL.java,v 1.23 2003/07/23 14:51:19 elias_naur Exp $ + * + * The core OpenGL1.4 API. + * + * @author cix_foo + * @version $Revision: 1.23 $ + */ +public abstract class CoreGL14 extends CoreGL13 implements CoreGL14Constants { + public static native void glFogCoordf(float coord); + public static void glFogCoordPointer(int stride, FloatBuffer data) { + assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + nglFogCoordPointer(GL_FLOAT, stride, data, data.position() << 2); + } + private static native void nglFogCoordPointer(int type, int stride, Buffer data, int data_offset); + public static void glFogCoordPointer(int type, int stride, int buffer_offset) { + assert VBOTracker.getVBOArrayStack().getState() != 0: "Cannot use int offsets when VBO is disabled"; + nglFogCoordPointerVBO(type, stride, buffer_offset); + } + private static native void nglFogCoordPointerVBO(int type, int stride, int buffer_offset); + public static void glMultiDrawArrays(int mode, IntBuffer piFirst, IntBuffer piCount) { + assert piFirst.remaining() == piCount.remaining(): "piFirst.remaining() != piCount.remaining()"; + nglMultiDrawArrays(mode, piFirst, piFirst.position(), piCount, piCount.position(), piFirst.remaining()); + } + private static native void nglMultiDrawArrays(int mode, IntBuffer piFirst, int piFirst_offset, IntBuffer piCount, int piCount_offset, int primcount); +/* public static native void glMultiDrawElements(int mode, int piCount, int type, int pIndices, int primcount);*/ + public static native void glPointParameterf (int pname, float param); + public static void glPointParameter(int pname, FloatBuffer params) { + nglPointParameterfv(pname, params, params.position()); + } + private static native void nglPointParameterfv(int pname, FloatBuffer params, int params_offset); + public static native void glSecondaryColor3b (byte red, byte green, byte blue); + public static native void glSecondaryColor3f (float red, float green, float blue); + public static native void glSecondaryColor3ub (byte red, byte green, byte blue); + public static void glSecondaryColorPointer(int size, boolean unsigned, int stride, ByteBuffer data) { + assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + nglSecondaryColorPointer(size, unsigned ? GL_UNSIGNED_BYTE : GL_BYTE, stride, data, data.position()); + } + public static void glSecondaryColorPointer(int size, int stride, FloatBuffer data) { + assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + nglSecondaryColorPointer(size, GL_FLOAT, stride, data, data.position() << 2); + } + private static native void nglSecondaryColorPointer (int size, int type, int stride, Buffer data, int data_offset); + public static void glSecondaryColorPointer(int size, int type, int stride, int buffer_offset) { + assert VBOTracker.getVBOArrayStack().getState() != 0: "Cannot use int offsets when VBO is disabled"; + nglSecondaryColorPointerVBO(size, type, stride, buffer_offset); + } + private static native void nglSecondaryColorPointerVBO(int size, int type, int stride, int buffer_offset); + public static native void glBlendFuncSeparate (int sfactorRGB, int dfactorRGB, int sfactorAlpha, int dfactorAlpha); + public static native void glWindowPos2f (float x, float y); + public static native void glWindowPos2i (int x, int y); + public static native void glWindowPos3f (float x, float y, float z); + public static native void glWindowPos3i (int x, int y, int z); +} + diff --git a/src/java/org/lwjgl/opengl/CoreGL14Constants.java b/src/java/org/lwjgl/opengl/CoreGL14Constants.java new file mode 100644 index 00000000..dd4803c7 --- /dev/null +++ b/src/java/org/lwjgl/opengl/CoreGL14Constants.java @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ + +package org.lwjgl.opengl; + +/** + * $Id$ + * + * Core OpenGL 1.1 constants. + * + * @author cix_foo + * @version $Revision$ + */ +public interface CoreGL14Constants extends CoreGL13Constants { + public static final int GL_GENERATE_MIPMAP = 0x8191; + public static final int GL_GENERATE_MIPMAP_HINT = 0x8192; + public static final int GL_DEPTH_COMPONENT16 = 0x81A5; + public static final int GL_DEPTH_COMPONENT24 = 0x81A6; + public static final int GL_DEPTH_COMPONENT32 = 0x81A7; + public static final int GL_TEXTURE_DEPTH_SIZE = 0x884A; + public static final int GL_DEPTH_TEXTURE_MODE = 0x884B; + public static final int GL_TEXTURE_COMPARE_MODE = 0x884C; + public static final int GL_TEXTURE_COMPARE_FUNC = 0x884D; + public static final int GL_COMPARE_R_TO_TEXTURE = 0x884E; + public static final int GL_FOG_COORDINATE_SOURCE = 0x8450; + public static final int GL_FOG_COORDINATE = 0x8451; + public static final int GL_FRAGMENT_DEPTH = 0x8452; + public static final int GL_CURRENT_FOG_COORDINATE = 0x8453; + public static final int GL_FOG_COORDINATE_ARRAY_TYPE = 0x8454; + public static final int GL_FOG_COORDINATE_ARRAY_STRIDE = 0x8455; + public static final int GL_FOG_COORDINATE_ARRAY_POINTER = 0x8456; + public static final int GL_FOG_COORDINATE_ARRAY = 0x8457; + public static final int GL_POINT_SIZE_MIN = 0x8126; + public static final int GL_POINT_SIZE_MAX = 0x8127; + public static final int GL_POINT_FADE_THRESHOLD_SIZE = 0x8128; + public static final int GL_POINT_DISTANCE_ATTENUATION = 0x8129; + public static final int GL_COLOR_SUM = 0x8458; + public static final int GL_CURRENT_SECONDARY_COLOR = 0x8459; + public static final int GL_SECONDARY_COLOR_ARRAY_SIZE = 0x845A; + public static final int GL_SECONDARY_COLOR_ARRAY_TYPE = 0x845B; + public static final int GL_SECONDARY_COLOR_ARRAY_STRIDE = 0x845C; + public static final int GL_SECONDARY_COLOR_ARRAY_POINTER = 0x845D; + public static final int GL_SECONDARY_COLOR_ARRAY = 0x845E; + public static final int GL_BLEND_DST_RGB = 0x80C8; + public static final int GL_BLEND_SRC_RGB = 0x80C9; + public static final int GL_BLEND_DST_ALPHA = 0x80CA; + public static final int GL_BLEND_SRC_ALPHA = 0x80CB; + public static final int GL_INCR_WRAP = 0x8507; + public static final int GL_DECR_WRAP = 0x8508; + public static final int GL_TEXTURE_FILTER_CONTROL = 0x8500; + public static final int GL_TEXTURE_LOD_BIAS = 0x8501; + public static final int GL_MAX_TEXTURE_LOD_BIAS = 0x84FD; + public static final int GL_GL_MIRRORED_REPEAT = 0x8370; +} diff --git a/src/java/org/lwjgl/opengl/GL.java b/src/java/org/lwjgl/opengl/GL.java new file mode 100644 index 00000000..c4c7940d --- /dev/null +++ b/src/java/org/lwjgl/opengl/GL.java @@ -0,0 +1,1556 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ + +package org.lwjgl.opengl; + +import java.nio.ByteBuffer; +import java.nio.IntBuffer; +import java.nio.ShortBuffer; +import java.nio.FloatBuffer; +import java.nio.Buffer; + +/** + * $Id$ + * + * The GL itself, with all supported extensions, based on OpenGL 1.4. + * + * @author cix_foo + * @version $Revision$ + */ +public abstract class GL extends CoreGL14 implements GLConstants { + public static native void glActiveStencilFaceEXT(int face); + + public static native void glActiveTextureARB(int texture); + + public static native void glAlphaFragmentOp1ATI( + int op, + int dst, + int dstMod, + int arg1, + int arg1Rep, + int arg1Mod); + + public static native void glAlphaFragmentOp2ATI( + int op, + int dst, + int dstMod, + int arg1, + int arg1Rep, + int arg1Mod, + int arg2, + int arg2Rep, + int arg2Mod); + + public static native void glAlphaFragmentOp3ATI( + int op, + int dst, + int dstMod, + int arg1, + int arg1Rep, + int arg1Mod, + int arg2, + int arg2Rep, + int arg2Mod, + int arg3, + int arg3Rep, + int arg3Mod); + + public static boolean glAreProgramsResidentNV(IntBuffer piIDs, ByteBuffer pbResidences) { + assert piIDs.remaining() == pbResidences.remaining(): "piIDs.remaining() != pbResidences.remaining()"; + return nglAreProgramsResidentNV(piIDs.remaining(), piIDs, piIDs.position(), pbResidences, pbResidences.position()); + } + private static native boolean nglAreProgramsResidentNV(int n, IntBuffer piIDs, int piIDs_offset, ByteBuffer pbResidences, int pbResidences_offset); + + public static native void glArrayObjectATI( + int array, + int size, + int type, + int stride, + int buffer, + int offset); + + public static native void glBeginFragmentShaderATI(); + + public static native void glBeginOcclusionQueryNV(int id); + + public static native void glBeginVertexShaderEXT(); + + public static native void glBindFragmentShaderATI(int id); + + public static native int glBindLightParameterEXT(int light, int value); + + public static native int glBindMaterialParameterEXT(int face, int value); + + public static native int glBindParameterEXT(int value); + + public static native void glBindProgramARB(int target, int program); + + public static native void glBindProgramNV(int target, int id); + + public static native int glBindTexGenParameterEXT(int unit, int coord, int value); + + public static native int glBindTextureUnitParameterEXT(int unit, int value); + + public static native void glBindVertexShaderEXT(int id); + + public static native void glClientActiveTextureARB(int texture); + + public static native void glClientActiveVertexStreamATI(int stream); + + public static native void glColorFragmentOp1ATI( + int op, + int dst, + int dstMask, + int dstMod, + int arg1, + int arg1Rep, + int arg1Mod); + + public static native void glColorFragmentOp2ATI( + int op, + int dst, + int dstMask, + int dstMod, + int arg1, + int arg1Rep, + int arg1Mod, + int arg2, + int arg2Rep, + int arg2Mod); + + public static native void glColorFragmentOp3ATI( + int op, + int dst, + int dstMask, + int dstMod, + int arg1, + int arg1Rep, + int arg1Mod, + int arg2, + int arg2Rep, + int arg2Mod, + int arg3, + int arg3Rep, + int arg3Mod); + + public static native void glCombinerInputNV( + int stage, + int portion, + int variable, + int input, + int mapping, + int componentUsage); + + public static native void glCombinerOutputNV( + int stage, + int portion, + int abOutput, + int cdOutput, + int sumOutput, + int scale, + int bias, + boolean abDotProduct, + boolean cdDotProduct, + boolean muxSum); + + public static native void glCombinerParameterfNV(int pname, float param); + + public static void glCombinerParameterNV(int pname, FloatBuffer pfParams) { + nglCombinerParameterfvNV(pname, pfParams, pfParams.position()); + } + private static native void nglCombinerParameterfvNV(int pname, FloatBuffer pfParams, int pfParams_offset); + + public static native void glCombinerParameteriNV(int pname, int param); + + public static void glCombinerParameterNV(int pname, IntBuffer piParams) { + nglCombinerParameterivNV(pname, piParams, piParams.position()); + } + private static native void nglCombinerParameterivNV(int pname, IntBuffer piParams, int piParams_offset); + + public static void glCombinerStageParameterNV(int stage, int pname, FloatBuffer pfParams) { + nglCombinerStageParameterfvNV(stage, pname, pfParams, pfParams.position()); + } + private static native void nglCombinerStageParameterfvNV(int stage, int pname, FloatBuffer pfParams, int pfParams_offset); + + public static void glCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, ByteBuffer pData) { + nglCompressedTexImage1DARB(target, level, internalformat, width, border, imageSize, pData, pData.position()); + } + public static void glCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, ShortBuffer pData) { + nglCompressedTexImage1DARB(target, level, internalformat, width, border, imageSize, pData, pData.position()<<1); + } + public static void glCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, IntBuffer pData) { + nglCompressedTexImage1DARB(target, level, internalformat, width, border, imageSize, pData, pData.position()<<2); + } + private static native void nglCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, Buffer pData, int pData_offset); + + public static void glCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, ByteBuffer pData) { + nglCompressedTexImage2DARB(target, level, internalformat, width, height, border, imageSize, pData, pData.position()); + } + public static void glCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, ShortBuffer pData) { + nglCompressedTexImage2DARB(target, level, internalformat, width, height, border, imageSize, pData, pData.position()<<1); + } + public static void glCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, IntBuffer pData) { + nglCompressedTexImage2DARB(target, level, internalformat, width, height, border, imageSize, pData, pData.position()<<2); + } + private static native void nglCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, Buffer pData, int pData_offset); + + public static void glCompressedTexImage3DARB(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, ByteBuffer pData) { + nglCompressedTexImage3DARB(target, level, internalformat, width, height, depth, border, imageSize, pData, pData.position()); + } + public static void glCompressedTexImage3DARB(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, ShortBuffer pData) { + nglCompressedTexImage3DARB(target, level, internalformat, width, height, depth, border, imageSize, pData, pData.position()<<1); + } + public static void glCompressedTexImage3DARB(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, IntBuffer pData) { + nglCompressedTexImage3DARB(target, level, internalformat, width, height, depth, border, imageSize, pData, pData.position()<<2); + } + private static native void nglCompressedTexImage3DARB(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, Buffer pData, int pData_offset); + + public static void glCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int border, int imageSize, ByteBuffer pData) { + nglCompressedTexSubImage1DARB(target, level, xoffset, width, border, imageSize, pData, pData.position()); + } + public static void glCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int border, int imageSize, ShortBuffer pData) { + nglCompressedTexSubImage1DARB(target, level, xoffset, width, border, imageSize, pData, pData.position()<<1); + } + public static void glCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int border, int imageSize, IntBuffer pData) { + nglCompressedTexSubImage1DARB(target, level, xoffset, width, border, imageSize, pData, pData.position()<<2); + } + private static native void nglCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int border, int imageSize, Buffer pData, int pData_offset); + + public static void glCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int border, int imageSize, ByteBuffer pData) { + nglCompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, border, imageSize, pData, pData.position()); + } + public static void glCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int border, int imageSize, ShortBuffer pData) { + nglCompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, border, imageSize, pData, pData.position()<<1); + } + public static void glCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int border, int imageSize, IntBuffer pData) { + nglCompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, border, imageSize, pData, pData.position()<<2); + } + private static native void nglCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int border, int imageSize, Buffer pData, int pData_offset); + + public static void glCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int border, int imageSize, ByteBuffer pData) { + nglCompressedTexSubImage3DARB(target, level, xoffset, yoffset, zoffset, width, height, depth, border, imageSize, pData, pData.position()); + } + public static void glCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int border, int imageSize, ShortBuffer pData) { + nglCompressedTexSubImage3DARB(target, level, xoffset, yoffset, zoffset, width, height, depth, border, imageSize, pData, pData.position()<<1); + } + public static void glCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int border, int imageSize, IntBuffer pData) { + nglCompressedTexSubImage3DARB(target, level, xoffset, yoffset, zoffset, width, height, depth, border, imageSize, pData, pData.position()<<2); + } + private static native void nglCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int border, int imageSize, Buffer pData, int pData_offset); + + public static native void glCurrentPaletteMatrixARB(int index); + + public static void glDeleteFencesNV(IntBuffer piFences) { + nglDeleteFencesNV(piFences.remaining(), piFences, piFences.position()); + } + private static native void nglDeleteFencesNV(int n, IntBuffer piFences, int piFences_offset); + + public static native void glDeleteFragmentShaderATI(int id); + + public static void glDeleteOcclusionQueriesNV(IntBuffer piIDs) { + nglDeleteOcclusionQueriesNV(piIDs.remaining(), piIDs, piIDs.position()); + } + private static native void nglDeleteOcclusionQueriesNV(int n, IntBuffer piIDs, int piIDs_offset); + + public static void glDeleteProgramsARB(IntBuffer piPrograms) { + nglDeleteProgramsARB(piPrograms.remaining(), piPrograms, piPrograms.position()); + } + private static native void nglDeleteProgramsARB(int n, IntBuffer piPrograms, int piPrograms_offset); + + public static void glDeleteProgramsNV(IntBuffer piIDs) { + nglDeleteProgramsNV(piIDs.remaining(), piIDs, piIDs.position()); + } + private static native void nglDeleteProgramsNV(int n, IntBuffer piIDs, int piIDs_offset); + + public static native void glDeleteVertexShaderEXT(int id); + + public static native void glDisableVariantClientStateEXT(int id); + + public static native void glDisableVertexAttribArrayARB(int index); + + public static native void glDrawElementArrayATI(int mode, int count); + + public static native void glDrawRangeElementArrayATI( + int mode, + int start, + int end, + int count); + + public static void glDrawRangeElementsEXT(int mode, int start, int end, ByteBuffer pIndices) { + nglDrawRangeElementsEXT(mode, start, end, pIndices.remaining(), GL_UNSIGNED_BYTE, pIndices, pIndices.position()); + } + public static void glDrawRangeElementsEXT(int mode, int start, int end, ShortBuffer pIndices) { + nglDrawRangeElementsEXT(mode, start, end, pIndices.remaining(), GL_UNSIGNED_SHORT, pIndices, pIndices.position()<<1); + } + public static void glDrawRangeElementsEXT(int mode, int start, int end, IntBuffer pIndices) { + nglDrawRangeElementsEXT(mode, start, end, pIndices.remaining(), GL_UNSIGNED_INT, pIndices, pIndices.position()<<2); + } + private static native void nglDrawRangeElementsEXT(int mode, int start, int end, int count, int type, Buffer pIndices, int pIndices_offset); + + public static void glElementPointerATI(ByteBuffer pPointer) { + nglElementPointerATI(GL_UNSIGNED_BYTE, pPointer, pPointer.position()); + } + public static void glElementPointerATI(ShortBuffer pPointer) { + nglElementPointerATI(GL_UNSIGNED_SHORT, pPointer, pPointer.position()<<1); + } + public static void glElementPointerATI(IntBuffer pPointer) { + nglElementPointerATI(GL_UNSIGNED_INT, pPointer, pPointer.position()<<2); + } + private static native void nglElementPointerATI(int type, Buffer pPointer, int pPointer_offset); + + public static native void glEnableVariantClientStateEXT(int id); + + public static native void glEnableVertexAttribArrayARB(int index); + + public static native void glEndFragmentShaderATI(); + + public static native void glEndOcclusionQueryNV(); + + public static native void glEndVertexShaderEXT(); + + public static native void glEvalMapsNV(int target, int mode); + + public static void glExecuteProgramNV(int target, int id, FloatBuffer pfParams) { + nglExecuteProgramNV(target, id, pfParams, pfParams.position()); + } + private static native void nglExecuteProgramNV(int target, int id, FloatBuffer pfParams, int pfParams_offset); + + public static native void glExtractComponentEXT(int res, int src, int num); + + public static native void glFinalCombinerInputNV( + int variable, + int input, + int mapping, + int componentUsage); + + public static native void glFinishFenceNV(int fence); + + public static native void glFlushVertexArrayRangeNV(); + + public static native void glFogCoordfEXT(float coord); + + public static void glFogCoordPointerEXT(int stride, FloatBuffer pPointer) { + nglFogCoordPointerEXT(GL_FLOAT, stride, pPointer, pPointer.position()<<2); + } + private static native void nglFogCoordPointerEXT(int type, int stride, Buffer pPointer, int pPointer_offset); + + public static native void glFreeObjectBufferATI(int buffer); + + public static void glGenFencesNV(IntBuffer piFences) { + nglGenFencesNV(piFences.remaining(), piFences, piFences.position()); + } + private static native void nglGenFencesNV(int n, IntBuffer piFences, int piFences_offset); + + public static native int glGenFragmentShadersATI(int range); + + public static void glGenOcclusionQueriesNV(IntBuffer piIDs) { + nglGenOcclusionQueriesNV(piIDs.remaining(), piIDs, piIDs.position()); + } + private static native void nglGenOcclusionQueriesNV(int n, IntBuffer piIDs, int piIDs_offset); + + public static void glGenProgramsARB(IntBuffer piPrograms) { + nglGenProgramsARB(piPrograms.remaining(), piPrograms, piPrograms.position()); + } + private static native void nglGenProgramsARB(int n, IntBuffer piPrograms, int piPrograms_offset); + + public static void glGenProgramsNV(IntBuffer piIDs) { + nglGenProgramsNV(piIDs.remaining(), piIDs, piIDs.position()); + } + private static native void nglGenProgramsNV(int n, IntBuffer piIDs, int piIDs_offset); + + public static native int glGenSymbolsEXT( + int dataType, + int storageType, + int range, + int components); + + public static native int glGenVertexShadersEXT(int range); + + public static void glGetArrayObjectATI(int array, int pname, FloatBuffer pfParams) { + nglGetArrayObjectfvATI(array, pname, pfParams, pfParams.position()); + } + private static native void nglGetArrayObjectfvATI(int array, int pname, FloatBuffer pfParams, int pfParams_offset); + + public static void glGetArrayObjectATI(int array, int pname, IntBuffer piParams) { + nglGetArrayObjectivATI(array, pname, piParams, piParams.position()); + } + private static native void nglGetArrayObjectivATI(int array, int pname, IntBuffer piParams, int piParams_offset); + + public static void glGetCombinerInputParameterNV(int stage, int portion, int variable, int pname, FloatBuffer pfParams) { + nglGetCombinerInputParameterfvNV(stage, portion, variable, pname, pfParams, pfParams.position()); + } + private static native void nglGetCombinerInputParameterfvNV(int stage, int portion, int variable, int pname, FloatBuffer pfParams, int pfParams_offset); + + public static void glGetCombinerInputParameterNV(int stage, int portion, int variable, int pname, IntBuffer piParams) { + nglGetCombinerInputParameterivNV(stage, portion, variable, pname, piParams, piParams.position()); + } + private static native void nglGetCombinerInputParameterivNV(int stage, int portion, int variable, int pname, IntBuffer piParams, int piParams_offset); + + public static void glGetCombinerOutputParameterNV(int stage, int portion, int pname, FloatBuffer pfParams) { + nglGetCombinerOutputParameterfvNV(stage, portion, pname, pfParams, pfParams.position()); + } + private static native void nglGetCombinerOutputParameterfvNV(int stage, int portion, int pname, FloatBuffer pfParams, int pfParams_offset); + + public static void glGetCombinerOutputParameterNV(int stage, int portion, int pname, IntBuffer piParams) { + nglGetCombinerOutputParameterivNV(stage, portion, pname, piParams, piParams.position()); + } + private static native void nglGetCombinerOutputParameterivNV(int stage, int portion, int pname, IntBuffer piParams, int pfParams_offset); + + public static void glGetCombinerStageParameterNV(int stage, int pname, FloatBuffer pfParams) { + nglGetCombinerStageParameterfvNV(stage, pname, pfParams, pfParams.position()); + } + private static native void nglGetCombinerStageParameterfvNV(int stage, int pname, FloatBuffer pfParams, int pfParams_offset); + + public static void glGetCompressedTexImageARB(int target, int lod, ByteBuffer pImg) { + nglGetCompressedTexImageARB(target, lod, pImg, pImg.position()); + } + public static void glGetCompressedTexImageARB(int target, int lod, ShortBuffer pImg) { + nglGetCompressedTexImageARB(target, lod, pImg, pImg.position()<<1); + } + public static void glGetCompressedTexImageARB(int target, int lod, IntBuffer pImg) { + nglGetCompressedTexImageARB(target, lod, pImg, pImg.position()<<2); + } + private static native void nglGetCompressedTexImageARB(int target, int lod, Buffer pImg, int pImg_offset); + + public static void glGetFenceNV(int fence, int pname, IntBuffer piParams) { + nglGetFenceivNV(fence, pname, piParams, piParams.position()); + } + private static native void nglGetFenceivNV(int fence, int pname, IntBuffer piParams, int piParams_offset); + + public static void glGetFinalCombinerInputParameterNV(int variable, int pname, FloatBuffer pfParams) { + nglGetFinalCombinerInputParameterfvNV(variable, pname, pfParams, pfParams.position()); + } + private static native void nglGetFinalCombinerInputParameterfvNV(int variable, int pname, FloatBuffer pfParams, int pfParams_offset); + + public static void glGetFinalCombinerInputParameterNV(int variable, int pname, IntBuffer piParams) { + nglGetFinalCombinerInputParameterivNV(variable, pname, piParams, piParams.position()); + } + private static native void nglGetFinalCombinerInputParameterivNV(int variable, int pname, IntBuffer piParams, int piParams_offset); + + public static void glGetInvariantBooleanEXT(int id, int value, ByteBuffer pbData) { + nglGetInvariantBooleanvEXT(id, value, pbData, pbData.position()); + } + private static native void nglGetInvariantBooleanvEXT(int id, int value, ByteBuffer pbData, int pbData_offset); + + public static void glGetInvariantFloatEXT(int id, int value, FloatBuffer pfData) { + nglGetInvariantFloatvEXT(id, value, pfData, pfData.position()); + } + private static native void nglGetInvariantFloatvEXT(int id, int value, FloatBuffer pfData, int pfData_offset); + + public static void glGetInvariantIntegerEXT(int id, int value, IntBuffer piData) { + nglGetInvariantIntegervEXT(id, value, piData, piData.position()); + } + private static native void nglGetInvariantIntegervEXT(int id, int value, IntBuffer piData, int piData_offset); + + public static void glGetLocalConstantBooleanEXT(int id, int value, ByteBuffer pbData) { + nglGetLocalConstantBooleanvEXT(id, value, pbData, pbData.position()); + } + private static native void nglGetLocalConstantBooleanvEXT(int id, int value, ByteBuffer pbData, int pbData_offset); + + public static void glGetLocalConstantFloatEXT(int id, int value, FloatBuffer pfData) { + nglGetLocalConstantFloatvEXT(id, value, pfData, pfData.position()); + } + private static native void nglGetLocalConstantFloatvEXT(int id, int value, FloatBuffer pfData, int pfData_offset); + + public static void glGetLocalConstantIntegerEXT(int id, int value, IntBuffer piData) { + nglGetLocalConstantIntegervEXT(id, value, piData, piData.position()); + } + private static native void nglGetLocalConstantIntegervEXT(int id, int value, IntBuffer piData, int piData_offset); + + public static void glGetMapAttribParameterNV(int target, int index, int pname, FloatBuffer pfParams) { + nglGetMapAttribParameterfvNV(target, index, pname, pfParams, pfParams.position()); + } + private static native void nglGetMapAttribParameterfvNV(int target, int index, int pname, FloatBuffer pfParams, int pfParams_offset); + + public static void glGetMapAttribParameterNV(int target, int index, int pname, IntBuffer piParams) { + nglGetMapAttribParameterivNV(target, index, pname, piParams, piParams.position()); + } + private static native void nglGetMapAttribParameterivNV(int target, int index, int pname, IntBuffer piParams, int piParams_offset); + + public static void glGetMapControlPointsNV(int target, int index, int type, int ustride, int vstride, boolean packed, FloatBuffer pPoints) { + nglGetMapControlPointsNV(target, index, type, ustride, vstride, packed, pPoints, pPoints.position()<<2); + } + private static native void nglGetMapControlPointsNV(int target, int index, int type, int ustride, int vstride, boolean packed, Buffer pPoints, int pPoints_offset); + + public static void glGetMapParameterNV(int target, int pname, FloatBuffer pfParams) { + nglGetMapParameterfvNV(target, pname, pfParams, pfParams.position()); + } + private static native void nglGetMapParameterfvNV(int target, int pname, FloatBuffer pfParams, int pfParams_offset); + + public static void glGetMapParameterNV(int target, int pname, IntBuffer piParams) { + nglGetMapParameterivNV(target, pname, piParams, piParams.position()); + } + private static native void nglGetMapParameterivNV(int target, int pname, IntBuffer piParams, int piParams_offset); + + public static void glGetObjectBufferATI(int buffer, int pname, FloatBuffer pfParams) { + nglGetObjectBufferfvATI(buffer, pname, pfParams, pfParams.position()); + } + private static native void nglGetObjectBufferfvATI(int buffer, int pname, FloatBuffer pfParams, int pfParams_offset); + + public static void glGetObjectBufferATI(int buffer, int pname, IntBuffer piParams) { + nglGetObjectBufferivATI(buffer, pname, piParams, piParams.position()); + } + private static native void nglGetObjectBufferivATI(int buffer, int pname, IntBuffer piParams, int piParams_offset); + + public static void glGetOcclusionQueryNV(int id, int pname, IntBuffer piParams) { + nglGetOcclusionQueryivNV(id, pname, piParams, piParams.position()); + } + private static native void nglGetOcclusionQueryivNV(int id, int pname, IntBuffer piParams, int piParams_offset); + + public static void glGetOcclusionQueryuNV(int id, int pname, IntBuffer piParams) { + nglGetOcclusionQueryuivNV(id, pname, piParams, piParams.position()); + } + private static native void nglGetOcclusionQueryuivNV(int id, int pname, IntBuffer piParams, int piParams_offset); + + public static void glGetProgramEnvParameterARB(int target, int index, FloatBuffer pfParams) { + nglGetProgramEnvParameterfvARB(target, index, pfParams, pfParams.position()); + } + private static native void nglGetProgramEnvParameterfvARB(int target, int index, FloatBuffer pfParams, int pfParams_offset); + + public static void glGetProgramARB(int target, int pname, IntBuffer piParams) { + nglGetProgramivARB(target, pname, piParams, piParams.position()); + } + private static native void nglGetProgramivARB(int target, int pname, IntBuffer piParams, int piParams_offset); + + public static void glGetProgramNV(int id, int pname, IntBuffer piParams) { + nglGetProgramivNV(id, pname, piParams, piParams.position()); + } + private static native void nglGetProgramivNV(int id, int pname, IntBuffer piParams, int piParams_offset); + + public static void glGetProgramLocalParameterARB(int target, int index, FloatBuffer pfParams) { + nglGetProgramLocalParameterfvARB(target, index, pfParams, pfParams.position()); + } + private static native void nglGetProgramLocalParameterfvARB(int target, int index, FloatBuffer pfParams, int pfParams_offset); + + public static void glGetProgramParameterNV(int target, int index, int pname, FloatBuffer pfParams) { + nglGetProgramParameterfvNV(target, index, pname, pfParams, pfParams.position()); + } + private static native void nglGetProgramParameterfvNV(int target, int index, int pname, FloatBuffer pfParams, int pfParams_offset); + + public static void glGetProgramStringARB(int target, int pname, ByteBuffer pString) { + nglGetProgramStringARB(target, pname, pString, pString.position()); + } + private static native void nglGetProgramStringARB(int target, int pname, Buffer pString, int pString_offset); + + public static void glGetProgramStringNV(int id, int pname, ByteBuffer pProgram) { + nglGetProgramStringNV(id, pname, pProgram, pProgram.position()); + } + private static native void nglGetProgramStringNV(int id, int pname, ByteBuffer pProgram, int pProgram_offset); + + public static void glGetTexBumpParameterATI(int pname, FloatBuffer pfParam) { + nglGetTexBumpParameterfvATI(pname, pfParam, pfParam.position()); + } + private static native void nglGetTexBumpParameterfvATI(int pname, FloatBuffer pfParam, int pfParam_offset); + + public static void glGetTexBumpParameterATI(int pname, IntBuffer piParam) { + nglGetTexBumpParameterivATI(pname, piParam, piParam.position()); + } + private static native void nglGetTexBumpParameterivATI(int pname, IntBuffer piParam, int piParam_offset); + + public static void glGetTrackMatrixNV(int target, int address, int pname, IntBuffer piParams) { + nglGetTrackMatrixivNV(target, address, pname, piParams, piParams.position()); + } + private static native void nglGetTrackMatrixivNV(int target, int address, int pname, IntBuffer piParams, int piParams_offset); + + public static void glGetVariantArrayObjectATI(int id, int pname, FloatBuffer pfParams) { + nglGetVariantArrayObjectfvATI(id, pname, pfParams, pfParams.position()); + } + private static native void nglGetVariantArrayObjectfvATI(int id, int pname, FloatBuffer pfParams, int pfParams_offset_offset); + + public static void glGetVariantArrayObjectATI(int id, int pname, IntBuffer piParams) { + nglGetVariantArrayObjectivATI(id, pname, piParams, piParams.position()); + } + private static native void nglGetVariantArrayObjectivATI(int id, int pname, IntBuffer piParams, int piParams_offset); + + public static void glGetVariantBooleanEXT(int id, int value, ByteBuffer pbData) { + nglGetVariantBooleanvEXT(id, value, pbData, pbData.position()); + } + private static native void nglGetVariantBooleanvEXT(int id, int value, ByteBuffer pbData, int pbData_offset); + + public static void glGetVariantFloatEXT(int id, int value, FloatBuffer pfData) { + nglGetVariantFloatvEXT(id, value, pfData, pfData.position()); + } + private static native void nglGetVariantFloatvEXT(int id, int value, FloatBuffer pfData, int pfData_offset); + + public static void glGetVariantIntegerEXT(int id, int value, IntBuffer piData) { + nglGetVariantIntegervEXT(id, value, piData, piData.position()); + } + private static native void nglGetVariantIntegervEXT(int id, int value, IntBuffer piData, int piData_offset); + + public static native ByteBuffer glGetVariantPointerEXT(int id, int value, int size); + + public static void glGetVertexAttribARB(int index, int pname, FloatBuffer pfParams) { + nglGetVertexAttribfvARB(index, pname, pfParams, pfParams.position()); + } + private static native void nglGetVertexAttribfvARB(int index, int pname, FloatBuffer pfParams, int pfParams_offset); + + public static void glGetVertexAttribNV(int index, int pname, FloatBuffer pfParams) { + nglGetVertexAttribfvNV(index, pname, pfParams, pfParams.position()); + } + private static native void nglGetVertexAttribfvNV(int index, int pname, FloatBuffer pfParams, int pfParams_offset); + + public static void glGetVertexAttribARB(int index, int pname, IntBuffer piParams) { + nglGetVertexAttribivARB(index, pname, piParams, piParams.position()); + } + private static native void nglGetVertexAttribivARB(int index, int pname, IntBuffer piParams, int piParams_offset); + + public static void glGetVertexAttribNV(int index, int pname, IntBuffer piParams) { + nglGetVertexAttribivNV(index, pname, piParams, piParams.position()); + } + private static native void nglGetVertexAttribivNV(int index, int pname, IntBuffer piParams, int piParams_offset); + + public static native ByteBuffer glGetVertexAttribPointerARB( + int index, + int pname, + int size); + + public static native ByteBuffer glGetVertexAttribPointerNV( + int index, + int pname, + int size); + + public static native void glInsertComponentEXT(int res, int src, int num); + + public static native boolean glIsFenceNV(int fence); + + public static native boolean glIsObjectBufferATI(int buffer); + + public static native boolean glIsOcclusionQueryNV(int id); + + public static native boolean glIsProgramARB(int program); + + // #ifdef _WIN32 + + public static native boolean glIsProgramNV(int id); + + public static native boolean glIsVariantEnabledEXT(int id, int cap); + + public static void glLoadProgramNV(int target, int id, ByteBuffer pProgram) { + nglLoadProgramNV(target, id, pProgram.remaining(), pProgram, pProgram.position()); + } + private static native void nglLoadProgramNV(int target, int id, int len, ByteBuffer pProgram, int pProgram_offset); + + public static void glLoadTransposeMatrixfARB(FloatBuffer pfMtx) { + nglLoadTransposeMatrixfARB(pfMtx, pfMtx.position()); + } + private static native void nglLoadTransposeMatrixfARB(FloatBuffer pfMtx, int pfMtx_offset); + + public static native void glLockArraysEXT(int first, int count); + + public static void glMapControlPointsNV(int target, int index, int type, int ustride, int vstride, int uorder, int vorder, boolean packed, FloatBuffer pPoints) { + nglMapControlPointsNV(target, index, type, ustride, vstride, uorder, vorder, packed, pPoints, pPoints.position()<<2); + } + private static native void nglMapControlPointsNV(int target, int index, int type, int ustride, int vstride, int uorder, int vorder, boolean packed, Buffer pPoints, int pPoints_offset); + + public static void glMapParameterNV(int target, int pname, FloatBuffer pfParams) { + nglMapParameterfvNV(target, pname, pfParams, pfParams.position()); + } + private static native void nglMapParameterfvNV(int target, int pname, FloatBuffer pfParams, int pfParams_offset); + + public static void glMapParameterNV(int target, int pname, IntBuffer piParams) { + nglMapParameterivNV(target, pname, piParams, piParams.position()); + } + private static native void nglMapParameterivNV(int target, int pname, IntBuffer piParams, int piParams_offset); + + public static void glMatrixIndexPointerARB(int size, int stride, ByteBuffer pPointer) { + nglMatrixIndexPointerARB(size, GL_UNSIGNED_BYTE, stride, pPointer, pPointer.position()); + } + public static void glMatrixIndexPointerARB(int size, int stride, ShortBuffer pPointer) { + nglMatrixIndexPointerARB(size, GL_UNSIGNED_SHORT, stride, pPointer, pPointer.position()<<1); + } + public static void glMatrixIndexPointerARB(int size, int stride, IntBuffer pPointer) { + nglMatrixIndexPointerARB(size, GL_UNSIGNED_INT, stride, pPointer, pPointer.position()<<2); + } + private static native void nglMatrixIndexPointerARB(int size, int type, int stride, Buffer pPointer, int pPointer_offset); + + public static void glMatrixIndexuARB(ByteBuffer pIndices) { + nglMatrixIndexubvARB(pIndices.remaining(), pIndices, pIndices.position()); + } + private static native void nglMatrixIndexubvARB(int size, ByteBuffer pIndices, int pIndices_offset); + + public static void glMatrixIndexuARB(IntBuffer piIndices) { + nglMatrixIndexuivARB(piIndices.remaining(), piIndices, piIndices.position()); + } + private static native void nglMatrixIndexuivARB(int size, IntBuffer piIndices, int piIndices_offset); + + public static void glMatrixIndexuARB(ShortBuffer psIndices) { + nglMatrixIndexusvARB(psIndices.remaining(), psIndices, psIndices.position()); + } + private static native void nglMatrixIndexusvARB(int size, ShortBuffer psIndices, int psIndices_offset); + + public static void glMultiDrawArraysEXT(int mode, IntBuffer piFirst, IntBuffer piCount) { + assert piFirst.remaining() == piCount.remaining(): "piFirst.remaining() != piCount.remaining()"; + nglMultiDrawArraysEXT(mode, piFirst, piFirst.position(), piCount, piCount.position(), piFirst.remaining()); + } + private static native void nglMultiDrawArraysEXT(int mode, IntBuffer piFirst, int piFirst_offset, IntBuffer piCount, int piCount_offset, int primcount); + +// public static native void glMultiDrawElementsEXT(int mode, int piCount, int type, int pIndices, int primcount); + + public static native void glMultiTexCoord1fARB(int target, float s); + + public static native void glMultiTexCoord1iARB(int target, int s); + + public static native void glMultiTexCoord1sARB(int target, short s); + + public static native void glMultiTexCoord2fARB(int target, float s, float t); + + public static native void glMultiTexCoord2iARB(int target, int s, int t); + + public static native void glMultiTexCoord2sARB(int target, short s, short t); + + public static native void glMultiTexCoord3fARB( + int target, + float s, + float t, + float r); + + public static native void glMultiTexCoord3iARB(int target, int s, int t, int r); + + public static native void glMultiTexCoord3sARB( + int target, + short s, + short t, + short r); + + public static native void glMultiTexCoord4fARB( + int target, + float s, + float t, + float r, + float q); + + public static native void glMultiTexCoord4iARB( + int target, + int s, + int t, + int r, + int q); + + public static native void glMultiTexCoord4sARB( + int target, + short s, + short t, + short r, + short q); + + public static void glMultTransposeMatrixfARB(FloatBuffer pfMtx) { + nglMultTransposeMatrixfARB(pfMtx, pfMtx.position()); + } + private static native void nglMultTransposeMatrixfARB(FloatBuffer pfMtx, int pfMtx_offset); + + public static int glNewObjectBufferATI(int size, ByteBuffer pPointer, int usage) { + return nglNewObjectBufferATI(size, pPointer, pPointer != null ? pPointer.position() : 0, usage); + } + public static int glNewObjectBufferATI(int size, ShortBuffer pPointer, int usage) { + return nglNewObjectBufferATI(size, pPointer, pPointer != null ? pPointer.position()<<1 : 0, usage); + } + public static int glNewObjectBufferATI(int size, FloatBuffer pPointer, int usage) { + return nglNewObjectBufferATI(size, pPointer, pPointer != null ? pPointer.position()<<2 : 0, usage); + } + public static int glNewObjectBufferATI(int size, IntBuffer pPointer, int usage) { + return nglNewObjectBufferATI(size, pPointer, pPointer != null ? pPointer.position()<<2 : 0, usage); + } + private static native int nglNewObjectBufferATI(int size, Buffer pPointer, int pPointer_offset, int usage); + + public static native void glNormalStream3bATI(int stream, byte x, byte y, byte z); + + public static native void glNormalStream3fATI(int stream, float x, float y, float z); + + public static native void glNormalStream3iATI(int stream, int x, int y, int z); + + public static native void glNormalStream3sATI(int stream, short x, short y, short z); + + public static native void glPassTexCoordATI(int dst, int coord, int swizzle); + + public static native void glPNTrianglesfATI(int pname, float param); + + public static native void glPNTrianglesiATI(int pname, int param); + + public static native void glPointParameterfARB(int pname, float param); + + public static native void glPointParameterfEXT(int pname, float param); + + public static void glPointParameterARB(int pname, FloatBuffer pfParams) { + nglPointParameterfvARB(pname, pfParams, pfParams.position()); + } + private static native void nglPointParameterfvARB(int pname, FloatBuffer pfParams, int pfParams_offset); + + public static void glPointParameterEXT(int pname, FloatBuffer pfParams) { + nglPointParameterfvEXT(pname, pfParams, pfParams.position()); + } + private static native void nglPointParameterfvEXT(int pname, FloatBuffer pfParams, int pfParams_offset); + + public static native void glPointParameteriNV(int pname, int param); + + public static void glPointParameterNV(int pname, IntBuffer piParams) { + nglPointParameterivNV(pname, piParams, piParams.position()); + } + private static native void nglPointParameterivNV(int pname, IntBuffer piParams, int piParams_offset); + + public static native void glProgramEnvParameter4fARB( + int target, + int index, + float x, + float y, + float z, + float w); + + public static native void glProgramLocalParameter4fARB( + int target, + int index, + float x, + float y, + float z, + float w); + + public static native void glProgramParameter4fNV( + int target, + int index, + float x, + float y, + float z, + float w); + + public static void glProgramParameters4NV(int target, int index, int num, FloatBuffer pfParams) { + nglProgramParameters4fvNV(target, index, num, pfParams, pfParams.position()); + } + private static native void nglProgramParameters4fvNV(int target, int index, int num, FloatBuffer pfParams, int pfParams_offset); + + public static void glProgramStringARB(int target, int format, ByteBuffer pString) { + nglProgramStringARB(target, format, pString.remaining(), pString, pString.position()); + } + private static native void nglProgramStringARB(int target, int format, int len, Buffer pString, int pString_offset); + + public static void glRequestResidentProgramsNV(IntBuffer piIDs) { + nglRequestResidentProgramsNV(piIDs.remaining(), piIDs, piIDs.position()); + } + private static native void nglRequestResidentProgramsNV(int n, IntBuffer piIDs, int piIDs_offset); + + public static native void glSampleCoverageARB(float value, boolean invert); + + public static native void glSampleMapATI(int dst, int interp, int swizzle); + + public static native void glSecondaryColor3bEXT(byte red, byte green, byte blue); + + public static native void glSecondaryColor3fEXT(float red, float green, float blue); + + public static native void glSecondaryColor3ubEXT(byte red, byte green, byte blue); + + public static void glSecondaryColorPointerEXT(int size, int type, int stride, ByteBuffer pPointer) { + nglSecondaryColorPointerEXT(size, type, stride, pPointer, pPointer.position()); + } + public static void glSecondaryColorPointerEXT(int size, int type, int stride, FloatBuffer pPointer) { + nglSecondaryColorPointerEXT(size, type, stride, pPointer, pPointer.position()<<2); + } + private static native void nglSecondaryColorPointerEXT(int size, int type, int stride, Buffer pPointer, int pPointer_offset); + + public static native void glSetFenceNV(int fence, int condition); + + public static void glSetFragmentShaderConstantATI(int dst, FloatBuffer pfValue) { + nglSetFragmentShaderConstantATI(dst, pfValue, pfValue.position()); + } + private static native void nglSetFragmentShaderConstantATI(int dst, FloatBuffer pfValue, int pfValue_offset); + + public static void glSetInvariantEXT(int id, boolean unsigned, ByteBuffer pAddr) { + nglSetInvariantEXT(id, unsigned ? GL_UNSIGNED_BYTE : GL_BYTE, pAddr, pAddr.position()); + } + public static void glSetInvariantEXT(int id, boolean unsigned, ShortBuffer pAddr) { + nglSetInvariantEXT(id, unsigned ? GL_UNSIGNED_SHORT : GL_SHORT, pAddr, pAddr.position()<<1); + } + public static void glSetInvariantEXT(int id, FloatBuffer pAddr) { + nglSetInvariantEXT(id, GL_FLOAT, pAddr, pAddr.position()<<2); + } + public static void glSetInvariantEXT(int id, boolean unsigned, IntBuffer pAddr) { + nglSetInvariantEXT(id, unsigned ? GL_UNSIGNED_INT : GL_INT, pAddr, pAddr.position()<<2); + } + private static native void nglSetInvariantEXT(int id, int type, Buffer pAddr, int pAddr_offset); + + public static void glSetLocalConstantEXT(int id, boolean unsigned, ByteBuffer pAddr) { + nglSetLocalConstantEXT(id, unsigned ? GL_UNSIGNED_BYTE : GL_BYTE, pAddr, pAddr.position()); + } + public static void glSetLocalConstantEXT(int id, boolean unsigned, ShortBuffer pAddr) { + nglSetLocalConstantEXT(id, unsigned ? GL_UNSIGNED_SHORT : GL_SHORT, pAddr, pAddr.position()<<1); + } + public static void glSetLocalConstantEXT(int id, FloatBuffer pAddr) { + nglSetLocalConstantEXT(id, GL_FLOAT, pAddr, pAddr.position()<<2); + } + public static void glSetLocalConstantEXT(int id, boolean unsigned, IntBuffer pAddr) { + nglSetLocalConstantEXT(id, unsigned ? GL_UNSIGNED_INT : GL_INT, pAddr, pAddr.position()<<2); + } + private static native void nglSetLocalConstantEXT(int id, int type, Buffer pAddr, int pAddr_offset); + + public static native void glShaderOp1EXT(int op, int res, int arg1); + + public static native void glShaderOp2EXT(int op, int res, int arg1, int arg2); + + public static native void glShaderOp3EXT( + int op, + int res, + int arg1, + int arg2, + int arg3); + + public static native void glSwizzleEXT( + int res, + int in, + int outX, + int outY, + int outZ, + int outW); + + public static native boolean glTestFenceNV(int fence); + + public static void glTexBumpParameterATI(int pname, FloatBuffer pfParam) { + nglTexBumpParameterfvATI(pname, pfParam, pfParam.position()); + } + private static native void nglTexBumpParameterfvATI(int pname, FloatBuffer pfParam, int pfParam_offset); + + public static void glTexBumpParameterATI(int pname, IntBuffer piParam) { + nglTexBumpParameterivATI(pname, piParam, piParam.position()); + } + private static native void nglTexBumpParameterivATI(int pname, IntBuffer piParam, int piParam_offset); + + public static native void glTrackMatrixNV( + int target, + int address, + int matrix, + int transform); + + public static native void glUnlockArraysEXT(); + + public static void glUpdateObjectBufferATI(int buffer, int offset, ByteBuffer pPointer, int preserve) { + nglUpdateObjectBufferATI(buffer, offset, pPointer.remaining(), pPointer, pPointer.position(), preserve); + } + public static void glUpdateObjectBufferATI(int buffer, int offset, ShortBuffer pPointer, int preserve) { + nglUpdateObjectBufferATI(buffer, offset, pPointer.remaining()<<1, pPointer, pPointer.position()<<1, preserve); + } + public static void glUpdateObjectBufferATI(int buffer, int offset, FloatBuffer pPointer, int preserve) { + nglUpdateObjectBufferATI(buffer, offset, pPointer.remaining()<<2, pPointer, pPointer.position()<<2, preserve); + } + public static void glUpdateObjectBufferATI(int buffer, int offset, IntBuffer pPointer, int preserve) { + nglUpdateObjectBufferATI(buffer, offset, pPointer.remaining()<<2, pPointer, pPointer.position()<<2, preserve); + } + private static native void nglUpdateObjectBufferATI(int buffer, int offset, int size, Buffer pPointer, int pPointer_offset, int preserve); + + public static native void glVariantArrayObjectATI( + int id, + int type, + int stride, + int buffer, + int offset); + + public static void glVariantEXT(int id, ByteBuffer pAddr) { + nglVariantbvEXT(id, pAddr, pAddr.position()); + } + private static native void nglVariantbvEXT(int id, ByteBuffer pAddr, int pAddr_offset); + + public static void glVariantEXT(int id, FloatBuffer pfAddr) { + nglVariantfvEXT(id, pfAddr, pfAddr.position()); + } + private static native void nglVariantfvEXT(int id, FloatBuffer pfAddr, int pfAddr_offset); + + public static void glVariantEXT(int id, IntBuffer piAddr) { + nglVariantivEXT(id, piAddr, piAddr.position()); + } + private static native void nglVariantivEXT(int id, IntBuffer piAddr, int piAddr_offset); + + public static void glVariantPointerEXT(int id, boolean unsigned, int stride, ByteBuffer pAddr) { + nglVariantPointerEXT(id, unsigned ? GL_UNSIGNED_BYTE : GL_BYTE, stride, pAddr, pAddr.position()); + } + public static void glVariantPointerEXT(int id, boolean unsigned, int stride, ShortBuffer pAddr) { + nglVariantPointerEXT(id, unsigned ? GL_UNSIGNED_SHORT : GL_SHORT, stride, pAddr, pAddr.position()<<1); + } + public static void glVariantPointerEXT(int id, int stride, FloatBuffer pAddr) { + nglVariantPointerEXT(id, GL_FLOAT, stride, pAddr, pAddr.position()<<2); + } + public static void glVariantPointerEXT(int id, boolean unsigned, int stride, IntBuffer pAddr) { + nglVariantPointerEXT(id, unsigned ? GL_UNSIGNED_INT : GL_INT, stride, pAddr, pAddr.position()<<2); + } + private static native void nglVariantPointerEXT(int id, int type, int stride, Buffer pAddr, int pAddr_offset); + + public static void glVariantEXT(int id, ShortBuffer psAddr) { + nglVariantsvEXT(id, psAddr, psAddr.position()); + } + private static native void nglVariantsvEXT(int id, ShortBuffer psAddr, int psAddr_offset); + + public static void glVariantuEXT(int id, ByteBuffer pAddr) { + nglVariantubvEXT(id, pAddr, pAddr.position()); + } + private static native void nglVariantubvEXT(int id, ByteBuffer pAddr, int pAddr_offset); + + public static void glVariantuEXT(int id, IntBuffer piAddr) { + nglVariantuivEXT(id, piAddr, piAddr.position()); + } + private static native void nglVariantuivEXT(int id, IntBuffer piAddr, int piAddr_offset); + + public static void glVariantuEXT(int id, ShortBuffer psAddr) { + nglVariantusvEXT(id, psAddr, psAddr.position()); + } + private static native void nglVariantusvEXT(int id, ShortBuffer psAddr, int psAddr_offset); + + public static void glVertexArrayRangeNV(ByteBuffer pPointer) { + nglVertexArrayRangeNV(pPointer.remaining(), pPointer, pPointer.position()); + } + private static native void nglVertexArrayRangeNV(int size, Buffer pPointer, int pPointer_offset); + + public static native void glVertexAttrib1fARB(int index, float x); + + public static native void glVertexAttrib1fNV(int index, float x); + + public static native void glVertexAttrib1sARB(int index, short x); + + public static native void glVertexAttrib1sNV(int index, short x); + + public static native void glVertexAttrib2fARB(int index, float x, float y); + + public static native void glVertexAttrib2fNV(int index, float x, float y); + + public static native void glVertexAttrib2sARB(int index, short x, short y); + + public static native void glVertexAttrib2sNV(int index, short x, short y); + + public static native void glVertexAttrib3fARB(int index, float x, float y, float z); + + public static native void glVertexAttrib3fNV(int index, float x, float y, float z); + + public static native void glVertexAttrib3sARB(int index, short x, short y, short z); + + public static native void glVertexAttrib3sNV(int index, short x, short y, short z); + + public static void glVertexAttrib4ARB(int index, ByteBuffer pV) { + nglVertexAttrib4bvARB(index, pV, pV.position()); + } + private static native void nglVertexAttrib4bvARB(int index, ByteBuffer pV, int pV_offset); + + public static native void glVertexAttrib4fARB( + int index, + float x, + float y, + float z, + float w); + + public static native void glVertexAttrib4fNV( + int index, + float x, + float y, + float z, + float w); + + public static void glVertexAttrib4ARB(int index, IntBuffer piV) { + nglVertexAttrib4ivARB(index, piV, piV.position()); + } + private static native void nglVertexAttrib4ivARB(int index, IntBuffer piV, int piV_offset); + + public static void glVertexAttrib4NARB(int index, ByteBuffer pV) { + nglVertexAttrib4NbvARB(index, pV, pV.position()); + } + private static native void nglVertexAttrib4NbvARB(int index, ByteBuffer pV, int pV_offset); + + public static void glVertexAttrib4NARB(int index, IntBuffer piV) { + nglVertexAttrib4NivARB(index, piV, piV.position()); + } + private static native void nglVertexAttrib4NivARB(int index, IntBuffer piV, int piV_offset); + + public static void glVertexAttrib4NARB(int index, ShortBuffer psV) { + nglVertexAttrib4NsvARB(index, psV, psV.position()); + } + private static native void nglVertexAttrib4NsvARB(int index, ShortBuffer psV, int psV_offset); + + public static native void glVertexAttrib4NubARB( + int index, + byte x, + byte y, + byte z, + byte w); + + public static void glVertexAttrib4NuARB(int index, ByteBuffer pV) { + nglVertexAttrib4NubvARB(index, pV, pV.position()); + } + private static native void nglVertexAttrib4NubvARB(int index, ByteBuffer pV, int pV_offset); + + public static void glVertexAttrib4NuARB(int index, IntBuffer piV) { + nglVertexAttrib4NuivARB(index, piV, piV.position()); + } + private static native void nglVertexAttrib4NuivARB(int index, IntBuffer piV, int piV_offset); + + public static void glVertexAttrib4NuARB(int index, ShortBuffer psV) { + nglVertexAttrib4NusvARB(index, psV, psV.position()); + } + private static native void nglVertexAttrib4NusvARB(int index, ShortBuffer psV, int psV_offset); + + public static native void glVertexAttrib4sARB( + int index, + short x, + short y, + short z, + short w); + + public static native void glVertexAttrib4sNV( + int index, + short x, + short y, + short z, + short w); + + public static native void glVertexAttrib4ubNV( + int index, + byte x, + byte y, + byte z, + byte w); + + public static void glVertexAttrib4uARB(int index, ByteBuffer pV) { + nglVertexAttrib4ubvARB(index, pV, pV.position()); + } + private static native void nglVertexAttrib4ubvARB(int index, ByteBuffer pV, int pV_offset); + + public static void glVertexAttrib4uNV(int index, ByteBuffer pV) { + nglVertexAttrib4ubvNV(index, pV, pV.position()); + } + private static native void nglVertexAttrib4ubvNV(int index, ByteBuffer pV, int pV_offset); + + public static void glVertexAttrib4uARB(int index, IntBuffer piV) { + nglVertexAttrib4uivARB(index, piV, piV.position()); + } + private static native void nglVertexAttrib4uivARB(int index, IntBuffer piV, int piV_offset); + + public static void glVertexAttrib4uARB(int index, ShortBuffer psV) { + nglVertexAttrib4usvARB(index, psV, psV.position()); + } + private static native void nglVertexAttrib4usvARB(int index, ShortBuffer psV, int psV_offset); + + public static void glVertexAttribPointerARB(int index, int size, boolean unsigned, boolean normalized, int stride, ByteBuffer pPointer) { + assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + nglVertexAttribPointerARB(index, size, unsigned ? GL_UNSIGNED_BYTE : GL_BYTE, normalized, stride, pPointer, pPointer.position()); + } + public static void glVertexAttribPointerARB(int index, int size, boolean unsigned, boolean normalized, int stride, ShortBuffer pPointer) { + assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + nglVertexAttribPointerARB(index, size, unsigned ? GL_UNSIGNED_SHORT : GL_SHORT, normalized, stride, pPointer, pPointer.position()<<1); + } + public static void glVertexAttribPointerARB(int index, int size, boolean normalized, int stride, FloatBuffer pPointer) { + assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + nglVertexAttribPointerARB(index, size, GL_FLOAT, normalized, stride, pPointer, pPointer.position()<<2); + } + public static void glVertexAttribPointerARB(int index, int size, boolean unsigned, boolean normalized, int stride, IntBuffer pPointer) { + assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + nglVertexAttribPointerARB(index, size, unsigned ? GL_UNSIGNED_INT : GL_INT, normalized, stride, pPointer, pPointer.position()<<2); + } + private static native void nglVertexAttribPointerARB(int index, int size, int type, boolean normalized, int stride, Buffer pPointer, int pPointer_offset); + public static void glVertexAttribPointerARB(int index, int size, int type, boolean normalized, int stride, int buffer_offset) { + assert VBOTracker.getVBOArrayStack().getState() != 0: "Cannot use int offsets when VBO is disabled"; + nglVertexAttribPointerARBVBO(index, size, type, normalized, stride, buffer_offset); + } + private static native void nglVertexAttribPointerARBVBO(int index, int size, int type, boolean normalized, int stride, int buffer_offset); + public static void glVertexAttribPointerNV(int index, int size, boolean unsigned, int stride, ByteBuffer pPointer) { + nglVertexAttribPointerNV(index, size, unsigned ? GL_UNSIGNED_BYTE : GL_BYTE, stride, pPointer, pPointer.position()); + } + public static void glVertexAttribPointerNV(int index, int size, boolean unsigned, int stride, ShortBuffer pPointer) { + nglVertexAttribPointerNV(index, size, unsigned ? GL_UNSIGNED_SHORT : GL_SHORT, stride, pPointer, pPointer.position()<<1); + } + public static void glVertexAttribPointerNV(int index, int size, int stride, FloatBuffer pPointer) { + nglVertexAttribPointerNV(index, size, GL_FLOAT, stride, pPointer, pPointer.position()<<2); + } + public static void glVertexAttribPointerNV(int index, int size, boolean unsigned, int stride, IntBuffer pPointer) { + nglVertexAttribPointerNV(index, size, unsigned ? GL_UNSIGNED_INT : GL_INT, stride, pPointer, pPointer.position()<<2); + } + private static native void nglVertexAttribPointerNV(int index, int size, int type, int stride, Buffer pPointer, int pPointer_offset); + + public static void glVertexAttribs1NV(int index, FloatBuffer pfV) { + nglVertexAttribs1fvNV(index, pfV.remaining(), pfV, pfV.position()); + } + private static native void nglVertexAttribs1fvNV(int index, int n, FloatBuffer pfV, int pfV_offset); + + public static void glVertexAttribs1NV(int index, ShortBuffer psV) { + nglVertexAttribs1svNV(index, psV.remaining(), psV, psV.position()); + } + private static native void nglVertexAttribs1svNV(int index, int n, ShortBuffer psV, int psV_offset); + + public static void glVertexAttribs2NV(int index, FloatBuffer pfV) { + nglVertexAttribs2fvNV(index, pfV.remaining()>>1, pfV, pfV.position()); + } + private static native void nglVertexAttribs2fvNV(int index, int n, FloatBuffer pfV, int pfV_offset); + + public static void glVertexAttribs2NV(int index, ShortBuffer psV) { + nglVertexAttribs2svNV(index, psV.remaining()>>1, psV, psV.position()); + } + private static native void nglVertexAttribs2svNV(int index, int n, ShortBuffer psV, int psV_offset); + + public static void glVertexAttribs3NV(int index, FloatBuffer pfV) { + nglVertexAttribs3fvNV(index, pfV.remaining()/3, pfV, pfV.position()); + } + private static native void nglVertexAttribs3fvNV(int index, int n, FloatBuffer pfV, int pfV_offset); + + public static void glVertexAttribs3NV(int index, ShortBuffer psV) { + nglVertexAttribs3svNV(index, psV.remaining()/3, psV, psV.position()); + } + private static native void nglVertexAttribs3svNV(int index, int n, ShortBuffer psV, int psV_offset); + + public static void glVertexAttribs4NV(int index, FloatBuffer pfV) { + nglVertexAttribs4fvNV(index, pfV.remaining()>>2, pfV, pfV.position()); + } + private static native void nglVertexAttribs4fvNV(int index, int n, FloatBuffer pfV, int pfV_offset); + + public static void glVertexAttribs4NV(int index, ShortBuffer psV) { + nglVertexAttribs4svNV(index, psV.remaining()>>2, psV, psV.position()); + } + private static native void nglVertexAttribs4svNV(int index, int n, ShortBuffer psV, int psV_offset); + + public static void glVertexAttribs4uNV(int index, ByteBuffer pV) { + nglVertexAttribs4ubvNV(index, pV.remaining()>>2, pV, pV.position()); + } + private static native void nglVertexAttribs4ubvNV(int index, int n, ByteBuffer pV, int pV_offset); + + public static native void glVertexBlendARB(int count); + + public static native void glVertexBlendEnvfATI(int pname, float param); + + public static native void glVertexBlendEnviATI(int pname, int param); + + public static native void glVertexStream2fATI(int stream, float x, float y); + + public static native void glVertexStream2iATI(int stream, int x, int y); + + public static native void glVertexStream2sATI(int stream, short x, short y); + + public static native void glVertexStream3fATI(int stream, float x, float y, float z); + + public static native void glVertexStream3iATI(int stream, int x, int y, int z); + + public static native void glVertexStream3sATI(int stream, short x, short y, short z); + + public static native void glVertexStream4fATI( + int stream, + float x, + float y, + float z, + float w); + + public static native void glVertexStream4iATI( + int stream, + int x, + int y, + int z, + int w); + + public static native void glVertexStream4sATI( + int stream, + short x, + short y, + short z, + short w); + + public static native void glVertexWeightfEXT(float weight); + + public static void glVertexWeightPointerEXT(int size, int stride, FloatBuffer pPointer) { + nglVertexWeightPointerEXT(size, GL_FLOAT, stride, pPointer, pPointer.position()<<2); + } + private static native void nglVertexWeightPointerEXT(int size, int type, int stride, Buffer pPointer, int pPointer_offset); + + public static void glWeightARB(ByteBuffer pWeights) { + nglWeightbvARB(pWeights.remaining(), pWeights, pWeights.position()); + } + private static native void nglWeightbvARB(int size, ByteBuffer pWeights, int pWeights_offset); + + public static void glWeightARB(int size, FloatBuffer pfWeights) { + nglWeightfvARB(pfWeights.remaining(), pfWeights, pfWeights.position()); + } + private static native void nglWeightfvARB(int size, FloatBuffer pfWeights, int pfWeights_offset); + + public static void glWeightARB(IntBuffer piWeights) { + nglWeightivARB(piWeights.remaining(), piWeights, piWeights.position()); + } + private static native void nglWeightivARB(int size, IntBuffer piWeights, int piWeights_offset); + + public static void glWeightPointerARB(int size, boolean unsigned, int stride, ByteBuffer pPointer) { + assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + nglWeightPointerARB(size, unsigned ? GL_UNSIGNED_BYTE : GL_BYTE, stride, pPointer, pPointer.position()); + } + public static void glWeightPointerARB(int size, boolean unsigned, int stride, ShortBuffer pPointer) { + assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + nglWeightPointerARB(size, unsigned ? GL_UNSIGNED_SHORT : GL_SHORT, stride, pPointer, pPointer.position()<<1); + } + public static void glWeightPointerARB(int size, int stride, FloatBuffer pPointer) { + assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + nglWeightPointerARB(size, GL_FLOAT, stride, pPointer, pPointer.position()<<2); + } + public static void glWeightPointerARB(int size, boolean unsigned, int stride, IntBuffer pPointer) { + assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + nglWeightPointerARB(size, unsigned ? GL_UNSIGNED_INT : GL_INT, stride, pPointer, pPointer.position()<<2); + } + private static native void nglWeightPointerARB(int size, int type, int stride, Buffer pPointer, int pPointer_offset); + public static void glWeightPointerARB(int size, int type, int stride, int buffer_offset) { + assert VBOTracker.getVBOArrayStack().getState() != 0: "Cannot use int offsets when VBO is disabled"; + nglWeightPointerARBVBO(size, type, stride, buffer_offset); + } + private static native void nglWeightPointerARBVBO(int size, int type, int stride, int buffer_offset); + + public static void glWeightARB(ShortBuffer psWeights) { + nglWeightsvARB(psWeights.remaining(), psWeights, psWeights.position()); + } + private static native void nglWeightsvARB(int size, ShortBuffer psWeights, int psWeights_offset); + + public static void glWeightuARB(ByteBuffer pWeights) { + nglWeightubvARB(pWeights.remaining(), pWeights, pWeights.position()); + } + private static native void nglWeightubvARB(int size, ByteBuffer pWeights, int pWeights_offset); + + public static void glWeightuARB(IntBuffer piWeights) { + nglWeightuivARB(piWeights.remaining(), piWeights, piWeights.position()); + } + private static native void nglWeightuivARB(int size, IntBuffer piWeights, int piWeights_offset); + + public static void glWeightuARB(ShortBuffer psWeights) { + nglWeightusvARB(psWeights.remaining(), psWeights, psWeights.position()); + } + private static native void nglWeightusvARB(int size, ShortBuffer psWeights, int psWeights_offset); + + public static native ByteBuffer glXAllocateMemoryNV( + int size, + float readFrequency, + float writeFrequency, + float priority); + + private static native void glXFreeMemoryNV(ByteBuffer pointer); + + // #ifdef _WIN32 + + public static native ByteBuffer wglAllocateMemoryNV( + int size, + float readFrequency, + float writeFrequency, + float priority); + + public static native boolean wglBindTexImageARB(int hPbuffer, int iBuffer); + +/* public static native boolean wglChoosePixelFormatARB( + int hdc, + int piAttribIList, + int pfAttribFList, + int nMaxFormats, + int piFormats, + int piNumFormats); +*/ +/* public static native int wglCreateBufferRegionARB( + int hdc, + int iLayerPlane, + int uType); +*/ +/* public static native int wglCreatePbufferARB( + int hDC, + int iPixelFormat, + int iWidth, + int iHeight, + int piAttribList); +*/ +// public static native void wglDeleteBufferRegionARB(Buffer hRegion); + +/* public static native boolean wglDestroyPbufferARB(int hPbuffer);*/ + + public static native void wglFreeMemoryNV(ByteBuffer pointer); + + public static native int wglGetCurrentReadDCARB(); + + public static native String wglGetExtensionsStringARB(); + + public static native String wglGetExtensionsStringEXT(); + +// public static native int wglGetPbufferDCARB(int hPbuffer); + +/* public static native boolean wglGetPixelFormatAttribfvARB( + int hdc, + int iPixelFormat, + int iLayerPlane, + int nAttributes, + int piAttributes, + int pfValues); + + public static native boolean wglGetPixelFormatAttribivARB( + int hdc, + int iPixelFormat, + int iLayerPlane, + int nAttributes, + int piAttributes, + int piValues); +*/ + public static native int wglGetSwapIntervalEXT(); + +/* public static native boolean wglMakeContextCurrentARB( + int hDrawDC, + int hReadDC, + int hglrc); + + public static native boolean wglQueryPbufferARB( + int hPbuffer, + int iAttribute, + int piValue); + + public static native int wglReleasePbufferDCARB(int hPbuffer, int hDC); +*/ + public static native boolean wglReleaseTexImageARB( + int hPbuffer, + int iBuffer); + +/* public static native boolean wglRestoreBufferRegionARB( + Buffer hRegion, + int x, + int y, + int width, + int height, + int xSrc, + int ySrc); + + public static native boolean wglSaveBufferRegionARB( + Buffer hRegion, + int x, + int y, + int width, + int height); +*/ +/* public static native boolean wglSetPbufferAttribARB( + int hPbuffer, + int piAttribList); +*/ + public static native boolean wglSwapIntervalEXT(int interval); + + public static native void glWindowPos2fARB(float x, float y); + + public static native void glWindowPos2iARB(int x, int y); + + public static native void glWindowPos2sARB(short x, short y); + + public static native void glWindowPos3fARB(float x, float y, float z); + + public static native void glWindowPos3iARB(int x, int y, int z); + + public static native void glWindowPos3sARB(short x, short y, short z); + + public static native void glWriteMaskEXT( + int res, + int in, + int outX, + int outY, + int outZ, + int outW); + + public static void glBindBufferARB(int target, int buffer) { + switch (target) { + case GL_ELEMENT_ARRAY_BUFFER_ARB: + VBOTracker.getVBOElementStack().setState(buffer); + break; + case GL_ARRAY_BUFFER_ARB: + VBOTracker.getVBOArrayStack().setState(buffer); + break; + default: assert false: "Unsupported VBO target " + target; + } + nglBindBufferARB(target, buffer); + } + private static native void nglBindBufferARB(int target, int buffer); + public static void glDeleteBuffersARB(IntBuffer buffers) { + for (int i = buffers.position(); i < buffers.limit(); i++) { + int buffer_handle = buffers.get(i); + if (VBOTracker.getVBOElementStack().getState() == buffer_handle) + VBOTracker.getVBOElementStack().setState(0); + if (VBOTracker.getVBOArrayStack().getState() == buffer_handle) + VBOTracker.getVBOArrayStack().setState(0); + } + nglDeleteBuffersARB(buffers.remaining(), buffers, buffers.position()); + } + private static native void nglDeleteBuffersARB(int n, IntBuffer buffers, int buffers_offset); + public static void glGenBuffersARB(IntBuffer buffers) { + nglGenBuffersARB(buffers.remaining(), buffers, buffers.position()); + } + private static native void nglGenBuffersARB(int n, IntBuffer buffers, int buffers_offset); + public static native boolean glIsBufferARB(int buffer); + public static void glBufferDataARB(int target, int size, ByteBuffer data, int usage) { + nglBufferDataARB(target, size, data, data != null ? data.position() : 0, usage); + } + public static void glBufferDataARB(int target, int size, ShortBuffer data, int usage) { + nglBufferDataARB(target, size, data, data != null ? data.position()<<1 : 0, usage); + } + public static void glBufferDataARB(int target, int size, FloatBuffer data, int usage) { + nglBufferDataARB(target, size, data, data != null ? data.position()<<2 : 0, usage); + } + public static void glBufferDataARB(int target, int size, IntBuffer data, int usage) { + nglBufferDataARB(target, size, data, data != null ? data.position()<<2 : 0, usage); + } + private static native void nglBufferDataARB(int target, int size, Buffer data, int data_offset, int usage); + public static void glBufferSubDataARB(int target, int offset, ByteBuffer data) { + nglBufferSubDataARB(target, offset, data.remaining(), data, data.position()); + } + public static void glBufferSubDataARB(int target, int offset, ShortBuffer data) { + nglBufferSubDataARB(target, offset, data.remaining()<<1, data, data.position()<<1); + } + public static void glBufferSubDataARB(int target, int offset, FloatBuffer data) { + nglBufferSubDataARB(target, offset, data.remaining()<<2, data, data.position()<<2); + } + public static void glBufferSubDataARB(int target, int offset, IntBuffer data) { + nglBufferSubDataARB(target, offset, data.remaining()<<2, data, data.position()<<2); + } + private static native void nglBufferSubDataARB(int target, int offset, int size, Buffer data, int data_offset); + public static void glGetBufferSubDataARB(int target, int offset, ByteBuffer data) { + nglGetBufferSubDataARB(target, offset, data.remaining(), data, data.position()); + } + public static void glGetBufferSubDataARB(int target, int offset, ShortBuffer data) { + nglGetBufferSubDataARB(target, offset, data.remaining()<<1, data, data.position()<<1); + } + public static void glGetBufferSubDataARB(int target, int offset, IntBuffer data) { + nglGetBufferSubDataARB(target, offset, data.remaining()<<2, data, data.position()<<2); + } + public static void glGetBufferSubDataARB(int target, int offset, FloatBuffer data) { + nglGetBufferSubDataARB(target, offset, data.remaining()<<2, data, data.position()<<2); + } + private static native void nglGetBufferSubDataARB(int target, int offset, int size, Buffer data, int data_offset); + /** + * glMapBufferARB maps a gl vertex buffer buffer to a ByteBuffer. The oldBuffer argument can be null, in + * which case a new ByteBuffer will be created, pointing to the returned memory. If oldBuffer is non-null, + * it will be returned if it points to the same mapped memory, otherwise a new ByteBuffer is created. + * That way, an application will normally use glMapBufferARB like this: + * + * ByteBuffer mapped_buffer; + * mapped_buffer = glMapBufferARB(..., ..., ..., null); + * ... + * // Another map on the same buffer + * mapped_buffer = glMapBufferARB(..., ..., ..., mapped_buffer); + * + * @param size The size of the buffer area. + * @param oldBuffer A ByteBuffer. If this argument points to the same address as the new mapping, it will be returned and + * no new buffer will be created. In that case, size is ignored. + * @return A ByteBuffer representing the mapped buffer memory. + */ + public static native ByteBuffer glMapBufferARB(int target, int access, int size, ByteBuffer oldBuffer); + public static native boolean glUnmapBufferARB(int target); + public static void glGetBufferParameterARB(int target, int pname, IntBuffer params) { + nglGetBufferParameterivARB(target, pname, params, params.position()); + } + private static native void nglGetBufferParameterivARB(int target, int pname, IntBuffer params, int params_offset); + public static native ByteBuffer glGetBufferPointerARB(int target, int pname, int size); +} diff --git a/src/java/org/lwjgl/opengl/GLCaps.java b/src/java/org/lwjgl/opengl/GLCaps.java new file mode 100644 index 00000000..ce39f3d1 --- /dev/null +++ b/src/java/org/lwjgl/opengl/GLCaps.java @@ -0,0 +1,265 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ + +package org.lwjgl.opengl; + +import org.lwjgl.Sys; +import java.lang.reflect.*; +import java.lang.reflect.Field; +import java.util.HashMap; +import java.util.StringTokenizer; + +/** + * $Id$ + * + * A static class describing all supported GL capabilities. + * + * @author elias_naur + * @version $Revision$ + */ +public abstract class GLCaps { + /* + * Available extensions + */ + public static boolean GL_ARB_imaging; + public static boolean GL_ARB_depth_texture; + public static boolean GL_ARB_matrix_palette; + public static boolean GL_ARB_multisample; + public static boolean GL_ARB_multitexture; + public static boolean GL_ARB_point_parameters; + public static boolean GL_ARB_shadow; + public static boolean GL_ARB_shadow_ambient; + public static boolean GL_ARB_texture_compression; + public static boolean GL_ARB_texture_env_add; + public static boolean GL_ARB_texture_env_dot3; + public static boolean GL_ARB_texture_env_combine; + public static boolean GL_ARB_texture_env_crossbar; + public static boolean GL_ARB_texture_border_clamp; + public static boolean GL_ARB_texture_cube_map; + public static boolean GL_ARB_texture_mirrored_repeat; + public static boolean GL_ARB_transpose_matrix; + public static boolean GL_ARB_vertex_blend; + public static boolean GL_ARB_vertex_program; + public static boolean GL_ARB_vertex_buffer_object; + public static boolean GL_ARB_window_pos; + public static boolean GL_EXT_abgr; + public static boolean GL_EXT_bgra; + public static boolean GL_EXT_blend_color; + public static boolean GL_EXT_blend_function_separate; + public static boolean GL_EXT_blend_minmax; + public static boolean GL_EXT_blend_subtract; + public static boolean GL_EXT_compiled_vertex_array; + public static boolean GL_EXT_cull_vertex; + public static boolean GL_EXT_draw_range_elements; + public static boolean GL_EXT_fog_coord; + public static boolean GL_EXT_light_max_exponent; + public static boolean GL_EXT_multi_draw_arrays; + public static boolean GL_EXT_packed_pixels; + public static boolean GL_EXT_paletted_texture; + public static boolean GL_EXT_point_parameters; + public static boolean GL_EXT_rescale_normal; + public static boolean GL_EXT_secondary_color; + public static boolean GL_EXT_separate_specular_color; + public static boolean GL_EXT_shadow_funcs; + public static boolean GL_EXT_shared_texture_palette; + public static boolean GL_EXT_stencil_two_side; + public static boolean GL_EXT_stencil_wrap; + public static boolean GL_EXT_texture_compression_s3tc; + public static boolean GL_EXT_texture_env_combine; + public static boolean GL_EXT_texture_env_dot3; + public static boolean GL_EXT_texture_filter_anisotropic; + public static boolean GL_EXT_texture_lod_bias; + public static boolean GL_EXT_vertex_array; + public static boolean GL_EXT_vertex_shader; + public static boolean GL_EXT_vertex_weighting; + public static boolean GL_ATI_element_array; + public static boolean GL_ATI_envmap_bumpmap; + public static boolean GL_ATI_fragment_shader; + public static boolean GL_ATI_pn_triangles; + public static boolean GL_ATI_texture_mirror_once; + public static boolean GL_ATI_vertex_array_object; + public static boolean GL_ATI_vertex_streams; + public static boolean GL_ATIX_point_sprites; + public static boolean GL_ATIX_texture_env_route; + public static boolean GL_HP_occlusion_test; + public static boolean GL_NV_blend_square; + public static boolean GL_NV_copy_depth_to_color; + public static boolean GL_NV_depth_clamp; + public static boolean GL_NV_evaluators; + public static boolean GL_NV_fence; + public static boolean GL_NV_fog_distance; + public static boolean GL_NV_light_max_exponent; + public static boolean GL_NV_occlusion_query; + public static boolean GL_NV_packed_depth_stencil; + public static boolean GL_NV_point_sprite; + public static boolean GL_NV_register_combiners; + public static boolean GL_NV_register_combiners2; + public static boolean GL_NV_texgen_reflection; + public static boolean GL_NV_texture_env_combine4; + public static boolean GL_NV_texture_rectangle; + public static boolean GL_NV_texture_shader; + public static boolean GL_NV_texture_shader2; + public static boolean GL_NV_texture_shader3; + public static boolean GL_NV_vertex_array_range; + public static boolean GL_NV_vertex_array_range2; + public static boolean GL_NV_vertex_program; + public static boolean GL_NV_vertex_program1_1; + public static boolean GL_SGIS_generate_mipmap; + public static boolean GL_SGIX_shadow; + public static boolean GL_SGIX_depth_texture; + public static boolean OpenGL10; + public static boolean OpenGL11; + public static boolean OpenGL12; + public static boolean OpenGL13; + public static boolean OpenGL14; + + /* + * Available WGL extensions + */ + public static boolean WGL_ARB_buffer_region; + public static boolean WGL_ARB_extensions_string; + public static boolean WGL_ARB_pbuffer; + public static boolean WGL_ARB_pixel_format; + public static boolean WGL_ARB_render_texture; + public static boolean WGL_EXT_extensions_string; + public static boolean WGL_EXT_swap_control; + + static { + System.loadLibrary(Sys.getLibraryName()); + } + + private static void setExtensionFields(String exts, HashMap field_map) { + StringTokenizer st = new StringTokenizer(exts); + while (st.hasMoreTokens()) { + String ext = st.nextToken(); + if(org.lwjgl.Sys.DEBUG) { + System.out.println(ext); + } + + Field f = (Field)field_map.get(ext); + if (f != null) { + try { + f.setBoolean(GLCaps.class, true); + } catch (IllegalAccessException e) { + e.printStackTrace(System.err); + } + } + + } + } + + /** + * Determine which extensions are available. Use this to initialize capability fields. + * Can only be called _after_ a GLWindow or Pbuffer has been created. + */ + public static void determineAvailableExtensions() { + + // Grab all the public static booleans out of this class + Field[] fields = GLCaps.class.getDeclaredFields(); + HashMap map = new HashMap(fields.length); + for (int i = 0; i < fields.length; i++) { + if (Modifier.isStatic(fields[i].getModifiers()) + && fields[i].getType() == boolean.class) { + map.put(fields[i].getName(), fields[i]); + // reset fields + try { + fields[i].setBoolean(GLCaps.class, false); + } catch (IllegalAccessException e) { + e.printStackTrace(System.err); + } + } + } + + determineAvailableWGLExtensions(map); + String exts = CoreGL11.glGetString(CoreGL11.GL_EXTENSIONS); + if(org.lwjgl.Sys.DEBUG) { + System.out.println("Available GL extensions:"); + } + setExtensionFields(exts, map); + + // Let's see what openGL version we are too: + String version = CoreGL11.glGetString(CoreGL11.GL_VERSION); + int i = version.indexOf("1."); + if (i > -1) { + char c = version.charAt(i + 2); + // Each case intentionally falls through! + switch (c) { + case '4': + OpenGL14 = true; + case '3': + OpenGL13 = true; + case '2': + OpenGL12 = true; + case '1': + OpenGL11 = true; + case '0': + OpenGL10 = true; + break ; + default: + // Unexpected character - ignore + } + } + } + + private static native boolean isWGLEXTExtensionsStringAvailable(); + + private static native boolean isWGLARBExtensionsStringAvailable(); + + /** + * Determine which WGL extensions are available + */ + private static void determineAvailableWGLExtensions(HashMap field_map) { + + // First we must determine if WGL_EXT_extensions_string is available + WGL_ARB_extensions_string = isWGLARBExtensionsStringAvailable(); + WGL_EXT_extensions_string = isWGLEXTExtensionsStringAvailable(); + if (!WGL_EXT_extensions_string && !WGL_ARB_extensions_string) + return; + final String exts; + + if (WGL_ARB_extensions_string) + exts = GL.wglGetExtensionsStringARB(); + // Remember - this is an HWND not an HDC, which is what's required. The native + // code on the other side of wglGetExtensionsStringARB gets the HDC from the HWND + // behind the scenes. + else + exts = GL.wglGetExtensionsStringEXT(); + + if (exts == null) + return; + + if(org.lwjgl.Sys.DEBUG) { + System.out.println("Available WGL extensions:"); + } + setExtensionFields(exts, field_map); + } +} diff --git a/src/java/org/lwjgl/opengl/GLConstants.java b/src/java/org/lwjgl/opengl/GLConstants.java new file mode 100644 index 00000000..364c2ead --- /dev/null +++ b/src/java/org/lwjgl/opengl/GLConstants.java @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ + +package org.lwjgl.opengl; + +import org.lwjgl.opengl.arb.*; +import org.lwjgl.opengl.ati.*; +import org.lwjgl.opengl.ati.ATIElementArray; +import org.lwjgl.opengl.ati.ATIEnvmapBumpmap; +import org.lwjgl.opengl.atix.ATIXPointSprites; +import org.lwjgl.opengl.atix.ATIXTextureEnvRoute; +import org.lwjgl.opengl.ext.*; +import org.lwjgl.opengl.ext.EXTAbgr; +import org.lwjgl.opengl.ext.EXTCompiledVertexArray; +import org.lwjgl.opengl.nv.*; +import org.lwjgl.opengl.nv.NVCopyDepthToColor; +import org.lwjgl.opengl.nv.NVDepthClamp; +import org.lwjgl.opengl.wgl.*; +import org.lwjgl.opengl.wgl.WGLBufferRegion; +import org.lwjgl.opengl.wgl.WGLMakeCurrentRead; + +/** + * $Id$ + * + * All GL constants, including all supported extensions. + * + * @author cix_foo + * @version $Revision$ + */ + +public interface GLConstants + extends + ARBCubeMap, + ARBDepthTexture, + ARBMatrixPalette, + ARBMultisample, + ARBMultitexture, + ARBPointParameters, + ARBShadow, + ARBShadowAmbient, + ARBTextureBorderClamp, + ARBTextureCompression, + ARBTextureEnvCombine, + ARBTextureEnvDot3, + ARBTextureMirroredRepeat, + ARBTransposeMatrix, + ARBVertexBlend, + ARBVertexBufferObject, + ARBVertexProgram, + ATIElementArray, + ATIEnvmapBumpmap, + ATIFragmentShader, + ATIPnTriangles, + ATITextureMirrorOnce, + ATIVertexArrayObject, + ATIVertexStreams, + ATIXPointSprites, + ATIXTextureEnvRoute, + EXTAbgr, + EXTBgra, + EXTBlendColor, + EXTBlendMinmax, + EXTCompiledVertexArray, + EXTDrawRangeElements, + EXTFogCoord, + EXTLightMaxExponent, + EXTPackedPixels, + EXTPalettedTexture, + EXTPointParameters, + EXTRescaleNormal, + EXTSecondaryColor, + EXTSeparateSpecularColor, + EXTSharedTexturePalette, + EXTStencilTwoSide, + EXTStencilWrap, + EXTTextureCompressionS3TC, + EXTTextureEnvCombine, + EXTTextureEnvDot3, + EXTTextureFilterAnisotropic, + EXTTextureLODBias, + EXTVertexArray, + EXTVertexShader, + EXTVertexWeighting, + NVCopyDepthToColor, + NVDepthClamp, + NVEvaluators, + NVFence, + NVFogDistance, + NVLightMaxExponent, + NVOcclusionQuery, + NVPackedDepthStencil, + NVPointSprite, + NVRegisterCombiners, + NVRegisterCombiners2, + NVTexgenReflection, + NVTextureEnvCombine4, + NVTextureRectangle, + NVTextureShader, + NVTextureShader2, + NVTextureShader3, + NVVertexArrayRange, + NVVertexArrayRange2, + NVVertexProgram, + WGLBufferRegion, + WGLMakeCurrentRead, + WGLMultisample, + WGLPBuffer, + WGLPixelFormat, + WGLRenderTexture, + CoreGL14Constants +{ + +} diff --git a/src/java/org/lwjgl/opengl/GLU.java b/src/java/org/lwjgl/opengl/GLU.java new file mode 100644 index 00000000..2a4825a7 --- /dev/null +++ b/src/java/org/lwjgl/opengl/GLU.java @@ -0,0 +1,204 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ + +package org.lwjgl.opengl; + +import org.lwjgl.Sys; + +import java.nio.ByteBuffer; +import java.nio.IntBuffer; +import java.nio.DoubleBuffer; + +/** + * $Id$ + * + * GL Utilities library. + * + * @author cix_foo + * @version $Revision$ + */ +public abstract class GLU implements GLUConstants { + + static { + System.loadLibrary(Sys.getLibraryName()); + } + + public static native String gluErrorString(int errCode); + + public static native String gluGetString(int name); + + public static native void gluOrtho2D( + double left, + double right, + double bottom, + double top); + + public static native void gluPerspective( + double fovy, + double aspect, + double zNear, + double zFar); + + public static void gluPickMatrix(double x, double y, double width, double height, IntBuffer viewport) { + ngluPickMatrix(x, y, width, height, viewport, viewport.position()); + } + private static native void ngluPickMatrix(double x, double y, double width, double height, IntBuffer viewport, int viewport_offset); + + public static native void gluLookAt( + double eyex, + double eyey, + double eyez, + double centerx, + double centery, + double centerz, + double upx, + double upy, + double upz); + + public static int gluProject( + double objx, + double objy, + double objz, + DoubleBuffer modelMatrix, + DoubleBuffer projMatrix, + IntBuffer viewport, + DoubleBuffer win + ) { + return ngluProject(objx, objy, objz, modelMatrix, modelMatrix.position(), projMatrix, projMatrix.position(), viewport, viewport.position(), win, win.position()); + } + + private static native int ngluProject( + double objx, + double objy, + double objz, + DoubleBuffer modelMatrix, + int modelMatrix_offset, + DoubleBuffer projMatrix, + int projMatrix_offset, + IntBuffer viewport, + int viewport_ofset, + DoubleBuffer win, + int win_offset + ); + + public static int gluUnProject( + double winx, + double winy, + double winz, + DoubleBuffer modelMatrix, + DoubleBuffer projMatrix, + IntBuffer viewport, + DoubleBuffer obj + ) { + return ngluUnProject(winx, winy, winz, modelMatrix, modelMatrix.position(), projMatrix, projMatrix.position(), viewport, viewport.position(), obj, obj.position()); + } + + private static native int ngluUnProject( + double winx, + double winy, + double winz, + DoubleBuffer modelMatrix, + int modelMatrix_offset, + DoubleBuffer projMatrix, + int projMatrix_offset, + IntBuffer viewport, + int viewport_offset, + DoubleBuffer obj, + int obj_offset + ); + + public static int gluScaleImage( + int format, + int widthin, + int heightin, + int typein, + ByteBuffer datain, + int widthout, int heightout, int typeout, ByteBuffer dataout + ) { + return ngluScaleImage(format, widthin, heightin, typein, datain, datain.position(), widthout, heightout, typeout, dataout, dataout.position()); + } + + private static native int ngluScaleImage( + int format, + int widthin, + int heightin, + int typein, + ByteBuffer datain, + int datain_offset, + int widthout, int heightout, int typeout, ByteBuffer dataout, int dataout_offset + ); + + public static int gluBuild1DMipmaps( + int target, + int components, + int width, + int format, + int type, + ByteBuffer data + ) { + return ngluBuild1DMipmaps(target, components, width, format, type, data, data.position()); + } + + private static native int ngluBuild1DMipmaps( + int target, + int components, + int width, + int format, + int type, + ByteBuffer data, + int data_offset + ); + + public static int gluBuild2DMipmaps( + int target, + int components, + int width, + int height, + int format, + int type, + ByteBuffer data + ) { + return ngluBuild2DMipmaps(target, components, width, height, format, type, data, data.position()); + } + + private static native int ngluBuild2DMipmaps( + int target, + int components, + int width, + int height, + int format, + int type, + ByteBuffer data, + int data_offset + ); + +} diff --git a/src/java/org/lwjgl/opengl/GLUConstants.java b/src/java/org/lwjgl/opengl/GLUConstants.java new file mode 100644 index 00000000..44575f9a --- /dev/null +++ b/src/java/org/lwjgl/opengl/GLUConstants.java @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ + +package org.lwjgl.opengl; + +/** + * $Id$ + * + * GLU constants. + * + * @author cix_foo + * @version $Revision$ + */ +public interface GLUConstants { + /* 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 int GLU_TRUE = CoreGL11Constants.GL_TRUE; + public static final int GLU_FALSE = CoreGL11Constants.GL_FALSE; + + +} diff --git a/src/java/org/lwjgl/opengl/OpenGLException.java b/src/java/org/lwjgl/opengl/OpenGLException.java new file mode 100644 index 00000000..3a2bccc1 --- /dev/null +++ b/src/java/org/lwjgl/opengl/OpenGLException.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ + +package org.lwjgl.opengl; + +/** + * $Id$ + * + * Thrown by the debug build library of the LWJGL if any OpenGL operation + * causes an error. + * + * @author cix_foo + * @version $Revision$ + */ +public class OpenGLException extends RuntimeException { + + /** + * 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 new file mode 100644 index 00000000..faa8b19a --- /dev/null +++ b/src/java/org/lwjgl/opengl/Pbuffer.java @@ -0,0 +1,168 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ + +package org.lwjgl.opengl; + +import org.lwjgl.*; + +/** + * $Id$ + * + * Pbuffer encapsulates an OpenGL pbuffer. + * + * Each instance of GL is only valid in the thread that creates it. + * In addition, only one instance of an OpenGL window or Pbuffer may be + * the current GL context in any one thread. To make a GL instance the + * current context, use makeCurrent(). + * + * @author elias_naur + * @version $Revision$ + */ +public class Pbuffer { + public final static int PBUFFER_SUPPORTED = 1; + + /** Current Pbuffer */ + private static Pbuffer currentBuffer = null; + + /** Handle to the native GL rendering context */ + private final int handle; + + /** Tracks VBO state */ + private final VBOTracker vbo_tracker; + + static { + System.loadLibrary(Sys.getLibraryName()); + } + + /** + * Construct an instance of a Pbuffer. If this fails then an Exception will be thrown. + * The buffer is single-buffered. + * + * NOTE: An OpenGL window must be created before a Pbuffer can be created. The Pbuffer will + * have its own context that shares display lists and textures with the OpenGL window context, + * but it will have its own OpenGL state. Therefore, state changes to a pbuffer will not be seen + * in the window context and vice versa. + * + * NOTE: Some OpenGL implementations requires the shared contexts to use the same pixel format. + * So if possible, use the same bpp, alpha, depth and stencil values used to create the main window. + * + * @param width Pbuffer width + * @param height Pbuffer height + * @param bpp Minimum bits per pixel + * @param alpha Minimum bits per pixel in alpha buffer + * @param depth Minimum bits per pixel in depth buffer + * @param stencil Minimum bits per pixel in stencil buffer + */ + public Pbuffer(int width, int height, int bpp, int alpha, int depth, int stencil) throws Exception { + handle = nCreate(width, height, bpp, alpha, depth, stencil); + vbo_tracker = new VBOTracker(); + } + + /** + * Method to release the current Pbuffer context and make the OpenGL window current. + */ + public static void releaseContext() { + currentBuffer = null; + VBOTracker.releaseCurrent(); + nReleaseContext(); + } + + /** + * 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 boolean isBufferLost() { + return nIsBufferLost(handle); + } + + /** + * Native method to test for buffer integrity + */ + private native static boolean nIsBufferLost(int handle); + + /** + * Native method to release the context. + */ + private native static void nReleaseContext(); + + /** + * Method to make the Pbuffer context current. All subsequent OpenGL + * calls will go to this buffer. + */ + public void makeCurrent() { + currentBuffer = this; + VBOTracker.setCurrent(vbo_tracker); + nMakeCurrent(handle); + } + + /** + * Native method to make a pbuffer current. + */ + private native static void nMakeCurrent(int handle); + + /** + * Gets the Pbuffer capabilities. Only the flag PBUFFER_SUPPORTED is + * available, and indicates that Pbuffers can be created. + * + * @return a bitmask of Pbuffer capabilities. + */ + public static native int getPbufferCaps(); + + /** + * Native method to create a Pbuffer + */ + private native static int nCreate( + int width, + int height, + int bpp, + int alpha, + int depth, + int stencil) throws Exception; + + /** + * Destroys the Pbuffer. The buffer must not be current. + */ + public void destroy() { + if (currentBuffer == this) + releaseContext(); + nDestroy(handle); + } + + /** + * Natively destroy any GL-related stuff + */ + private native static void nDestroy(int handle); +} diff --git a/src/java/org/lwjgl/opengl/StateStack.java b/src/java/org/lwjgl/opengl/StateStack.java new file mode 100644 index 00000000..dfd6c591 --- /dev/null +++ b/src/java/org/lwjgl/opengl/StateStack.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ + +package org.lwjgl.opengl; + +class StateStack { + /** Only int state is tracked */ + private final int[] state_stack; + private int stack_pos; + + public int getState() { + return state_stack[stack_pos]; + } + + public void setState(int new_state) { + state_stack[stack_pos] = new_state; + } + + public void pushState() { + stack_pos++; + state_stack[stack_pos] = state_stack[stack_pos - 1]; + } + + public int popState() { + int result = state_stack[stack_pos]; + stack_pos--; + return result; + } + + public StateStack(int stack_size, int initial_value) { + state_stack = new int[stack_size]; + stack_pos = 0; + state_stack[stack_pos] = initial_value; + } +} diff --git a/src/java/org/lwjgl/opengl/Util.java b/src/java/org/lwjgl/opengl/Util.java new file mode 100644 index 00000000..cb08e4a6 --- /dev/null +++ b/src/java/org/lwjgl/opengl/Util.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +package org.lwjgl.opengl; + +import java.nio.*; + +/** + * Simple utility class. + * + * @author cix_foo + * @version $Revision$ + */ +abstract class Util { + private final static IntBuffer int_buffer = ByteBuffer.allocateDirect(4).order(ByteOrder.nativeOrder()).asIntBuffer(); + /** + * 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 + */ + static int getOffset(Buffer buffer) { + if (buffer instanceof FloatBuffer || buffer instanceof IntBuffer) + return buffer.position() << 2; + else if (buffer instanceof ShortBuffer || buffer instanceof CharBuffer) + return buffer.position() << 1; + else if (buffer instanceof DoubleBuffer || buffer instanceof LongBuffer) + return buffer.position() << 3; + else + return buffer.position(); + } + + static int getGLInteger(int enum) { + CoreGL11.glGetInteger(enum, int_buffer); + return int_buffer.get(0); + } +} diff --git a/src/java/org/lwjgl/opengl/VBOTracker.java b/src/java/org/lwjgl/opengl/VBOTracker.java new file mode 100644 index 00000000..8e30b31b --- /dev/null +++ b/src/java/org/lwjgl/opengl/VBOTracker.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ + +package org.lwjgl.opengl; + +class VBOTracker { + private static VBOTracker default_tracker = new VBOTracker(); + private static VBOTracker current_tracker = default_tracker; + + private final StateStack vbo_array_stack; + private final StateStack vbo_element_stack; + private final StateStack attrib_stack; + + public static void setCurrent(VBOTracker tracker) { + current_tracker = tracker; + } + + public static void releaseCurrent() { + current_tracker = default_tracker; + } + + public VBOTracker() { + int stack_size = Util.getGLInteger(CoreGL11Constants.GL_MAX_CLIENT_ATTRIB_STACK_DEPTH); + vbo_array_stack = new StateStack(stack_size, 0); + vbo_element_stack = new StateStack(stack_size, 0); + attrib_stack = new StateStack(stack_size, 0); + } + + public static StateStack getVBOArrayStack() { + return current_tracker.vbo_array_stack; + } + + public static StateStack getVBOElementStack() { + return current_tracker.vbo_element_stack; + } + + public static StateStack getClientAttribStack() { + return current_tracker.attrib_stack; + } +} diff --git a/src/java/org/lwjgl/opengl/Window.java b/src/java/org/lwjgl/opengl/Window.java index a1ed4c4e..d03ff18c 100644 --- a/src/java/org/lwjgl/opengl/Window.java +++ b/src/java/org/lwjgl/opengl/Window.java @@ -332,5 +332,5 @@ public final class Window { * Updates the windows internal state. This must be called at least once per video frame * to handle window close requests, moves, paints, etc. */ - public static native void update(); + public static native void updateState(); } diff --git a/src/java/org/lwjgl/opengl/arb/ARBCubeMap.java b/src/java/org/lwjgl/opengl/arb/ARBCubeMap.java new file mode 100644 index 00000000..f10d96a6 --- /dev/null +++ b/src/java/org/lwjgl/opengl/arb/ARBCubeMap.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:11:04 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.arb; + +public interface ARBCubeMap +{ + public static final int GL_NORMAL_MAP_ARB = 0x8511; + public static final int GL_REFLECTION_MAP_ARB = 0x8512; + public static final int GL_TEXTURE_CUBE_MAP_ARB = 0x8513; + public static final int GL_TEXTURE_BINDING_CUBE_MAP_ARB = 0x8514; + public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB = 0x8515; + public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB = 0x8516; + public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB = 0x8517; + public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB = 0x8518; + public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB = 0x8519; + public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB = 0x851A; + public static final int GL_PROXY_TEXTURE_CUBE_MAP_ARB = 0x851B; + public static final int GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB = 0x851C; +} diff --git a/src/java/org/lwjgl/opengl/arb/ARBDepthTexture.java b/src/java/org/lwjgl/opengl/arb/ARBDepthTexture.java new file mode 100644 index 00000000..a08a0378 --- /dev/null +++ b/src/java/org/lwjgl/opengl/arb/ARBDepthTexture.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:59:46 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.arb; + +public interface ARBDepthTexture +{ + public static final int GL_DEPTH_COMPONENT16_ARB = 0x81A5; + public static final int GL_DEPTH_COMPONENT24_ARB = 0x81A6; + public static final int GL_DEPTH_COMPONENT32_ARB = 0x81A7; + public static final int GL_TEXTURE_DEPTH_SIZE_ARB = 0x884A; + public static final int GL_DEPTH_TEXTURE_MODE_ARB = 0x884B; +} diff --git a/src/java/org/lwjgl/opengl/arb/ARBMatrixPalette.java b/src/java/org/lwjgl/opengl/arb/ARBMatrixPalette.java new file mode 100644 index 00000000..66f853d5 --- /dev/null +++ b/src/java/org/lwjgl/opengl/arb/ARBMatrixPalette.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:32:23 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.arb; + +public interface ARBMatrixPalette +{ + public static final int GL_MATRIX_PALETTE_ARB = 0x8840; + public static final int GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB = 0x8841; + public static final int GL_MAX_PALETTE_MATRICES_ARB = 0x8842; + public static final int GL_CURRENT_PALETTE_MATRIX_ARB = 0x8843; + public static final int GL_MATRIX_INDEX_ARRAY_ARB = 0x8844; + public static final int GL_CURRENT_MATRIX_INDEX_ARB = 0x8845; + public static final int GL_MATRIX_INDEX_ARRAY_SIZE_ARB = 0x8846; + public static final int GL_MATRIX_INDEX_ARRAY_TYPE_ARB = 0x8847; + public static final int GL_MATRIX_INDEX_ARRAY_STRIDE_ARB = 0x8848; + public static final int GL_MATRIX_INDEX_ARRAY_POINTER_ARB = 0x8849; +} diff --git a/src/java/org/lwjgl/opengl/arb/ARBMultisample.java b/src/java/org/lwjgl/opengl/arb/ARBMultisample.java new file mode 100644 index 00000000..03aa33c8 --- /dev/null +++ b/src/java/org/lwjgl/opengl/arb/ARBMultisample.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:21:23 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.arb; + +public interface ARBMultisample +{ + public static final int GL_MULTISAMPLE_ARB = 0x809D; + public static final int GL_SAMPLE_ALPHA_TO_COVERAGE_ARB = 0x809E; + public static final int GL_SAMPLE_ALPHA_TO_ONE_ARB = 0x809F; + public static final int GL_SAMPLE_COVERAGE_ARB = 0x80A0; + public static final int GL_SAMPLE_BUFFERS_ARB = 0x80A8; + public static final int GL_SAMPLES_ARB = 0x80A9; + public static final int GL_SAMPLE_COVERAGE_VALUE_ARB = 0x80AA; + public static final int GL_SAMPLE_COVERAGE_INVERT_ARB = 0x80AB; + public static final int GL_MULTISAMPLE_BIT_ARB = 0x20000000; +} diff --git a/src/java/org/lwjgl/opengl/arb/ARBMultitexture.java b/src/java/org/lwjgl/opengl/arb/ARBMultitexture.java new file mode 100644 index 00000000..1503ecd7 --- /dev/null +++ b/src/java/org/lwjgl/opengl/arb/ARBMultitexture.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:06:09 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.arb; + +public interface ARBMultitexture +{ + public static final int GL_TEXTURE0_ARB = 0x84C0; + public static final int GL_TEXTURE1_ARB = 0x84C1; + public static final int GL_TEXTURE2_ARB = 0x84C2; + public static final int GL_TEXTURE3_ARB = 0x84C3; + public static final int GL_TEXTURE4_ARB = 0x84C4; + public static final int GL_TEXTURE5_ARB = 0x84C5; + public static final int GL_TEXTURE6_ARB = 0x84C6; + public static final int GL_TEXTURE7_ARB = 0x84C7; + public static final int GL_TEXTURE8_ARB = 0x84C8; + public static final int GL_TEXTURE9_ARB = 0x84C9; + public static final int GL_TEXTURE10_ARB = 0x84CA; + public static final int GL_TEXTURE11_ARB = 0x84CB; + public static final int GL_TEXTURE12_ARB = 0x84CC; + public static final int GL_TEXTURE13_ARB = 0x84CD; + public static final int GL_TEXTURE14_ARB = 0x84CE; + public static final int GL_TEXTURE15_ARB = 0x84CF; + public static final int GL_TEXTURE16_ARB = 0x84D0; + public static final int GL_TEXTURE17_ARB = 0x84D1; + public static final int GL_TEXTURE18_ARB = 0x84D2; + public static final int GL_TEXTURE19_ARB = 0x84D3; + public static final int GL_TEXTURE20_ARB = 0x84D4; + public static final int GL_TEXTURE21_ARB = 0x84D5; + public static final int GL_TEXTURE22_ARB = 0x84D6; + public static final int GL_TEXTURE23_ARB = 0x84D7; + public static final int GL_TEXTURE24_ARB = 0x84D8; + public static final int GL_TEXTURE25_ARB = 0x84D9; + public static final int GL_TEXTURE26_ARB = 0x84DA; + public static final int GL_TEXTURE27_ARB = 0x84DB; + public static final int GL_TEXTURE28_ARB = 0x84DC; + public static final int GL_TEXTURE29_ARB = 0x84DD; + public static final int GL_TEXTURE30_ARB = 0x84DE; + public static final int GL_TEXTURE31_ARB = 0x84DF; + public static final int GL_ACTIVE_TEXTURE_ARB = 0x84E0; + public static final int GL_CLIENT_ACTIVE_TEXTURE_ARB = 0x84E1; + public static final int GL_MAX_TEXTURE_UNITS_ARB = 0x84E2; +} diff --git a/src/java/org/lwjgl/opengl/arb/ARBPointParameters.java b/src/java/org/lwjgl/opengl/arb/ARBPointParameters.java new file mode 100644 index 00000000..66c2f8e1 --- /dev/null +++ b/src/java/org/lwjgl/opengl/arb/ARBPointParameters.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:31:36 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.arb; + +public interface ARBPointParameters +{ + public static final int GL_POINT_SIZE_MIN_ARB = 0x8126; + public static final int GL_POINT_SIZE_MAX_ARB = 0x8127; + public static final int GL_POINT_FADE_THRESHOLD_SIZE_ARB = 0x8128; + public static final int GL_POINT_DISTANCE_ATTENUATION_ARB = 0x8129; +} diff --git a/src/java/org/lwjgl/opengl/arb/ARBShadow.java b/src/java/org/lwjgl/opengl/arb/ARBShadow.java new file mode 100644 index 00000000..2b644597 --- /dev/null +++ b/src/java/org/lwjgl/opengl/arb/ARBShadow.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:58:50 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.arb; + +public interface ARBShadow +{ + public static final int GL_TEXTURE_COMPARE_MODE_ARB = 0x884C; + public static final int GL_TEXTURE_COMPARE_FUNC_ARB = 0x884D; + public static final int GL_COMPARE_R_TO_TEXTURE_ARB = 0x884E; +} diff --git a/src/java/org/lwjgl/opengl/arb/ARBShadowAmbient.java b/src/java/org/lwjgl/opengl/arb/ARBShadowAmbient.java new file mode 100644 index 00000000..eb03c723 --- /dev/null +++ b/src/java/org/lwjgl/opengl/arb/ARBShadowAmbient.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:59:19 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.arb; + +public interface ARBShadowAmbient +{ + public static final int GL_TEXTURE_COMPARE_FAIL_VALUE_ARB = 0x80BF; +} diff --git a/src/java/org/lwjgl/opengl/arb/ARBTextureBorderClamp.java b/src/java/org/lwjgl/opengl/arb/ARBTextureBorderClamp.java new file mode 100644 index 00000000..1b61c15c --- /dev/null +++ b/src/java/org/lwjgl/opengl/arb/ARBTextureBorderClamp.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:16:42 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.arb; + +public interface ARBTextureBorderClamp +{ + public static final int GL_CLAMP_TO_BORDER_ARB = 0x812D; +} diff --git a/src/java/org/lwjgl/opengl/arb/ARBTextureCompression.java b/src/java/org/lwjgl/opengl/arb/ARBTextureCompression.java new file mode 100644 index 00000000..55fe5cff --- /dev/null +++ b/src/java/org/lwjgl/opengl/arb/ARBTextureCompression.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:10:08 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.arb; + +public interface ARBTextureCompression +{ + public static final int GL_COMPRESSED_ALPHA_ARB = 0x84E9; + public static final int GL_COMPRESSED_LUMINANCE_ARB = 0x84EA; + public static final int GL_COMPRESSED_LUMINANCE_ALPHA_ARB = 0x84EB; + public static final int GL_COMPRESSED_INTENSITY_ARB = 0x84EC; + public static final int GL_COMPRESSED_RGB_ARB = 0x84ED; + public static final int GL_COMPRESSED_RGBA_ARB = 0x84EE; + public static final int GL_TEXTURE_COMPRESSION_HINT_ARB = 0x84EF; + public static final int GL_TEXTURE_IMAGE_SIZE_ARB = 0x86A0; + public static final int GL_TEXTURE_COMPRESSED_ARB = 0x86A1; + public static final int GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB = 0x86A2; + public static final int GL_COMPRESSED_TEXTURE_FORMATS_ARB = 0x86A3; +} diff --git a/src/java/org/lwjgl/opengl/arb/ARBTextureEnvCombine.java b/src/java/org/lwjgl/opengl/arb/ARBTextureEnvCombine.java new file mode 100644 index 00000000..455c811f --- /dev/null +++ b/src/java/org/lwjgl/opengl/arb/ARBTextureEnvCombine.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:14:40 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.arb; + +public interface ARBTextureEnvCombine +{ + public static final int GL_COMBINE_ARB = 0x8570; + public static final int GL_COMBINE_RGB_ARB = 0x8571; + public static final int GL_COMBINE_ALPHA_ARB = 0x8572; + public static final int GL_RGB_SCALE_ARB = 0x8573; + public static final int GL_ADD_SIGNED_ARB = 0x8574; + public static final int GL_INTERPOLATE_ARB = 0x8575; + public static final int GL_CONSTANT_ARB = 0x8576; + public static final int GL_PRIMARY_COLOR_ARB = 0x8577; + public static final int GL_PREVIOUS_ARB = 0x8578; + public static final int GL_SOURCE0_RGB_ARB = 0x8580; + public static final int GL_SOURCE1_RGB_ARB = 0x8581; + public static final int GL_SOURCE2_RGB_ARB = 0x8582; + public static final int GL_SOURCE0_ALPHA_ARB = 0x8588; + public static final int GL_SOURCE1_ALPHA_ARB = 0x8589; + public static final int GL_SOURCE2_ALPHA_ARB = 0x858A; + public static final int GL_OPERAND0_RGB_ARB = 0x8590; + public static final int GL_OPERAND1_RGB_ARB = 0x8591; + public static final int GL_OPERAND2_RGB_ARB = 0x8592; + public static final int GL_OPERAND0_ALPHA_ARB = 0x8598; + public static final int GL_OPERAND1_ALPHA_ARB = 0x8599; + public static final int GL_OPERAND2_ALPHA_ARB = 0x859A; +} diff --git a/src/java/org/lwjgl/opengl/arb/ARBTextureEnvDot3.java b/src/java/org/lwjgl/opengl/arb/ARBTextureEnvDot3.java new file mode 100644 index 00000000..1d2828fd --- /dev/null +++ b/src/java/org/lwjgl/opengl/arb/ARBTextureEnvDot3.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:15:16 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.arb; + +public interface ARBTextureEnvDot3 +{ + public static final int GL_DOT3_RGB_ARB = 0x86AE; + public static final int GL_DOT3_RGBA_ARB = 0x86AF; + +} diff --git a/src/java/org/lwjgl/opengl/arb/ARBTextureMirroredRepeat.java b/src/java/org/lwjgl/opengl/arb/ARBTextureMirroredRepeat.java new file mode 100644 index 00000000..64f80488 --- /dev/null +++ b/src/java/org/lwjgl/opengl/arb/ARBTextureMirroredRepeat.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:58:27 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.arb; + +public interface ARBTextureMirroredRepeat +{ + public static final int GL_MIRRORED_REPEAT_ARB = 0x8370; +} diff --git a/src/java/org/lwjgl/opengl/arb/ARBTransposeMatrix.java b/src/java/org/lwjgl/opengl/arb/ARBTransposeMatrix.java new file mode 100644 index 00000000..019cab19 --- /dev/null +++ b/src/java/org/lwjgl/opengl/arb/ARBTransposeMatrix.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:08:52 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.arb; + +public interface ARBTransposeMatrix +{ + public static final int GL_TRANSPOSE_MODELVIEW_MATRIX_ARB = 0x84E3; + public static final int GL_TRANSPOSE_PROJECTION_MATRIX_ARB = 0x84E4; + public static final int GL_TRANSPOSE_TEXTURE_MATRIX_ARB = 0x84E5; + public static final int GL_TRANSPOSE_COLOR_MATRIX_ARB = 0x84E6; +} diff --git a/src/java/org/lwjgl/opengl/arb/ARBVertexBlend.java b/src/java/org/lwjgl/opengl/arb/ARBVertexBlend.java new file mode 100644 index 00000000..cb43f2f0 --- /dev/null +++ b/src/java/org/lwjgl/opengl/arb/ARBVertexBlend.java @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:31:57 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.arb; + +public interface ARBVertexBlend +{ + public static final int GL_MAX_VERTEX_UNITS_ARB = 0x86A4; + public static final int GL_ACTIVE_VERTEX_UNITS_ARB = 0x86A5; + public static final int GL_WEIGHT_SUM_UNITY_ARB = 0x86A6; + public static final int GL_VERTEX_BLEND_ARB = 0x86A7; + public static final int GL_CURRENT_WEIGHT_ARB = 0x86A8; + public static final int GL_WEIGHT_ARRAY_TYPE_ARB = 0x86A9; + public static final int GL_WEIGHT_ARRAY_STRIDE_ARB = 0x86AA; + public static final int GL_WEIGHT_ARRAY_SIZE_ARB = 0x86AB; + public static final int GL_WEIGHT_ARRAY_POINTER_ARB = 0x86AC; + public static final int GL_WEIGHT_ARRAY_ARB = 0x86AD; + public static final int GL_MODELVIEW0_ARB = 0x1700; + public static final int GL_MODELVIEW1_ARB = 0x850a; + public static final int GL_MODELVIEW2_ARB = 0x8722; + public static final int GL_MODELVIEW3_ARB = 0x8723; + public static final int GL_MODELVIEW4_ARB = 0x8724; + public static final int GL_MODELVIEW5_ARB = 0x8725; + public static final int GL_MODELVIEW6_ARB = 0x8726; + public static final int GL_MODELVIEW7_ARB = 0x8727; + public static final int GL_MODELVIEW8_ARB = 0x8728; + public static final int GL_MODELVIEW9_ARB = 0x8729; + public static final int GL_MODELVIEW10_ARB = 0x872A; + public static final int GL_MODELVIEW11_ARB = 0x872B; + public static final int GL_MODELVIEW12_ARB = 0x872C; + public static final int GL_MODELVIEW13_ARB = 0x872D; + public static final int GL_MODELVIEW14_ARB = 0x872E; + public static final int GL_MODELVIEW15_ARB = 0x872F; + public static final int GL_MODELVIEW16_ARB = 0x8730; + public static final int GL_MODELVIEW17_ARB = 0x8731; + public static final int GL_MODELVIEW18_ARB = 0x8732; + public static final int GL_MODELVIEW19_ARB = 0x8733; + public static final int GL_MODELVIEW20_ARB = 0x8734; + public static final int GL_MODELVIEW21_ARB = 0x8735; + public static final int GL_MODELVIEW22_ARB = 0x8736; + public static final int GL_MODELVIEW23_ARB = 0x8737; + public static final int GL_MODELVIEW24_ARB = 0x8738; + public static final int GL_MODELVIEW25_ARB = 0x8739; + public static final int GL_MODELVIEW26_ARB = 0x873A; + public static final int GL_MODELVIEW27_ARB = 0x873B; + public static final int GL_MODELVIEW28_ARB = 0x873C; + public static final int GL_MODELVIEW29_ARB = 0x873D; + public static final int GL_MODELVIEW30_ARB = 0x873E; + public static final int GL_MODELVIEW31_ARB = 0x873F; +} diff --git a/src/java/org/lwjgl/opengl/arb/ARBVertexBufferObject.java b/src/java/org/lwjgl/opengl/arb/ARBVertexBufferObject.java new file mode 100755 index 00000000..7b2e57cd --- /dev/null +++ b/src/java/org/lwjgl/opengl/arb/ARBVertexBufferObject.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ + +/** + * $Id$ + * + * ARB_vertex_buffer_object constants. + * + * @author elias_naur + * @version $Revision$ + */ + +package org.lwjgl.opengl.arb; + +public interface ARBVertexBufferObject +{ + public static final int GL_ARRAY_BUFFER_ARB = 0x8892; + public static final int GL_ELEMENT_ARRAY_BUFFER_ARB = 0x8893; + public static final int GL_ARRAY_BUFFER_BINDING_ARB = 0x8894; + public static final int GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB = 0x8895; + public static final int GL_VERTEX_ARRAY_BUFFER_BINDING_ARB = 0x8896; + public static final int GL_NORMAL_ARRAY_BUFFER_BINDING_ARB = 0x8897; + public static final int GL_COLOR_ARRAY_BUFFER_BINDING_ARB = 0x8898; + public static final int GL_INDEX_ARRAY_BUFFER_BINDING_ARB = 0x8899; + public static final int GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB = 0x889A; + public static final int GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB = 0x889B; + public static final int GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB = 0x889C; + public static final int GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB = 0x889D; + public static final int GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB = 0x889E; + public static final int GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB = 0x889F; + public static final int GL_STREAM_DRAW_ARB = 0x88E0; + public static final int GL_STREAM_READ_ARB = 0x88E1; + public static final int GL_STREAM_COPY_ARB = 0x88E2; + public static final int GL_STATIC_DRAW_ARB = 0x88E4; + public static final int GL_STATIC_READ_ARB = 0x88E5; + public static final int GL_STATIC_COPY_ARB = 0x88E6; + public static final int GL_DYNAMIC_DRAW_ARB = 0x88E8; + public static final int GL_DYNAMIC_READ_ARB = 0x88E9; + public static final int GL_DYNAMIC_COPY_ARB = 0x88EA; + public static final int GL_READ_ONLY_ARB = 0x88B8; + public static final int GL_WRITE_ONLY_ARB = 0x88B9; + public static final int GL_READ_WRITE_ARB = 0x88BA; + public static final int GL_BUFFER_SIZE_ARB = 0x8764; + public static final int GL_BUFFER_USAGE_ARB = 0x8765; + public static final int GL_BUFFER_ACCESS_ARB = 0x88BB; + public static final int GL_BUFFER_MAPPED_ARB = 0x88BC; + public static final int GL_BUFFER_MAP_POINTER_ARB = 0x88BD; +} diff --git a/src/java/org/lwjgl/opengl/arb/ARBVertexProgram.java b/src/java/org/lwjgl/opengl/arb/ARBVertexProgram.java new file mode 100644 index 00000000..b0a0a43b --- /dev/null +++ b/src/java/org/lwjgl/opengl/arb/ARBVertexProgram.java @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 16:02:30 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.arb; + +public interface ARBVertexProgram +{ + public static final int GL_VERTEX_PROGRAM_ARB = 0x8620; + public static final int GL_VERTEX_PROGRAM_POINT_SIZE_ARB = 0x8642; + public static final int GL_VERTEX_PROGRAM_TWO_SIDE_ARB = 0x8643; + public static final int GL_COLOR_SUM_ARB = 0x8458; + public static final int GL_PROGRAM_FORMAT_ASCII_ARB = 0x8875; + public static final int GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB = 0x8622; + public static final int GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB = 0x8623; + public static final int GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB = 0x8624; + public static final int GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB = 0x8625; + public static final int GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB = 0x886A; + public static final int GL_CURRENT_VERTEX_ATTRIB_ARB = 0x8626; + public static final int GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB = 0x8645; + public static final int GL_PROGRAM_LENGTH_ARB = 0x8627; + public static final int GL_PROGRAM_FORMAT_ARB = 0x8876; + public static final int GL_PROGRAM_BINDING_ARB = 0x8677; + public static final int GL_PROGRAM_INSTRUCTIONS_ARB = 0x88A0; + public static final int GL_MAX_PROGRAM_INSTRUCTIONS_ARB = 0x88A1; + public static final int GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB = 0x88A2; + public static final int GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB = 0x88A3; + public static final int GL_PROGRAM_TEMPORARIES_ARB = 0x88A4; + public static final int GL_MAX_PROGRAM_TEMPORARIES_ARB = 0x88A5; + public static final int GL_PROGRAM_NATIVE_TEMPORARIES_ARB = 0x88A6; + public static final int GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB = 0x88A7; + public static final int GL_PROGRAM_PARAMETERS_ARB = 0x88A8; + public static final int GL_MAX_PROGRAM_PARAMETERS_ARB = 0x88A9; + public static final int GL_PROGRAM_NATIVE_PARAMETERS_ARB = 0x88AA; + public static final int GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB = 0x88AB; + public static final int GL_PROGRAM_ATTRIBS_ARB = 0x88AC; + public static final int GL_MAX_PROGRAM_ATTRIBS_ARB = 0x88AD; + public static final int GL_PROGRAM_NATIVE_ATTRIBS_ARB = 0x88AE; + public static final int GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB = 0x88AF; + public static final int GL_PROGRAM_ADDRESS_REGISTERS_ARB = 0x88B0; + public static final int GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB = 0x88B1; + public static final int GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB = 0x88B2; + public static final int GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB = 0x88B3; + public static final int GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB = 0x88B4; + public static final int GL_MAX_PROGRAM_ENV_PARAMETERS_ARB = 0x88B5; + public static final int GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB = 0x88B6; + public static final int GL_PROGRAM_STRING_ARB = 0x8628; + public static final int GL_PROGRAM_ERROR_POSITION_ARB = 0x864B; + public static final int GL_CURRENT_MATRIX_ARB = 0x8641; + public static final int GL_TRANSPOSE_CURRENT_MATRIX_ARB = 0x88B7; + public static final int GL_CURRENT_MATRIX_STACK_DEPTH_ARB = 0x8640; + public static final int GL_MAX_VERTEX_ATTRIBS_ARB = 0x8869; + public static final int GL_MAX_PROGRAM_MATRICES_ARB = 0x862F; + public static final int GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB = 0x862E; + public static final int GL_PROGRAM_ERROR_STRING_ARB = 0x8874; + public static final int GL_MATRIX0_ARB = 0x88C0; + public static final int GL_MATRIX1_ARB = 0x88C1; + public static final int GL_MATRIX2_ARB = 0x88C2; + public static final int GL_MATRIX3_ARB = 0x88C3; + public static final int GL_MATRIX4_ARB = 0x88C4; + public static final int GL_MATRIX5_ARB = 0x88C5; + public static final int GL_MATRIX6_ARB = 0x88C6; + public static final int GL_MATRIX7_ARB = 0x88C7; + public static final int GL_MATRIX8_ARB = 0x88C8; + public static final int GL_MATRIX9_ARB = 0x88C9; + public static final int GL_MATRIX10_ARB = 0x88CA; + public static final int GL_MATRIX11_ARB = 0x88CB; + public static final int GL_MATRIX12_ARB = 0x88CC; + public static final int GL_MATRIX13_ARB = 0x88CD; + public static final int GL_MATRIX14_ARB = 0x88CE; + public static final int GL_MATRIX15_ARB = 0x88CF; + public static final int GL_MATRIX16_ARB = 0x88D0; + public static final int GL_MATRIX17_ARB = 0x88D1; + public static final int GL_MATRIX18_ARB = 0x88D2; + public static final int GL_MATRIX19_ARB = 0x88D3; + public static final int GL_MATRIX20_ARB = 0x88D4; + public static final int GL_MATRIX21_ARB = 0x88D5; + public static final int GL_MATRIX22_ARB = 0x88D6; + public static final int GL_MATRIX23_ARB = 0x88D7; + public static final int GL_MATRIX24_ARB = 0x88D8; + public static final int GL_MATRIX25_ARB = 0x88D9; + public static final int GL_MATRIX26_ARB = 0x88DA; + public static final int GL_MATRIX27_ARB = 0x88DB; + public static final int GL_MATRIX28_ARB = 0x88DC; + public static final int GL_MATRIX29_ARB = 0x88DD; + public static final int GL_MATRIX30_ARB = 0x88DE; + public static final int GL_MATRIX31_ARB = 0x88DF; +} diff --git a/src/java/org/lwjgl/opengl/ati/ATIElementArray.java b/src/java/org/lwjgl/opengl/ati/ATIElementArray.java new file mode 100644 index 00000000..66f3994f --- /dev/null +++ b/src/java/org/lwjgl/opengl/ati/ATIElementArray.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:34:52 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.ati; + +public interface ATIElementArray +{ + public static final int GL_ELEMENT_ARRAY_ATI = 0x8768; + public static final int GL_ELEMENT_ARRAY_TYPE_ATI = 0x8769; + public static final int GL_ELEMENT_ARRAY_POINTER_ATI = 0x876A; +} diff --git a/src/java/org/lwjgl/opengl/ati/ATIEnvmapBumpmap.java b/src/java/org/lwjgl/opengl/ati/ATIEnvmapBumpmap.java new file mode 100644 index 00000000..2a4ecea0 --- /dev/null +++ b/src/java/org/lwjgl/opengl/ati/ATIEnvmapBumpmap.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:33:36 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.ati; + +public interface ATIEnvmapBumpmap +{ + public static final int GL_BUMP_ROT_MATRIX_ATI = 0x8775; + public static final int GL_BUMP_ROT_MATRIX_SIZE_ATI = 0x8776; + public static final int GL_BUMP_NUM_TEX_UNITS_ATI = 0x8777; + public static final int GL_BUMP_TEX_UNITS_ATI = 0x8778; + public static final int GL_DUDV_ATI = 0x8779; + public static final int GL_DU8DV8_ATI = 0x877A; + public static final int GL_BUMP_ENVMAP_ATI = 0x877B; + public static final int GL_BUMP_TARGET_ATI = 0x877C; +} diff --git a/src/java/org/lwjgl/opengl/ati/ATIFragmentShader.java b/src/java/org/lwjgl/opengl/ati/ATIFragmentShader.java new file mode 100644 index 00000000..ef3148c1 --- /dev/null +++ b/src/java/org/lwjgl/opengl/ati/ATIFragmentShader.java @@ -0,0 +1,152 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:34:05 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + * + * Note: 2X_BIT_ATI, 4X_BIT_ATI and 8X_BIT_ATI has been changed to X2_BIT_ATI, X4_BIT_ATI and X8_BIT_ATI + * because variables cannot start with a number. + * + */ +package org.lwjgl.opengl.ati; + +public interface ATIFragmentShader +{ + public static final int GL_FRAGMENT_SHADER_ATI = 0x8920; + public static final int GL_REG_0_ATI = 0x8921; + public static final int GL_REG_1_ATI = 0x8922; + public static final int GL_REG_2_ATI = 0x8923; + public static final int GL_REG_3_ATI = 0x8924; + public static final int GL_REG_4_ATI = 0x8925; + public static final int GL_REG_5_ATI = 0x8926; + public static final int GL_REG_6_ATI = 0x8927; + public static final int GL_REG_7_ATI = 0x8928; + public static final int GL_REG_8_ATI = 0x8929; + public static final int GL_REG_9_ATI = 0x892A; + public static final int GL_REG_10_ATI = 0x892B; + public static final int GL_REG_11_ATI = 0x892C; + public static final int GL_REG_12_ATI = 0x892D; + public static final int GL_REG_13_ATI = 0x892E; + public static final int GL_REG_14_ATI = 0x892F; + public static final int GL_REG_15_ATI = 0x8930; + public static final int GL_REG_16_ATI = 0x8931; + public static final int GL_REG_17_ATI = 0x8932; + public static final int GL_REG_18_ATI = 0x8933; + public static final int GL_REG_19_ATI = 0x8934; + public static final int GL_REG_20_ATI = 0x8935; + public static final int GL_REG_21_ATI = 0x8936; + public static final int GL_REG_22_ATI = 0x8937; + public static final int GL_REG_23_ATI = 0x8938; + public static final int GL_REG_24_ATI = 0x8939; + public static final int GL_REG_25_ATI = 0x893A; + public static final int GL_REG_26_ATI = 0x893B; + public static final int GL_REG_27_ATI = 0x893C; + public static final int GL_REG_28_ATI = 0x893D; + public static final int GL_REG_29_ATI = 0x893E; + public static final int GL_REG_30_ATI = 0x893F; + public static final int GL_REG_31_ATI = 0x8940; + public static final int GL_CON_0_ATI = 0x8941; + public static final int GL_CON_1_ATI = 0x8942; + public static final int GL_CON_2_ATI = 0x8943; + public static final int GL_CON_3_ATI = 0x8944; + public static final int GL_CON_4_ATI = 0x8945; + public static final int GL_CON_5_ATI = 0x8946; + public static final int GL_CON_6_ATI = 0x8947; + public static final int GL_CON_7_ATI = 0x8948; + public static final int GL_CON_8_ATI = 0x8949; + public static final int GL_CON_9_ATI = 0x894A; + public static final int GL_CON_10_ATI = 0x894B; + public static final int GL_CON_11_ATI = 0x894C; + public static final int GL_CON_12_ATI = 0x894D; + public static final int GL_CON_13_ATI = 0x894E; + public static final int GL_CON_14_ATI = 0x894F; + public static final int GL_CON_15_ATI = 0x8950; + public static final int GL_CON_16_ATI = 0x8951; + public static final int GL_CON_17_ATI = 0x8952; + public static final int GL_CON_18_ATI = 0x8953; + public static final int GL_CON_19_ATI = 0x8954; + public static final int GL_CON_20_ATI = 0x8955; + public static final int GL_CON_21_ATI = 0x8956; + public static final int GL_CON_22_ATI = 0x8957; + public static final int GL_CON_23_ATI = 0x8958; + public static final int GL_CON_24_ATI = 0x8959; + public static final int GL_CON_25_ATI = 0x895A; + public static final int GL_CON_26_ATI = 0x895B; + public static final int GL_CON_27_ATI = 0x895C; + public static final int GL_CON_28_ATI = 0x895D; + public static final int GL_CON_29_ATI = 0x895E; + public static final int GL_CON_30_ATI = 0x895F; + public static final int GL_CON_31_ATI = 0x8960; + public static final int GL_MOV_ATI = 0x8961; + public static final int GL_ADD_ATI = 0x8963; + public static final int GL_MUL_ATI = 0x8964; + public static final int GL_SUB_ATI = 0x8965; + public static final int GL_DOT3_ATI = 0x8966; + public static final int GL_DOT4_ATI = 0x8967; + public static final int GL_MAD_ATI = 0x8968; + public static final int GL_LERP_ATI = 0x8969; + public static final int GL_CND_ATI = 0x896A; + public static final int GL_CND0_ATI = 0x896B; + public static final int GL_DOT2_ADD_ATI = 0x896C; + public static final int GL_SECONDARY_INTERPOLATOR_ATI = 0x896D; + public static final int GL_NUM_FRAGMENT_REGISTERS_ATI = 0x896E; + public static final int GL_NUM_FRAGMENT_CONSTANTS_ATI = 0x896F; + public static final int GL_NUM_PASSES_ATI = 0x8970; + public static final int GL_NUM_INSTRUCTIONS_PER_PASS_ATI = 0x8971; + public static final int GL_NUM_INSTRUCTIONS_TOTAL_ATI = 0x8972; + public static final int GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI = 0x8973; + public static final int GL_NUM_LOOPBACK_COMPONENTS_ATI = 0x8974; + public static final int GL_COLOR_ALPHA_PAIRING_ATI = 0x8975; + public static final int GL_SWIZZLE_STR_ATI = 0x8976; + public static final int GL_SWIZZLE_STQ_ATI = 0x8977; + public static final int GL_SWIZZLE_STR_DR_ATI = 0x8978; + public static final int GL_SWIZZLE_STQ_DQ_ATI = 0x8979; + public static final int GL_SWIZZLE_STRQ_ATI = 0x897A; + public static final int GL_SWIZZLE_STRQ_DQ_ATI = 0x897B; + public static final int GL_RED_BIT_ATI = 0x00000001; + public static final int GL_GREEN_BIT_ATI = 0x00000002; + public static final int GL_BLUE_BIT_ATI = 0x00000004; + public static final int GL_X2_BIT_ATI = 0x00000001; + public static final int GL_X4_BIT_ATI = 0x00000002; + public static final int GL_X8_BIT_ATI = 0x00000004; + public static final int GL_HALF_BIT_ATI = 0x00000008; + public static final int GL_QUARTER_BIT_ATI = 0x00000010; + public static final int GL_EIGHTH_BIT_ATI = 0x00000020; + public static final int GL_SATURATE_BIT_ATI = 0x00000040; + public static final int GL_COMP_BIT_ATI = 0x00000002; + public static final int GL_NEGATE_BIT_ATI = 0x00000004; + public static final int GL_BIAS_BIT_ATI = 0x00000008; +} diff --git a/src/java/org/lwjgl/opengl/ati/ATIPnTriangles.java b/src/java/org/lwjgl/opengl/ati/ATIPnTriangles.java new file mode 100644 index 00000000..04771b32 --- /dev/null +++ b/src/java/org/lwjgl/opengl/ati/ATIPnTriangles.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:31:14 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.ati; + +public interface ATIPnTriangles +{ + public static final int GL_PN_TRIANGLES_ATI = 0x87F0; + public static final int GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI = 0x87F1; + public static final int GL_PN_TRIANGLES_POINT_MODE_ATI = 0x87F2; + public static final int GL_PN_TRIANGLES_NORMAL_MODE_ATI = 0x87F3; + public static final int GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI = 0x87F4; + public static final int GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI = 0x87F5; + public static final int GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI = 0x87F6; + public static final int GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI = 0x87F7; + public static final int GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI = 0x87F8; +} diff --git a/src/java/org/lwjgl/opengl/ati/ATITextureMirrorOnce.java b/src/java/org/lwjgl/opengl/ati/ATITextureMirrorOnce.java new file mode 100644 index 00000000..e2ba28de --- /dev/null +++ b/src/java/org/lwjgl/opengl/ati/ATITextureMirrorOnce.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:34:34 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.ati; + +public interface ATITextureMirrorOnce +{ + public static final int GL_MIRROR_CLAMP_ATI = 0x8742; + public static final int GL_MIRROR_CLAMP_TO_EDGE_ATI = 0x8743; +} diff --git a/src/java/org/lwjgl/opengl/ati/ATIVertexArrayObject.java b/src/java/org/lwjgl/opengl/ati/ATIVertexArrayObject.java new file mode 100644 index 00000000..79c88da7 --- /dev/null +++ b/src/java/org/lwjgl/opengl/ati/ATIVertexArrayObject.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:36:01 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.ati; + +public interface ATIVertexArrayObject +{ + public static final int GL_STATIC_ATI = 0x8760; + public static final int GL_DYNAMIC_ATI = 0x8761; + public static final int GL_PRESERVE_ATI = 0x8762; + public static final int GL_DISCARD_ATI = 0x8763; + public static final int GL_OBJECT_BUFFER_SIZE_ATI = 0x8764; + public static final int GL_OBJECT_BUFFER_USAGE_ATI = 0x8765; + public static final int GL_ARRAY_OBJECT_BUFFER_ATI = 0x8766; + public static final int GL_ARRAY_OBJECT_OFFSET_ATI = 0x8767; +} diff --git a/src/java/org/lwjgl/opengl/ati/ATIVertexStreams.java b/src/java/org/lwjgl/opengl/ati/ATIVertexStreams.java new file mode 100644 index 00000000..bae0d50d --- /dev/null +++ b/src/java/org/lwjgl/opengl/ati/ATIVertexStreams.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:35:16 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.ati; + +public interface ATIVertexStreams +{ + public static final int GL_MAX_VERTEX_STREAMS_ATI = 0x876B; + public static final int GL_VERTEX_SOURCE_ATI = 0x876C; + public static final int GL_VERTEX_STREAM0_ATI = 0x876D; + public static final int GL_VERTEX_STREAM1_ATI = 0x876E; + public static final int GL_VERTEX_STREAM2_ATI = 0x876F; + public static final int GL_VERTEX_STREAM3_ATI = 0x8770; + public static final int GL_VERTEX_STREAM4_ATI = 0x8771; + public static final int GL_VERTEX_STREAM5_ATI = 0x8772; + public static final int GL_VERTEX_STREAM6_ATI = 0x8773; + public static final int GL_VERTEX_STREAM7_ATI = 0x8774; +} diff --git a/src/java/org/lwjgl/opengl/atix/ATIXPointSprites.java b/src/java/org/lwjgl/opengl/atix/ATIXPointSprites.java new file mode 100644 index 00000000..ffc10584 --- /dev/null +++ b/src/java/org/lwjgl/opengl/atix/ATIXPointSprites.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:36:54 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.atix; + +public interface ATIXPointSprites +{ + public static final int GL_TEXTURE_POINT_MODE_ATIX = 0x60b0; + public static final int GL_TEXTURE_POINT_ONE_COORD_ATIX = 0x60b1; + public static final int GL_TEXTURE_POINT_SPRITE_ATIX = 0x60b2; + public static final int GL_POINT_SPRITE_CULL_MODE_ATIX = 0x60b3; + public static final int GL_POINT_SPRITE_CULL_CENTER_ATIX = 0x60b4; + public static final int GL_POINT_SPRITE_CULL_CLIP_ATIX = 0x60b5; +} diff --git a/src/java/org/lwjgl/opengl/atix/ATIXTextureEnvRoute.java b/src/java/org/lwjgl/opengl/atix/ATIXTextureEnvRoute.java new file mode 100644 index 00000000..c9679853 --- /dev/null +++ b/src/java/org/lwjgl/opengl/atix/ATIXTextureEnvRoute.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:37:26 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.atix; + +public interface ATIXTextureEnvRoute +{ + public static final int GL_SECONDARY_COLOR_ATIX = 0x8747; + public static final int GL_TEXTURE_OUTPUT_RGB_ATIX = 0x8748; + public static final int GL_TEXTURE_OUTPUT_ALPHA_ATIX = 0x8749; +} diff --git a/src/java/org/lwjgl/opengl/ext/EXTAbgr.java b/src/java/org/lwjgl/opengl/ext/EXTAbgr.java new file mode 100644 index 00000000..cf3e0cef --- /dev/null +++ b/src/java/org/lwjgl/opengl/ext/EXTAbgr.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:29:12 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.ext; + +public interface EXTAbgr +{ + + public static final int GL_ABGR_EXT = 0x8000; +} diff --git a/src/java/org/lwjgl/opengl/ext/EXTBgra.java b/src/java/org/lwjgl/opengl/ext/EXTBgra.java new file mode 100644 index 00000000..0ed5b966 --- /dev/null +++ b/src/java/org/lwjgl/opengl/ext/EXTBgra.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ + + package org.lwjgl.opengl.ext; + +/** + * EXT_bgra_constants + * + * @author cas + */ +public interface EXTBgra { + public static final int GL_BGR_EXT = 0x80E0; + public static final int GL_BGRA_EXT = 0x80E1; +} diff --git a/src/java/org/lwjgl/opengl/ext/EXTBlendColor.java b/src/java/org/lwjgl/opengl/ext/EXTBlendColor.java new file mode 100644 index 00000000..7721ada0 --- /dev/null +++ b/src/java/org/lwjgl/opengl/ext/EXTBlendColor.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ + +package org.lwjgl.opengl.ext; + +/** + * Insert the type's description here. + * Creation date: (29/06/2000 00:45:10) + */ +public interface EXTBlendColor { + public static final int GL_CONSTANT_COLOR_EXT = 0x8001; + public static final int GL_ONE_MINUS_CONSTANT_COLOR_EXT = 0x8002; + public static final int GL_CONSTANT_ALPHA_EXT = 0x8003; + public static final int GL_ONE_MINUS_CONSTANT_ALPHA_EXT = 0x8004; + public static final int GL_BLEND_COLOR_EXT = 0x8005; +} diff --git a/src/java/org/lwjgl/opengl/ext/EXTBlendMinmax.java b/src/java/org/lwjgl/opengl/ext/EXTBlendMinmax.java new file mode 100644 index 00000000..159b0624 --- /dev/null +++ b/src/java/org/lwjgl/opengl/ext/EXTBlendMinmax.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ + +package org.lwjgl.opengl.ext; + +/** + * EXT_blend_minmax constants + * @author cas + */ +public interface EXTBlendMinmax { + public static final int GL_FUNC_ADD_EXT = 0x8006; + public static final int GL_MIN_EXT = 0x8007; + public static final int GL_MAX_EXT = 0x8008; + public static final int GL_BLEND_EQUATION_EXT = 0x8009; +} diff --git a/src/java/org/lwjgl/opengl/ext/EXTBlendSubtract.java b/src/java/org/lwjgl/opengl/ext/EXTBlendSubtract.java new file mode 100644 index 00000000..f54cca2f --- /dev/null +++ b/src/java/org/lwjgl/opengl/ext/EXTBlendSubtract.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ + +package org.lwjgl.opengl.ext; + +/** + * EXT_blend_subtract constants + * @author cas + */ +public interface EXTBlendSubtract { + public static final int GL_FUNC_SUBTRACT_EXT = 0x800A; + public static final int GL_FUNC_REVERSE_SUBTRACT_EXT = 0x800B; +} diff --git a/src/java/org/lwjgl/opengl/ext/EXTCompiledVertexArray.java b/src/java/org/lwjgl/opengl/ext/EXTCompiledVertexArray.java new file mode 100644 index 00000000..869afd51 --- /dev/null +++ b/src/java/org/lwjgl/opengl/ext/EXTCompiledVertexArray.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:14:06 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.ext; + +public interface EXTCompiledVertexArray +{ + public static final int GL_ARRAY_ELEMENT_LOCK_FIRST_EXT = 0x81A8; + public static final int GL_ARRAY_ELEMENT_LOCK_COUNT_EXT = 0x81A9; +} diff --git a/src/java/org/lwjgl/opengl/ext/EXTDrawRangeElements.java b/src/java/org/lwjgl/opengl/ext/EXTDrawRangeElements.java new file mode 100644 index 00000000..d864487c --- /dev/null +++ b/src/java/org/lwjgl/opengl/ext/EXTDrawRangeElements.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 16:00:36 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.ext; + +public interface EXTDrawRangeElements +{ + public static final int GL_MAX_ELEMENTS_VERTICES_EXT = 0x80E8; + public static final int GL_MAX_ELEMENTS_INDICES_EXT = 0x80E9; +} diff --git a/src/java/org/lwjgl/opengl/ext/EXTFogCoord.java b/src/java/org/lwjgl/opengl/ext/EXTFogCoord.java new file mode 100644 index 00000000..2bab818e --- /dev/null +++ b/src/java/org/lwjgl/opengl/ext/EXTFogCoord.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:17:44 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.ext; + +public interface EXTFogCoord +{ + public static final int GL_FOG_COORDINATE_SOURCE_EXT = 0x8450; + public static final int GL_FOG_COORDINATE_EXT = 0x8451; + public static final int GL_FRAGMENT_DEPTH_EXT = 0x8452; + public static final int GL_CURRENT_FOG_COORDINATE_EXT = 0x8453; + public static final int GL_FOG_COORDINATE_ARRAY_TYPE_EXT = 0x8454; + public static final int GL_FOG_COORDINATE_ARRAY_STRIDE_EXT = 0x8455; + public static final int GL_FOG_COORDINATE_ARRAY_POINTER_EXT = 0x8456; + public static final int GL_FOG_COORDINATE_ARRAY_EXT = 0x8457; + +} diff --git a/src/java/org/lwjgl/opengl/ext/EXTLightMaxExponent.java b/src/java/org/lwjgl/opengl/ext/EXTLightMaxExponent.java new file mode 100644 index 00000000..e930365c --- /dev/null +++ b/src/java/org/lwjgl/opengl/ext/EXTLightMaxExponent.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ + +package org.lwjgl.opengl.ext; + +/** + * EXT_light_max_exponent constants + * @author cas + */ +public interface EXTLightMaxExponent { + public static final int GL_MAX_SHININESS_EXT = 0x8504; + public static final int GL_MAX_SPOT_EXPONENT_EXT = 0x8505; +} diff --git a/src/java/org/lwjgl/opengl/ext/EXTPackedPixels.java b/src/java/org/lwjgl/opengl/ext/EXTPackedPixels.java new file mode 100644 index 00000000..210bf20c --- /dev/null +++ b/src/java/org/lwjgl/opengl/ext/EXTPackedPixels.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ + +package org.lwjgl.opengl.ext; + +/** + * Insert the type's description here. + * Creation date: (07/11/99 19:16:17) + */ +public interface EXTPackedPixels { + public static final int GL_UNSIGNED_BYTE_3_3_2_EXT = 0x8032; + public static final int GL_UNSIGNED_SHORT_4_4_4_4_EXT = 0x8033; + public static final int GL_UNSIGNED_SHORT_5_5_5_1_EXT = 0x8034; + public static final int GL_UNSIGNED_INT_8_8_8_8_EXT = 0x8035; + public static final int GL_UNSIGNED_INT_10_10_10_2_EXT = 0x8036; +} diff --git a/src/java/org/lwjgl/opengl/ext/EXTPalettedTexture.java b/src/java/org/lwjgl/opengl/ext/EXTPalettedTexture.java new file mode 100644 index 00000000..ea1ea1df --- /dev/null +++ b/src/java/org/lwjgl/opengl/ext/EXTPalettedTexture.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ + + package org.lwjgl.opengl.ext; + +/** + * EXT_bgra_constants + * + * @author cas + */ +public interface EXTPalettedTexture { + public static final int GL_COLOR_TABLE_FORMAT_EXT = 0x80D8; + public static final int GL_COLOR_TABLE_WIDTH_EXT = 0x80D9; + public static final int GL_COLOR_TABLE_RED_SIZE_EXT = 0x80DA; + public static final int GL_COLOR_TABLE_GREEN_SIZE_EXT = 0x80DB; + public static final int GL_COLOR_TABLE_BLUE_SIZE_EXT = 0x80DC; + public static final int GL_COLOR_TABLE_ALPHA_SIZE_EXT = 0x80DD; + public static final int GL_COLOR_TABLE_LUMINANCE_SIZE_EXT = 0x80DE; + public static final int GL_COLOR_TABLE_INTENSITY_SIZE_EXT = 0x80DF; + + public static final int GL_COLOR_INDEX1_EXT = 0x80E2; + public static final int GL_COLOR_INDEX2_EXT = 0x80E3; + public static final int GL_COLOR_INDEX4_EXT = 0x80E4; + public static final int GL_COLOR_INDEX8_EXT = 0x80E5; + public static final int GL_COLOR_INDEX12_EXT = 0x80E6; + public static final int GL_COLOR_INDEX16_EXT = 0x80E7; +} diff --git a/src/java/org/lwjgl/opengl/ext/EXTPointParameters.java b/src/java/org/lwjgl/opengl/ext/EXTPointParameters.java new file mode 100644 index 00000000..519ba2a8 --- /dev/null +++ b/src/java/org/lwjgl/opengl/ext/EXTPointParameters.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:20:06 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.ext; + +public interface EXTPointParameters +{ + public static final int GL_POINT_SIZE_MIN_EXT = 0x8126; + public static final int GL_POINT_SIZE_MAX_EXT = 0x8127; + public static final int GL_POINT_FADE_THRESHOLD_SIZE_EXT = 0x8128; + public static final int GL_DISTANCE_ATTENUATION_EXT = 0x8129; +} diff --git a/src/java/org/lwjgl/opengl/ext/EXTRescaleNormal.java b/src/java/org/lwjgl/opengl/ext/EXTRescaleNormal.java new file mode 100644 index 00000000..7d1c1a27 --- /dev/null +++ b/src/java/org/lwjgl/opengl/ext/EXTRescaleNormal.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ + +package org.lwjgl.opengl.ext; + + +/** + * EXT_rescale_normal + * @author cas + */ +public interface EXTRescaleNormal { + public static final int GL_RESCALE_NORMAL_EXT = 0x803A; +} diff --git a/src/java/org/lwjgl/opengl/ext/EXTSecondaryColor.java b/src/java/org/lwjgl/opengl/ext/EXTSecondaryColor.java new file mode 100644 index 00000000..33916f47 --- /dev/null +++ b/src/java/org/lwjgl/opengl/ext/EXTSecondaryColor.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:17:13 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.ext; + +public interface EXTSecondaryColor +{ + public static final int GL_COLOR_SUM_EXT = 0x8458; + public static final int GL_CURRENT_SECONDARY_COLOR_EXT = 0x8459; + public static final int GL_SECONDARY_COLOR_ARRAY_SIZE_EXT = 0x845A; + public static final int GL_SECONDARY_COLOR_ARRAY_TYPE_EXT = 0x845B; + public static final int GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT = 0x845C; + public static final int GL_SECONDARY_COLOR_ARRAY_POINTER_EXT = 0x845D; + public static final int GL_SECONDARY_COLOR_ARRAY_EXT = 0x845E; +} diff --git a/src/java/org/lwjgl/opengl/ext/EXTSeparateSpecularColor.java b/src/java/org/lwjgl/opengl/ext/EXTSeparateSpecularColor.java new file mode 100644 index 00000000..9e9c4114 --- /dev/null +++ b/src/java/org/lwjgl/opengl/ext/EXTSeparateSpecularColor.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2002 Light Weight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ + +package org.lwjgl.opengl.ext; + + +/** + * EXT_separate_specular_color constants. + * @author cas + */ +public interface EXTSeparateSpecularColor { + public static final int GL_SINGLE_COLOR_EXT = 0x81F9; + public static final int GL_SEPARATE_SPECULAR_COLOR_EXT = 0x81FA; + public static final int GL_LIGHT_MODEL_COLOR_CONTROL_EXT = 0x81F8; +} diff --git a/src/java/org/lwjgl/opengl/ext/EXTSharedTexturePalette.java b/src/java/org/lwjgl/opengl/ext/EXTSharedTexturePalette.java new file mode 100644 index 00000000..05dd7f1a --- /dev/null +++ b/src/java/org/lwjgl/opengl/ext/EXTSharedTexturePalette.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ + +package org.lwjgl.opengl.ext; + +/** + * Insert the type's description here. + * Creation date: (07/11/99 19:15:54) + */ +public interface EXTSharedTexturePalette { + public static final int GL_SHARED_TEXTURE_PALETTE_EXT = 0x81FB; +} diff --git a/src/java/org/lwjgl/opengl/ext/EXTStencilTwoSide.java b/src/java/org/lwjgl/opengl/ext/EXTStencilTwoSide.java new file mode 100644 index 00000000..54752751 --- /dev/null +++ b/src/java/org/lwjgl/opengl/ext/EXTStencilTwoSide.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 16:01:46 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.ext; + +public interface EXTStencilTwoSide +{ + public static final int GL_STENCIL_TEST_TWO_SIDE_EXT = 0x8910; + public static final int GL_ACTIVE_STENCIL_FACE_EXT = 0x8911; +} diff --git a/src/java/org/lwjgl/opengl/ext/EXTStencilWrap.java b/src/java/org/lwjgl/opengl/ext/EXTStencilWrap.java new file mode 100644 index 00000000..6698d370 --- /dev/null +++ b/src/java/org/lwjgl/opengl/ext/EXTStencilWrap.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:29:34 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.ext; + +public interface EXTStencilWrap +{ + public static final int GL_INCR_WRAP_EXT = 0x8507; + public static final int GL_DECR_WRAP_EXT = 0x8508; +} diff --git a/src/java/org/lwjgl/opengl/ext/EXTTextureCompressionS3TC.java b/src/java/org/lwjgl/opengl/ext/EXTTextureCompressionS3TC.java new file mode 100644 index 00000000..c4695085 --- /dev/null +++ b/src/java/org/lwjgl/opengl/ext/EXTTextureCompressionS3TC.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 16:01:13 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.ext; + +public interface EXTTextureCompressionS3TC +{ + public static final int GL_COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0; + public static final int GL_COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1; + public static final int GL_COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2; + public static final int GL_COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3; +} diff --git a/src/java/org/lwjgl/opengl/ext/EXTTextureEnvCombine.java b/src/java/org/lwjgl/opengl/ext/EXTTextureEnvCombine.java new file mode 100644 index 00000000..ad85e99e --- /dev/null +++ b/src/java/org/lwjgl/opengl/ext/EXTTextureEnvCombine.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ + +package org.lwjgl.opengl.ext; + +/** + * Insert the type's description here. + * Creation date: (22/02/00 01:26:05) + */ +public interface EXTTextureEnvCombine { + public static final int GL_COMBINE_EXT = 0x8570; + public static final int GL_COMBINE_RGB_EXT = 0x8571; + public static final int GL_COMBINE_ALPHA_EXT = 0x8572; + public static final int GL_SOURCE0_RGB_EXT = 0x8580; + public static final int GL_SOURCE1_RGB_EXT = 0x8581; + public static final int GL_SOURCE2_RGB_EXT = 0x8582; + public static final int GL_SOURCE0_ALPHA_EXT = 0x8588; + public static final int GL_SOURCE1_ALPHA_EXT = 0x8589; + public static final int GL_SOURCE2_ALPHA_EXT = 0x858A; + public static final int GL_OPERAND0_RGB_EXT = 0x8590; + public static final int GL_OPERAND1_RGB_EXT = 0x8591; + public static final int GL_OPERAND2_RGB_EXT = 0x8592; + public static final int GL_OPERAND0_ALPHA_EXT = 0x8598; + public static final int GL_OPERAND1_ALPHA_EXT = 0x8599; + public static final int GL_OPERAND2_ALPHA_EXT = 0x859A; + public static final int GL_RGB_SCALE_EXT = 0x8573; + public static final int GL_ADD_SIGNED_EXT = 0x8574; + public static final int GL_INTERPOLATE_EXT = 0x8575; + public static final int GL_CONSTANT_EXT = 0x8576; + public static final int GL_PRIMARY_COLOR_EXT = 0x8577; + public static final int GL_PREVIOUS_EXT = 0x8578; +} diff --git a/src/java/org/lwjgl/opengl/ext/EXTTextureEnvDot3.java b/src/java/org/lwjgl/opengl/ext/EXTTextureEnvDot3.java new file mode 100644 index 00000000..9b49d883 --- /dev/null +++ b/src/java/org/lwjgl/opengl/ext/EXTTextureEnvDot3.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ + +package org.lwjgl.opengl.ext; + + +/** + * EXT_texture_env_dot3 constants. + * @author cas + */ +public interface EXTTextureEnvDot3 { + public static final int GL_DOT3_RGB_EXT = 0x8740; + public static final int GL_DOT3_RGBA_EXT = 0x8741; +} diff --git a/src/java/org/lwjgl/opengl/ext/EXTTextureFilterAnisotropic.java b/src/java/org/lwjgl/opengl/ext/EXTTextureFilterAnisotropic.java new file mode 100644 index 00000000..66118db0 --- /dev/null +++ b/src/java/org/lwjgl/opengl/ext/EXTTextureFilterAnisotropic.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:24:27 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.ext; + +public interface EXTTextureFilterAnisotropic +{ + public static final int GL_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE; + public static final int GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF; +} diff --git a/src/java/org/lwjgl/opengl/ext/EXTTextureLODBias.java b/src/java/org/lwjgl/opengl/ext/EXTTextureLODBias.java new file mode 100644 index 00000000..8e68fe95 --- /dev/null +++ b/src/java/org/lwjgl/opengl/ext/EXTTextureLODBias.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:29:59 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.ext; + +public interface EXTTextureLODBias +{ + public static final int GL_TEXTURE_FILTER_CONTROL_EXT = 0x8500; + public static final int GL_TEXTURE_LOD_BIAS_EXT = 0x8501; + public static final int GL_MAX_TEXTURE_LOD_BIAS_EXT = 0x84FD; +} diff --git a/src/java/org/lwjgl/opengl/ext/EXTVertexArray.java b/src/java/org/lwjgl/opengl/ext/EXTVertexArray.java new file mode 100644 index 00000000..ec27120a --- /dev/null +++ b/src/java/org/lwjgl/opengl/ext/EXTVertexArray.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ + +package org.lwjgl.opengl.ext; +/** + * Insert the type's description here. + * Creation date: (07/11/99 18:58:04) + */ +public interface EXTVertexArray { + public static final int GL_VERTEX_ARRAY_EXT = 0x8074; + public static final int GL_NORMAL_ARRAY_EXT = 0x8075; + public static final int GL_COLOR_ARRAY_EXT = 0x8076; + public static final int GL_INDEX_ARRAY_EXT = 0x8077; + public static final int GL_TEXTURE_COORD_ARRAY_EXT = 0x8078; + public static final int GL_EDGE_FLAG_ARRAY_EXT = 0x8079; + public static final int GL_VERTEX_ARRAY_SIZE_EXT = 0x807A; + public static final int GL_VERTEX_ARRAY_TYPE_EXT = 0x807B; + public static final int GL_VERTEX_ARRAY_STRIDE_EXT = 0x807C; + public static final int GL_VERTEX_ARRAY_COUNT_EXT = 0x807D; + public static final int GL_NORMAL_ARRAY_TYPE_EXT = 0x807E; + public static final int GL_NORMAL_ARRAY_STRIDE_EXT = 0x807F; + public static final int GL_NORMAL_ARRAY_COUNT_EXT = 0x8080; + public static final int GL_COLOR_ARRAY_SIZE_EXT = 0x8081; + public static final int GL_COLOR_ARRAY_TYPE_EXT = 0x8082; + public static final int GL_COLOR_ARRAY_STRIDE_EXT = 0x8083; + public static final int GL_COLOR_ARRAY_COUNT_EXT = 0x8084; + public static final int GL_INDEX_ARRAY_TYPE_EXT = 0x8085; + public static final int GL_INDEX_ARRAY_STRIDE_EXT = 0x8086; + public static final int GL_INDEX_ARRAY_COUNT_EXT = 0x8087; + public static final int GL_TEXTURE_COORD_ARRAY_SIZE_EXT = 0x8088; + public static final int GL_TEXTURE_COORD_ARRAY_TYPE_EXT = 0x8089; + public static final int GL_TEXTURE_COORD_ARRAY_STRIDE_EXT = 0x808A; + public static final int GL_TEXTURE_COORD_ARRAY_COUNT_EXT = 0x808B; + public static final int GL_EDGE_FLAG_ARRAY_STRIDE_EXT = 0x808C; + public static final int GL_EDGE_FLAG_ARRAY_COUNT_EXT = 0x808D; + public static final int GL_VERTEX_ARRAY_POINTER_EXT = 0x808E; + public static final int GL_NORMAL_ARRAY_POINTER_EXT = 0x808F; + public static final int GL_COLOR_ARRAY_POINTER_EXT = 0x8090; + public static final int GL_INDEX_ARRAY_POINTER_EXT = 0x8091; + public static final int GL_TEXTURE_COORD_ARRAY_POINTER_EXT = 0x8092; + public static final int GL_EDGE_FLAG_ARRAY_POINTER_EXT = 0x8093; +} diff --git a/src/java/org/lwjgl/opengl/ext/EXTVertexShader.java b/src/java/org/lwjgl/opengl/ext/EXTVertexShader.java new file mode 100644 index 00000000..cfd9a833 --- /dev/null +++ b/src/java/org/lwjgl/opengl/ext/EXTVertexShader.java @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:33:02 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.ext; + +public interface EXTVertexShader +{ + public static final int GL_VERTEX_SHADER_EXT = 0x8780; + public static final int GL_VERTEX_SHADER_BINDING_EXT = 0x8781; + public static final int GL_OP_INDEX_EXT = 0x8782; + public static final int GL_OP_NEGATE_EXT = 0x8783; + public static final int GL_OP_DOT3_EXT = 0x8784; + public static final int GL_OP_DOT4_EXT = 0x8785; + public static final int GL_OP_MUL_EXT = 0x8786; + public static final int GL_OP_ADD_EXT = 0x8787; + public static final int GL_OP_MADD_EXT = 0x8788; + public static final int GL_OP_FRAC_EXT = 0x8789; + public static final int GL_OP_MAX_EXT = 0x878A; + public static final int GL_OP_MIN_EXT = 0x878B; + public static final int GL_OP_SET_GE_EXT = 0x878C; + public static final int GL_OP_SET_LT_EXT = 0x878D; + public static final int GL_OP_CLAMP_EXT = 0x878E; + public static final int GL_OP_FLOOR_EXT = 0x878F; + public static final int GL_OP_ROUND_EXT = 0x8790; + public static final int GL_OP_EXP_BASE_2_EXT = 0x8791; + public static final int GL_OP_LOG_BASE_2_EXT = 0x8792; + public static final int GL_OP_POWER_EXT = 0x8793; + public static final int GL_OP_RECIP_EXT = 0x8794; + public static final int GL_OP_RECIP_SQRT_EXT = 0x8795; + public static final int GL_OP_SUB_EXT = 0x8796; + public static final int GL_OP_CROSS_PRODUCT_EXT = 0x8797; + public static final int GL_OP_MULTIPLY_MATRIX_EXT = 0x8798; + public static final int GL_OP_MOV_EXT = 0x8799; + public static final int GL_OUTPUT_VERTEX_EXT = 0x879A; + public static final int GL_OUTPUT_COLOR0_EXT = 0x879B; + public static final int GL_OUTPUT_COLOR1_EXT = 0x879C; + public static final int GL_OUTPUT_TEXTURE_COORD0_EXT = 0x879D; + public static final int GL_OUTPUT_TEXTURE_COORD1_EXT = 0x879E; + public static final int GL_OUTPUT_TEXTURE_COORD2_EXT = 0x879F; + public static final int GL_OUTPUT_TEXTURE_COORD3_EXT = 0x87A0; + public static final int GL_OUTPUT_TEXTURE_COORD4_EXT = 0x87A1; + public static final int GL_OUTPUT_TEXTURE_COORD5_EXT = 0x87A2; + public static final int GL_OUTPUT_TEXTURE_COORD6_EXT = 0x87A3; + public static final int GL_OUTPUT_TEXTURE_COORD7_EXT = 0x87A4; + public static final int GL_OUTPUT_TEXTURE_COORD8_EXT = 0x87A5; + public static final int GL_OUTPUT_TEXTURE_COORD9_EXT = 0x87A6; + public static final int GL_OUTPUT_TEXTURE_COORD10_EXT = 0x87A7; + public static final int GL_OUTPUT_TEXTURE_COORD11_EXT = 0x87A8; + public static final int GL_OUTPUT_TEXTURE_COORD12_EXT = 0x87A9; + public static final int GL_OUTPUT_TEXTURE_COORD13_EXT = 0x87AA; + public static final int GL_OUTPUT_TEXTURE_COORD14_EXT = 0x87AB; + public static final int GL_OUTPUT_TEXTURE_COORD15_EXT = 0x87AC; + public static final int GL_OUTPUT_TEXTURE_COORD16_EXT = 0x87AD; + public static final int GL_OUTPUT_TEXTURE_COORD17_EXT = 0x87AE; + public static final int GL_OUTPUT_TEXTURE_COORD18_EXT = 0x87AF; + public static final int GL_OUTPUT_TEXTURE_COORD19_EXT = 0x87B0; + public static final int GL_OUTPUT_TEXTURE_COORD20_EXT = 0x87B1; + public static final int GL_OUTPUT_TEXTURE_COORD21_EXT = 0x87B2; + public static final int GL_OUTPUT_TEXTURE_COORD22_EXT = 0x87B3; + public static final int GL_OUTPUT_TEXTURE_COORD23_EXT = 0x87B4; + public static final int GL_OUTPUT_TEXTURE_COORD24_EXT = 0x87B5; + public static final int GL_OUTPUT_TEXTURE_COORD25_EXT = 0x87B6; + public static final int GL_OUTPUT_TEXTURE_COORD26_EXT = 0x87B7; + public static final int GL_OUTPUT_TEXTURE_COORD27_EXT = 0x87B8; + public static final int GL_OUTPUT_TEXTURE_COORD28_EXT = 0x87B9; + public static final int GL_OUTPUT_TEXTURE_COORD29_EXT = 0x87BA; + public static final int GL_OUTPUT_TEXTURE_COORD30_EXT = 0x87BB; + public static final int GL_OUTPUT_TEXTURE_COORD31_EXT = 0x87BC; + public static final int GL_OUTPUT_FOG_EXT = 0x87BD; + public static final int GL_SCALAR_EXT = 0x87BE; + public static final int GL_VECTOR_EXT = 0x87BF; + public static final int GL_MATRIX_EXT = 0x87C0; + public static final int GL_VARIANT_EXT = 0x87C1; + public static final int GL_INVARIANT_EXT = 0x87C2; + public static final int GL_LOCAL_CONSTANT_EXT = 0x87C3; + public static final int GL_LOCAL_EXT = 0x87C4; + public static final int GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT = 0x87C5; + public static final int GL_MAX_VERTEX_SHADER_VARIANTS_EXT = 0x87C6; + public static final int GL_MAX_VERTEX_SHADER_INVARIANTS_EXT = 0x87C7; + public static final int GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT = 0x87C8; + public static final int GL_MAX_VERTEX_SHADER_LOCALS_EXT = 0x87C9; + public static final int GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT = 0x87CA; + public static final int GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT = 0x87CB; + public static final int GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT = 0x87CC; + public static final int GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT = 0x87CD; + public static final int GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT = 0x87CE; + public static final int GL_VERTEX_SHADER_INSTRUCTIONS_EXT = 0x87CF; + public static final int GL_VERTEX_SHADER_VARIANTS_EXT = 0x87D0; + public static final int GL_VERTEX_SHADER_INVARIANTS_EXT = 0x87D1; + public static final int GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT = 0x87D2; + public static final int GL_VERTEX_SHADER_LOCALS_EXT = 0x87D3; + public static final int GL_VERTEX_SHADER_OPTIMIZED_EXT = 0x87D4; + public static final int GL_X_EXT = 0x87D5; + public static final int GL_Y_EXT = 0x87D6; + public static final int GL_Z_EXT = 0x87D7; + public static final int GL_W_EXT = 0x87D8; + public static final int GL_NEGATIVE_X_EXT = 0x87D9; + public static final int GL_NEGATIVE_Y_EXT = 0x87DA; + public static final int GL_NEGATIVE_Z_EXT = 0x87DB; + public static final int GL_NEGATIVE_W_EXT = 0x87DC; + public static final int GL_ZERO_EXT = 0x87DD; + public static final int GL_ONE_EXT = 0x87DE; + public static final int GL_NEGATIVE_ONE_EXT = 0x87DF; + public static final int GL_NORMALIZED_RANGE_EXT = 0x87E0; + public static final int GL_FULL_RANGE_EXT = 0x87E1; + public static final int GL_CURRENT_VERTEX_EXT = 0x87E2; + public static final int GL_MVP_MATRIX_EXT = 0x87E3; + public static final int GL_VARIANT_VALUE_EXT = 0x87E4; + public static final int GL_VARIANT_DATATYPE_EXT = 0x87E5; + public static final int GL_VARIANT_ARRAY_STRIDE_EXT = 0x87E6; + public static final int GL_VARIANT_ARRAY_TYPE_EXT = 0x87E7; + public static final int GL_VARIANT_ARRAY_EXT = 0x87E8; + public static final int GL_VARIANT_ARRAY_POINTER_EXT = 0x87E9; + public static final int GL_INVARIANT_VALUE_EXT = 0x87EA; + public static final int GL_INVARIANT_DATATYPE_EXT = 0x87EB; + public static final int GL_LOCAL_CONSTANT_VALUE_EXT = 0x87EC; + public static final int GL_LOCAL_CONSTANT_DATATYPE_EXT = 0x87ED; +} diff --git a/src/java/org/lwjgl/opengl/ext/EXTVertexWeighting.java b/src/java/org/lwjgl/opengl/ext/EXTVertexWeighting.java new file mode 100644 index 00000000..11312e09 --- /dev/null +++ b/src/java/org/lwjgl/opengl/ext/EXTVertexWeighting.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:25:57 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.ext; + +public interface EXTVertexWeighting +{ + public static final int GL_MODELVIEW0_STACK_DEPTH_EXT = 0x0BA3; /* alias to MODELVIEW_STACK_DEPTH */ + public static final int GL_MODELVIEW1_STACK_DEPTH_EXT = 0x8502; + public static final int GL_MODELVIEW0_MATRIX_EXT = 0x0BA6; /* alias to MODELVIEW_MATRIX */ + public static final int GL_MODELVIEW1_MATRIX_EXT = 0x8506; + public static final int GL_VERTEX_WEIGHTING_EXT = 0x8509; + public static final int GL_MODELVIEW0_EXT = 0x1700; /* alias to MODELVIEW */ + public static final int GL_MODELVIEW1_EXT = 0x850A; + public static final int GL_CURRENT_VERTEX_WEIGHT_EXT = 0x850B; + public static final int GL_VERTEX_WEIGHT_ARRAY_EXT = 0x850C; + public static final int GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT = 0x850D; + public static final int GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT = 0x850E; + public static final int GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT = 0x850F; + public static final int GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT = 0x8510; +} diff --git a/src/java/org/lwjgl/opengl/nv/NVCopyDepthToColor.java b/src/java/org/lwjgl/opengl/nv/NVCopyDepthToColor.java new file mode 100644 index 00000000..93e8fdeb --- /dev/null +++ b/src/java/org/lwjgl/opengl/nv/NVCopyDepthToColor.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:30:49 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.nv; + +public interface NVCopyDepthToColor +{ + public static final int GL_DEPTH_STENCIL_TO_RGBA_NV = 0x886E; + public static final int GL_DEPTH_STENCIL_TO_BGRA_NV = 0x886F; +} diff --git a/src/java/org/lwjgl/opengl/nv/NVDepthClamp.java b/src/java/org/lwjgl/opengl/nv/NVDepthClamp.java new file mode 100644 index 00000000..768672c2 --- /dev/null +++ b/src/java/org/lwjgl/opengl/nv/NVDepthClamp.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:37:44 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.nv; + +public interface NVDepthClamp +{ + public static final int GL_DEPTH_CLAMP_NV = 0x864F; +} diff --git a/src/java/org/lwjgl/opengl/nv/NVEvaluators.java b/src/java/org/lwjgl/opengl/nv/NVEvaluators.java new file mode 100644 index 00000000..207d0b20 --- /dev/null +++ b/src/java/org/lwjgl/opengl/nv/NVEvaluators.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:30:22 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.nv; + +public interface NVEvaluators +{ + public static final int GL_EVAL_2D_NV = 0x86C0; + public static final int GL_EVAL_TRIANGULAR_2D_NV = 0x86C1; + public static final int GL_MAP_TESSELLATION_NV = 0x86C2; + public static final int GL_MAP_ATTRIB_U_ORDER_NV = 0x86C3; + public static final int GL_MAP_ATTRIB_V_ORDER_NV = 0x86C4; + public static final int GL_EVAL_FRACTIONAL_TESSELLATION_NV = 0x86C5; + public static final int GL_EVAL_VERTEX_ATTRIB0_NV = 0x86C6; + public static final int GL_EVAL_VERTEX_ATTRIB1_NV = 0x86C7; + public static final int GL_EVAL_VERTEX_ATTRIB2_NV = 0x86C8; + public static final int GL_EVAL_VERTEX_ATTRIB3_NV = 0x86C9; + public static final int GL_EVAL_VERTEX_ATTRIB4_NV = 0x86CA; + public static final int GL_EVAL_VERTEX_ATTRIB5_NV = 0x86CB; + public static final int GL_EVAL_VERTEX_ATTRIB6_NV = 0x86CC; + public static final int GL_EVAL_VERTEX_ATTRIB7_NV = 0x86CD; + public static final int GL_EVAL_VERTEX_ATTRIB8_NV = 0x86CE; + public static final int GL_EVAL_VERTEX_ATTRIB9_NV = 0x86CF; + public static final int GL_EVAL_VERTEX_ATTRIB10_NV = 0x86D0; + public static final int GL_EVAL_VERTEX_ATTRIB11_NV = 0x86D1; + public static final int GL_EVAL_VERTEX_ATTRIB12_NV = 0x86D2; + public static final int GL_EVAL_VERTEX_ATTRIB13_NV = 0x86D3; + public static final int GL_EVAL_VERTEX_ATTRIB14_NV = 0x86D4; + public static final int GL_EVAL_VERTEX_ATTRIB15_NV = 0x86D5; + public static final int GL_MAX_MAP_TESSELLATION_NV = 0x86D6; + public static final int GL_MAX_RATIONAL_EVAL_ORDER_NV = 0x86D7; +} diff --git a/src/java/org/lwjgl/opengl/nv/NVFence.java b/src/java/org/lwjgl/opengl/nv/NVFence.java new file mode 100644 index 00000000..a152bf89 --- /dev/null +++ b/src/java/org/lwjgl/opengl/nv/NVFence.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:26:52 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.nv; + +public interface NVFence +{ + public static final int GL_ALL_COMPLETED_NV = 0x84F2; + public static final int GL_FENCE_STATUS_NV = 0x84F3; + public static final int GL_FENCE_CONDITION_NV = 0x84F4; +} diff --git a/src/java/org/lwjgl/opengl/nv/NVFogDistance.java b/src/java/org/lwjgl/opengl/nv/NVFogDistance.java new file mode 100644 index 00000000..0a3f41d9 --- /dev/null +++ b/src/java/org/lwjgl/opengl/nv/NVFogDistance.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:23:35 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.nv; + +public interface NVFogDistance +{ + public static final int GL_FOG_DISTANCE_MODE_NV = 0x855A; + public static final int GL_EYE_RADIAL_NV = 0x855B; + public static final int GL_EYE_PLANE_ABSOLUTE_NV = 0x855C; +} diff --git a/src/java/org/lwjgl/opengl/nv/NVLightMaxExponent.java b/src/java/org/lwjgl/opengl/nv/NVLightMaxExponent.java new file mode 100644 index 00000000..aced39ca --- /dev/null +++ b/src/java/org/lwjgl/opengl/nv/NVLightMaxExponent.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:27:54 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.nv; + +public interface NVLightMaxExponent +{ + public static final int GL_MAX_SHININESS_NV = 0x8504; + public static final int GL_MAX_SPOT_EXPONENT_NV = 0x8505; +} diff --git a/src/java/org/lwjgl/opengl/nv/NVOcclusionQuery.java b/src/java/org/lwjgl/opengl/nv/NVOcclusionQuery.java new file mode 100644 index 00000000..797af394 --- /dev/null +++ b/src/java/org/lwjgl/opengl/nv/NVOcclusionQuery.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:38:29 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.nv; + +public interface NVOcclusionQuery +{ + public static final int GL_OCCLUSION_TEST_HP = 0x8165; + public static final int GL_OCCLUSION_TEST_RESULT_HP = 0x8166; + /* HP_occlusion_test */ + public static final int GL_PIXEL_COUNTER_BITS_NV = 0x8864; + public static final int GL_CURRENT_OCCLUSION_QUERY_ID_NV = 0x8865; + public static final int GL_PIXEL_COUNT_NV = 0x8866; + public static final int GL_PIXEL_COUNT_AVAILABLE_NV = 0x8867; +} diff --git a/src/java/org/lwjgl/opengl/nv/NVPackedDepthStencil.java b/src/java/org/lwjgl/opengl/nv/NVPackedDepthStencil.java new file mode 100644 index 00000000..6d4066cf --- /dev/null +++ b/src/java/org/lwjgl/opengl/nv/NVPackedDepthStencil.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:28:27 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.nv; + +public interface NVPackedDepthStencil +{ + public static final int GL_DEPTH_STENCIL_NV = 0x84F9; + public static final int GL_UNSIGNED_INT_24_8_NV = 0x84FA; +} diff --git a/src/java/org/lwjgl/opengl/nv/NVPointSprite.java b/src/java/org/lwjgl/opengl/nv/NVPointSprite.java new file mode 100644 index 00000000..b3d71d1a --- /dev/null +++ b/src/java/org/lwjgl/opengl/nv/NVPointSprite.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:56:50 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.nv; + +public interface NVPointSprite +{ + public static final int GL_POINT_SPRITE_NV = 0x8861; + public static final int GL_COORD_REPLACE_NV = 0x8862; + public static final int GL_POINT_SPRITE_R_MODE_NV = 0x8863; +} diff --git a/src/java/org/lwjgl/opengl/nv/NVRegisterCombiners.java b/src/java/org/lwjgl/opengl/nv/NVRegisterCombiners.java new file mode 100644 index 00000000..eb71c0ac --- /dev/null +++ b/src/java/org/lwjgl/opengl/nv/NVRegisterCombiners.java @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:20:54 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.nv; + +public interface NVRegisterCombiners +{ + public static final int GL_REGISTER_COMBINERS_NV = 0x8522; + public static final int GL_COMBINER0_NV = 0x8550; + public static final int GL_COMBINER1_NV = 0x8551; + public static final int GL_COMBINER2_NV = 0x8552; + public static final int GL_COMBINER3_NV = 0x8553; + public static final int GL_COMBINER4_NV = 0x8554; + public static final int GL_COMBINER5_NV = 0x8555; + public static final int GL_COMBINER6_NV = 0x8556; + public static final int GL_COMBINER7_NV = 0x8557; + public static final int GL_VARIABLE_A_NV = 0x8523; + public static final int GL_VARIABLE_B_NV = 0x8524; + public static final int GL_VARIABLE_C_NV = 0x8525; + public static final int GL_VARIABLE_D_NV = 0x8526; + public static final int GL_VARIABLE_E_NV = 0x8527; + public static final int GL_VARIABLE_F_NV = 0x8528; + public static final int GL_VARIABLE_G_NV = 0x8529; + public static final int GL_CONSTANT_COLOR0_NV = 0x852A; + public static final int GL_CONSTANT_COLOR1_NV = 0x852B; + public static final int GL_PRIMARY_COLOR_NV = 0x852C; + public static final int GL_SECONDARY_COLOR_NV = 0x852D; + public static final int GL_SPARE0_NV = 0x852E; + public static final int GL_SPARE1_NV = 0x852F; + public static final int GL_UNSIGNED_IDENTITY_NV = 0x8536; + public static final int GL_UNSIGNED_INVERT_NV = 0x8537; + public static final int GL_EXPAND_NORMAL_NV = 0x8538; + public static final int GL_EXPAND_NEGATE_NV = 0x8539; + public static final int GL_HALF_BIAS_NORMAL_NV = 0x853A; + public static final int GL_HALF_BIAS_NEGATE_NV = 0x853B; + public static final int GL_SIGNED_IDENTITY_NV = 0x853C; + public static final int GL_SIGNED_NEGATE_NV = 0x853D; + public static final int GL_E_TIMES_F_NV = 0x8531; + public static final int GL_SPARE0_PLUS_SECONDARY_COLOR_NV = 0x8532; + public static final int GL_SCALE_BY_TWO_NV = 0x853E; + public static final int GL_SCALE_BY_FOUR_NV = 0x853F; + public static final int GL_SCALE_BY_ONE_HALF_NV = 0x8540; + public static final int GL_BIAS_BY_NEGATIVE_ONE_HALF_NV = 0x8541; + public static final int GL_DISCARD_NV = 0x8530; + public static final int GL_COMBINER_INPUT_NV = 0x8542; + public static final int GL_COMBINER_MAPPING_NV = 0x8543; + public static final int GL_COMBINER_COMPONENT_USAGE_NV = 0x8544; + public static final int GL_COMBINER_AB_DOT_PRODUCT_NV = 0x8545; + public static final int GL_COMBINER_CD_DOT_PRODUCT_NV = 0x8546; + public static final int GL_COMBINER_MUX_SUM_NV = 0x8547; + public static final int GL_COMBINER_SCALE_NV = 0x8548; + public static final int GL_COMBINER_BIAS_NV = 0x8549; + public static final int GL_COMBINER_AB_OUTPUT_NV = 0x854A; + public static final int GL_COMBINER_CD_OUTPUT_NV = 0x854B; + public static final int GL_COMBINER_SUM_OUTPUT_NV = 0x854C; + public static final int GL_NUM_GENERAL_COMBINERS_NV = 0x854E; + public static final int GL_COLOR_SUM_CLAMP_NV = 0x854F; + public static final int GL_MAX_GENERAL_COMBINERS_NV = 0x854D; +} diff --git a/src/java/org/lwjgl/opengl/nv/NVRegisterCombiners2.java b/src/java/org/lwjgl/opengl/nv/NVRegisterCombiners2.java new file mode 100644 index 00000000..c2d25cfc --- /dev/null +++ b/src/java/org/lwjgl/opengl/nv/NVRegisterCombiners2.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:28:46 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.nv; + +public interface NVRegisterCombiners2 +{ + public static final int GL_PER_STAGE_CONSTANTS_NV = 0x8535; +} diff --git a/src/java/org/lwjgl/opengl/nv/NVTexgenReflection.java b/src/java/org/lwjgl/opengl/nv/NVTexgenReflection.java new file mode 100644 index 00000000..4d947050 --- /dev/null +++ b/src/java/org/lwjgl/opengl/nv/NVTexgenReflection.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:25:20 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.nv; + +public interface NVTexgenReflection +{ + public static final int GL_NORMAL_MAP_NV = 0x8511; + public static final int GL_REFLECTION_MAP_NV = 0x8512; +} diff --git a/src/java/org/lwjgl/opengl/nv/NVTextureEnvCombine4.java b/src/java/org/lwjgl/opengl/nv/NVTextureEnvCombine4.java new file mode 100644 index 00000000..43e7ad1a --- /dev/null +++ b/src/java/org/lwjgl/opengl/nv/NVTextureEnvCombine4.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:23:05 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.nv; + +public interface NVTextureEnvCombine4 +{ + public static final int GL_COMBINE4_NV = 0x8503; + public static final int GL_SOURCE3_RGB_NV = 0x8583; + public static final int GL_SOURCE3_ALPHA_NV = 0x858B; + public static final int GL_OPERAND3_RGB_NV = 0x8593; + public static final int GL_OPERAND3_ALPHA_NV = 0x859B; +} diff --git a/src/java/org/lwjgl/opengl/nv/NVTextureRectangle.java b/src/java/org/lwjgl/opengl/nv/NVTextureRectangle.java new file mode 100644 index 00000000..d7b07d20 --- /dev/null +++ b/src/java/org/lwjgl/opengl/nv/NVTextureRectangle.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:22:23 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.nv; + +public interface NVTextureRectangle +{ + public static final int GL_TEXTURE_RECTANGLE_NV = 0x84F5; + public static final int GL_TEXTURE_BINDING_RECTANGLE_NV = 0x84F6; + public static final int GL_PROXY_TEXTURE_RECTANGLE_NV = 0x84F7; + public static final int GL_MAX_RECTANGLE_TEXTURE_SIZE_NV = 0x84F8; +} diff --git a/src/java/org/lwjgl/opengl/nv/NVTextureShader.java b/src/java/org/lwjgl/opengl/nv/NVTextureShader.java new file mode 100644 index 00000000..696ed043 --- /dev/null +++ b/src/java/org/lwjgl/opengl/nv/NVTextureShader.java @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:21:57 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.nv; + +public interface NVTextureShader +{ + public static final int GL_TEXTURE_SHADER_NV = 0x86DE; + public static final int GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV = 0x86D9; + public static final int GL_SHADER_OPERATION_NV = 0x86DF; + public static final int GL_CULL_MODES_NV = 0x86E0; + public static final int GL_OFFSET_TEXTURE_MATRIX_NV = 0x86E1; + public static final int GL_OFFSET_TEXTURE_SCALE_NV = 0x86E2; + public static final int GL_OFFSET_TEXTURE_BIAS_NV = 0x86E3; + public static final int GL_PREVIOUS_TEXTURE_INPUT_NV = 0x86E4; + public static final int GL_CONST_EYE_NV = 0x86E5; + public static final int GL_SHADER_CONSISTENT_NV = 0x86DD; + public static final int GL_PASS_THROUGH_NV = 0x86E6; + public static final int GL_CULL_FRAGMENT_NV = 0x86E7; + public static final int GL_OFFSET_TEXTURE_2D_NV = 0x86E8; + public static final int GL_OFFSET_TEXTURE_RECTANGLE_NV = 0x864C; + public static final int GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV = 0x864D; + public static final int GL_DEPENDENT_AR_TEXTURE_2D_NV = 0x86E9; + public static final int GL_DEPENDENT_GB_TEXTURE_2D_NV = 0x86EA; + public static final int GL_DOT_PRODUCT_NV = 0x86EC; + public static final int GL_DOT_PRODUCT_DEPTH_REPLACE_NV = 0x86ED; + public static final int GL_DOT_PRODUCT_TEXTURE_2D_NV = 0x86EE; + public static final int GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV = 0x864E; + public static final int GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV = 0x86F0; + public static final int GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV = 0x86F1; + public static final int GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV = 0x86F2; + public static final int GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV = 0x86F3; + public static final int GL_HILO_NV = 0x86F4; + public static final int GL_DSDT_NV = 0x86F5; + public static final int GL_DSDT_MAG_NV = 0x86F6; + public static final int GL_DSDT_MAG_VIB_NV = 0x86F7; + public static final int GL_UNSIGNED_INT_S8_S8_8_8_NV = 0x86DA; + public static final int GL_UNSIGNED_INT_8_8_S8_S8_REV_NV = 0x86DB; + public static final int GL_SIGNED_RGBA_NV = 0x86FB; + public static final int GL_SIGNED_RGBA8_NV = 0x86FC; + public static final int GL_SIGNED_RGB_NV = 0x86FE; + public static final int GL_SIGNED_RGB8_NV = 0x86FF; + public static final int GL_SIGNED_LUMINANCE_NV = 0x8701; + public static final int GL_SIGNED_LUMINANCE8_NV = 0x8702; + public static final int GL_SIGNED_LUMINANCE_ALPHA_NV = 0x8703; + public static final int GL_SIGNED_LUMINANCE8_ALPHA8_NV = 0x8704; + public static final int GL_SIGNED_ALPHA_NV = 0x8705; + public static final int GL_SIGNED_ALPHA8_NV = 0x8706; + public static final int GL_SIGNED_INTENSITY_NV = 0x8707; + public static final int GL_SIGNED_INTENSITY8_NV = 0x8708; + public static final int GL_SIGNED_RGB_UNSIGNED_ALPHA_NV = 0x870C; + public static final int GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV = 0x870D; + public static final int GL_HILO16_NV = 0x86F8; + public static final int GL_SIGNED_HILO_NV = 0x86F9; + public static final int GL_SIGNED_HILO16_NV = 0x86FA; + public static final int GL_DSDT8_NV = 0x8709; + public static final int GL_DSDT8_MAG8_NV = 0x870A; + public static final int GL_DSDT_MAG_INTENSITY_NV = 0x86DC; + public static final int GL_DSDT8_MAG8_INTENSITY8_NV = 0x870B; + public static final int GL_HI_SCALE_NV = 0x870E; + public static final int GL_LO_SCALE_NV = 0x870F; + public static final int GL_DS_SCALE_NV = 0x8710; + public static final int GL_DT_SCALE_NV = 0x8711; + public static final int GL_MAGNITUDE_SCALE_NV = 0x8712; + public static final int GL_VIBRANCE_SCALE_NV = 0x8713; + public static final int GL_HI_BIAS_NV = 0x8714; + public static final int GL_LO_BIAS_NV = 0x8715; + public static final int GL_DS_BIAS_NV = 0x8716; + public static final int GL_DT_BIAS_NV = 0x8717; + public static final int GL_MAGNITUDE_BIAS_NV = 0x8718; + public static final int GL_VIBRANCE_BIAS_NV = 0x8719; + public static final int GL_TEXTURE_BORDER_VALUES_NV = 0x871A; + public static final int GL_TEXTURE_HI_SIZE_NV = 0x871B; + public static final int GL_TEXTURE_LO_SIZE_NV = 0x871C; + public static final int GL_TEXTURE_DS_SIZE_NV = 0x871D; + public static final int GL_TEXTURE_DT_SIZE_NV = 0x871E; + public static final int GL_TEXTURE_MAG_SIZE_NV = 0x871F; +} diff --git a/src/java/org/lwjgl/opengl/nv/NVTextureShader2.java b/src/java/org/lwjgl/opengl/nv/NVTextureShader2.java new file mode 100644 index 00000000..03fc750e --- /dev/null +++ b/src/java/org/lwjgl/opengl/nv/NVTextureShader2.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:27:12 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.nv; + +public interface NVTextureShader2 +{ + public static final int GL_DOT_PRODUCT_TEXTURE_3D_NV = 0x86EF; + public static final int GL_HILO_NV = 0x86F4; + public static final int GL_DSDT_NV = 0x86F5; + public static final int GL_DSDT_MAG_NV = 0x86F6; + public static final int GL_DSDT_MAG_VIB_NV = 0x86F7; + public static final int GL_UNSIGNED_INT_S8_S8_8_8_NV = 0x86DA; + public static final int GL_UNSIGNED_INT_8_8_S8_S8_REV_NV = 0x86DB; + public static final int GL_SIGNED_RGBA_NV = 0x86FB; + public static final int GL_SIGNED_RGBA8_NV = 0x86FC; + public static final int GL_SIGNED_RGB_NV = 0x86FE; + public static final int GL_SIGNED_RGB8_NV = 0x86FF; + public static final int GL_SIGNED_LUMINANCE_NV = 0x8701; + public static final int GL_SIGNED_LUMINANCE8_NV = 0x8702; + public static final int GL_SIGNED_LUMINANCE_ALPHA_NV = 0x8703; + public static final int GL_SIGNED_LUMINANCE8_ALPHA8_NV = 0x8704; + public static final int GL_SIGNED_ALPHA_NV = 0x8705; + public static final int GL_SIGNED_ALPHA8_NV = 0x8706; + public static final int GL_SIGNED_INTENSITY_NV = 0x8707; + public static final int GL_SIGNED_INTENSITY8_NV = 0x8708; + public static final int GL_SIGNED_RGB_UNSIGNED_ALPHA_NV = 0x870C; + public static final int GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV = 0x870D; + public static final int GL_HILO16_NV = 0x86F8; + public static final int GL_SIGNED_HILO_NV = 0x86F9; + public static final int GL_SIGNED_HILO16_NV = 0x86FA; + public static final int GL_DSDT8_NV = 0x8709; + public static final int GL_DSDT8_MAG8_NV = 0x870A; + public static final int GL_DSDT_MAG_INTENSITY_NV = 0x86DC; + public static final int GL_DSDT8_MAG8_INTENSITY8_NV = 0x870B; +} diff --git a/src/java/org/lwjgl/opengl/nv/NVTextureShader3.java b/src/java/org/lwjgl/opengl/nv/NVTextureShader3.java new file mode 100644 index 00000000..ac2f4a81 --- /dev/null +++ b/src/java/org/lwjgl/opengl/nv/NVTextureShader3.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:57:41 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.nv; + +public interface NVTextureShader3 +{ + public static final int GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV = 0x8850; + public static final int GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV = 0x8851; + public static final int GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV = 0x8852; + public static final int GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV = 0x8853; + public static final int GL_OFFSET_HILO_TEXTURE_2D_NV = 0x8854; + public static final int GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV = 0x8855; + public static final int GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV = 0x8856; + public static final int GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV = 0x8857; + public static final int GL_DEPENDENT_HILO_TEXTURE_2D_NV = 0x8858; + public static final int GL_DEPENDENT_RGB_TEXTURE_3D_NV = 0x8859; + public static final int GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV = 0x885A; + public static final int GL_DOT_PRODUCT_PASS_THROUGH_NV = 0x885B; + public static final int GL_DOT_PRODUCT_TEXTURE_1D_NV = 0x885C; + public static final int GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV = 0x885D; + public static final int GL_HILO8_NV = 0x885E; + public static final int GL_SIGNED_HILO8_NV = 0x885F; + public static final int GL_FORCE_BLUE_TO_ONE_NV = 0x8860; +} diff --git a/src/java/org/lwjgl/opengl/nv/NVVertexArrayRange.java b/src/java/org/lwjgl/opengl/nv/NVVertexArrayRange.java new file mode 100644 index 00000000..c2331422 --- /dev/null +++ b/src/java/org/lwjgl/opengl/nv/NVVertexArrayRange.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:18:16 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.nv; + +public interface NVVertexArrayRange +{ + public static final int GL_VERTEX_ARRAY_RANGE_NV = 0x851D; + public static final int GL_VERTEX_ARRAY_RANGE_LENGTH_NV = 0x851E; + public static final int GL_VERTEX_ARRAY_RANGE_VALID_NV = 0x851F; + public static final int GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV = 0x8520; + public static final int GL_VERTEX_ARRAY_RANGE_POINTER_NV = 0x8521; +} diff --git a/src/java/org/lwjgl/opengl/nv/NVVertexArrayRange2.java b/src/java/org/lwjgl/opengl/nv/NVVertexArrayRange2.java new file mode 100644 index 00000000..3fee5ac2 --- /dev/null +++ b/src/java/org/lwjgl/opengl/nv/NVVertexArrayRange2.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:18:42 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.nv; + +public interface NVVertexArrayRange2 +{ + public static final int GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV = 0x8533; +} diff --git a/src/java/org/lwjgl/opengl/nv/NVVertexProgram.java b/src/java/org/lwjgl/opengl/nv/NVVertexProgram.java new file mode 100644 index 00000000..afe46773 --- /dev/null +++ b/src/java/org/lwjgl/opengl/nv/NVVertexProgram.java @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 15:26:24 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.nv; + +public interface NVVertexProgram +{ + public static final int GL_VERTEX_PROGRAM_NV = 0x8620; + public static final int GL_VERTEX_PROGRAM_POINT_SIZE_NV = 0x8642; + public static final int GL_VERTEX_PROGRAM_TWO_SIDE_NV = 0x8643; + public static final int GL_VERTEX_STATE_PROGRAM_NV = 0x8621; + public static final int GL_ATTRIB_ARRAY_SIZE_NV = 0x8623; + public static final int GL_ATTRIB_ARRAY_STRIDE_NV = 0x8624; + public static final int GL_ATTRIB_ARRAY_TYPE_NV = 0x8625; + public static final int GL_CURRENT_ATTRIB_NV = 0x8626; + public static final int GL_PROGRAM_PARAMETER_NV = 0x8644; + public static final int GL_ATTRIB_ARRAY_POINTER_NV = 0x8645; + public static final int GL_PROGRAM_TARGET_NV = 0x8646; + public static final int GL_PROGRAM_LENGTH_NV = 0x8627; + public static final int GL_PROGRAM_RESIDENT_NV = 0x8647; + public static final int GL_PROGRAM_STRING_NV = 0x8628; + public static final int GL_TRACK_MATRIX_NV = 0x8648; + public static final int GL_TRACK_MATRIX_TRANSFORM_NV = 0x8649; + public static final int GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV = 0x862E; + public static final int GL_MAX_TRACK_MATRICES_NV = 0x862F; + public static final int GL_CURRENT_MATRIX_STACK_DEPTH_NV = 0x8640; + public static final int GL_CURRENT_MATRIX_NV = 0x8641; + public static final int GL_VERTEX_PROGRAM_BINDING_NV = 0x864A; + public static final int GL_PROGRAM_ERROR_POSITION_NV = 0x864B; + public static final int GL_MODELVIEW_PROJECTION_NV = 0x8629; + public static final int GL_MATRIX0_NV = 0x8630; + public static final int GL_MATRIX1_NV = 0x8631; + public static final int GL_MATRIX2_NV = 0x8632; + public static final int GL_MATRIX3_NV = 0x8633; + public static final int GL_MATRIX4_NV = 0x8634; + public static final int GL_MATRIX5_NV = 0x8635; + public static final int GL_MATRIX6_NV = 0x8636; + public static final int GL_MATRIX7_NV = 0x8637; + public static final int GL_IDENTITY_NV = 0x862A; + public static final int GL_INVERSE_NV = 0x862B; + public static final int GL_TRANSPOSE_NV = 0x862C; + public static final int GL_INVERSE_TRANSPOSE_NV = 0x862D; + public static final int GL_VERTEX_ATTRIB_ARRAY0_NV = 0x8650; + public static final int GL_VERTEX_ATTRIB_ARRAY1_NV = 0x8651; + public static final int GL_VERTEX_ATTRIB_ARRAY2_NV = 0x8652; + public static final int GL_VERTEX_ATTRIB_ARRAY3_NV = 0x8653; + public static final int GL_VERTEX_ATTRIB_ARRAY4_NV = 0x8654; + public static final int GL_VERTEX_ATTRIB_ARRAY5_NV = 0x8655; + public static final int GL_VERTEX_ATTRIB_ARRAY6_NV = 0x8656; + public static final int GL_VERTEX_ATTRIB_ARRAY7_NV = 0x8657; + public static final int GL_VERTEX_ATTRIB_ARRAY8_NV = 0x8658; + public static final int GL_VERTEX_ATTRIB_ARRAY9_NV = 0x8659; + public static final int GL_VERTEX_ATTRIB_ARRAY10_NV = 0x865A; + public static final int GL_VERTEX_ATTRIB_ARRAY11_NV = 0x865B; + public static final int GL_VERTEX_ATTRIB_ARRAY12_NV = 0x865C; + public static final int GL_VERTEX_ATTRIB_ARRAY13_NV = 0x865D; + public static final int GL_VERTEX_ATTRIB_ARRAY14_NV = 0x865E; + public static final int GL_VERTEX_ATTRIB_ARRAY15_NV = 0x865F; + public static final int GL_MAP1_VERTEX_ATTRIB0_4_NV = 0x8660; + public static final int GL_MAP1_VERTEX_ATTRIB1_4_NV = 0x8661; + public static final int GL_MAP1_VERTEX_ATTRIB2_4_NV = 0x8662; + public static final int GL_MAP1_VERTEX_ATTRIB3_4_NV = 0x8663; + public static final int GL_MAP1_VERTEX_ATTRIB4_4_NV = 0x8664; + public static final int GL_MAP1_VERTEX_ATTRIB5_4_NV = 0x8665; + public static final int GL_MAP1_VERTEX_ATTRIB6_4_NV = 0x8666; + public static final int GL_MAP1_VERTEX_ATTRIB7_4_NV = 0x8667; + public static final int GL_MAP1_VERTEX_ATTRIB8_4_NV = 0x8668; + public static final int GL_MAP1_VERTEX_ATTRIB9_4_NV = 0x8669; + public static final int GL_MAP1_VERTEX_ATTRIB10_4_NV = 0x866A; + public static final int GL_MAP1_VERTEX_ATTRIB11_4_NV = 0x866B; + public static final int GL_MAP1_VERTEX_ATTRIB12_4_NV = 0x866C; + public static final int GL_MAP1_VERTEX_ATTRIB13_4_NV = 0x866D; + public static final int GL_MAP1_VERTEX_ATTRIB14_4_NV = 0x866E; + public static final int GL_MAP1_VERTEX_ATTRIB15_4_NV = 0x866F; + public static final int GL_MAP2_VERTEX_ATTRIB0_4_NV = 0x8670; + public static final int GL_MAP2_VERTEX_ATTRIB1_4_NV = 0x8671; + public static final int GL_MAP2_VERTEX_ATTRIB2_4_NV = 0x8672; + public static final int GL_MAP2_VERTEX_ATTRIB3_4_NV = 0x8673; + public static final int GL_MAP2_VERTEX_ATTRIB4_4_NV = 0x8674; + public static final int GL_MAP2_VERTEX_ATTRIB5_4_NV = 0x8675; + public static final int GL_MAP2_VERTEX_ATTRIB6_4_NV = 0x8676; + public static final int GL_MAP2_VERTEX_ATTRIB7_4_NV = 0x8677; + public static final int GL_MAP2_VERTEX_ATTRIB8_4_NV = 0x8678; + public static final int GL_MAP2_VERTEX_ATTRIB9_4_NV = 0x8679; + public static final int GL_MAP2_VERTEX_ATTRIB10_4_NV = 0x867A; + public static final int GL_MAP2_VERTEX_ATTRIB11_4_NV = 0x867B; + public static final int GL_MAP2_VERTEX_ATTRIB12_4_NV = 0x867C; + public static final int GL_MAP2_VERTEX_ATTRIB13_4_NV = 0x867D; + public static final int GL_MAP2_VERTEX_ATTRIB14_4_NV = 0x867E; + public static final int GL_MAP2_VERTEX_ATTRIB15_4_NV = 0x867F; +} diff --git a/src/java/org/lwjgl/opengl/wgl/WGLBufferRegion.java b/src/java/org/lwjgl/opengl/wgl/WGLBufferRegion.java new file mode 100644 index 00000000..936cc1f3 --- /dev/null +++ b/src/java/org/lwjgl/opengl/wgl/WGLBufferRegion.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 16:06:10 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.wgl; + +public interface WGLBufferRegion +{ + public static final int WGL_WFRONT_COLOR_BUFFER_BIT_ARB = 0x00000001; + public static final int WGL_WBACK_COLOR_BUFFER_BIT_ARB = 0x00000002; + public static final int WGL_WDEPTH_BUFFER_BIT_ARB = 0x00000004; + public static final int WGL_WSTENCIL_BUFFER_BIT_ARB = 0x00000008; +} diff --git a/src/java/org/lwjgl/opengl/wgl/WGLMakeCurrentRead.java b/src/java/org/lwjgl/opengl/wgl/WGLMakeCurrentRead.java new file mode 100644 index 00000000..f595f3fd --- /dev/null +++ b/src/java/org/lwjgl/opengl/wgl/WGLMakeCurrentRead.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 16:09:29 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.wgl; + +public interface WGLMakeCurrentRead +{ + public static final int WGL_ERROR_INVALID_PIXEL_TYPE_ARB = 0x2043; + public static final int WGL_ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB = 0x2054; +} diff --git a/src/java/org/lwjgl/opengl/wgl/WGLMultisample.java b/src/java/org/lwjgl/opengl/wgl/WGLMultisample.java new file mode 100644 index 00000000..1f6e0cfc --- /dev/null +++ b/src/java/org/lwjgl/opengl/wgl/WGLMultisample.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 16:10:06 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.wgl; + +public interface WGLMultisample +{ + public static final int WGL_WSAMPLE_BUFFERS_ARB = 0x2041; + public static final int WGL_WSAMPLES_ARB = 0x2042; +} diff --git a/src/java/org/lwjgl/opengl/wgl/WGLPBuffer.java b/src/java/org/lwjgl/opengl/wgl/WGLPBuffer.java new file mode 100644 index 00000000..f66c96fa --- /dev/null +++ b/src/java/org/lwjgl/opengl/wgl/WGLPBuffer.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 16:06:59 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.wgl; + +public interface WGLPBuffer +{ + public static final int WGL_WDRAW_TO_PBUFFER_ARB = 0x202D; + public static final int WGL_WMAX_PBUFFER_PIXELS_ARB = 0x202E; + public static final int WGL_WMAX_PBUFFER_WIDTH_ARB = 0x202F; + public static final int WGL_WMAX_PBUFFER_HEIGHT_ARB = 0x2030; + public static final int WGL_WPBUFFER_LARGEST_ARB = 0x2033; + public static final int WGL_WPBUFFER_WIDTH_ARB = 0x2034; + public static final int WGL_WPBUFFER_HEIGHT_ARB = 0x2035; + public static final int WGL_WPBUFFER_LOST_ARB = 0x2036; +} diff --git a/src/java/org/lwjgl/opengl/wgl/WGLPixelFormat.java b/src/java/org/lwjgl/opengl/wgl/WGLPixelFormat.java new file mode 100644 index 00000000..7af37192 --- /dev/null +++ b/src/java/org/lwjgl/opengl/wgl/WGLPixelFormat.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 16:07:42 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.wgl; + +public interface WGLPixelFormat +{ + public static final int WGL_WNUMBER_PIXEL_FORMATS_ARB = 0x2000; + public static final int WGL_WDRAW_TO_WINDOW_ARB = 0x2001; + public static final int WGL_WDRAW_TO_BITMAP_ARB = 0x2002; + public static final int WGL_WACCELERATION_ARB = 0x2003; + public static final int WGL_WNEED_PALETTE_ARB = 0x2004; + public static final int WGL_WNEED_SYSTEM_PALETTE_ARB = 0x2005; + public static final int WGL_WSWAP_LAYER_BUFFERS_ARB = 0x2006; + public static final int WGL_WSWAP_METHOD_ARB = 0x2007; + public static final int WGL_WNUMBER_OVERLAYS_ARB = 0x2008; + public static final int WGL_WNUMBER_UNDERLAYS_ARB = 0x2009; + public static final int WGL_WTRANSPARENT_ARB = 0x200A; + public static final int WGL_WTRANSPARENT_RED_VALUE_ARB = 0x2037; + public static final int WGL_WTRANSPARENT_GREEN_VALUE_ARB = 0x2038; + public static final int WGL_WTRANSPARENT_BLUE_VALUE_ARB = 0x2039; + public static final int WGL_WTRANSPARENT_ALPHA_VALUE_ARB = 0x203A; + public static final int WGL_WTRANSPARENT_INDEX_VALUE_ARB = 0x203B; + public static final int WGL_WSHARE_DEPTH_ARB = 0x200C; + public static final int WGL_WSHARE_STENCIL_ARB = 0x200D; + public static final int WGL_WSHARE_ACCUM_ARB = 0x200E; + public static final int WGL_WSUPPORT_GDI_ARB = 0x200F; + public static final int WGL_WSUPPORT_OPENARB = 0x2010; + public static final int WGL_WDOUBLE_BUFFER_ARB = 0x2011; + public static final int WGL_WSTEREO_ARB = 0x2012; + public static final int WGL_WPIXEL_TYPE_ARB = 0x2013; + public static final int WGL_WCOLOR_BITS_ARB = 0x2014; + public static final int WGL_WRED_BITS_ARB = 0x2015; + public static final int WGL_WRED_SHIFT_ARB = 0x2016; + public static final int WGL_WGREEN_BITS_ARB = 0x2017; + public static final int WGL_WGREEN_SHIFT_ARB = 0x2018; + public static final int WGL_WBLUE_BITS_ARB = 0x2019; + public static final int WGL_WBLUE_SHIFT_ARB = 0x201A; + public static final int WGL_WALPHA_BITS_ARB = 0x201B; + public static final int WGL_WALPHA_SHIFT_ARB = 0x201C; + public static final int WGL_WACCUM_BITS_ARB = 0x201D; + public static final int WGL_WACCUM_RED_BITS_ARB = 0x201E; + public static final int WGL_WACCUM_GREEN_BITS_ARB = 0x201F; + public static final int WGL_WACCUM_BLUE_BITS_ARB = 0x2020; + public static final int WGL_WACCUM_ALPHA_BITS_ARB = 0x2021; + public static final int WGL_WDEPTH_BITS_ARB = 0x2022; + public static final int WGL_WSTENCIL_BITS_ARB = 0x2023; + public static final int WGL_WAUX_BUFFERS_ARB = 0x2024; + public static final int WGL_WNO_ACCELERATION_ARB = 0x2025; + public static final int WGL_WGENERIC_ACCELERATION_ARB = 0x2026; + public static final int WGL_WFULL_ACCELERATION_ARB = 0x2027; + public static final int WGL_WSWAP_EXCHANGE_ARB = 0x2028; + public static final int WGL_WSWAP_COPY_ARB = 0x2029; + public static final int WGL_WSWAP_UNDEFINED_ARB = 0x202A; + public static final int WGL_WTYPE_RGBA_ARB = 0x202B; + public static final int WGL_WTYPE_COLORINDEX_ARB = 0x202C; +} diff --git a/src/java/org/lwjgl/opengl/wgl/WGLRenderTexture.java b/src/java/org/lwjgl/opengl/wgl/WGLRenderTexture.java new file mode 100644 index 00000000..cfa2f3dc --- /dev/null +++ b/src/java/org/lwjgl/opengl/wgl/WGLRenderTexture.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * 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. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 16:08:41 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.wgl; + +public interface WGLRenderTexture +{ + public static final int WGL_WBIND_TO_TEXTURE_RGB_ARB = 0x2070; + public static final int WGL_WBIND_TO_TEXTURE_RGBA_ARB = 0x2071; + public static final int WGL_WTEXTURE_FORMAT_ARB = 0x2072; + public static final int WGL_WTEXTURE_TARGET_ARB = 0x2073; + public static final int WGL_WMIPMAP_TEXTURE_ARB = 0x2074; + public static final int WGL_WTEXTURE_RGB_ARB = 0x2075; + public static final int WGL_WTEXTURE_RGBA_ARB = 0x2076; + public static final int WGL_WNO_TEXTURE_ARB = 0x2077; + public static final int WGL_WTEXTURE_CUBE_MAP_ARB = 0x2078; + public static final int WGL_WTEXTURE_1D_ARB = 0x2079; + public static final int WGL_WTEXTURE_2D_ARB = 0x207A; + public static final int WGL_WMIPMAP_LEVEL_ARB = 0x207B; + public static final int WGL_WCUBE_MAP_FACE_ARB = 0x207C; + public static final int WGL_WTEXTURE_CUBE_MAP_POSITIVE_X_ARB = 0x207D; + public static final int WGL_WTEXTURE_CUBE_MAP_NEGATIVE_X_ARB = 0x207E; + public static final int WGL_WTEXTURE_CUBE_MAP_POSITIVE_Y_ARB = 0x207F; + public static final int WGL_WTEXTURE_CUBE_MAP_NEGATIVE_Y_ARB = 0x2080; + public static final int WGL_WTEXTURE_CUBE_MAP_POSITIVE_Z_ARB = 0x2081; + public static final int WGL_WTEXTURE_CUBE_MAP_NEGATIVE_Z_ARB = 0x2082; + public static final int WGL_WFRONT_LEFT_ARB = 0x2083; + public static final int WGL_WFRONT_RIGHT_ARB = 0x2084; + public static final int WGL_WBACK_LEFT_ARB = 0x2085; + public static final int WGL_WBACK_RIGHT_ARB = 0x2086; + public static final int WGL_WAUX0_ARB = 0x2087; + public static final int WGL_WAUX1_ARB = 0x2088; + public static final int WGL_WAUX2_ARB = 0x2089; + public static final int WGL_WAUX3_ARB = 0x208A; + public static final int WGL_WAUX4_ARB = 0x208B; + public static final int WGL_WAUX5_ARB = 0x208C; + public static final int WGL_WAUX6_ARB = 0x208D; + public static final int WGL_WAUX7_ARB = 0x208E; + public static final int WGL_WAUX8_ARB = 0x208F; + public static final int WGL_WAUX9_ARB = 0x2090; + +} diff --git a/src/java/org/lwjgl/test/DisplayConfigurationTest.java b/src/java/org/lwjgl/test/DisplayConfigurationTest.java deleted file mode 100644 index ae94603f..00000000 --- a/src/java/org/lwjgl/test/DisplayConfigurationTest.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Created on 18-03-2003 - * - * To change this generated comment go to - * Window>Preferences>Java>Code Generation>Code Template - */ -package org.lwjgl.test; - -import org.lwjgl.*; - -/** - * @author Elias Naur - */ -public class DisplayConfigurationTest { - private static void changeConfig(float gamma, float brightness, float contrast) { - Display.setDisplayConfiguration(gamma, brightness, contrast); - System.out.println("Configuration changed, gamma = " + gamma + " brightness = " + brightness + " contrast = " + contrast); - try { - Thread.sleep(3000); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public static void main(String[] args) { - 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.println("Test done - Resetting configuration"); - Display.resetDisplayMode(); - } -} diff --git a/src/java/org/lwjgl/test/WindowCreationTest.java b/src/java/org/lwjgl/test/WindowCreationTest.java deleted file mode 100644 index 43308df7..00000000 --- a/src/java/org/lwjgl/test/WindowCreationTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Created on 18-03-2003 - * - * To change this generated comment go to - * Window>Preferences>Java>Code Generation>Code Template - */ -package org.lwjgl.test; - -import org.lwjgl.*; -import org.lwjgl.opengl.Window; - -/** - * @author Brian - */ -public class WindowCreationTest { - - public static void main(String[] args) { - DisplayMode[] modes = Display.getAvailableDisplayModes(); - System.out.println("Found " + modes.length + " display modes"); - - - try { - Window.create("WindowCreationTest", 50, 50, 320, 240, 16, 0, 0, 0); - } catch (Exception e) { - e.printStackTrace(); - } - - System.out.println(Window.getHeight() + ", " + Window.getWidth() + ", " + Window.getTitle()); - - - System.out.println("Display created"); - - while(!Window.isCloseRequested()) { - Window.update(); - try { - Thread.sleep(100); - } catch (Exception e) { - e.printStackTrace(); - } - } - - Window.destroy(); - } -} diff --git a/src/java/org/lwjgl/test/input/ControllerCreationTest.java b/src/java/org/lwjgl/test/input/ControllerCreationTest.java deleted file mode 100644 index 5b34201d..00000000 --- a/src/java/org/lwjgl/test/input/ControllerCreationTest.java +++ /dev/null @@ -1,225 +0,0 @@ -/* - * Copyright (c) 2002 Lightweight Java Game Library Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'Lightweight 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. - */ -package org.lwjgl.test.input; - -import org.lwjgl.Sys; -import org.lwjgl.Display; -import org.lwjgl.DisplayMode; -import org.lwjgl.input.Controller; -import org.lwjgl.opengl.GL; -import org.lwjgl.opengl.Window; -import org.lwjgl.opengl.GLU; -import org.lwjgl.vector.Vector2f; - -/** - * $Id$ - *
- * Controller creation test - * - * @author Brian Matzon - * @version $Revision$ - */ -public class ControllerCreationTest { - /** 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 ControllerCreationTest() { - } - - private void initialize(boolean fullscreen) { - // find first display mode that allows us 640*480*16 - DisplayMode[] modes = Display.getAvailableDisplayModes(); - for (int i = 0; i < modes.length; i++) { - if (modes[i].width == 640 - && modes[i].height == 480 - && modes[i].bpp >= 16) { - displayMode = modes[i]; - break; - } - } - - try { - if(fullscreen) { - Display.setDisplayMode(displayMode); - Window.create("ControllerCreationTest", 16, 0, 0, 0); - } else { - Window.create("ControllerCreationTest", 50, 50, 640, 480, 16, 0, 0, 0); - } - - } catch (Exception e) { - e.printStackTrace(); - System.exit(-1); - } - - initializeOpenGL(); - } - - private void initializeOpenGL() { - GL.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - GLU.gluOrtho2D(0.0, 640, 0, 480); - } - - 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) + ":"); - createController(); - wiggleController(); - destroyController(); - System.out.println(""); - } - - // recreate display in fullscreen mode - System.out.print("Destroying display..."); - Window.destroy(); - System.out.println("success"); - - System.out.print("Entering fullscreen mode..."); - try { - Window.destroy(); - initialize(true); - Display.setDisplayMode(displayMode); - } 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) + ":"); - createController(); - wiggleController(); - destroyController(); - System.out.println(""); - } - - System.out.println("Test completed successfully!"); - System.out.print("Shutting down..."); - Display.resetDisplayMode(); - Controller.destroy(); - Window.destroy(); - System.out.println("shutdown complete"); - } - - private void createController() { - System.out.print("Creating controller..."); - try { - Controller.create(); - } catch (Exception e) { - System.out.println("failed"); - System.exit(-1); - } - System.out.println("success"); - } - - private void wiggleController() { - System.out.print("Please move the controller around"); - - long statustime = Sys.getTime(); - long endtime = Sys.getTime() + Sys.getTimerResolution() * 5; - - while (Sys.getTime() < endtime) { - - Window.update(); - - Controller.poll(); - - //controller is a bit fuzzy - if(Controller.x > 100) { - position.x += 1; - } else if (Controller.x < -100) { - position.x -= 1; - } - if(Controller.y > 100) { - position.y -= 1; - } else if (Controller.y < -100) { - position.y += 1; - } - - render(); - - Window.paint(); - - if (Sys.getTime() - statustime > Sys.getTimerResolution()) { - System.out.print("."); - statustime = Sys.getTime(); - } - } - System.out.println("thank you"); - } - - private void destroyController() { - System.out.print("Destroying controller..."); - Controller.destroy(); - System.out.print("success"); - } - - private void render() { - GL.glClear(GL.GL_COLOR_BUFFER_BIT); - - GL.glPushMatrix(); - GL.glBegin(GL.GL_POLYGON); - { - GL.glColor3f(0.0f, 1.0f, 1.0f); - GL.glVertex2f(position.x + 0.0f, position.y + 0.0f); - - GL.glColor3f(1.0f, 0.0f, 1.0f); - GL.glVertex2f(position.x + 0.0f, position.y + 30.0f); - GL.glVertex2f(position.x + 40.0f, position.y + 30.0f); - - GL.glColor3f(1.0f, 1.0f, 0.0f); - GL.glVertex2f(position.x + 60.0f, position.y + 15.f); - GL.glVertex2f(position.x + 40.0f, position.y + 0.0f); - } - GL.glEnd(); - GL.glPopMatrix(); - } - - /** - * @param args the command line arguments - */ - public static void main(String[] args) { - ControllerCreationTest cct = new ControllerCreationTest(); - cct.executeTest(); - } -} diff --git a/src/java/org/lwjgl/test/input/ControllerTest.java b/src/java/org/lwjgl/test/input/ControllerTest.java deleted file mode 100644 index 42758274..00000000 --- a/src/java/org/lwjgl/test/input/ControllerTest.java +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Copyright (c) 2002 Lightweight Java Game Library Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'Lightweight 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. - */ -package org.lwjgl.test.input; - -import org.lwjgl.DisplayMode; -import org.lwjgl.input.Controller; -import org.lwjgl.input.Keyboard; -import org.lwjgl.opengl.GL; -import org.lwjgl.opengl.Window; -import org.lwjgl.opengl.GLU; -import org.lwjgl.vector.Vector2f; - -/** - * $Id$ - *
- * Controller test - * - * @author Brian Matzon - * @version $Revision$ - */ -public class ControllerTest { - - /** GLU instance */ - private GLU glu; - - /** 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 ControllerTest */ - public ControllerTest() { - } - - private void initialize() { - // create display and opengl - setupDisplay(false); - - try { - Keyboard.create(); - } catch (Exception e) { - e.printStackTrace(); - System.exit(-1); - } - } - - private void setupDisplay(boolean fullscreen) { - try { - Window.create("ControllerTest", 50, 50, 640, 480, 16, 0, 0, 0); - } catch (Exception e) { - e.printStackTrace(); - System.exit(-1); - } - - initializeOpenGL(); - } - - private void initializeOpenGL() { - GL.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - GLU.gluOrtho2D(0.0, 640, 0, 480); - } - - public void executeTest() { - initialize(); - - createController(); - - wiggleController(); - - Controller.destroy(); - Keyboard.destroy(); - Window.destroy(); - } - - private void createController() { - try { - Controller.create(); - } catch (Exception e) { - e.printStackTrace(); - System.exit(-1); - } - } - - private void wiggleController() { - while (!Window.isCloseRequested()) { - Window.update(); - - if(Window.isMinimized()) { - try { - Thread.sleep(100); - } catch (InterruptedException inte) { - inte.printStackTrace(); - } - continue; - } - - Controller.poll(); - Keyboard.poll(); - - if(Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)) { - return; - } - - if (Controller.x > 200) { - position.x += 1; - } - - if (Controller.x < -200) { - position.x -= 1; - } - - if (Controller.y < -200) { - position.y += 1; - } - - if (Controller.y > 200) { - position.y -= 1; - } - - 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(); - - Window.paint(); - } - } - - private void render() { - GL.glClear(GL.GL_COLOR_BUFFER_BIT); - - GL.glBegin(GL.GL_POLYGON); - { - float color = 1.0f; - int buttonDown = 0; - - for(int i=0;i - * @version $Revision$ - */ -public class HWCursorTest { - - /** Intended deiplay mode */ - private DisplayMode mode; - - /** GLU instance */ - private GLU glu; - - /** The native cursor */ - private static Cursor cursor = null; - - /** The mouse cursor position */ - private static int mouse_x; - private static int mouse_y; - - /** - * Executes the test - */ - public void execute() { - initialize(); - - mainLoop(); - - cleanup(); - } - - /** - * Initializes the test - */ - private void initialize() { - try { - //find displaymode - mode = findDisplayMode(800, 600, 16); - - // start of in windowed mode - Window.create("Test", 50, 50, mode.width, mode.height, mode.bpp, 0, 0, 0); - - glInit(); - - Keyboard.create(); - initNativeCursor(); - - } catch (Exception e) { - e.printStackTrace(); - } - } - - private static void initNativeCursor() { - try { - Mouse.create(); - } catch (Exception e) { - e.printStackTrace(); - } - if ((Mouse.getNativeCursorCaps() & Mouse.CURSOR_ONE_BIT_TRANSPARANCY) == 0) { - System.out.println("No HW cursor support!"); - System.exit(0); - } - System.out.println("Maximum native cursor size: " + Mouse.getMaxCursorSize() + ", min size: " + Mouse.getMinCursorSize()); - mouse_x = mouse_y = 0; - int num_images = 3; - int image_size = Mouse.getMaxCursorSize()*Mouse.getMaxCursorSize(); - IntBuffer cursor_images = ByteBuffer.allocateDirect(num_images*image_size*4).order(ByteOrder.nativeOrder()).asIntBuffer(); - IntBuffer delays = ByteBuffer.allocateDirect(num_images*4).order(ByteOrder.nativeOrder()).asIntBuffer(); - delays.put(0, 500); - delays.put(1, 500); - delays.put(2, 500); - int color_scale = 255/Mouse.getMaxCursorSize(); - int bit_mask = 0x81000000; - for (int j = 0; j < image_size; j++) { - if (j % 4 == 0) - bit_mask = (~bit_mask) & 0x81000000; - int color = (j*color_scale/Mouse.getMaxCursorSize()) << 16; - cursor_images.put(0*image_size + j, 0x00000020 | color | bit_mask); - } - for (int j = 0; j < image_size; j++) { - if (j % 4 == 0) - bit_mask = (~bit_mask) & 0x81000000; - int color = (j*color_scale/Mouse.getMaxCursorSize()) << 8; - cursor_images.put(1*image_size + j, 0x00000020 | color | bit_mask); - } - for (int j = 0; j < image_size; j++) { - if (j % 4 == 0) - bit_mask = (~bit_mask) & 0x81000000; - int color = (j*color_scale/Mouse.getMaxCursorSize()); - cursor_images.put(2*image_size + j, 0x00000020 | color | bit_mask); - } - try { - if ((Mouse.getNativeCursorCaps() | Mouse.CURSOR_ANIMATION) == 0) - num_images = 1; - cursor = new Cursor(Mouse.getMaxCursorSize(), Mouse.getMaxCursorSize(), Mouse.getMaxCursorSize()/2, Mouse.getMaxCursorSize()/2, num_images, cursor_images, delays); - Mouse.setNativeCursor(cursor); - } catch (Exception e) { - e.printStackTrace(); - System.exit(1); - } - } - - /** - * Runs the main loop of the "test" - */ - private void mainLoop() { - while (!Keyboard.isKeyDown(Keyboard.KEY_ESCAPE) - && !Window.isCloseRequested()) { - // allow subsystem to get a chance to run too - Window.update(); - - if (!Window.isMinimized()) { - // check keyboard input - processKeyboard(); - - render(); - - // paint window - Window.paint(); - } else { - - // no need to render/paint if nothing has changed (ie. window dragged over) - if (Window.isDirty()) { - render(); - Window.paint(); - } - - // don't waste cpu time, sleep more - try { - Thread.sleep(100); - } catch (InterruptedException inte) { - } - } - } - } - - /** - * Performs the logic - */ - private void render() { - //clear background - GL.glClear(GL.GL_COLOR_BUFFER_BIT); - - // draw white quad - GL.glPushMatrix(); - { - GL.glTranslatef(mouse_x, 600 - mouse_y, 0); - GL.glColor3f(1.0f, 1.0f, 1.0f); - GL.glBegin(GL.GL_QUADS); - { - GL.glVertex2i(-50, -50); - GL.glVertex2i(50, -50); - GL.glVertex2i(50, 50); - GL.glVertex2i(-50, 50); - } - GL.glEnd(); - } - GL.glPopMatrix(); - } - - /** - * Processes keyboard input - */ - private void processKeyboard() { - Keyboard.poll(); - Mouse.poll(); - - if (Mouse.dx != 0 || Mouse.dy != 0) { - mouse_x += Mouse.dx; - mouse_y += Mouse.dy; - System.out.println("mouse_x " + mouse_x + " mouse_y " + mouse_y); - } - - //check for fullscreen key - if (Keyboard.isKeyDown(Keyboard.KEY_F)) { - - try { - Keyboard.destroy(); - try { - Mouse.setNativeCursor(null); - } catch (Exception e) { - e.printStackTrace(); - System.exit(1); - } - cursor.destroy(); - Mouse.destroy(); - Window.destroy(); - - Display.setDisplayMode(mode); - Window.create("Test", mode.bpp, 0, 0, 0); - - glInit(); - - Keyboard.create(); - initNativeCursor(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - //check for window key - if (Keyboard.isKeyDown(Keyboard.KEY_W)) { - try { - Keyboard.destroy(); - try { - Mouse.setNativeCursor(null); - } catch (Exception e) { - e.printStackTrace(); - System.exit(1); - } - cursor.destroy(); - Mouse.destroy(); - Window.destroy(); - - Display.resetDisplayMode(); - Window.create("Test", 50, 50, mode.width, mode.height, mode.bpp, 0, 0, 0); - - glInit(); - - Keyboard.create(); - initNativeCursor(); - } 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)) { - try { - Mouse.setNativeCursor(cursor); - mouse_x = mouse_y = 0; - } catch (Exception e) { - e.printStackTrace(); - } - } - } - - /** - * Cleans up the test - */ - private void cleanup() { - Keyboard.destroy(); - try { - Mouse.setNativeCursor(null); - } catch (Exception e) { - e.printStackTrace(); - System.exit(1); - } - cursor.destroy(); - Mouse.destroy(); - Display.resetDisplayMode(); - Window.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) { - DisplayMode[] modes = Display.getAvailableDisplayModes(); - for (int i = 0; i < modes.length; i++) { - if (modes[i].width == width - && modes[i].height == height - && modes[i].bpp >= bpp) { - return modes[i]; - } - } - return null; - } - - /** - * Initializes OGL - */ - private void glInit() { - // Go into orthographic projection mode. - GL.glMatrixMode(GL.GL_PROJECTION); - GL.glLoadIdentity(); - GLU.gluOrtho2D(0, mode.width, 0, mode.height); - GL.glMatrixMode(GL.GL_MODELVIEW); - GL.glLoadIdentity(); - GL.glViewport(0, 0, mode.width, mode.height); - - //set clear color to black - GL.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - - //sync frame (only works on windows) - GLCaps.determineAvailableExtensions(); - if (GLCaps.WGL_EXT_swap_control) { - GL.wglSwapIntervalEXT(1); - } - } - - /** - * 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."); - System.out.println( - "Move quad using arrowkeys, and change rotation using +/-"); - HWCursorTest cursorTest = new HWCursorTest(); - cursorTest.execute(); - } -} diff --git a/src/java/org/lwjgl/test/input/KeyboardTest.java b/src/java/org/lwjgl/test/input/KeyboardTest.java deleted file mode 100644 index a085cfba..00000000 --- a/src/java/org/lwjgl/test/input/KeyboardTest.java +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Copyright (c) 2002 Lightweight Java Game Library Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'Lightweight 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. - */ -package org.lwjgl.test.input; - -import org.lwjgl.DisplayMode; -import org.lwjgl.input.Keyboard; -import org.lwjgl.opengl.GL; -import org.lwjgl.opengl.Window; -import org.lwjgl.opengl.GLU; -import org.lwjgl.vector.Vector2f; - -/** - * $Id$ - *
- * Keyboard test - * - * @author Brian Matzon - * @version $Revision$ - */ -public class KeyboardTest { - - /** GLU instance */ - private GLU glu; - - /** position of quad to draw */ - private Vector2f position = new Vector2f(320.0f, 240.0f); - - /** Display mode selected */ - private DisplayMode displayMode; - - private boolean bufferedKeyboard; - private boolean translatedKeyboard; - private int bufferSize; - - /** 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); - } - } - - private void setupDisplay(boolean fullscreen) { - try { - Window.create("KeyboardTest", 50, 50, 640, 480, 16, 0, 0, 0); - } catch (Exception e) { - e.printStackTrace(); - System.exit(-1); - } - - initializeOpenGL(); - } - - private void initializeOpenGL() { - GL.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - GLU.gluOrtho2D(0.0, 640, 0, 480); - } - - public void executeTest() { - initialize(); - - createKeyboard(); - - wiggleKeyboard(); - - Keyboard.destroy(); - Window.destroy(); - } - - private void createKeyboard() { - try { - Keyboard.create(); - } catch (Exception e) { - e.printStackTrace(); - System.exit(-1); - } - } - - private void wiggleKeyboard() { - Keyboard.enableBuffer(); - Keyboard.enableTranslation(); - - while (!Window.isCloseRequested()) { - Window.update(); - - if(Window.isMinimized()) { - try { - Thread.sleep(100); - } catch (InterruptedException inte) { - inte.printStackTrace(); - } - continue; - } - - //check keys, buffered - Keyboard.read(); - - int count = Keyboard.getNumKeyboardEvents(); - System.out.println("Read " + count + " events"); - while(Keyboard.next()) { - System.out.println("Checking key:" + Keyboard.getKeyName(Keyboard.key)); - if(Keyboard.key == Keyboard.KEY_ESCAPE) { - return; - } - - if (Keyboard.isKeyDown(Keyboard.KEY_RIGHT)) { - position.x += 1; - } - - if (Keyboard.key == 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(); - - Window.paint(); - - try { - Thread.sleep(0); - } catch (Exception e) { - } - } - } - - private void render() { - GL.glClear(GL.GL_COLOR_BUFFER_BIT); - - GL.glBegin(GL.GL_POLYGON); - { - float color = 1.0f; - int buttonDown = 0; - GL.glColor3f(color, color, color); - - GL.glVertex2f(position.x + 0.0f, position.y + 0.0f); - GL.glVertex2f(position.x + 0.0f, position.y + 30.0f); - GL.glVertex2f(position.x + 40.0f, position.y + 30.0f); - GL.glVertex2f(position.x + 60.0f, position.y + 15.f); - GL.glVertex2f(position.x + 40.0f, position.y + 0.0f); - } - GL.glEnd(); - } - - /** - * @param args the command line arguments - */ - public static void main(String[] args) { - KeyboardTest kt = new KeyboardTest(); - kt.executeTest(); - } -} diff --git a/src/java/org/lwjgl/test/input/MouseCreationTest.java b/src/java/org/lwjgl/test/input/MouseCreationTest.java deleted file mode 100644 index 04d304d2..00000000 --- a/src/java/org/lwjgl/test/input/MouseCreationTest.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Copyright (c) 2002 Lightweight Java Game Library Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'Lightweight 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. - */ -package org.lwjgl.test.input; - -import org.lwjgl.Sys; -import org.lwjgl.Display; -import org.lwjgl.DisplayMode; -import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.GL; -import org.lwjgl.opengl.Window; -import org.lwjgl.opengl.GLU; -import org.lwjgl.vector.Vector2f; - -/** - * $Id$ - *
- * Mouse test - * - * @author Brian Matzon - * @version $Revision$ - */ -public class MouseCreationTest { - /** GLU instance */ - private GLU glu; - - /** 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 MouseCreationTest() { - } - - private void initialize(boolean fullscreen) { - // find first display mode that allows us 640*480*16 - DisplayMode[] modes = Display.getAvailableDisplayModes(); - for (int i = 0; i < modes.length; i++) { - if (modes[i].width == 640 - && modes[i].height == 480 - && modes[i].bpp >= 16) { - displayMode = modes[i]; - break; - } - } - - try { - if(fullscreen) { - Display.setDisplayMode(displayMode); - Window.create("MouseCreationTest", 16, 0, 0, 0); - } else { - Window.create("MouseCreationTest", 50, 50, 640, 480, 16, 0, 0, 0); - } - - } catch (Exception e) { - e.printStackTrace(); - System.exit(-1); - } - - initializeOpenGL(); - } - - private void initializeOpenGL() { - GL.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - GLU.gluOrtho2D(0.0, 640, 0, 480); - } - - 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) + ":"); - createMouse(); - wiggleMouse(); - destroyMouse(); - System.out.println(""); - } - - // recreate display in fullscreen mode - System.out.print("Destroying display..."); - - System.out.println("success"); - - System.out.print("Entering fullscreen mode..."); - try { - Window.destroy(); - initialize(true); - Display.setDisplayMode(displayMode); - } 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) + ":"); - createMouse(); - wiggleMouse(); - destroyMouse(); - System.out.println(""); - } - - System.out.println("Test completed successfully!"); - System.out.print("Shutting down..."); - Display.resetDisplayMode(); - Mouse.destroy(); - Window.destroy(); - System.out.println("shutdown complete"); - } - - private void createMouse() { - System.out.print("Creating mouse..."); - try { - Mouse.create(); - } catch (Exception e) { - System.out.println("failed"); - System.exit(-1); - } - System.out.println("success"); - } - - 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) { - Window.update(); - - Mouse.poll(); - - position.x += Mouse.dx; - position.y -= Mouse.dy; - - 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(); - - Window.paint(); - - if (Sys.getTime() - statustime > Sys.getTimerResolution()) { - System.out.print("."); - statustime = Sys.getTime(); - } - } - System.out.println("thank you"); - } - - private void destroyMouse() { - System.out.print("Destroying mouse..."); - Mouse.destroy(); - System.out.print("success"); - } - - private void render() { - GL.glClear(GL.GL_COLOR_BUFFER_BIT); - - GL.glBegin(GL.GL_POLYGON); - { - float color = 1.0f; - int buttonDown = 0; - - for(int i=0;i - * Mouse test - * - * @author Brian Matzon - * @version $Revision$ - */ -public class MouseTest { - - /** GLU instance */ - private GLU glu; - - /** 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 MouseTest() { - } - - private void initialize() { - // create display and opengl - setupDisplay(false); - - try { - Keyboard.create(); - } catch (Exception e) { - e.printStackTrace(); - System.exit(-1); - } - } - - private void setupDisplay(boolean fullscreen) { - try { - Window.create("MouseTest", 50, 50, 640, 480, 16, 0, 0, 0); - } catch (Exception e) { - e.printStackTrace(); - System.exit(-1); - } - - initializeOpenGL(); - } - - private void initializeOpenGL() { - GL.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - GLU.gluOrtho2D(0.0, 640, 0, 480); - } - - public void executeTest() { - initialize(); - - createMouse(); - - wiggleMouse(); - - Mouse.destroy(); - Keyboard.destroy(); - Window.destroy(); - } - - private void createMouse() { - try { - Mouse.create(); - } catch (Exception e) { - e.printStackTrace(); - System.exit(-1); - } - } - - private void wiggleMouse() { - while (!Window.isCloseRequested()) { - Window.update(); - - if(Window.isMinimized()) { - try { - Thread.sleep(100); - } catch (InterruptedException inte) { - inte.printStackTrace(); - } - continue; - } - - Mouse.poll(); - Keyboard.poll(); - - if(Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)) { - return; - } - - position.x += Mouse.dx; - position.y -= Mouse.dy; - - 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(); - - Window.paint(); - } - } - - private void render() { - GL.glClear(GL.GL_COLOR_BUFFER_BIT); - - GL.glBegin(GL.GL_POLYGON); - { - float color = 1.0f; - int buttonDown = 0; - - for(int i=0;i - * @version $Revision$ - */ -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 = ALC.ALC_NO_ERROR; - - //create attribute list for context creation - IntBuffer buffer = createIntBuffer(7); - - if ((lastError = ALC.alcGetError()) != ALC.ALC_NO_ERROR) { - System.out.println("ALC Error: " + ALC.alcGetString(lastError)); - System.exit(-1); - } - - //query - System.out.println( - "DEFAULT_DEVICE_SPECIFIER: " - + ALC.alcGetString(ALC.ALC_DEFAULT_DEVICE_SPECIFIER)); - System.out.println( - "DEVICE_SPECIFIER: " + ALC.alcGetString(ALC.ALC_DEVICE_SPECIFIER)); - System.out.println("EXTENSIONS: " + ALC.alcGetString(ALC.ALC_EXTENSIONS)); - - //mo query - buffer.rewind(); - buffer.limit(1); - ALC.alcGetInteger(ALC.ALC_MAJOR_VERSION, buffer); - ALC.alcGetInteger(ALC.ALC_MINOR_VERSION, (IntBuffer) buffer.position(1).limit(2)); - - 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: " - + ALC.alcGetEnumValue("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); - } -} \ No newline at end of file diff --git a/src/java/org/lwjgl/test/openal/MovingSoundTest.java b/src/java/org/lwjgl/test/openal/MovingSoundTest.java deleted file mode 100644 index e5d751b7..00000000 --- a/src/java/org/lwjgl/test/openal/MovingSoundTest.java +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Copyright (c) 2002 Lightweight Java Game Library Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * 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. - */ -package org.lwjgl.test.openal; - -import org.lwjgl.openal.AL; -import org.lwjgl.openal.eax.*; -import org.lwjgl.input.Keyboard; -import org.lwjgl.opengl.Window; -import org.lwjgl.vector.Vector3f; - -import java.nio.IntBuffer; - -/** - * $Id$ - * - * This test simulates a listener positioned in the center, and - * a source moving around the listener using the keyboard - * - * @author Brian Matzon - * @version $Revision$ - */ -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 { - Window.create("Moving Sound Test", 100, 100, 320, 240, 32, 0 ,0 ,0); - } catch (Exception e) { - e.printStackTrace(); - } - - - int lastError; - Vector3f sourcePosition = new Vector3f(); - Vector3f listenerPosition = new Vector3f(); - boolean eaxApplied = false; - EAXListenerProperties eaxListenerProp = null; - - //initialize keyboard - try { - Keyboard.create(); - } catch (Exception e) { - e.printStackTrace(); - exit(-1); - } - - //create 1 buffer and 1 source - IntBuffer buffers = createIntBuffer(1); - IntBuffer sources = createIntBuffer(1); - - // al generate buffers and sources - buffers.position(0).limit(1); - AL.alGenBuffers(buffers); - if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { - exit(lastError); - } - - sources.position(0).limit(1); - AL.alGenSources(sources); - if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { - exit(lastError); - } - - //load wave data - WaveData wavefile = WaveData.create(args[0]); - - //copy to buffers - AL.alBufferData( - buffers.get(0), - wavefile.format, - wavefile.data, - wavefile.data.capacity(), - wavefile.samplerate); - if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { - exit(lastError); - } - - //unload file again - wavefile.dispose(); - - //set up source input - AL.alSourcei(sources.get(0), AL.AL_BUFFER, buffers.get(0)); - if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { - exit(lastError); - } - - AL.alSourcef(sources.get(0), AL.AL_REFERENCE_DISTANCE, 1024.0f); - AL.alSourcef(sources.get(0), AL.AL_ROLLOFF_FACTOR, 0.5f); - - //lets loop the sound - AL.alSourcei(sources.get(0), AL.AL_LOOPING, AL.AL_TRUE); - if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { - exit(lastError); - } - - //play source 0 - AL.alSourcePlay(sources.get(0)); - if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { - exit(lastError); - } - - //setup EAX if possible - if (AL.alIsExtensionPresent("EAX")) { - try { - EAX.create(); - eaxListenerProp = new EAXListenerProperties(); - } catch (Exception e) { - } - } - - System.out.println("Move source with arrow keys\nMove listener with right shift and arrowkeys\nEnable EAX effect by pressing e (if available)\nExit with ESC"); - - while(!Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)) { - Window.update(); - - Keyboard.poll(); - if(Keyboard.isKeyDown(Keyboard.KEY_LEFT)) { - if(Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) { - listenerPosition.x -= MOVEMENT; - AL.alListener3f(AL.AL_POSITION, listenerPosition.x, listenerPosition.y, listenerPosition.z); - System.out.println("listenerx: " + listenerPosition.x); - } else { - sourcePosition.x -= MOVEMENT; - AL.alSource3f(sources.get(0), AL.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; - AL.alListener3f(AL.AL_POSITION, listenerPosition.x, listenerPosition.y, listenerPosition.z); - System.out.println("listenerx: " + listenerPosition.x); - } else { - sourcePosition.x += MOVEMENT; - AL.alSource3f(sources.get(0), AL.AL_POSITION, sourcePosition.x, sourcePosition.y, sourcePosition.z); - System.out.println("sourcex: " + sourcePosition.x); - } - } - - if(Keyboard.isKeyDown(Keyboard.KEY_E)) { - if(eaxApplied) { - eaxListenerProp.setEnvironment(EAX.EAX_ENVIRONMENT_GENERIC); - eaxListenerProp.eaxSet(EAXListenerProperties.EAXLISTENER_ENVIRONMENT, 0); - } else { - eaxListenerProp.setEnvironment(EAX.EAX_ENVIRONMENT_HANGAR); - eaxListenerProp.eaxSet(EAXListenerProperties.EAXLISTENER_ENVIRONMENT, 0); - } - eaxApplied = !eaxApplied; - } - - if(Window.isCloseRequested()) { - break; - } - - try { - Thread.sleep(100); - } catch (InterruptedException inte) { - } - } - - //stop source 0 - AL.alSourceStop(sources.get(0)); - if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { - exit(lastError); - } - - //delete buffers and sources - sources.position(0).limit(1); - AL.alDeleteSources(sources); - if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { - exit(lastError); - } - - buffers.position(0).limit(1); - AL.alDeleteBuffers(buffers); - if ((lastError = AL.alGetError()) != AL.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); - } -} diff --git a/src/java/org/lwjgl/test/openal/OpenALCreationTest.java b/src/java/org/lwjgl/test/openal/OpenALCreationTest.java deleted file mode 100644 index 3db9ff64..00000000 --- a/src/java/org/lwjgl/test/openal/OpenALCreationTest.java +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Copyright (c) 2002 Lightweight Java Game Library Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'Lightweight 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. - */ -package org.lwjgl.test.openal; - -import org.lwjgl.openal.AL; - -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.nio.IntBuffer; - -/** - * $Id$ - *
- * Performs a creation test, by creating and destroying OpenAL twice. - * We cannot inherit from BasicTest since it follows another structure. - * - * @author Brian Matzon - * @version $Revision$ - */ -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: " + AL.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); - AL.alGenBuffers(buffers); - if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { - exit(lastError); - } - - sources.position(0).limit(1); - AL.alGenSources(sources); - if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { - exit(lastError); - } - - //load wave data - WaveData wavefile = WaveData.create("Footsteps.wav"); - - //copy to buffers - AL.alBufferData( - buffers.get(0), - wavefile.format, - wavefile.data, - wavefile.data.capacity(), - wavefile.samplerate); - if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { - exit(lastError); - } - - //unload file again - wavefile.dispose(); - - //set up source input - AL.alSourcei(sources.get(0), AL.AL_BUFFER, buffers.get(0)); - if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { - exit(lastError); - } - - //lets loop the sound - AL.alSourcei(sources.get(0), AL.AL_LOOPING, AL.AL_TRUE); - if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { - exit(lastError); - } - - //play source 0 - AL.alSourcePlay(sources.get(0)); - if ((lastError = AL.alGetError()) != AL.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 - AL.alSourceStop(sources.get(0)); - if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { - exit(lastError); - } - - //delete buffers and sources - sources.position(0).limit(1); - AL.alDeleteSources(sources); - if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { - exit(lastError); - } - - buffers.position(0).limit(1); - AL.alDeleteBuffers(buffers); - if ((lastError = AL.alGetError()) != AL.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); - } -} \ 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 deleted file mode 100644 index 4fd42db7..00000000 --- a/src/java/org/lwjgl/test/openal/PlayTest.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (c) 2002 Lightweight Java Game Library Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * 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. - */ -package org.lwjgl.test.openal; - -import org.lwjgl.openal.AL; - -import java.nio.IntBuffer; - -/** - * $Id$ - * - * This is a basic play test - * Yes, over zealous use of getError ;) - * - * @author Brian Matzon - * @version $Revision$ - */ -public class PlayTest extends BasicTest { - - /** - * 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"}; - } - - 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); - AL.alGenBuffers(buffers); - if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { - exit(lastError); - } - - sources.position(0).limit(1); - AL.alGenSources(sources); - if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { - exit(lastError); - } - - //load wave data - WaveData wavefile = WaveData.create(args[0]); - - //copy to buffers - AL.alBufferData(buffers.get(0), wavefile.format, wavefile.data, wavefile.data.capacity(), wavefile.samplerate); - if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { - exit(lastError); - } - - //unload file again - wavefile.dispose(); - - //set up source input - AL.alSourcei(sources.get(0), AL.AL_BUFFER, buffers.get(0)); - if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { - exit(lastError); - } - - //lets loop the sound - AL.alSourcei(sources.get(0), AL.AL_LOOPING, AL.AL_TRUE); - if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { - exit(lastError); - } - - //play source 0 - AL.alSourcePlay(sources.get(0)); - if((lastError = AL.alGetError()) != AL.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 - AL.alSourceStop(sources.get(0)); - if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { - exit(lastError); - } - - //delete buffers and sources - sources.position(0).limit(1); - AL.alDeleteSources(sources); - if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { - exit(lastError); - } - - buffers.position(0).limit(1); - AL.alDeleteBuffers(buffers); - if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { - exit(lastError); - } - - //no errorchecking from now on, since our context is gone. - //shutdown - alExit(); - } - - /** - * main entry point - * - * @param args String array containing arguments - */ - public static void main(String[] args) { - PlayTest playTest = new PlayTest(); - playTest.execute(args); - } -} \ No newline at end of file diff --git a/src/java/org/lwjgl/test/openal/PlayTestMemory.java b/src/java/org/lwjgl/test/openal/PlayTestMemory.java deleted file mode 100644 index f20274a2..00000000 --- a/src/java/org/lwjgl/test/openal/PlayTestMemory.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Copyright (c) 2002 Lightweight Java Game Library Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * 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. - */ -package org.lwjgl.test.openal; - -import org.lwjgl.openal.AL; - -import java.io.BufferedInputStream; -import java.io.ByteArrayOutputStream; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.nio.IntBuffer; - -/** - * $Id$ - * - * This is a basic play test - * Yes, over zealous use of getError ;) - * - * @author Brian Matzon - * @version $Revision$ - */ -public class PlayTestMemory extends BasicTest { - - /** - * 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"}; - } - - 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); - AL.alGenBuffers(buffers); - if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { - exit(lastError); - } - - sources.position(0).limit(1); - AL.alGenSources(sources); - if((lastError = AL.alGetError()) != AL.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); - } - - //ALUTLoadWAVData file = alut.loadWAVMemory(Sys.getDirectBufferAddress(filebuffer)); - WaveData wavefile = WaveData.create(filebuffer.array()); - - - //copy to buffers - AL.alBufferData(buffers.get(0), wavefile.format, wavefile.data, wavefile.data.capacity(), wavefile.samplerate); - if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { - exit(lastError); - } - - //unload file again - wavefile.dispose(); - - //set up source input - AL.alSourcei(sources.get(0), AL.AL_BUFFER, buffers.get(0)); - if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { - exit(lastError); - } - - //lets loop the sound - AL.alSourcei(sources.get(0), AL.AL_LOOPING, AL.AL_TRUE); - if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { - exit(lastError); - } - - //play source 0 - AL.alSourcePlay(sources.get(0)); - if((lastError = AL.alGetError()) != AL.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 - AL.alSourceStop(sources.get(0)); - if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { - exit(lastError); - } - - //delete buffers and sources - sources.position(0).limit(1); - AL.alDeleteSources(sources); - if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { - exit(lastError); - } - - buffers.position(0).limit(1); - AL.alDeleteBuffers(buffers); - if((lastError = AL.alGetError()) != AL.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(); - - buffer = ByteBuffer.allocate(baos.size()); - buffer.order(ByteOrder.nativeOrder()); - buffer.put(baos.toByteArray()); - } 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); - } -} \ No newline at end of file diff --git a/src/java/org/lwjgl/test/openal/SourceLimitTest.java b/src/java/org/lwjgl/test/openal/SourceLimitTest.java deleted file mode 100644 index 140059da..00000000 --- a/src/java/org/lwjgl/test/openal/SourceLimitTest.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright (c) 2002 Lightweight Java Game Library Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * 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. - */ -package org.lwjgl.test.openal; - -import org.lwjgl.openal.AL; -import org.lwjgl.openal.OpenALException; - -import java.nio.IntBuffer; - -/** - * $Id$ - * - * Simple test for testing the number of available sources - * - * @author Brian Matzon - * @version $Revision$ - */ -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) { - } - - - System.out.print("Creating " + sourcesToCreate + " one at a time..."); - try { - CreateSourcesStep(); - } catch(Exception e) { - } - //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 = createIntBuffer(sourcesToCreate); - - //Create sourcesToCreate sources in one fell swoop - sources.position(0).limit(sourcesToCreate); - AL.alGenSources(sources); - if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { - System.out.println("failed to create " + sourcesToCreate + " sources (" + AL.alGetString(lastError) + ")"); - return; - } - - //delete sources - sources.position(0).limit(sourcesToCreate); - AL.alDeleteSources(sources); - - System.out.println("created " + sourcesToCreate + " sources successfully!"); - } - - /** - * 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 - for (int i = 0; i <= sourcesToCreate; i++) { - sources[i] = createIntBuffer(1); - sources[i].position(0).limit(1); - AL.alGenSources(sources[i]); - if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { - System.out.println("failed to create source: " + (i + 1)); - break; - } - sourcesCreated++; - } - - //delete allocated sources - for (int i = 0; i < sourcesCreated; i++) { - //delete buffers and sources - sources[i].position(0).limit(1); - AL.alDeleteSources(sources[i]); - if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { - System.out.println("failed to delete source: " + i + "(" + AL.alGetString(lastError) + ")"); - break; - } - } - - 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); - } -} \ No newline at end of file diff --git a/src/java/org/lwjgl/test/openal/StressTest.java b/src/java/org/lwjgl/test/openal/StressTest.java deleted file mode 100644 index 6fe8ccc2..00000000 --- a/src/java/org/lwjgl/test/openal/StressTest.java +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Copyright (c) 2002 Lightweight Java Game Library Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * 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. - */ -package org.lwjgl.test.openal; - -import org.lwjgl.openal.AL; -import java.nio.IntBuffer; - -/** - * $Id$ - * - * Simple test for stresstesting OpenAL playing random samples ad nausea - * - * @author Brian Matzon - * @version $Revision$ - */ -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 = createIntBuffer(4); - sources.position(0).limit(4); - AL.alGenSources(sources); - if (AL.alGetError() != AL.AL_NO_ERROR) { - System.out.println("Unable to create 4 sources"); - alExit(); - } - } - - private void createBuffers() { - buffers = createIntBuffer(10); - buffers.position(0).limit(10); - AL.alGenBuffers(buffers); - if (AL.alGetError() != AL.AL_NO_ERROR) { - System.out.println("Unable to create 10 buffers"); - sources.position(0).limit(4); - AL.alDeleteSources(sources); - alExit(); - } - } - - private void loadSamples() throws Exception { - AL.alGetError(); - WaveData data = WaveData.create("ding.wav"); - for (int i = 1; i <= 10; i++) { - AL.alBufferData( - buffers.get(i - 1), - data.format, - data.data, - data.data.capacity(), - data.samplerate); - - if (AL.alGetError() != AL.AL_NO_ERROR) { - System.out.println("Failed to load " + i + ".wav into buffer"); - sources.position(0).limit(4); - AL.alDeleteSources(sources); - buffers.position(0).limit(10); - AL.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 - AL.alSourcei(sources.get(0), AL.AL_LOOPING, AL.AL_TRUE); - - //play background - AL.alSourcei(sources.get(0), AL.AL_BUFFER, buffers.get(0)); - AL.alSourcePlay(sources.get(0)); - - while (System.currentTimeMillis() - startTime < (2000)) { - - randomBuffer = getRandomBuffer(); - System.out.println("random:" + randomBuffer); - - //stop source at slot - AL.alSourceStop(sources.get(nextSlot)); - if (AL.alGetError() != AL.AL_NO_ERROR) { - System.out.println("Error stopping source."); - } - System.out.println("Stopped source: " + nextSlot); - - //link source<->buffer - AL.alSourcei(sources.get(nextSlot), AL.AL_BUFFER, buffers.get(randomBuffer)); - if (AL.alGetError() != AL.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); - AL.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++) { - AL.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.in.read(); - } catch (Exception e) { - } - - sources.position(0).limit(4); - AL.alDeleteSources(sources); - buffers.position(0).limit(10); - AL.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); - } -} \ No newline at end of file diff --git a/src/java/org/lwjgl/test/openal/WaveData.java b/src/java/org/lwjgl/test/openal/WaveData.java deleted file mode 100644 index 53b5e17f..00000000 --- a/src/java/org/lwjgl/test/openal/WaveData.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright (c) 2002 Lightweight Java Game Library Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * 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. - */ -package org.lwjgl.test.openal; - -import org.lwjgl.openal.AL; - -import java.nio.ByteBuffer; - -import javax.sound.sampled.AudioInputStream; -import javax.sound.sampled.AudioSystem; -import javax.sound.sampled.*; - -import java.io.BufferedInputStream; -import java.io.ByteArrayInputStream; -import java.io.IOException; - -/** - * $Id$ - * - * Utitlity class for loading wavefiles. - * - * @author Brian Matzon - * @version $Revision$ - */ -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 filename - * - * @param filepath path to file (relative, and in classpath) - * @return WaveData containing data, or null if a failure occured - */ - public static WaveData create(String filepath) { - try { - return create( - AudioSystem.getAudioInputStream( - new BufferedInputStream(WaveData.class.getClassLoader().getResourceAsStream(filepath)))); - } catch (Exception e) { - e.printStackTrace(); - 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) { - e.printStackTrace(); - 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 = AL.AL_FORMAT_MONO8; - } else if (audioformat.getSampleSizeInBits() == 16) { - channels = AL.AL_FORMAT_MONO16; - } else { - assert false : "Illegal sample size"; - } - } else if (audioformat.getChannels() == 2) { - if (audioformat.getSampleSizeInBits() == 8) { - channels = AL.AL_FORMAT_STEREO8; - } else if (audioformat.getSampleSizeInBits() == 16) { - channels = AL.AL_FORMAT_STEREO16; - } else { - assert false : "Illegal sample size"; - } - } else { - assert false : "Only mono or stereo is supported"; - } - - //read data into buffer - byte[] buf = - new byte[audioformat.getChannels() - * (int) ais.getFrameLength() - * audioformat.getSampleSizeInBits() - / 8]; - int read = 0, total = 0; - try { - while ((read = ais.read(buf, total, buf.length - total)) != -1 - && total < buf.length) { - total += read; - } - } catch (IOException ioe) { - return null; - } - - //insert data into bytebuffer - ByteBuffer buffer = ByteBuffer.allocateDirect(buf.length); - buffer.put(buf); - buffer.rewind(); - - //create our result - WaveData wavedata = - new WaveData(buffer, channels, (int) audioformat.getSampleRate()); - - //close stream - try { - ais.close(); - } catch (IOException ioe) { - } - - return wavedata; - } -} \ No newline at end of file diff --git a/src/java/org/lwjgl/test/opengl/FullScreenWindowedTest.java b/src/java/org/lwjgl/test/opengl/FullScreenWindowedTest.java deleted file mode 100644 index 2ba18607..00000000 --- a/src/java/org/lwjgl/test/opengl/FullScreenWindowedTest.java +++ /dev/null @@ -1,335 +0,0 @@ -/* - * Copyright (c) 2003 Lightweight Java Game Library Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'Lightweight 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. - */ -package org.lwjgl.test.opengl; - -import org.lwjgl.*; -import org.lwjgl.input.*; -import org.lwjgl.opengl.*; -import org.lwjgl.vector.Vector2f; - -/** - * $Id$ - * - * Tests switching between windowed and fullscreen - * - * @author Brian Matzon - * @version $Revision$ - */ -public class FullScreenWindowedTest { - - /** Intended deiplay mode */ - private DisplayMode mode; - - /** GLU instance */ - private GLU glu; - - /** 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(); - } - - /** - * Initializes the test - */ - private void initialize() { - try { - //find displaymode - mode = findDisplayMode(800, 600, 16); - - // start of in windowed mode - Window.create("Test", 50, 50, mode.width, mode.height, mode.bpp, 0, 0, 0); - - glInit(); - - 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) - && !Window.isCloseRequested()) { - // allow subsystem to get a chance to run too - Window.update(); - - if (!Window.isMinimized()) { - // check keyboard input - processKeyboard(); - - // do "game" logic, and render it - logic(); - render(); - - // paint window - Window.paint(); - } else { - - // no need to render/paint if nothing has changed (ie. window dragged over) - if (Window.isDirty()) { - render(); - Window.paint(); - } - - // don't waste cpu time, sleep more - try { - Thread.sleep(100); - } catch (InterruptedException inte) { - } - } - } - } - - /** - * 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.width || quadPosition.x - 50 <= 0) { - quadVelocity.x *= -1; - } - - //check collision with horizontal border - if (quadPosition.y + 50 >= mode.height || quadPosition.y - 50 <= 0) { - quadVelocity.y *= -1; - } - } - - private void render() { - //clear background - GL.glClear(GL.GL_COLOR_BUFFER_BIT); - - // draw white quad - GL.glPushMatrix(); - { - GL.glTranslatef(quadPosition.x, quadPosition.y, 0); - GL.glRotatef(angle, 0.0f, 0.0f, 1.0f); - GL.glColor3f(1.0f, 1.0f, 1.0f); - GL.glBegin(GL.GL_QUADS); - { - GL.glVertex2i(-50, -50); - GL.glVertex2i(50, -50); - GL.glVertex2i(50, 50); - GL.glVertex2i(-50, 50); - } - GL.glEnd(); - } - GL.glPopMatrix(); - } - - /** - * Processes keyboard input - */ - private void processKeyboard() { - Keyboard.poll(); - - //check for fullscreen key - if (Keyboard.isKeyDown(Keyboard.KEY_F)) { - - try { - Keyboard.destroy(); - Window.destroy(); - - Display.setDisplayMode(mode); - Window.create("Test", mode.bpp, 0, 0, 0); - - glInit(); - - Keyboard.create(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - //check for window key - if (Keyboard.isKeyDown(Keyboard.KEY_W)) { - try { - Keyboard.destroy(); - Window.destroy(); - - Display.resetDisplayMode(); - Window.create("Test", 50, 50, mode.width, mode.height, mode.bpp, 0, 0, 0); - - glInit(); - - Keyboard.create(); - } 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() { - Keyboard.destroy(); - Window.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) { - DisplayMode[] modes = Display.getAvailableDisplayModes(); - for (int i = 0; i < modes.length; i++) { - if (modes[i].width == width - && modes[i].height == height - && modes[i].bpp >= bpp) { - return modes[i]; - } - } - return null; - } - - /** - * Initializes OGL - */ - private void glInit() { - // Go into orthographic projection mode. - GL.glMatrixMode(GL.GL_PROJECTION); - GL.glLoadIdentity(); - GLU.gluOrtho2D(0, mode.width, 0, mode.height); - GL.glMatrixMode(GL.GL_MODELVIEW); - GL.glLoadIdentity(); - GL.glViewport(0, 0, mode.width, mode.height); - - //set clear color to black - GL.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - - //sync frame (only works on windows) - GLCaps.determineAvailableExtensions(); - if (GLCaps.WGL_EXT_swap_control) { - GL.wglSwapIntervalEXT(1); - } - } - - /** - * 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(); - } -} diff --git a/src/java/org/lwjgl/test/opengl/Game.java b/src/java/org/lwjgl/test/opengl/Game.java deleted file mode 100644 index 20598f63..00000000 --- a/src/java/org/lwjgl/test/opengl/Game.java +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Copyright (c) 2002 Lightweight Java Game Library Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * 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. - */ - -/** - * $Id$ - * - * Simple java test program. - * - * @author elias_naur - * @version $Revision$ - */ - -package org.lwjgl.test.opengl; - -import org.lwjgl.*; -import org.lwjgl.opengl.*; -import org.lwjgl.input.*; - -import java.nio.*; - -public final class Game { - 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].width == 640 - && modes[i].height == 480 - && modes[i].bpp >= 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 { - Window.create("LWJGL Game Example", 16, 0, 0,0); - 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; - - /** - * No construction allowed - */ - private Game() { - } - - public static void main(String[] arguments) { - try { - init(); - while (!finished) { - Window.update(); - - if (Window.isMinimized()) - Thread.sleep(200); - else if (Window.isCloseRequested()) - System.exit(0); - - Keyboard.poll(); - mainLoop(); - render(); - Window.paint(); - } - } catch (Throwable t) { - t.printStackTrace(); - } finally { - cleanup(); - } - } - - /** - * All calculations are done in here - */ - private static void mainLoop() { - angle += 1f; - if (angle > 360.0f) - angle = 0.0f; - - Mouse.poll(); - if (Mouse.dx != 0 || Mouse.dy != 0 || Mouse.dwheel != 0) - System.out.println("Mouse moved " + Mouse.dx + " " + Mouse.dy + " " + Mouse.dwheel); - for (int i = 0; i < Mouse.buttonCount; i++) - if (Mouse.isButtonDown(i)) - System.out.println("Button " + i + " down"); -/* Keyboard.poll(); - if (Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)) - finished = true;*/ - Keyboard.read(); - for (int i = 0; i < Keyboard.getNumKeyboardEvents(); i++) { - Keyboard.next(); - if (Keyboard.key == Keyboard.KEY_ESCAPE && Keyboard.state) - finished = true; - if (Keyboard.key == Keyboard.KEY_T && Keyboard.state) - System.out.println("Current time: " + Sys.getTime()); - } - } - - /** - * All rendering is done in here - */ - private static void render() { - GL.glClear(GL.GL_COLOR_BUFFER_BIT); - GL.glPushMatrix(); - GL.glTranslatef(Display.getWidth() / 2, Display.getHeight() / 2, 0.0f); - GL.glRotatef(angle, 0, 0, 1.0f); - GL.glBegin(GL.GL_QUADS); - GL.glVertex2i(-50, -50); - GL.glVertex2i(50, -50); - GL.glVertex2i(50, 50); - GL.glVertex2i(-50, 50); - GL.glEnd(); - GL.glPopMatrix(); - } - - /** - * Initialize - */ - private static void init() throws Exception { - Keyboard.create(); - Keyboard.enableBuffer(); - Mouse.create(); - Sys.setTime(0); - Sys.setProcessPriority(Sys.HIGH_PRIORITY); - System.out.println("Timer resolution: " + Sys.getTimerResolution()); - // Go into orthographic projection mode. - GL.glMatrixMode(GL.GL_PROJECTION); - GL.glLoadIdentity(); - GLU.gluOrtho2D(0, Display.getWidth(), 0, Display.getHeight()); - GL.glMatrixMode(GL.GL_MODELVIEW); - GL.glLoadIdentity(); - GL.glViewport(0, 0, Display.getWidth(), Display.getHeight()); - ByteBuffer num_tex_units_buf = ByteBuffer.allocateDirect(4); - num_tex_units_buf.order(ByteOrder.nativeOrder()); - GL.glGetInteger(GL.GL_MAX_TEXTURE_UNITS_ARB, num_tex_units_buf.asIntBuffer()); - System.out.println("Number of texture units: " + num_tex_units_buf.getInt()); - // Fix the refresh rate to the display frequency. -// GL.wglSwapIntervalEXT(1); - } - - /** - * Cleanup - */ - private static void cleanup() { - Keyboard.destroy(); - Mouse.destroy(); - Window.destroy(); - try { - Display.resetDisplayMode(); - } catch (Exception e) { - e.printStackTrace(); - } - } - } diff --git a/src/java/org/lwjgl/test/opengl/Grass.java b/src/java/org/lwjgl/test/opengl/Grass.java deleted file mode 100644 index 77880a7f..00000000 --- a/src/java/org/lwjgl/test/opengl/Grass.java +++ /dev/null @@ -1,466 +0,0 @@ -/* - * Copyright (c) 2002 Lightweight Java Game Library Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * 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. - */ - -/** - * $Id$ - * - * Simple java test program. - * - * @author elias_naur - * @version $Revision$ - */ - -package org.lwjgl.test.opengl; - -import org.lwjgl.input.*; -import org.lwjgl.opengl.*; -import org.lwjgl.*; - -import java.io.*; -import java.nio.*; -import java.util.*; - -public class Grass { - - static class Aslod { - float angle; - float value; - float ripple; - float count; - } - private static boolean finished = false; - private static Random rand = new Random(); - - static { - try { - int mode = -1; - DisplayMode[] modes = Display.getAvailableDisplayModes(); - for (int i = 0; i < modes.length; i++) { - if (modes[i].width == 640 - && modes[i].height == 480 - && modes[i].bpp >= 16) { - mode = i; - break; - } - } - - if (mode == -1) { - System.out.println("did not find suitable mode"); - } else { - System.out.println("Display mode: " + modes[mode]); - } - // For now let's just pick a mode we're certain to have - - Display.setDisplayMode(modes[mode]); - System.out.println("Created display."); - } catch (Exception e) { - e.printStackTrace(); - System.exit(1); - } - } - - static { - try { - Window.create("LWJGL Grass", 50, 50, 640, 480, 16, 0, 0,0); - Keyboard.create(); - Keyboard.enableBuffer(); - Mouse.create(); - System.out.println("Created OpenGL."); - } catch (Exception e) { - System.err.println("Failed to create OpenGL due to " + e); - System.exit(1); - } - - } - - private static Aslod aslod = new Aslod(); - - private static int mesh; - private static int program_handle; - - private static byte[] loadFile(String file) { - int next; - java.util.Vector bytes = new java.util.Vector(); - try { - ClassLoader loader = Grass.class.getClassLoader(); - InputStream stream = new BufferedInputStream(loader.getResourceAsStream(file)); - while ((next = (stream.read())) != -1) - bytes.add(new Byte((byte) next)); - stream.close(); - byte[] result = new byte[bytes.size()]; - for (int i = 0; i < result.length; i++) - result[i] = ((Byte) bytes.get(i)).byteValue(); - return result; - } catch (Exception e) { - e.printStackTrace(); - } - return null; - } - - public static void main(String[] args) { - ByteBuffer byte_buf = ByteBuffer.allocateDirect(4); - byte_buf.order(ByteOrder.nativeOrder()); - GLCaps.determineAvailableExtensions(); - System.out.println("Vertex program supported: " + GLCaps.GL_NV_vertex_program); - GL.glGenProgramsNV(byte_buf.asIntBuffer()); - IntBuffer int_buf = byte_buf.asIntBuffer(); - if (int_buf.get(0) == 0) - throw new RuntimeException("Could not allocate new vertex program id!"); - - program_handle = int_buf.get(0); - byte[] program = loadFile("cg_grass2.vp"); - ByteBuffer program_buf = ByteBuffer.allocateDirect(program.length); - program_buf.order(ByteOrder.nativeOrder()); - program_buf.rewind(); - program_buf.put(program); - program_buf.rewind(); - GL.glLoadProgramNV( - GL.GL_VERTEX_PROGRAM_NV, - program_handle, - program_buf); - /*GL.glGetInteger(GL.PROGRAM_ERROR_POSITION_NV, int_buf); - System.out.println("error position: " + int_buf.get(0));*/ - - genMesh(); - - float[] LightDiffuse = { 1.0f, 0.0f, 0.0f, 1.0f }; - float[] LightPosition = { 1.0f, 1.0f, 1.0f, 0.0f }; - ByteBuffer light_buf = ByteBuffer.allocateDirect(4 * 4); - light_buf.order(ByteOrder.nativeOrder()); - FloatBuffer light_buf_f = light_buf.asFloatBuffer(); - light_buf_f.rewind(); - light_buf_f.put(LightDiffuse); - - GL.glLightfv( - GL.GL_LIGHT0, - GL.GL_DIFFUSE, - light_buf_f); - light_buf_f.rewind(); - light_buf_f.put(LightPosition); - GL.glLightfv( - GL.GL_LIGHT0, - GL.GL_POSITION, - light_buf_f); - GL.glEnable(GL.GL_LIGHT0); - GL.glEnable(GL.GL_LIGHTING); - GL.glEnable(GL.GL_DEPTH_TEST); - GL.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA); - GL.glEnable(GL.GL_BLEND); - GL.glMatrixMode(GL.GL_PROJECTION); - GLU.gluPerspective(40.0, 1.0, 1.0, 50.0); - GL.glMatrixMode(GL.GL_MODELVIEW); - - GLU.gluLookAt(14.0, 10.0, -16.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0); - - aslod.angle = 2.6179935f; - aslod.value = 0.2f; - aslod.ripple = 0.0f; - aslod.count = 0.0f; - - while (!finished) { - keyPoll(); - float degree = (1.0f + (aslod.value * 20.0f)) * 0.01745329f; - - degree *= (0.5 + myrand()); - - ptrAnimate(degree); - GL.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); - - //ptrDraw(); - - grsDraw(); - - Window.paint(); - } - Mouse.destroy(); - Keyboard.destroy(); - Window.destroy(); - } - - private static float myrand() { - // returns a value between 0 and 1 - return rand.nextFloat(); - } - - private static void genGrass( - float fFaceHeight, - float fFaceWidth, - float fX, - float fZ) { - int cFaces; - int numFaces; - float cWidth; - float fDecWidth, frndWidth, frndHeight; - float fRotate; - float fRigid; - - numFaces = 5; - frndHeight = - fFaceHeight - + ((fFaceHeight / 1.5f) - * (float) java.lang.Math.cos( - java.lang.Math.abs(rand.nextInt()))); - frndWidth = - fFaceWidth - + ((fFaceWidth / 4.0f) - * (float) java.lang.Math.cos( - java.lang.Math.abs(rand.nextInt()))); - fDecWidth = frndWidth / 5.0f; - fRotate = myrand() * 3.1415f; - fRigid = ((fRigid = myrand()) < 0.2f) ? 0.2f : fRigid; - - if (myrand() < 0.3) - GL.glBegin(GL.GL_LINE_STRIP); - else - GL.glBegin(GL.GL_QUAD_STRIP); - - for (cFaces = 0; cFaces < numFaces; cFaces++) { - for (cWidth = frndWidth; - cWidth >= -frndWidth; - cWidth -= (frndWidth * 2.0f)) { - GL.glColor4f(fX, fRigid, fZ, (float) cFaces / (float) numFaces); - GL.glVertex3f( - (float) (((cFaces - 2) * 0.1f) - * java.lang.Math.cos(fRotate) - + (cWidth) * java.lang.Math.sin(fRotate)), - cFaces * frndHeight, - - (float) - (((cFaces - 2) * 0.1f) * java.lang.Math.sin(fRotate) - + (cWidth) * java.lang.Math.cos(fRotate))); - } - frndWidth -= fDecWidth; - } - GL.glEnd(); - - } - - private static void genMesh() { - float cI, cJ, fArea; - - fArea = 20.0f; - mesh = GL.glGenLists(1); - GL.glNewList(mesh, GL.GL_COMPILE); - for (cI = -fArea / 2; cI < fArea / 2; cI += 0.25f) { - for (cJ = -fArea / 2; cJ < fArea / 2; cJ += 0.25f) { - genGrass(0.5f, 0.1f, cI, cJ); - } - } - GL.glEndList(); - } - - private static void grsDraw() { - GL.glEnable(GL.GL_VERTEX_PROGRAM_NV); - GL.glBindProgramNV(GL.GL_VERTEX_PROGRAM_NV, program_handle); - GL.glTrackMatrixNV( - GL.GL_VERTEX_PROGRAM_NV, - 0, - GL.GL_MODELVIEW_PROJECTION_NV, - GL.GL_IDENTITY_NV); - - GL.glProgramParameter4fNV( - GL.GL_VERTEX_PROGRAM_NV, - 4, - 0.0f, - 0.0f, - 0.0f, - 0.0f); - GL.glProgramParameter4fNV( - GL.GL_VERTEX_PROGRAM_NV, - 5, - 0.0f, - 0.0f, - 0.0f, - 0.0f); - GL.glProgramParameter4fNV( - GL.GL_VERTEX_PROGRAM_NV, - 6, - 1.763609f, - 0.496495f, - 0.0f, - 0.0f); - GL.glProgramParameter4fNV( - GL.GL_VERTEX_PROGRAM_NV, - 7, - -0.943599f, - 3.203737f, - 0.0f, - 0.0f); - GL.glProgramParameter4fNV( - GL.GL_VERTEX_PROGRAM_NV, - 8, - 4.101107f, - 0.943413f, - 0.0f, - 0.0f); - GL.glProgramParameter4fNV( - GL.GL_VERTEX_PROGRAM_NV, - 9, - -1.218603f, - 6.259399f, - 0.0f, - 0.0f); - GL.glProgramParameter4fNV( - GL.GL_VERTEX_PROGRAM_NV, - 10, - 7.214299f, - 1.352961f, - 0.0f, - 0.0f); - GL.glProgramParameter4fNV( - GL.GL_VERTEX_PROGRAM_NV, - 11, - -1.540748f, - 10.080958f, - 0.0f, - 0.0f); - GL.glProgramParameter4fNV( - GL.GL_VERTEX_PROGRAM_NV, - 12, - 10.880035f, - 1.759046f, - 0.0f, - 0.0f); - GL.glProgramParameter4fNV( - GL.GL_VERTEX_PROGRAM_NV, - 13, - -1.852705f, - 14.468674f, - 0.0f, - 0.0f); - GL.glProgramParameter4fNV( - GL.GL_VERTEX_PROGRAM_NV, - 14, - 14.292879f, - 1.973329f, - 0.0f, - 0.0f); - GL.glProgramParameter4fNV( - GL.GL_VERTEX_PROGRAM_NV, - 15, - -1.973387f, - 18.506531f, - 0.0f, - 0.0f); - GL.glProgramParameter4fNV( - GL.GL_VERTEX_PROGRAM_NV, - 16, - (float) (java.lang.Math.sin(aslod.angle) - * (aslod.value + aslod.ripple)), - 0.0f, - (float) (java.lang.Math.cos(aslod.angle) - * (aslod.value + aslod.ripple)), - 0.0f); - - GL.glProgramParameter4fNV(GL.GL_VERTEX_PROGRAM_NV, 17, 1.7f, 5f, 2f, 0f); - GL.glProgramParameter4fNV( - GL.GL_VERTEX_PROGRAM_NV, - 18, - -0.0187293f, - 0.074261f, - 0.2121144f, - 1.570729f); - GL.glProgramParameter4fNV(GL.GL_VERTEX_PROGRAM_NV, 20, 0f, 0.5f, 1f, 0f); - GL.glProgramParameter4fNV( - GL.GL_VERTEX_PROGRAM_NV, - 21, - 0.25f, - -9f, - 0.75f, - 0.1591549f); - GL.glProgramParameter4fNV( - GL.GL_VERTEX_PROGRAM_NV, - 22, - 24.9808f, - -24.9808f, - -60.14581f, - 60.14581f); - GL.glProgramParameter4fNV( - GL.GL_VERTEX_PROGRAM_NV, - 23, - 85.45379f, - -85.45379f, - -64.93935f, - 64.93935f); - GL.glProgramParameter4fNV( - GL.GL_VERTEX_PROGRAM_NV, - 24, - 19.73921f, - -19.73921f, - -1f, - 1f); - GL.glProgramParameter4fNV(GL.GL_VERTEX_PROGRAM_NV, 25, 0f, 4f, 0f, 0f); - GL.glProgramParameter4fNV( - GL.GL_VERTEX_PROGRAM_NV, - 19, - 1f, - 3.141593f, - 0.5f, - 1f); - GL.glProgramParameter4fNV(GL.GL_VERTEX_PROGRAM_NV, 26, 0.7f, 0.4f, 0f, 0f); - GL.glCallList(mesh); - GL.glDisable(GL.GL_VERTEX_PROGRAM_NV); - - } - - private static void ptrAnimate(float degree) { - aslod.count += degree; - aslod.ripple = (float) (java.lang.Math.cos(aslod.count) / 80.0); - - } - - private static void keyPoll() { - Keyboard.read(); - for (int i = 0; i < Keyboard.getNumKeyboardEvents(); i++) { - Keyboard.next(); - if (!Keyboard.state) - continue; - switch (Keyboard.key) { - case Keyboard.KEY_A : - aslod.angle += 0.1; - break; - case Keyboard.KEY_D : - aslod.angle -= 0.1; - break; - case Keyboard.KEY_W : - aslod.value += (aslod.value >= 0.15) ? 0.0 : 0.0025; - break; - case Keyboard.KEY_S : - aslod.value -= (aslod.value <= 0.005) ? 0.0 : 0.0025; - break; - case Keyboard.KEY_ESCAPE : - finished = true; - break; - } - } - } - -} diff --git a/src/java/org/lwjgl/test/opengl/PbufferTest.java b/src/java/org/lwjgl/test/opengl/PbufferTest.java deleted file mode 100644 index 63d26833..00000000 --- a/src/java/org/lwjgl/test/opengl/PbufferTest.java +++ /dev/null @@ -1,417 +0,0 @@ -/* - * Copyright (c) 2003 Lightweight Java Game Library Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'Lightweight 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. - */ -package org.lwjgl.test.opengl; - -import org.lwjgl.*; -import org.lwjgl.input.*; -import org.lwjgl.opengl.*; -import org.lwjgl.vector.Vector2f; - -import java.nio.*; - -/** - * $Id$ - * - * Tests Pbuffers - * - * @author elias_naur - * @version $Revision$ - */ -public class PbufferTest { - - /** Intended deiplay mode */ - private DisplayMode mode; - - /** GLU instance */ - private GLU glu; - - /** 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 - mode = findDisplayMode(800, 600, 16); - - // start of in windowed mode - Window.create("Test", 50, 50, mode.width, mode.height, mode.bpp, 0, 0, 0); -// gl = new GLWindow("Test", 50, 50, mode.width, mode.height, mode.bpp, 0, 0, 0); - if ((Pbuffer.getPbufferCaps() & 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) - && !Window.isCloseRequested()) { - // allow subsystem to get a chance to run too - Window.update(); - - if (!Window.isMinimized()) { - // check keyboard input - processKeyboard(); - - // do "game" logic, and render it - logic(); - render(); - - // paint window - Window.paint(); - } else { - - // no need to render/paint if nothing has changed (ie. window dragged over) - if (Window.isDirty()) { - render(); - Window.paint(); - } - - // don't waste cpu time, sleep more - try { - Thread.sleep(100); - } catch (InterruptedException inte) { - } - } - } - } - - /** - * 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.width || quadPosition.x - 50 <= 0) { - quadVelocity.x *= -1; - } - - //check collision with horizontal border - if (quadPosition.y + 50 >= mode.height || quadPosition.y - 50 <= 0) { - quadVelocity.y *= -1; - } - } - - private void render() { - if (pbuffer.isBufferLost()) { - System.out.println("Buffer contents lost - will recreate the buffer"); - Pbuffer.releaseContext(); - pbuffer.destroy(); - initPbuffer(); - } - pbuffer.makeCurrent(); - // Pbuffer rendering - //clear background - GL.glClear(GL.GL_COLOR_BUFFER_BIT); - - // draw white quad - GL.glPushMatrix(); - { - GL.glTranslatef(quadPosition.x, quadPosition.y, 0); - GL.glRotatef(angle, 0.0f, 0.0f, 1.0f); - GL.glColor3f(1.0f, 1.0f, 1.0f); - GL.glBegin(GL.GL_QUADS); - { - GL.glVertex2i(-50, -50); - GL.glVertex2i(50, -50); - GL.glVertex2i(50, 50); - GL.glVertex2i(-50, 50); - } - GL.glEnd(); - } - GL.glPopMatrix(); - GL.glCopyTexImage2D(GL.GL_TEXTURE_2D, 0, GL.GL_RGB, 0, 0, 256, 256, 0); - Pbuffer.releaseContext(); - - // OpenGL window rendering - GL.glClear(GL.GL_COLOR_BUFFER_BIT); - // draw white quad - GL.glPushMatrix(); - { - GL.glTranslatef(quadPosition.x, quadPosition.y, 0); - GL.glRotatef(angle, 0.0f, 0.0f, 1.0f); - GL.glColor3f(1.0f, 1.0f, 0.0f); - GL.glBegin(GL.GL_QUADS); - { - GL.glTexCoord2f(0f, 0f); - GL.glVertex2i(-50, -50); - GL.glTexCoord2f(1f, 0f); - GL.glVertex2i(50, -50); - GL.glTexCoord2f(1f, 1f); - GL.glVertex2i(50, 50); - GL.glTexCoord2f(0f, 1f); - GL.glVertex2i(-50, 50); - } - GL.glEnd(); - } - GL.glPopMatrix(); - } - - private void initPbuffer() { - try { - pbuffer = new Pbuffer(256, 256, mode.bpp, 0, 0, 0); - pbuffer.makeCurrent(); - initGLState(256, 256, 0.5f); - GL.glBindTexture(GL.GL_TEXTURE_2D, tex_handle); - Pbuffer.releaseContext(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - /** - * Processes keyboard input - */ - private void processKeyboard() { - Keyboard.poll(); - - //check for fullscreen key - if (Keyboard.isKeyDown(Keyboard.KEY_F)) { - - try { - destroyTexture(); - Keyboard.destroy(); - Pbuffer.releaseContext(); - pbuffer.destroy(); - Window.destroy(); - - Display.setDisplayMode(mode); - Window.create("Test", mode.bpp, 0, 0, 0); - glInit(); - initPbuffer(); - - Keyboard.create(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - //check for window key - if (Keyboard.isKeyDown(Keyboard.KEY_W)) { - try { - destroyTexture(); - Keyboard.destroy(); - Pbuffer.releaseContext(); - pbuffer.destroy(); - Window.destroy(); - - Display.resetDisplayMode(); - Window.create("Test", 50, 50, mode.width, mode.height, mode.bpp, 0, 0, 0); - glInit(); - initPbuffer(); - - - Keyboard.create(); - } 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); - GL.glDeleteTextures(buffer); - } - - /** - * Cleans up the test - */ - private void cleanup() { - destroyTexture(); - Keyboard.destroy(); - Pbuffer.releaseContext(); - pbuffer.destroy(); - Window.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) { - DisplayMode[] modes = Display.getAvailableDisplayModes(); - for (int i = 0; i < modes.length; i++) { - if (modes[i].width == width - && modes[i].height == height - && modes[i].bpp >= bpp) { - return modes[i]; - } - } - return null; - } - - private void initGLState(int width, int height, float color) { - GL.glMatrixMode(GL.GL_PROJECTION); - GL.glLoadIdentity(); - GLU.gluOrtho2D(0, mode.width, 0, mode.height); - GL.glMatrixMode(GL.GL_MODELVIEW); - GL.glLoadIdentity(); - GL.glViewport(0, 0, width, height); - - //set clear color to black - GL.glClearColor(color, color, color, 0.0f); - } - - /** - * Initializes OGL - */ - private void glInit() { - //sync frame (only works on windows) - GLCaps.determineAvailableExtensions(); - if (GLCaps.WGL_EXT_swap_control) { - GL.wglSwapIntervalEXT(1); - } - GL.glTexEnvf(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_REPLACE); - GL.glEnable(GL.GL_TEXTURE_2D); - // Create shared texture - IntBuffer buffer = ByteBuffer.allocateDirect(4).order(ByteOrder.nativeOrder()).asIntBuffer(); - GL.glGenTextures(buffer); - tex_handle = buffer.get(0); - GL.glBindTexture(GL.GL_TEXTURE_2D, tex_handle); - GL.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_S, GL.GL_CLAMP); - GL.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_T, GL.GL_CLAMP); - GL.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR); - GL.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR); - initGLState(mode.width, mode.height, 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(); - } -} diff --git a/src/java/org/lwjgl/test/opengl/VBOIndexTest.java b/src/java/org/lwjgl/test/opengl/VBOIndexTest.java deleted file mode 100644 index de47453e..00000000 --- a/src/java/org/lwjgl/test/opengl/VBOIndexTest.java +++ /dev/null @@ -1,242 +0,0 @@ -/* - * Copyright (c) 2002 Lightweight Java Game Library Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * 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. - */ - -/** - * $Id$ - * - * Simple java test program. - * - * @author elias_naur - * @version $Revision$ - */ - -package org.lwjgl.test.opengl; - -import org.lwjgl.*; -import org.lwjgl.opengl.*; -import org.lwjgl.input.*; - -import java.nio.*; - -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].width == 640 - && modes[i].height == 480 - && modes[i].bpp >= 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 { - Window.create("LWJGL Game Example", 16, 0, 0,0); - 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) { - Window.update(); - - if (Window.isMinimized()) - Thread.sleep(200); - else if (Window.isCloseRequested()) - System.exit(0); - - Keyboard.poll(); - mainLoop(); - render(); - Window.paint(); - } - } catch (Throwable t) { - t.printStackTrace(); - } finally { - cleanup(); - } - } - - /** - * All calculations are done in here - */ - private static void mainLoop() { - angle += 1f; - if (angle > 360.0f) - angle = 0.0f; - - Mouse.poll(); - if (Mouse.dx != 0 || Mouse.dy != 0 || Mouse.dwheel != 0) - System.out.println("Mouse moved " + Mouse.dx + " " + Mouse.dy + " " + Mouse.dwheel); - for (int i = 0; i < Mouse.buttonCount; i++) - if (Mouse.isButtonDown(i)) - System.out.println("Button " + i + " down"); -/* Keyboard.poll(); - if (Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)) - finished = true;*/ - Keyboard.read(); - for (int i = 0; i < Keyboard.getNumKeyboardEvents(); i++) { - Keyboard.next(); - if (Keyboard.key == Keyboard.KEY_ESCAPE && Keyboard.state) - finished = true; - if (Keyboard.key == Keyboard.KEY_T && Keyboard.state) - System.out.println("Current time: " + Sys.getTime()); - } - } - - /** - * All rendering is done in here - */ - private static void render() { - GL.glClear(GL.GL_COLOR_BUFFER_BIT); - GL.glPushMatrix(); - GL.glTranslatef(Display.getWidth() / 2, Display.getHeight() / 2, 0.0f); - GL.glRotatef(angle, 0, 0, 1.0f); - - - ByteBuffer new_mapped_buffer = GL.glMapBufferARB(GL.GL_ARRAY_BUFFER_ARB, GL.GL_WRITE_ONLY_ARB, 2*4*4, 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 = GL.glMapBufferARB(GL.GL_ELEMENT_ARRAY_BUFFER_ARB, GL.GL_WRITE_ONLY_ARB, 4*4, 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 (GL.glUnmapBufferARB(GL.GL_ARRAY_BUFFER_ARB) && GL.glUnmapBufferARB(GL.GL_ELEMENT_ARRAY_BUFFER_ARB)) { - GL.glDrawElements(GL.GL_QUADS, 4, GL.GL_UNSIGNED_INT, 0); - } - GL.glPopMatrix(); - } - - /** - * Initialize - */ - private static void init() throws Exception { - Keyboard.create(); - Keyboard.enableBuffer(); - Mouse.create(); - Sys.setTime(0); - Sys.setProcessPriority(Sys.HIGH_PRIORITY); - System.out.println("Timer resolution: " + Sys.getTimerResolution()); - // Go into orthographic projection mode. - GLCaps.determineAvailableExtensions(); - GL.glMatrixMode(GL.GL_PROJECTION); - GL.glLoadIdentity(); - GLU.gluOrtho2D(0, Display.getWidth(), 0, Display.getHeight()); - GL.glMatrixMode(GL.GL_MODELVIEW); - GL.glLoadIdentity(); - GL.glViewport(0, 0, Display.getWidth(), Display.getHeight()); - if (!GLCaps.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(); - GL.glGenBuffersARB(int_buffer); - buffer_id = int_buffer.get(0); - indices_buffer_id = int_buffer.get(1); - GL.glBindBufferARB(GL.GL_ARRAY_BUFFER_ARB, buffer_id); - GL.glBindBufferARB(GL.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(); - GL.glBufferDataARB(GL.GL_ARRAY_BUFFER_ARB, 2*4*4, (ByteBuffer)null, GL.GL_STREAM_DRAW_ARB); - GL.glBufferDataARB(GL.GL_ELEMENT_ARRAY_BUFFER_ARB, 4*4, (ByteBuffer)null, GL.GL_STREAM_DRAW_ARB); - GL.glEnableClientState(GL.GL_VERTEX_ARRAY); - GL.glVertexPointer(2, GL.GL_FLOAT, 0, 0); - GL.glGetInteger(GL.GL_MAX_TEXTURE_UNITS_ARB, int_buffer); - System.out.println("Number of texture units: " + int_buffer.get(0)); - // Fix the refresh rate to the display frequency. -// gl.wglSwapIntervalEXT(1); - } - - /** - * 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); - GL.glDeleteBuffersARB(int_buffer); - Keyboard.destroy(); - Mouse.destroy(); - Window.destroy(); - try { - Display.resetDisplayMode(); - } catch (Exception e) { - e.printStackTrace(); - } - } - } diff --git a/src/java/org/lwjgl/test/opengl/VBOTest.java b/src/java/org/lwjgl/test/opengl/VBOTest.java deleted file mode 100644 index 87ebe85d..00000000 --- a/src/java/org/lwjgl/test/opengl/VBOTest.java +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Copyright (c) 2002 Lightweight Java Game Library Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * 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. - */ - -/** - * $Id$ - * - * Simple java test program. - * - * @author elias_naur - * @version $Revision$ - */ - -package org.lwjgl.test.opengl; - -import org.lwjgl.*; -import org.lwjgl.opengl.*; -import org.lwjgl.input.*; - -import java.nio.*; - -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].width == 640 - && modes[i].height == 480 - && modes[i].bpp >= 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 { - Window.create("LWJGL Game Example", 16, 0, 0,0); - 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) { - Window.update(); - - if (Window.isMinimized()) - Thread.sleep(200); - else if (Window.isCloseRequested()) - System.exit(0); - - Keyboard.poll(); - mainLoop(); - render(); - Window.paint(); - } - } catch (Throwable t) { - t.printStackTrace(); - } finally { - cleanup(); - } - } - - /** - * All calculations are done in here - */ - private static void mainLoop() { - angle += 1f; - if (angle > 360.0f) - angle = 0.0f; - - Mouse.poll(); - if (Mouse.dx != 0 || Mouse.dy != 0 || Mouse.dwheel != 0) - System.out.println("Mouse moved " + Mouse.dx + " " + Mouse.dy + " " + Mouse.dwheel); - for (int i = 0; i < Mouse.buttonCount; i++) - if (Mouse.isButtonDown(i)) - System.out.println("Button " + i + " down"); -/* Keyboard.poll(); - if (Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)) - finished = true;*/ - Keyboard.read(); - for (int i = 0; i < Keyboard.getNumKeyboardEvents(); i++) { - Keyboard.next(); - if (Keyboard.key == Keyboard.KEY_ESCAPE && Keyboard.state) - finished = true; - if (Keyboard.key == Keyboard.KEY_T && Keyboard.state) - System.out.println("Current time: " + Sys.getTime()); - } - } - - /** - * All rendering is done in here - */ - private static void render() { - GL.glClear(GL.GL_COLOR_BUFFER_BIT); - GL.glPushMatrix(); - GL.glTranslatef(Display.getWidth() / 2, Display.getHeight() / 2, 0.0f); - GL.glRotatef(angle, 0, 0, 1.0f); - ByteBuffer new_mapped_buffer = GL.glMapBufferARB(GL.GL_ARRAY_BUFFER_ARB, GL.GL_WRITE_ONLY_ARB, 2*4*4, 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 (GL.glUnmapBufferARB(GL.GL_ARRAY_BUFFER_ARB)) - GL.glDrawArrays(GL.GL_QUADS, 0, 4); - GL.glPopMatrix(); - } - - /** - * Initialize - */ - private static void init() throws Exception { - Keyboard.create(); - Keyboard.enableBuffer(); - Mouse.create(); - Sys.setTime(0); - Sys.setProcessPriority(Sys.HIGH_PRIORITY); - System.out.println("Timer resolution: " + Sys.getTimerResolution()); - // Go into orthographic projection mode. - GLCaps.determineAvailableExtensions(); - GL.glMatrixMode(GL.GL_PROJECTION); - GL.glLoadIdentity(); - GLU.gluOrtho2D(0, Display.getWidth(), 0, Display.getHeight()); - GL.glMatrixMode(GL.GL_MODELVIEW); - GL.glLoadIdentity(); - GL.glViewport(0, 0, Display.getWidth(), Display.getHeight()); - if (!GLCaps.GL_ARB_vertex_buffer_object) { - System.out.println("ARB VBO not supported!"); - System.exit(1); - } - IntBuffer int_buffer = ByteBuffer.allocateDirect(4).order(ByteOrder.nativeOrder()).asIntBuffer(); - GL.glGenBuffersARB(int_buffer); - buffer_id = int_buffer.get(0); - GL.glBindBufferARB(GL.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); - GL.glBufferDataARB(GL.GL_ARRAY_BUFFER_ARB, 2*4*4, (ByteBuffer)null, GL.GL_STREAM_DRAW_ARB); - GL.glEnableClientState(GL.GL_VERTEX_ARRAY); - GL.glVertexPointer(2, GL.GL_FLOAT, 0, 0); - GL.glGetInteger(GL.GL_MAX_TEXTURE_UNITS_ARB, int_buffer); - System.out.println("Number of texture units: " + int_buffer.get(0)); - // Fix the refresh rate to the display frequency. -// gl.wglSwapIntervalEXT(1); - } - - /** - * Cleanup - */ - private static void cleanup() { - IntBuffer int_buffer = ByteBuffer.allocateDirect(4).order(ByteOrder.nativeOrder()).asIntBuffer(); - int_buffer.put(0, buffer_id); - GL.glDeleteBuffersARB(int_buffer); - Keyboard.destroy(); - Mouse.destroy(); - Window.destroy(); - try { - Display.resetDisplayMode(); - } catch (Exception e) { - e.printStackTrace(); - } - } - } diff --git a/src/java/org/lwjgl/test/opengl/cg_grass2.cg b/src/java/org/lwjgl/test/opengl/cg_grass2.cg deleted file mode 100644 index 4a743e9e..00000000 --- a/src/java/org/lwjgl/test/opengl/cg_grass2.cg +++ /dev/null @@ -1,72 +0,0 @@ -#pragma bind app2vert.position = ATTR0 -#pragma bind app2vert.normal = ATTR2 -#pragma bind app2vert.color = ATTR3 - - -struct app2vert : application2vertex -{ - float4 position; //in object space - float3 normal; //in object space - float4 color; -}; - -#pragma bind vert2frag.HPOS = HPOS -#pragma bind vert2frag.COL0 = COL0 - -struct vert2frag : vertex2fragment -{ - float4 HPOS; - float4 COL0; -}; - -vert2frag main(app2vert IN, - uniform float4x4 ModelViewProj, - uniform float4 Stiff[12], - uniform float4 Load) -{ - vert2frag OUT; - float4 position; - float3 normal; - float3 disloc; - float4 dif; - float index; - float teta; - float alpha; - - alpha = IN.position.y / 1.7; - - // matrix line index - index = IN.color.a * 5 * 2; - - // straw stiffness (randomic) - Load = Load * IN.color.y; - - disloc.x = IN.position.x + dot(Stiff[index].xy, Load.xz); - disloc.y = IN.position.y; - disloc.z = IN.position.z + dot(Stiff[index + 1].xy, Load.xz); - - // find the normal - teta = acos(IN.position.y / length(disloc)); - - normal = IN.position.xyz - disloc.xyz; - normal.y = sin(teta) * length(disloc); - normal = normalize(normal); - - position.x = disloc.x + IN.color.x; - position.y = disloc.y; - position.z = disloc.z + IN.color.z; - position.w = 1; - - OUT.HPOS = mul(ModelViewProj, position); - - // calculate diffuse lighting off the normal that was just calculated - float4 lightPos = float4(0,4,0,0); - float4 lightVec = normalize(lightPos - position); - float diffuseInten = dot(lightVec.xyz, normal); - - diffuseInten = (diffuseInten < 0.5) ? 0.5 : diffuseInten; - - OUT.COL0 = float4(IN.color.y * 0.7, 0.7, 0.4, alpha) * diffuseInten; - - return OUT; -} diff --git a/src/java/org/lwjgl/test/opengl/cg_grass2.vp b/src/java/org/lwjgl/test/opengl/cg_grass2.vp deleted file mode 100644 index 892a6430..00000000 --- a/src/java/org/lwjgl/test/opengl/cg_grass2.vp +++ /dev/null @@ -1,116 +0,0 @@ -!!VP1.0 -# NV_vertex_program generated by NVIDIA Cg compiler -# cgc version 1.5.0001, build date Sep 12 2002 15:49:58 -# command line args: -profile vp20 cg_grass2.cg -# nv30vp backend compiling 'main' program -#vendor NVIDIA Corporation -#version 1.0.1 -#profile vp20 -#program main -#semantic main.ModelViewProj -#semantic main.Stiff -#semantic main.Load -#var float4 IN.position : $vin.ATTR0 : ATTR0 : 0 : 1 -#var float3 IN.normal : $vin.ATTR2 : ATTR2 : 0 : 1 -#var float4 IN.color : $vin.ATTR3 : ATTR3 : 0 : 1 -#var float4x4 ModelViewProj : : c[0], 4 : 1 : 1 -#var float4 Stiff[0] : : c[4] : 2 : 1 -#var float4 Stiff[1] : : c[5] : 2 : 1 -#var float4 Stiff[2] : : c[6] : 2 : 1 -#var float4 Stiff[3] : : c[7] : 2 : 1 -#var float4 Stiff[4] : : c[8] : 2 : 1 -#var float4 Stiff[5] : : c[9] : 2 : 1 -#var float4 Stiff[6] : : c[10] : 2 : 1 -#var float4 Stiff[7] : : c[11] : 2 : 1 -#var float4 Stiff[8] : : c[12] : 2 : 1 -#var float4 Stiff[9] : : c[13] : 2 : 1 -#var float4 Stiff[10] : : c[14] : 2 : 1 -#var float4 Stiff[11] : : c[15] : 2 : 1 -#var float4 Load : : c[16] : 3 : 1 -#var float4 HPOS : $vout.HPOS : HPOS : -1 : 1 -#var float4 COL0 : $vout.COL0 : COL0 : -1 : 1 -#const c[17] = 1.7 5 2 0 -#const c[18] = -0.0187293 0.074261 0.2121144 1.570729 -#const c[20] = 0 0.5 1 0 -#const c[21] = 0.25 -9 0.75 0.1591549 -#const c[22] = 24.9808 -24.9808 -60.14581 60.14581 -#const c[23] = 85.45379 -85.45379 -64.93935 64.93935 -#const c[24] = 19.73921 -19.73921 -1 1 -#const c[25] = 0 4 0 0 -#const c[19] = 1 3.141593 0.5 1 -#const c[26] = 0.7 0.4 0 0 - MUL R2, c[16], v[3].y; - MUL R0, v[3].w, c[17].y; - MUL R1, R0.x, c[17].z; - ARL A0.x, R1.x; - MUL R0, c[A0.x + 4].xyxx, R2.xzxx; - ADD R0, R0.x, R0.y; - ADD R3.x, v[0].x, R0.x; - MOV R3.y, v[0].y; - MUL R0, c[A0.x + 5].xyxx, R2.xzxx; - ADD R0, R0.x, R0.y; - ADD R3.z, v[0].z, R0.x; - ADD R2.x, R3.x, v[3].x; - MOV R2.y, R3.y; - ADD R2.z, R3.z, v[3].z; - MOV R2.w, c[19].x; - DP4 R0.x, c[0], R2; - DP4 R0.y, c[1], R2; - DP4 R0.z, c[2], R2; - DP4 R0.w, c[3], R2; - MOV o[HPOS], R0; - ADD R1.xz, v[0].xyzx, -R3.xyzx; - DP3 R0, R3.xyzx, R3.xyzx; - RSQ R0, R0.x; - RCP R0, R0.x; - RCP R3, R0.x; - MUL R6, v[0].y, R3.x; - MAX R5, R6.x, -R6.x; - MAD R3, c[18].x, R5.x, c[18].y; - MAD R3, R3.x, R5.x, -c[18].z; - MAD R4, R3.x, R5.x, c[18].w; - ADD R3, c[19].x, -R5.x; - RSQ R3, R3.x; - RCP R3, R3.x; - MUL R5, R4.x, R3.x; - SLT R4, R6.x, c[17].w; - MUL R3, c[17].z, R4.x; - MUL R3, R3.x, R5.x; - ADD R3, R5.x, -R3.x; - MAD R3, R4.x, c[19].y, R3.x; - MAD R6, c[21].w, R3.x, -c[21].x; - EXP R6.y, R6.x; - ADD R3, c[20].xyzx, -R6.yyyy; - MUL R5, R3.xyzx, R3.xyzx; - SLT R4.x, R6.y, c[21].x; - SGE R3, R6.yyyy, c[21].yzyy; - MOV R4.yz, R3.xxyw; - DP3 R4.y, R4.xyzx, c[24].zwzz; - MAD R3, c[22].xyxx, R5.xyzx, c[22].zwzz; - MAD R3, R3.xyzx, R5.xyzx, c[23].xyxx; - MAD R3, R3.xyzx, R5.xyzx, c[23].zwzz; - MAD R3, R3.xyzx, R5.xyzx, c[24].xyxx; - MAD R3, R3.xyzx, R5.xyzx, c[24].zwzz; - DP3 R5.x, R3.xyzx, -R4.xyzx; - MUL R1.y, R5.x, R0.x; - DP3 R0, R1.xyzx, R1.xyzx; - RSQ R0, R0.x; - MUL R3, R0.x, R1.xyzx; - ADD R1, c[25], -R2; - DP4 R0, R1, R1; - RSQ R0, R0.x; - MUL R0, R0.x, R1; - DP3 R2, R0.xyzx, R3.xyzx; - SLT R1, R2.x, c[19].z; - ADD R0, c[19].w, -R1.x; - MUL R0, R0.x, R2.x; - MAD R2, R1.x, c[19].z, R0.x; - MUL R1.x, v[3].y, c[26].x; - MOV R1.y, c[26].x; - MOV R1.z, c[26].y; - RCP R0, c[17].x; - MUL R1.w, v[0].y, R0.x; - MUL o[COL0], R1, R2.x; -END -# 72 instructions -# End of program diff --git a/src/java/org/lwjgl/vector/Matrix.java b/src/java/org/lwjgl/vector/Matrix.java new file mode 100644 index 00000000..2fa70395 --- /dev/null +++ b/src/java/org/lwjgl/vector/Matrix.java @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'Lightweight 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. + */ +package org.lwjgl.vector; + +import java.io.Serializable; +import java.nio.FloatBuffer; + +/** + * $Id$ + * + * Base class for matrices. When a matrix is constructed it will be the identity + * matrix unless otherwise stated. + * + * @author cix_foo + * @version $Revision$ + */ +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/vector/Matrix2f.java b/src/java/org/lwjgl/vector/Matrix2f.java new file mode 100644 index 00000000..c6bfe33c --- /dev/null +++ b/src/java/org/lwjgl/vector/Matrix2f.java @@ -0,0 +1,393 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'Lightweight 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. + */ +package org.lwjgl.vector; + +import java.io.Serializable; +import java.nio.FloatBuffer; + +/** + * $Id$ + * + * Holds a 2x2 matrix + * + * @author cix_foo + * @version $Revision$ + */ + +public class Matrix2f extends Matrix implements Serializable { + + public float m00 = 1.0f, m01, m10, m11 = 1.0f; + + /** + * Constructor for Matrix2f. + */ + public Matrix2f() { + } + + /** + * Constructor + */ + public Matrix2f(Matrix2f src) { + load(src); + } + + /** + * Load from another matrix2f + * @param src The source matrix + * @return this + */ + public Matrix2f load(Matrix2f src) { + + m00 = src.m00; + m01 = src.m01; + m10 = src.m10; + m11 = src.m11; + + return this; + } + + /** + * 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) { + + Matrix2f temp = null; + + if (dest == null) + dest = new Matrix2f(); + else if (dest == left || dest == right) { + temp = dest; + 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; + + if (temp != null) { + temp.load(dest); + return temp; + } else + 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) { + + Matrix2f temp = null; + + if (dest == null) + dest = new Matrix2f(); + else if (dest == left || dest == right) { + temp = dest; + 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; + + if (temp != null) { + temp.load(dest); + return temp; + } else + 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) { + + Matrix2f temp = null; + + if (dest == null) + dest = new Matrix2f(); + else if (dest == left || dest == right) { + temp = dest; + dest = new Matrix2f(); + } + + dest.m00 = left.m00 * right.m00 + left.m10 * right.m01; + dest.m01 = left.m01 * right.m00 + left.m11 * right.m01; + dest.m10 = left.m00 * right.m10 + left.m10 * right.m11; + dest.m11 = left.m01 * right.m10 + left.m11 * right.m11; + + if (temp != null) { + temp.load(dest); + return temp; + } else + 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) { + + Vector2f temp = null; + + if (dest == null) + dest = new Vector2f(); + else if (dest == right) { + temp = dest; + dest = new Vector2f(); + } + + dest.x = left.m00 * right.x + left.m10 * right.y; + dest.y = left.m01 * right.x + left.m11 * right.y; + + if (temp != null) { + temp.set(dest); + return temp; + } else + return dest; + } + + /** + * Transpose this matrix + * @return this + */ + public Matrix transpose() { + float temp; + + temp = m01; + m01 = m10; + m10 = temp; + return 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) { + + if (dest == null) + dest = new Matrix2f(); + + if (dest == this) + transpose(); + else { + dest.m01 = m10; + dest.m10 = m01; + } + + return dest; + } + + /** + * Invert this matrix + * @return this if successful, null otherwise + */ + public Matrix invert() + { + + /* + *inv(A) = 1/det(A) * adj(A); + */ + + float determinant = determinant(); + if (determinant != 0) { + float determinant_inv = 1f/determinant; + float t00 = m11*determinant_inv; + float t01 = -m01*determinant_inv; + float t11 = m00*determinant_inv; + float t10 = -m10*determinant_inv; + + m00 = t00; + m01 = t01; + m10 = t10; + m11 = t11; + return this; + } 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() { + + m00 = -m00; + m01 = -m01; + m10 = -m10; + m11 = -m11; + + return 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) { + + if (dest == null) + dest = new Matrix2f(); + + dest.m00 = -m00; + dest.m01 = -m01; + dest.m10 = -m10; + dest.m11 = -m11; + + return dest; + } + + /** + * Set this matrix to be the identity matrix. + * @return this + */ + public Matrix setIdentity() { + m00 = 1.0f; + m01 = 0.0f; + m10 = 0.0f; + m11 = 1.0f; + return this; + } + + /** + * Set this matrix to 0. + * @return this + */ + public Matrix setZero() { + m00 = 0.0f; + m01 = 0.0f; + m10 = 0.0f; + m11 = 0.0f; + return this; + } + + /* (non-Javadoc) + * @see org.lwjgl.vector.Matrix#determinant() + */ + public float determinant() { + return m00 * m11 - m01*m10; + } + +} diff --git a/src/java/org/lwjgl/vector/Matrix3f.java b/src/java/org/lwjgl/vector/Matrix3f.java new file mode 100644 index 00000000..a018abce --- /dev/null +++ b/src/java/org/lwjgl/vector/Matrix3f.java @@ -0,0 +1,494 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'Lightweight 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. + */ +package org.lwjgl.vector; + +import java.io.Serializable; +import java.nio.FloatBuffer; + +/** + * $Id$ + * + * Holds a 3x3 matrix. + * + * @author cix_foo + * @version $Revision$ + */ + +public class Matrix3f extends Matrix implements Serializable { + + public float m00 = 1.0f, + m01, + m02, + m10, + m11 = 1.0f, + m12, + m20, + m21, + m22 = 1.0f; + + /** + * Constructor for Matrix3f. + */ + public Matrix3f() { + super(); + } + /** + * Load from another matrix3f + * @param src The source matrix + * @return this + */ + public Matrix3f load(Matrix3f src) { + + m00 = src.m00; + m10 = src.m10; + m20 = src.m20; + m01 = src.m01; + m11 = src.m11; + m21 = src.m21; + m02 = src.m02; + m12 = src.m12; + m22 = src.m22; + + return this; + } + + /** + * 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) { + + Matrix3f temp = null; + + if (dest == null) + dest = new Matrix3f(); + else if (dest == left || dest == right) { + temp = dest; + 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; + + if (temp != null) { + temp.load(dest); + return temp; + } else + 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) { + + Matrix3f temp = null; + + if (dest == null) + dest = new Matrix3f(); + else if (dest == left || dest == right) { + temp = dest; + 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; + + if (temp != null) { + temp.load(dest); + return temp; + } else + 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) { + + Matrix3f temp = null; + + if (dest == null) + dest = new Matrix3f(); + else if (dest == left || dest == right) { + temp = dest; + dest = new Matrix3f(); + } + + dest.m00 = + left.m00 * right.m00 + left.m10 * right.m01 + left.m20 * right.m02; + dest.m01 = + left.m01 * right.m00 + left.m11 * right.m01 + left.m21 * right.m02; + dest.m02 = + left.m02 * right.m00 + left.m12 * right.m01 + left.m22 * right.m02; + dest.m10 = + left.m00 * right.m10 + left.m10 * right.m11 + left.m20 * right.m12; + dest.m11 = + left.m01 * right.m10 + left.m11 * right.m11 + left.m21 * right.m12; + dest.m12 = + left.m02 * right.m10 + left.m12 * right.m11 + left.m22 * right.m12; + dest.m20 = + left.m00 * right.m20 + left.m10 * right.m21 + left.m20 * right.m22; + dest.m21 = + left.m01 * right.m20 + left.m11 * right.m21 + left.m21 * right.m22; + dest.m22 = + left.m02 * right.m20 + left.m12 * right.m21 + left.m22 * right.m22; + + if (temp != null) { + temp.load(dest); + return temp; + } else + 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) { + + Vector3f temp = null; + + if (dest == null) + dest = new Vector3f(); + else if (dest == right) { + temp = dest; + dest = new Vector3f(); + } + + dest.x = left.m00 * right.x + left.m10 * right.y + left.m20 * right.z; + dest.y = left.m01 * right.x + left.m11 * right.y + left.m21 * right.z; + dest.z = left.m02 * right.x + left.m12 * right.y + left.m22 * right.z; + + if (temp != null) { + temp.set(dest); + return temp; + } else + return dest; + } + + /** + * Transpose this matrix + * @return this + */ + public Matrix transpose() { + float f = m10; + m10 = m01; + m01 = f; + f = m20; + m20 = m02; + m02 = f; + f = m21; + m21 = m12; + m12 = f; + return 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) { + + if (dest == null) + dest = new Matrix3f(); + + if (this != dest) { + m00 = dest.m00; + m01 = dest.m10; + m02 = dest.m20; + m10 = dest.m01; + m11 = dest.m11; + m12 = dest.m21; + m20 = dest.m02; + m21 = dest.m12; + m22 = dest.m22; + } else + transpose(); + + return this; + + } + + /** + * @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() + { + float determinant = determinant(); + + if (determinant != 0) + { + /* 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 = m11 * m22 - m12* m21; + float t01 = - m10 * m22 + m12 *m20; + float t02 = m10 * m21 - m11 * m20; + float t10 = - m01 * m22 + m02 * m21; + float t11 = m00 * m22 - m02 * m20; + float t12 = - m00 * m21 + m01 * m20; + float t20 = m01 * m12 - m02 * m11; + float t21 = -m00 * m12 + m02 * m10; + float t22 = m00 * m11 - m01 * m10; + + + m00 = t00*determinant_inv; + m11 = t11*determinant_inv; + m22 = t22*determinant_inv; + m01 = t10*determinant_inv; + m10 = t01*determinant_inv; + m20 = t02*determinant_inv; + m02 = t20*determinant_inv; + m12 = t21*determinant_inv; + m21 = t12*determinant_inv; + return this; + } else + return null; + } + + /** + * Negate this matrix + * @return this + */ + public Matrix negate() { + m00 = -m00; + m01 = -m02; + m02 = -m01; + m10 = -m10; + m11 = -m12; + m12 = -m11; + m20 = -m20; + m21 = -m22; + m22 = -m21; + return 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) { + if (dest == null) + dest = new Matrix3f(); + + dest.m00 = -m00; + dest.m01 = -m02; + dest.m02 = -m01; + dest.m10 = -m10; + dest.m11 = -m12; + dest.m12 = -m11; + dest.m20 = -m20; + dest.m21 = -m22; + dest.m22 = -m21; + return dest; + } + + /** + * Set this matrix to be the identity matrix. + * @return this + */ + public Matrix setIdentity() { + m00 = 1.0f; + m01 = 0.0f; + m02 = 0.0f; + m10 = 0.0f; + m11 = 1.0f; + m12 = 0.0f; + m20 = 0.0f; + m21 = 0.0f; + m22 = 1.0f; + return this; + } + + /** + * Set this matrix to 0. + * @return this + */ + public Matrix setZero() { + m00 = 0.0f; + m01 = 0.0f; + m02 = 0.0f; + m10 = 0.0f; + m11 = 0.0f; + m12 = 0.0f; + m20 = 0.0f; + m21 = 0.0f; + m22 = 0.0f; + return this; + } + +} diff --git a/src/java/org/lwjgl/vector/Matrix4f.java b/src/java/org/lwjgl/vector/Matrix4f.java new file mode 100644 index 00000000..fe606ca0 --- /dev/null +++ b/src/java/org/lwjgl/vector/Matrix4f.java @@ -0,0 +1,818 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'Lightweight 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. + */ +package org.lwjgl.vector; + +import java.io.Serializable; +import java.nio.FloatBuffer; + +/** + * Holds a 4x4 float matrix. + * + * @author foo + */ +public class Matrix4f extends Matrix implements Serializable { + + public float m00 = 1.0f, m01, m02, m03, m10, m11 = 1.0f, m12, m13, m20, m21, m22 = 1.0f, m23, m30, m31, m32, m33 = 1.0f; + + /** + * Construct a Matrix4f + */ + public Matrix4f() { + super(); + } + + /** + * 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() { + m00 = 1.0f; + m01 = 0.0f; + m02 = 0.0f; + m03 = 0.0f; + m10 = 0.0f; + m11 = 1.0f; + m12 = 0.0f; + m13 = 0.0f; + m20 = 0.0f; + m21 = 0.0f; + m22 = 1.0f; + m23 = 0.0f; + m30 = 0.0f; + m31 = 0.0f; + m32 = 0.0f; + m33 = 1.0f; + + return this; + } + + + /** + * Set this matrix to 0. + * @return this + */ + public Matrix setZero() { + m00 = 0.0f; + m01 = 0.0f; + m02 = 0.0f; + m03 = 0.0f; + m10 = 0.0f; + m11 = 0.0f; + m12 = 0.0f; + m13 = 0.0f; + m20 = 0.0f; + m21 = 0.0f; + m22 = 0.0f; + m23 = 0.0f; + m30 = 0.0f; + m31 = 0.0f; + m32 = 0.0f; + m33 = 0.0f; + + return this; + } + + + /** + * Load from another matrix4f + * @param src The source matrix + * @return this + */ + public Matrix4f load(Matrix4f src) { + + m00 = src.m00; + m01 = src.m01; + m02 = src.m02; + m03 = src.m03; + m10 = src.m10; + m11 = src.m11; + m12 = src.m12; + m13 = src.m13; + m20 = src.m20; + m21 = src.m21; + m22 = src.m22; + m23 = src.m23; + m30 = src.m30; + m31 = src.m31; + m32 = src.m32; + m33 = src.m33; + + return this; + } + + /** + * 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) { + + Matrix4f temp = null; + + if (dest == null) + dest = new Matrix4f(); + else if (dest == left || dest == right) { + temp = dest; + 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; + + + if (temp != null) { + temp.load(dest); + return temp; + } else + 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) { + + Matrix4f temp = null; + + if (dest == null) + dest = new Matrix4f(); + else if (dest == left || dest == right) { + temp = dest; + 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; + + if (temp != null) { + temp.load(dest); + return temp; + } else + 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) { + + Matrix4f temp = null; + + if (dest == null) + dest = new Matrix4f(); + else if (dest == left || dest == right) { + temp = dest; + dest = new Matrix4f(); + } + + + dest.m00 = left.m00 * right.m00 + left.m10 * right.m01 + left.m20 * right.m02 + left.m30 * right.m03; + dest.m01 = left.m01 * right.m00 + left.m11 * right.m01 + left.m21 * right.m02 + left.m31 * right.m03; + dest.m02 = left.m02 * right.m00 + left.m12 * right.m01 + left.m22 * right.m02 + left.m32 * right.m03; + dest.m03 = left.m03 * right.m00 + left.m13 * right.m01 + left.m23 * right.m02 + left.m33 * right.m03; + dest.m10 = left.m00 * right.m10 + left.m10 * right.m11 + left.m20 * right.m12 + left.m30 * right.m13; + dest.m11 = left.m01 * right.m10 + left.m11 * right.m11 + left.m21 * right.m12 + left.m31 * right.m13; + dest.m12 = left.m02 * right.m10 + left.m12 * right.m11 + left.m22 * right.m12 + left.m32 * right.m13; + dest.m13 = left.m03 * right.m10 + left.m13 * right.m11 + left.m23 * right.m12 + left.m33 * right.m13; + dest.m20 = left.m00 * right.m20 + left.m10 * right.m21 + left.m20 * right.m22 + left.m30 * right.m23; + dest.m21 = left.m01 * right.m20 + left.m11 * right.m21 + left.m21 * right.m22 + left.m31 * right.m23; + dest.m22 = left.m02 * right.m20 + left.m12 * right.m21 + left.m22 * right.m22 + left.m32 * right.m23; + dest.m23 = left.m03 * right.m20 + left.m13 * right.m21 + left.m23 * right.m22 + left.m33 * right.m23; + dest.m30 = left.m00 * right.m30 + left.m10 * right.m31 + left.m20 * right.m32 + left.m30 * right.m33; + dest.m31 = left.m01 * right.m30 + left.m11 * right.m31 + left.m21 * right.m32 + left.m31 * right.m33; + dest.m32 = left.m02 * right.m30 + left.m12 * right.m31 + left.m22 * right.m32 + left.m32 * right.m33; + dest.m33 = left.m03 * right.m30 + left.m13 * right.m31 + left.m23 * right.m32 + left.m33 * right.m33; + + if (temp != null) { + temp.load(dest); + return temp; + } else + 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) { + + Vector4f temp = null; + + if (dest == null) + dest = new Vector4f(); + else if (dest == right) { + temp = dest; + dest = new Vector4f(); + } + + + dest.x = left.m00 * right.x + left.m10 * right.y + left.m20 * right.z + left.m30 * right.w; + dest.y = left.m01 * right.x + left.m11 * right.y + left.m21 * right.z + left.m31 * right.w; + dest.z = left.m02 * right.x + left.m12 * right.y + left.m22 * right.z + left.m32 * right.w; + dest.w = left.m03 * right.x + left.m13 * right.y + left.m23 * right.z + left.m33 * right.w; + + if (temp != null) { + temp.set(dest); + return temp; + } else + return dest; + } + + /** + * Transpose this matrix + * @return this + */ + public Matrix transpose() { + + float f = m10; + m10 = m01; + m01 = f; + f = m20; + m20 = m02; + m02 = f; + f = m30; + m30 = m03; + m03 = f; + f = m21; + m21 = m12; + m12 = f; + f = m31; + m31 = m13; + m13 = f; + f = m32; + m32 = m23; + m23 = f; + + return this; + } + + /** + * Translate this matrix + * @param vec The vector to translate by + * @return this + */ + public Matrix4f translate(Vector2f vec) { + m30 += m00 * vec.x + m10 * vec.y; + m31 += m01 * vec.x + m11 * vec.y; + m32 += m02 * vec.x + m12 * vec.y; + m33 += m03 * vec.x + m13 * vec.y; + return this; + } + + /** + * Translate this matrix + * @param vec The vector to translate by + * @return this + */ + public Matrix4f translate(Vector3f vec) { + m30 += m00 * vec.x + m10 * vec.y + m20 * vec.z; + m31 += m01 * vec.x + m11 * vec.y + m21 * vec.z; + m32 += m02 * vec.x + m12 * vec.y + m22 * vec.z; + m33 += m03 * vec.x + m13 * vec.y + m23 * vec.z; + return this; + } + + /** + * Scales this matrix + * @param vec The vector to scale by + * @return this + */ + public Matrix4f scale(Vector3f vec) { + m00 *= vec.x; + m01 *= vec.x; + m02 *= vec.x; + m03 *= vec.x; + m10 *= vec.y; + m11 *= vec.y; + m12 *= vec.y; + m13 *= vec.y; + m20 *= vec.z; + m21 *= vec.z; + m22 *= vec.z; + m23 *= vec.z; + return this; + } + + /** + * Rotates the matrix around the given axis the specified angle + * @param angle the angle, in degrees. + * @param axis The vector representing the rotation axis. Must be normalized. + * @return this + */ + public Matrix4f rotate(float angle, Vector3f axis) { + 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 = m00 * f00 + m10 * f01 + m20 * f02; + float t01 = m01 * f00 + m11 * f01 + m21 * f02; + float t02 = m02 * f00 + m12 * f01 + m22 * f02; + float t03 = m03 * f00 + m13 * f01 + m23 * f02; + float t10 = m00 * f10 + m10 * f11 + m20 * f12; + float t11 = m01 * f10 + m11 * f11 + m21 * f12; + float t12 = m02 * f10 + m12 * f11 + m22 * f12; + float t13 = m03 * f10 + m13 * f11 + m23 * f12; + m20 = m00 * f20 + m10 * f21 + m20 * f22; + m21 = m01 * f20 + m11 * f21 + m21 * f22; + m22 = m02 * f20 + m12 * f21 + m22 * f22; + m23 = m03 * f20 + m13 * f21 + m23 * f22; + m00 = t00; + m01 = t01; + m02 = t02; + m03 = t03; + m10 = t10; + m11 = t11; + m12 = t12; + m13 = t13; + return this; + } + + /** + * Rotates the matrix around the given axis the specified angle, and stores it in the specified destination + * @param angle the angle, in degrees. + * @param axis The vector representing the rotation axis. Must be normalized. + * @param dest The destination matrix or null if a new matrix is to be created + * @return The rotated matrix + */ + public Matrix4f rotate(float angle, Vector3f axis, Matrix4f dest) { + if (dest == null) + dest = new Matrix4f(); + else if (dest == this) + return rotate(angle, axis); + 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 f0 = axis.x*axis.x*oneminusc+c; + float f1 = xy*oneminusc+zs; + float f2 = xz*oneminusc-ys; + // n[3] not used + float f4 = xy*oneminusc-zs; + float f5 = axis.y*axis.y*oneminusc+c; + float f6 = yz*oneminusc+xs; + // n[7] not used + float f8 = xz*oneminusc+ys; + float f9 = yz*oneminusc-xs; + float f10 = axis.z*axis.z*oneminusc+c; + + /* m[12] to m[15] are not changed by a rotate */ + dest.m00 = m00 * f0 + m10 * f1 + m20 * f2; + dest.m01 = m01 * f0 + m11 * f1 + m21 * f2; + dest.m02 = m02 * f0 + m12 * f1 + m22 * f2; + dest.m03 = m03 * f0 + m13 * f1 + m23 * f2; + dest.m10 = m00 * f4 + m10 * f5 + m20 * f6; + dest.m11 = m01 * f4 + m11 * f5 + m21 * f6; + dest.m12 = m02 * f4 + m12 * f5 + m22 * f6; + dest.m13 = m03 * f4 + m13 * f5 + m23 * f6; + dest.m20 = m00 * f8 + m10 * f9 + m20 * f10; + dest.m21 = m01 * f8 + m11 * f9 + m21 * f10; + dest.m22 = m02 * f8 + m12 * f9 + m22 * f10; + dest.m23 = m03 * f8 + m13 * f9 + m23 * f10; + 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) { + if (dest == null) + dest = new Matrix4f(); + else if (dest == this) + return translate(vec); + + dest.m30 += m00 * vec.x + m10 * vec.y + m20 * vec.z; + dest.m31 += m01 * vec.x + m11 * vec.y + m21 * vec.z; + dest.m32 += m02 * vec.x + m12 * vec.y + m22 * vec.z; + dest.m33 += m03 * vec.x + m13 * vec.y + 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) { + if (dest == null) + dest = new Matrix4f(); + else if (dest == this) + return translate(vec); + + dest.m30 += m00 * vec.x + m10 * vec.y; + dest.m31 += m01 * vec.x + m11 * vec.y; + dest.m32 += m02 * vec.x + m12 * vec.y; + dest.m33 += m03 * vec.x + 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) { + + if (this != dest) { + m00 = dest.m00; + m01 = dest.m10; + m02 = dest.m20; + m03 = dest.m30; + m10 = dest.m01; + m11 = dest.m11; + m12 = dest.m21; + m13 = dest.m31; + m20 = dest.m02; + m21 = dest.m12; + m22 = dest.m22; + m23 = dest.m32; + m30 = dest.m03; + m31 = dest.m13; + m32 = dest.m23; + m33 = dest.m33; + } else + transpose(); + + 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 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() { + + float determinant = determinant(); + + if (determinant != 0) + { + /* + * m00 m01 m02 m03 + * m10 m11 m12 m13 + * m20 m21 m22 m23 + * m30 m31 m32 m33 + */ + float determinant_inv = 1f/determinant; + + // first row + float t00 = determinant3x3(m11, m12, m13, m21, m22, m23, m31, m32, m33); + float t01 = -determinant3x3(m10, m12, m13, m20, m22, m23, m30, m32, m33); + float t02 = determinant3x3(m10, m11, m13, m20, m21, m23, m30, m31, m33); + float t03 = -determinant3x3(m10, m11, m12, m20, m21, m22, m30, m31, m32); + // second row + float t10 = -determinant3x3(m01, m02, m03, m21, m22, m23, m31, m32, m33); + float t11 = determinant3x3(m00, m02, m03, m20, m22, m23, m30, m32, m33); + float t12 = -determinant3x3(m00, m01, m03, m20, m21, m23, m30, m31, m33); + float t13 = determinant3x3(m00, m01, m02, m20, m21, m22, m30, m31, m32); + // third row + float t20 = determinant3x3(m01, m02, m03, m11, m12, m13, m31, m32, m33); + float t21 = -determinant3x3(m00, m02, m03, m10, m12, m13, m30, m32, m33); + float t22 = determinant3x3(m00, m01, m03, m10, m11, m13, m30, m31, m33); + float t23 = -determinant3x3(m00, m01, m02, m10, m11, m12, m30, m31, m32); + // fourth row + float t30 = -determinant3x3(m01, m02, m03, m11, m12, m13, m21, m22, m23); + float t31 = determinant3x3(m00, m02, m03, m10, m12, m13, m20, m22, m23); + float t32 = -determinant3x3(m00, m01, m03, m10, m11, m13, m20, m21, m23); + float t33 = determinant3x3(m00, m01, m02, m10, m11, m12, m20, m21, m22); + + // transpose and divide by the determinant + m00 = t00*determinant_inv; + m11 = t11*determinant_inv; + m22 = t22*determinant_inv; + m33 = t33*determinant_inv; + m01 = t10*determinant_inv; + m10 = t01*determinant_inv; + m20 = t02*determinant_inv; + m02 = t20*determinant_inv; + m12 = t21*determinant_inv; + m21 = t12*determinant_inv; + m03 = t30*determinant_inv; + m30 = t03*determinant_inv; + m13 = t31*determinant_inv; + m31 = t13*determinant_inv; + m32 = t23*determinant_inv; + m23 = t32*determinant_inv; + return this; + } else + return null; + } + + /** + * Negate this matrix + * @return this + */ + public Matrix negate() { + m00 = -m00; + m01 = -m01; + m02 = -m02; + m03 = -m03; + m10 = -m10; + m11 = -m11; + m12 = -m12; + m13 = -m13; + m20 = -m20; + m21 = -m21; + m22 = -m22; + m23 = -m23; + m30 = -m30; + m31 = -m31; + m32 = -m32; + m33 = -m33; + return 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) { + if (dest == null) + dest = new Matrix4f(); + + 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; + } + +} diff --git a/src/java/org/lwjgl/vector/Vector.java b/src/java/org/lwjgl/vector/Vector.java new file mode 100644 index 00000000..9899baf6 --- /dev/null +++ b/src/java/org/lwjgl/vector/Vector.java @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'Lightweight 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. + */ +package org.lwjgl.vector; + +import java.io.Serializable; +import java.nio.FloatBuffer; + +/** + * $Id$ + * + * Base class for vectors. + * + * @author cix_foo + * @version $Revision$ + */ +public abstract class Vector implements Serializable { + + /** + * 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 normalize() { + float len = length(); + if (len != 0.0f) { + float l = 1.0f / len; + return scale(l); + } else { + assert false; + return this; + } + } + + + /** + * 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/vector/Vector2f.java b/src/java/org/lwjgl/vector/Vector2f.java new file mode 100644 index 00000000..b98e8969 --- /dev/null +++ b/src/java/org/lwjgl/vector/Vector2f.java @@ -0,0 +1,244 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'Lightweight 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. + */ +package org.lwjgl.vector; + +import java.io.Serializable; +import java.nio.FloatBuffer; + +/** + * $Id$ + * + * Holds a 2-tuple vector. + * + * @author cix_foo + * @version $Revision$ + */ + +public class Vector2f extends Vector implements Serializable { + + public float x, y; + + /** + * Constructor for Vector3f. + */ + public Vector2f() { + super(); + } + + /** + * Constructor + */ + public Vector2f(Vector2f src) { + set(src); + } + + /** + * Constructor + */ + public Vector2f(float x, float y) { + set(x, y); + } + + /** + * Set values + * @return this + */ + public Vector2f set(float x, float y) { + this.x = x; + this.y = y; + return this; + } + + /** + * Load from another Vector2f + * @param src The source vector + * @return this + */ + public Vector2f set(Vector2f src) { + x = src.x; + y = src.y; + 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 degrees + * @param a A vector + * @param b The other vector + * @return the angle between the two vectors, in degrees + */ + 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.toDegrees(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 { + return dest.set(left.x + right.x, left.y + right.y); + } + } + + /** + * 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 { + return dest.set(left.x - right.x, left.y - right.y); + } + } + + /** + * 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; + } + +} diff --git a/src/java/org/lwjgl/vector/Vector3f.java b/src/java/org/lwjgl/vector/Vector3f.java new file mode 100644 index 00000000..09526768 --- /dev/null +++ b/src/java/org/lwjgl/vector/Vector3f.java @@ -0,0 +1,294 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'Lightweight 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. + */ +package org.lwjgl.vector; + +import java.io.Serializable; +import java.nio.FloatBuffer; + +/** + * $Id$ + * + * Holds a 3-tuple vector. + * + * @author cix_foo + * @version $Revision$ + */ + +public class Vector3f extends Vector implements Serializable { + + public float x, y, z; + + /** + * Constructor for Vector3f. + */ + public Vector3f() { + super(); + } + + /** + * Constructor + */ + public Vector3f(Vector3f src) { + set(src); + } + + /** + * Constructor + */ + public Vector3f(float x, float y, float z) { + set(x, y, z); + } + + /** + * Set values + * @return this + */ + public Vector3f set(float x, float y, float z) { + this.x = x; + this.y = y; + this.z = z; + return this; + } + + /** + * Load from another Vector3f + * @param src The source vector + * @return this + */ + public Vector3f set(Vector3f src) { + x = src.x; + y = src.y; + z = src.z; + 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 { + return dest.set(left.x + right.x, left.y + right.y, left.z + right.z); + } + } + + /** + * 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 { + return dest.set(left.x - right.x, left.y - right.y, left.z - right.z); + } + } + + /** + * 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 degrees + * @param a A vector + * @param b The other vector + * @return the angle between the two vectors, in degrees + */ + 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.toDegrees(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(); + } + + +}